Professional Documents
Culture Documents
Operational Documentation
Document Control
History
NOTE: Kindly DO NOT share the document outside MFG as it contains data/password
strictly for internal use only.
Scenario
Target Database SID JASDB (Single Instance DB)
Ensure that the required downtime has been sought and blackout has been applied before starting
off with the activity.
Prerequisites:
Disk space: Enough to cater to storing at least 1 cold backup of the database + Full Database + 1
Level 0 RMAN backup of database taken after finishing the Upgrade + (If needed it is advisable to
take a fresh cold backup just after upgrade so that even if application is tested and changes are
done then too if plant requests for roll back or refresh again than it can be done to latest cold
backup which was taken just after the upgrade).
Now manually copy the following database files from the paths queried above to a separate
location on the disk and name it PRODDB_COLD_BACKUP:
Data Files
Control Files
Redo Log Files
Pfile/SPfile of PRODDB database
Pre-upgrade tasks:
Creating separate Oracle Home for upgrade:
In order to upgrade the Oracle database, we need to create a separate Oracle Home for the new
Oracle binaries. It is very similar to installing Oracle Database Software with a Software Only
option but we need to supply a new path name (directory location) when asked for Oracle Home.
Refer to the snap below:
1. Start the setup for Oracle Database Software version 12.1.0.2. Install 12c database
binaries on the server where the database needs to be upgraded.
Uncheck the option to receive updates and click Next to get below screen. Click Yes to it to
proceed.
Either use an Existing Windows User or create a new one as per your requirement:
Provide the path to Oracle_Base and Oracle_Home (this should be the path to your new
Oracle_Home meant to be created for the upgraded version i.e, for 11.2.0.4). Click Next.
Verify that Oracle_Home (Software Location) is being set to correct directory path before
proceeding on to installation. Once assured, click Install.
2. Create pfile from spfile on source database and get it shipped to new
%ORACLE_HOME%\database directory (to be copied to Oracle12c_home in this
case):
If the EM repository is not removed up front, it will be automatically removed during the catuppst.sql post-
upgrade phase.
utlrp.sql -- Before running the preupgrd.sql script it will be advisable to run the utlrp.sq;
script and suppress
Run the dbupgdiag.sql (attached here for reference) and see Note <556610.1> Script to
Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql) for more information.
dbupgdiag_output.
dbupgdiag.sql txt
utlrp.sql -- Before running the preupgrd.sql script it will be advisable to run the utlrp.sq;
script few times to suppress any remaining invalid objects.
Three files are created after executing of preupgrd.sql and that are:
preupgrade.log,
preupgrade_fixups.sql and
postupgrade_fixups.sql files
Preupgrade.log
Preupgrade_fixups.sql -- execute it before upgrade and get warnings and
recommendations fixed.
9. Open a new command prompt window and Stop the lower version listener (11g in this case):
10. Create a new Listener service in 12c oracle home using NETCA by navigating to
Oracle12c_Home and then issuing NETCA command to route to new Oracle12c_home\Bin.
Upgrade Tasks:
1. Drop the sid with oradim utility by executing it from the old oracle home
(Oracle11g_home\bin in this case) and close the command prompt session.
C:\Users\Administrator>cd E:\oracle11g_home\app\Administrator\product\11.2.0\dbhome_1\BIN
C:\Users\Administrator>E:
E:\oracle11g_home\app\Administrator\product\11.2.0\dbhome_1\BIN>
2. Open a new command prompt session and create the same sid with oradim utility by
executing from the new oracle home 12c (Oracle12c_home in this case). You will be
prompted to enter the MFGDBA (Oracle_Home user authenticated password):
C:\Users\Administrator>cd E:\oracle12c_home\app\mfgdba\product\12.1.0\dbhome_1\BIN
C:\Users\Administrator>E:
E:\oracle12c_home\app\mfgdba\product\12.1.0\dbhome_1\BIN>
3. Now open the database in upgrade mode by issuing Startup upgrade command:
Since you have deleted the 11g service and created a new one. Shutdown the database ones and
start it again with upgrade mode. Please do so in a new command prompt.
To run this command, first make sure your database is connected in Startup Upgrade mode from
12c Oracle_Home. It should show the screen as:
Before running the perl.exe catctl.pl command please make sure the another command prompt
window you have opened to execute also has ORACLE_HOME and SID set.
cd E:\oracle12c_home\app\mfgdba\product\12.1.0\dbhome_1\RDBMS\ADMIN
E:\oracle12c_home\app\mfgdba\product\12.1.0\dbhome_1\RDBMS\ADMIN> set
ORACLE_SID=JASDB
E:\oracle12c_home\app\mfgdba\product\12.1.0\dbhome_1\RDBMS\ADMIN>E:\oracle12c_ho
me\app\mfgdba\product\12.1.0\dbhome_1\perl\bi
n\perl.exe catctl.pl -l E:\oracle12c_home\app\mfgdba\product\12.1.0\dbhome_1\diagnostics
catupgrd.sql
(Note: This script will run depending upon the size of the database. In this case the fresh database
took around 1hr 25m 58s to finish).
.
.
.
cd $ORACLE_HOME/rdbms/admin>@utlrp.sql
.
.
Run the dbupgdiag.sql (attached here for reference) and see Note <556610.1> Script to Collect DB
Upgrade/Migrate Diagnostic Information (dbupgdiag.sql) for more information.
dbupgdiag_output.
dbupgdiag.sql txt
.
.
In this output file you may find OLAPSYS owner as Invalid Objects. But there is nothing to worry
about. As per Oracle Metalink Document ID Invalid OLAPSYS Objects after Upgrading TO 12C
(Doc ID 1593666.1) OLAPSYS is not required and can be dropped. And in case you do not want to
drop them then you can leave them as it is since they are not related to SYS or internal schema. They
will not impact your after upgrade work.
IMPORTANT NOTE: Ones we are executing the above catupgrd.sql command with Perl feature then we do
not need to run the catupgrd.sql PARALLEL=NO again. As till 11g catupgrd.sql used to be done alone
but from Oracle 12c, there is a new feature introduced of parallelism where PERL is introduced to run the
upgrade in parallel mode in which it will depend upon the systems CPU count. So below command will not
be run again.
Note: PARALLEL=NO is not required to be run with 11g upgrade. It is a feature to be used with 12c.
3. If all the above components are in VALID state then there is no need to execute catuppst.sql
script (upgrade those components which dont require db in upgrade mode).
SQL>@E:\oracle12c_home\app\mfgdba\product\12.1.0\dbhome_1\RDBMS\ADMI
N\catuppst.sql;
6. Startup the db in upgrade mode to update the Time zone version to 18 as recommended in
preupgrade_fixups.sql.
END;
/
You would require the Upgraded database 12.1.0.2 to run from spfile so do the following:
Show parameter spfile
Create spfile from pfile;
Shut immediate
Startup
Show parameter spfile
Now, reset the compatible parameter to 12.1.0 and then Startup the db in normal mode.
Alter system set compatible=12.1.0.2 scope=spfile;
Shut immediate
Startup
Show parameter compatible
Lastly check the registry parameters to check all components have been successfully upgraded to
12.1.0.2 version by issuing the below command on an open database:
In the above snap you will notice that OWB component still shows in 11.2.0.4 version. The reason for it is
mentioned below.
Oracle Warehouse Builder (OWB) above 11.2.0.3 or higher is compatible is with 12c version as suggested
by oracle. If one still wants to upgrade this component then please refer to the Metalink Document ID
1516557.1. A piece of it from document is for reference:
Oracle Warehouse Builder: OWB is not installed as part of the software for Oracle Database 12c, and OWB
components that may exist in earlier releases are not upgraded as part of the Oracle Database upgrade
process. However, you can use OWB release 11.2.0.3 with Oracle Database 12c. Note that OWB releases
earlier than release 11.2.0.3 do not work with Oracle Database 12c.
Now, we can say that the database has been successfully upgraded to 12.1.0.2 version.
Select banner from v$version;
select host_name, name, db_unique_name, status, open_mode, database_role, logins from
v$database, v$instance;
**************************************END OF DOCUMENT************************************