Step 1: Backup database
Backup the database or create the restorepoint before starting the upgrade process. In the event of a failure, we can restore the database to the starting point.
rman "target / nocatalog"
RUN
{
ALLOCATE CHANNEL chan_name TYPE DISK;
BACKUP DATABASE FORMAT '/tmp/backup/DBTEST_%U' TAG before_upgrade;
BACKUP CURRENT CONTROLFILE FORMAT '/tmp/backup/controlfile';
}
Step 2: Run the Pre-Upgrade Information Tool
Copy the Pre-Upgrade Information Tool script preupgrd.sql and utluppkg.sql from the Oracle Database 12c Release 1 (12.1) $ORACLE_HOME/rdbms/admin directory to /tmp/upgrade
Connect to the database instance using sqlplus as a user with SYSDBA privileges. Please make sure that the database should be started using the Source Oracle Home 11gR2 . Then run preupgrd.sql
$ sqlplus '/ as sysdba'
SQL> @/tmp/upgrade/preupgrd.sql
Loading Pre-Upgrade Package...
***************************************************************************
Executing Pre-Upgrade Checks in DBTEST...
***************************************************************************
************************************************************
====>> ERRORS FOUND for DBTEST <<====
The following are *** ERROR LEVEL CONDITIONS *** that must be addressed
prior to attempting your upgrade.
Failure to do so will result in a failed upgrade.
You MUST resolve the above errors prior to upgrade
************************************************************
************************************************************
====>> PRE-UPGRADE RESULTS for DBTEST <<====
ACTIONS REQUIRED:
1. Review results of the pre-upgrade checks:
/opt/oracle/base/cfgtoollogs/DBTEST/preupgrade/preupgrade.log
2. Execute in the SOURCE environment BEFORE upgrade:
/opt/oracle/base/cfgtoollogs/DBTEST/preupgrade/preupgrade_fixups.sql
3. Execute in the NEW environment AFTER upgrade:
/opt/oracle/base/cfgtoollogs/DBTEST/preupgrade/postupgrade_fixups.sql
************************************************************
***************************************************************************
Pre-Upgrade Checks in DBTEST Completed.
***************************************************************************
***************************************************************************
***************************************************************************
Step3: Pre upgrade StepsA fixup script preupgrade_fixups.sql that should be run before the upgrade .
SQL> @/opt/oracle/base/cfgtoollogs/DBTEST/preupgrade/preupgrade_fixups.sql
Pre-Upgrade Fixup Script Generated on 2014-09-02 10:18:09 Version: 12.1.0.2 Build: 006
Beginning Pre-Upgrade Fixups...
Executing in container DBTEST
**********************************************************************
Check Tag: DEFAULT_PROCESS_COUNT
Check Summary: Verify min process count is not too low
Fix Summary: Review and increase if needed, your PROCESSES value.
**********************************************************************
Fixup Returned Information:
WARNING: --> Process Count may be too low
Database has a maximum process count of 150 which is lower than the
default value of 300 for this release.
You should update your processes value prior to the upgrade
to a value of at least 300.
For example:
ALTER SYSTEM SET PROCESSES=300 SCOPE=SPFILE
or update your init.ora file.
**********************************************************************
**********************************************************************
[Pre-Upgrade Recommendations]
**********************************************************************
*****************************************
********* Dictionary Statistics *********
*****************************************
Please gather dictionary statistics 24 hours prior to
upgrading the database.
To gather dictionary statistics execute the following command
while connected as SYSDBA:
EXECUTE dbms_stats.gather_dictionary_stats;
^^^ MANUAL ACTION SUGGESTED ^^^
**************************************************
************* Fixup Summary ************
1 fixup routine generated an INFORMATIONAL message that should be reviewed.
**************** Pre-Upgrade Fixup Script Complete *********************
The script suggested that i should increase the PROCESSES and gather statistics.Step3.
After completing the Pre-Upgrade suggestion, we will shutdown the database.
- Copy the parameter and password files from the old home 11gR2 to the 12c home.
cp /opt/oracle/11.2.0.4/dbs/initDBTEST.ora /opt/oracle/12.1.0.2/dbs/ cp /opt/oracle/11.2.0.4/dbs/orapwDBTEST /opt/oracle/12.1.0.2/dbs/
- Edit the oratab file, setting the new ORACLE HOME value.
DBTEST:/opt/oracle/12.1.0.2:N
- Edit the parameter files and change COMPATIBLE to 12.0.0 if you are using an initialization parameter file
*.compatible='12.0.0'or execute the statement.
SQL> ALTER SYSTEM SET COMPATIBLE = '12.0.0' SCOPE=SPFILE;
Step4 . Upgrading Database to 12cR1
Start the database in upgrade mode. Make sure that the database will start using Oracle Home 12c.
$ sqlplus / as sysdba SQL> STARTUP UPGRADE; SQL> EXIT;
Run the catctl.pl script from the new Oracle home.
cd $ORACLE_HOME/rdbms/admin $ORACLE_HOME/perl/bin/perl catctl.pl -n 2 -l $ORACLE_HOME/diagnostics catupgrd.sql
It tooks time to do a upgrade.
Run the Post-Upgrade Status Tool utlu121s.sql , which is located at $ORACLE_HOME/rdbms/admin/which provides a summary of the upgrade
SQL> @utlu121s.sql
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
CATCTL REPORT = /opt/oracle/12.1.0.2/cfgtoollogs/DBTEST/upgrade/upg_summary.log
PL/SQL procedure successfully completed.
Oracle Database 12.1 Post-Upgrade Status Tool 09-02-2014 12:24:21
Component Current Version Elapsed Time
Name Status Number HH:MM:SS
Oracle Server UPGRADED 12.1.0.2.0 00:26:12
Oracle Workspace Manager VALID 12.1.0.2.0 00:01:21
Oracle Text VALID 12.1.0.2.0 00:01:49
Oracle XML Database VALID 12.1.0.2.0 00:02:00
Final Actions 00:02:20
Post Upgrade 00:02:56
Total Upgrade Time: 00:36:49
PL/SQL procedure successfully completed.
SQL>
SQL> --
SQL> -- Update Summary Table with con_name and endtime.
SQL> --
SQL> UPDATE sys.registry$upg_summary SET reportname = :ReportName,
2 con_name = SYS_CONTEXT('USERENV','CON_NAME'),
3 endtime = SYSDATE
4 WHERE con_id = -1;
1 row updated.
SQL> commit;
Commit complete.
The catuppst.sql script is run as part of the upgrade process unless the upgrade returns errors during the process . Since we have any errors, we can run it manually.
SQL>@$ORACLE_HOME/rdbms/admin/catuppst.sql
Step5. Post Upgrade Steps
Run the postupgrade_fixups.sql after upgrade.
SQL>@/opt/oracle/base/cfgtoollogs/DBTEST/preupgrade/postupgrade_fixups.sql
Step6. Verify the database.
#sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 2 16:12:39 2014 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options SQL> select open_mode from v$database; OPEN_MODE -------------------- READ WRITE
Show Conversion Code Hide Conversion Code Show Emoticon Hide Emoticon