Sunday, October 20, 2019

Oracle RAC Upgrade From 11.2.0.4 to 12.1.0.2

Oracle RAC Upgrade From 11.2.0.4 to 12.1.0.2


Main steps:

GRID_HOME:

1.check all the services are up and running of GRIDHOME (11gr2)
crsctl check crs
crsctl status resource -t
2.check the GRID infrastructure software version
crsctl query crs activeversion
3.check database status and configuration
srvctl status database -d PROD
srvctl config database -d PROD
4.perform the local backup of OCR, GRID and DATABASE.
./ $GRID_HOME/bin/ocrconfig -export /u01/ocrmanulbkp
use tar command for GRID and DATABASE backup
5.Run the cluvfy utility from 12cr1 to pre-check any errors
./runclufy.sh stage -pre crsinst -upgrade -rolling -scr_crshome <11g loc> -dest_crshome <12c loc> -dest_version 12.1.0.2 -
versbose (-fixup) optionally
6.stop the running 11g database
srvctl stop database -d PROD
6.Unzip the 12c software, change the ownership and permissions
7.start the 12cr1 upgrade by executing ./runInstaller
-select upgrade GRID infrastructure with ASM
-check the existing grid homes
-provide the location of 12c grid home
8.execute the rootupgrade.sh script in both nodes from root user
9.check the clusterware upgrade version
crsctl query crs activeversion
10.start the 11g database
srvctl start database -d PROD
srvctl status database -d PROD

RDBMS_HOME:

1.backup the database before upgrade(important)
take level zero backup or cold backup
2.database pre-checks
-run cluvfy.sh stage -pre dbinst -upgrade -src_dbhome <11g> -dest_dbhome <12c> dest_version 12.1.0.2.0
-unzip the database software
-execute runInstaller
-select the RAC cluster database
-provide the 12c binaries home location
-run the root.sh script on both the nodes with root user

DATABASE:

1.perform the pre-checks
-check the invalid objects
select count(*) from dba_objects where status='INVALID';
-check the duplicate objects owned by sys and system
other than 4 we need to cleanup
2.run the preupgrade tool
copy the prequprd.sql and utluppkg.sql from 12c and run on 11g home
preupgrd.sql will generate 3 files, prequpgrade.log, preupgrade_fixups.sql and postupgrade_fixups.sql
3.execute the preupgrade_fixups.sq
it will set few parameters like processess, job_queue_processes, execute gather status and purge recyclebin
4.check the timezone version, for 12c database timezone is 18 and 11g is 14
select version from v$timezone_file;
5.make sure no files in begin backup mode and no files in media recovery
select * from v$recover_file;
6.disable cronjob and dbms_scheduler jobs
execute dbms_scheduler.disable;
7.remove EM repository because it is superseded in 12c
emctl stop dbcontrol
@?/rdbms/admin/emremove.sql
8.enable flashback by setting 2 parameters
db_recovery_file_dest_size and db_recovery_file_dest
alter database flashback on;
9.create restore point
create restore point bef_upgrade guarantee flashback database;
10.stop the 11g listener and database.
lsnrctl stop PROD
shut immediate;
11.update theORACLE_HOME paths pointing to 12c home
export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=PROD
12.move spfile and password file from 11g home dbs directory to 12c home dbs directory
13.start the 12c database with startup upgrade option
startup upgrade;
14.run catupgrade script from os level with parallel=6
goto cd $ORACLE_HOME/rdbms/admin
$ORACLE_HOME/perl/bin/perl catctl.pl -n 6 -1 $ORACLE_HOME/diagnostics catupgrd.sql
check the logfiles for diagnosis the upgrde process
15.run the post upgrade status tool
startup
@utlu121s.sql
16.run the catuppst.sql script
$ORACLE_HOME/rdbms/admin/catuppst.sql
16.upgrade DST timezone
downlod the dst upgrade script from metalink
17.run the postupgrade_fixups.sql script
18.change the ORACLE_HOME to 12c in listener.ora file
19.uncomment the crontab and enable the dba_scheduler_jobs
18.run utlrp.sql to compile to invalid objects
19.update the compatible parameter and bounce the db
alter system set compatibe='12.1.0.2' scope=spfile;
Once compatible is set to higher version, downgrade is not possible

IF UPGRADE FAILS:

If you have done the prechecks properly, then chances are very less that, upgrade willl fail. but enven if it is fails for any other reasons like server crash during upgrade, then follow below steps to revert back to 11g version.

1.shutdown immediate;
2.set ORACLE_HOME to 11g
3.startup mount (with the 11g spfile)
4.select * from v$restore_point;
5.flashback database to restore point bef_upgrade (this restore point was created before upgrade)
6.alter database open resetlogs;

No comments:

Post a Comment