Tuesday, May 17, 2016

ORA-39700: database must be opened with UPGRADE option

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Process ID: 3887
Session ID: 5644 Serial number: 5


Solution
After restore database another server appear this error, because on older server database version was 11.2.0.1.0 and on new server database version is 11.2.0.4.0, therefore we need:
1) open with upgrade option
2) upgrade database – it means run script $ORACLE_HOME/rdbms/admin/catupgrd.sql
3) shutdown clearly and startup
4) run script $ORACLE_HOME/rdbms/admin/utlrp.sql – for recompile all invalid PL/SQL packages

sqlplus / as sysdba
SQL> startup upgrade;
SQL> @/soft/app/oracle/product/11.2.0.4.0/dbhome_1//rdbms/admin/catupgrd.sql
SQL> shutdown immediate;
SQL> startup;
SQL> @/soft/app/oracle/product/11.2.0.4.0/dbhome_1//rdbms/admin/utlrp.sql


Test Server Implement Log:
SQL> startup upgrade;
ORACLE instance started.

Total System Global Area 7482626048 bytes
Fixed Size                  2267792 bytes
Variable Size            6023021936 bytes
Database Buffers         1442840576 bytes
Redo Buffers               14495744 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL>
SQL> @/soft/app/oracle/product/11.2.0.4.0/dbhome_1//rdbms/admin/catupgrd.sql
.................
................running....
...............
DOC>   Next restart for normal operation, and then run utlrp.sql to
DOC>   recompile any invalid application objects.
DOC>
DOC>   If the source database had an older time zone version prior to
DOC>   upgrade, then please run the DBMS_DST package.  DBMS_DST will upgrade
DOC>   TIMESTAMP WITH TIME ZONE data to use the latest time zone file shipped
DOC>   with Oracle.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SQL>
SQL> Rem Set errorlogging off
SQL> SET ERRORLOGGING OFF;
SQL>
SQL> REM END OF CATUPGRD.SQL
SQL>
SQL> REM bug 12337546 - Exit current sqlplus session at end of catupgrd.sql.
SQL> REM                This forces user to start a new sqlplus session in order
SQL> REM                to connect to the upgraded db.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@bkuptest ~]$
[oracle@bkuptest ~]$
[oracle@bkuptest ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon May 16 17:58:53 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 7482626048 bytes
Fixed Size                  2267792 bytes
Variable Size            6023021936 bytes
Database Buffers         1442840576 bytes
Redo Buffers               14495744 bytes
Database mounted.
Database opened.
SQL> @/soft/app/oracle/product/11.2.0.4.0/dbhome_1//rdbms/admin/utlrp.sql

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2016-05-16 17:59:33

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
...............
................
.....................
Function dropped.

Warning: XDB now invalid, could not find xdbconfig
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110:
data file 201: '/u01/app/oracle/oradata/remitdb/temp01.dbf'
ORA-01403: no data
found

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> exit
[oracle@bkuptest ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon May 16 18:00:09 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL>
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL>
SQL>

No comments:

Post a Comment