Wednesday, 4 February 2015

Upgrading the database from 11.1.0.6 TO 11.2.0.2

UPGRADE 11.1.0.6 TO 11.2.0.2
---------------------------------------
1. Install required version 11.2.0.1
old version 11.1.0.6 (db_1)
new version 11.2.0.1 (db_2)

2. Install patches on new ORACLE_HOME if required.
Using Opatch apply

3. goto ORACLE_HOME (db_2) location
 copy /rdbms/admin/utlu112i.sql to  /tmp/utlu112i.sql

4. copy network configuration files tnsnames.ora and listener.ora to new ORACLE_HOME

5. Copy pfile or spfile from old ORACLE_HOME/dbs to new ORACLE_HOME/dbs location

6. ensure your system, sys user using same tablespace or not.

7. check for backups.
select * from v$backup;
if any wait to complete.

8. purge dba_recyclebin;

9. collect the dictionary statistics
exec dbas_stats.gather_dictionary_stats();

10. select * from dba_2pc_pending;
If there is any transactions close them.

11. Disable all cronjobs.

12. check the integrity of the database
sql> spool /tmp/dbup.txt
sql> @/tmp/utlu112i.sql
sql> spool off
take necessary steps if needed.

13. vi /etc/oratab
change old ORACLE_HOME (db_1)TO new ORACLE_HOME (db_2)

14. shut immediate

15. Take full backup.

16.
. oraenv
sqlplus / as sysdba
startup upgrade;
[check file version, home version
it will start the database in temp mode]

17. sql> spool /tmp/dbup.txt
@?/rdbms/admin/catupgrd.sql
@?/rdbms/admin/utlu112s.sql
@?/rdbms/admin/catuppst.sql
sql> spool off

18. sql> select * from dba_registry;

19.check for invalid objects.
sql> select object_name, object_type, status from dba_objects where status like 'INVALID';

If there is any invalid objects
sql> @?/rdbms/admin/utlrp.sql

still any invalid objects
sql> alter object_type, object_name compile;
sql> alter table <table_name> compile;
sql> alter procedure <procedure_name> compile;

20. take full backup

21. collect the statistics.

22. stop the listener and start the new listener in new ORACLE_HOME.

23. Enable crontab job.

No comments:

Post a Comment

Optimizer Access Paths using Indexes

Introduction In this tutorial you will use the Optimizer Access Paths for the following cases (scenarios): Case 1: With and Without Index Ca...