Friday, 14 March 2014

Upgrading database(PSU patch apply) from 11.2.0.1.0 to 11.2.0.4.0 on LINUX x86_64

How to Upgrade database from 11.2.0.1.0 to 11.2.0.4.0 on LINUX x86_64 ?

1. Be ready with suitable software Patch set. Download it from oracle support link and save in your respective server directory

2.Do basic check of your database
-------------------------------------------------------------------------
SQL> select * from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL> select COMP_NAME,VERSION,STATUS from dba_registry


3.For safe side take backup of your database either cold backup or RMAN backup using below script:
-------------------------------------------------------------------------
Rman target /
run{
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
CROSSCHECK ARCHIVELOG ALL;
CROSSCHECK BACKUP;
allocate channel t1 type disk format '/u01/oracle/app/oradata/pavan/ttdtest/flash_recovery_area/ttdTEST/backupset/ORA_rman_full_backup_ttdtest_%U.bck' maxpiecesize 5120m;
backup incremental level - 0 AS COMPRESSED BACKUPSET database tag - full_open_backup_disk;
sql  'alter system archive log current';
backup archivelog all;
backup current controlfile format '/u01/oracle/app/oradata/pavan/ttdtest/flash_recovery_area/ttdTEST/backupset/ORA_rman_ctrl_backup_ttdtest_%U.bck';
}
exit


4.Once you got the patch ZIP files unzip them by using below command:(there will be totally 7 files available, but we need only first two files for our purpose)

-------------------------------------------------------------------------
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip


5.Once unzipped a directory called database will be created with all unzipped files in it. you can view them as mentioned below:
-------------------------------------------------------------------------
cd database/
cd stage/
ls -lrt


6.Go to the below step only if your database is created using DBCA method. Otherwise skip this step

-------------------------------------------------------------------------
cat /etc/oratab
ttdtest:/u01/oracle/app/product/11.2.0/dbhome_1:N
replace it with
ttdtest:/u01/oracle/app/product/11.2.0.4/dbhome_1:N


7.Now in ~ OS prompt set the display value as below. You need to do this because you can install software using xlaunch GUI.
-------------------------------------------------------------------------
~OS prompt:setenv DISPLAY  <IPaddress of your PC>:0.0
~OS prompt:echo $DISPLAY
~OS prompt:which xterm
/usr/bin/xterm
~OS prompt:xterm &


8.Now a GUI will be opened which resembles similar to unix prompt. there you can install the software by issuing :
-------------------------------------------------------------------------
./runInstaller
during this installation it will ask us to run the below scipts.
/tmp/CVU_11.2.0.4.0_oracle/runfixup.sh
/u01/oracle/app/product/11.2.0.4/dbhome_1/root.sh
note: these scripts can be run only by root user.
During this installation part in will ask us to provide new ORACLE_HOME path. we can give the path whatever we wish.


9. Stop the listener and Shutdown database:

-------------------------------------------------------------------------
lsnrctl stop LISTENER_1
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.


10. Copy the parameter files ,listener files to new location:
-------------------------------------------------------------------------
cp /u01/oracle/app/product/11.2.0/dbhome_1/initttdtest.ora /u01/oracle/app/product/11.2.0.4/dbhome_1/
cp  /u01/oracle/app/product/11.2.0/dbhome_1/network/admin/*.ora  /u01/oracle/app/product/11.2.0.4/dbhome_1/network/admin/


11.Set the new environment variables in bash_profile/.cshrc/any other environment file and execute it.
-------------------------------------------------------------------------
echo $ORACLE_HOME
echo $PATH


12.in $ORACLE_HOME/rdbms/admin/ path execute the below sql script.
-------------------------------------------------------------------------
SQL>@utlu112i.sql
Note: this is a pre-upgrade tool which will generate a report that suggests us to modify whatever changes required for upgradation.we have to run in before upgradation starts.


13. Now once the modifications are done execute the command in sql prompt

-------------------------------------------------------------------------
SQL> STARTUP UPGRADE
SQL> @catupgrd.sql


14. Almost 95 % of up gradation activity is completed. Now perform the execution of  below sql's
-------------------------------------------------------------------------
SQL>utlu112s.sql   ---------- intimates POST-UPGRADATION STATUS --------- dispays upgrade status after upgradation
SQL>catuppst.sql   ---------- this is part of last step of upgradation once the above steps are completed successfully


15.Now Run utlrp.sql to recompile Invalid objects.
-------------------------------------------------------------------------
SQL> @utlrp.sql

16.Verify that all expected packages ,procedures and objects are valid:
-------------------------------------------------------------------------
SQL> SELECT count(*) FROM dba_invalid_objects;
SQL> SELECT distinct object_name FROM dba_invalid_objects;

17.Now make you listener up
-------------------------------------------------------------------------
lsnrctl start LISTENER_1

18.check finally the upgradion effects by issuing below in sql prompt:
-------------------------------------------------------------------------
select * from v$version;
select COMP_NAME,VERSION,STATUS from dba_registry

SQL> select * from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production



Cheers...
Upgradation successful....!!!!!!!!




http://docs.oracle.com/cd/E11882_01/server.112/e40402/scripts004.htm#i1006127



No comments:

ORA-600 [kwqitnmphe:ltbagi], [1], [0] reported in the alert log file.

ORA-00600 [kwqitnmphe:ltbagi] Cause: This issue arises in 12.1.0.2. The error occurs because there are still Historical Messages without...