Tuesday, May 31, 2016

Restore 11g Full BAckup To 12c

Rman can restore a backup taken on older database version into new version.Important point is after restore and recover process , database must not be opened and manual upgrade operation must be done.This method can be used for out-of place upgrades.In my case I have a full backup from 11g and it will be restored into 12c version on new host.

Before start , in older version pre-upgrade and post-upgrade procedures should be completed for successfull upgrade.

Basically ,

  1. Copy preupgrd.sql and utluppkg.sql files from new 12c $ORACLE_HOME/rdbms/admin to old 11g $ORACLE_HOME/rdbms/admin
  2. Execute  preupgrd.sql under 11g to detect pre-upgrade issues that must be completed.
  3. Backup full database 
  4. Copy backup files and archive logs to new host 
  5. Copy current init file and password file to new 12c $ORACLE_HOME/dbs
  6. Startup database in nomount mode
  7. Restore controlfile.
  8. Open database in mount mode.
  9. Restore and recover database
  10. Shutdown database
  11. Open database in upgrade
  12. SQL> startup upgrade
    In this step i have encountered error ,

    ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

    ORA-1589 signalled during: ALTER DATABASE OPEN MIGRATE...

    In order to pass over this error  following command can be used.

    alter database open resetlogs upgrade 
  13. For 12c new catctl.pl perl script is executed
    cd $ORACLE_HOME/rdbms/admin
    $ORACLE_HOME/perl/bin/perl catctl.pl -n  6 -l $ORACLE_HOME/diagnostics catupgrd.sql
     
  14. Run post-upgrade status tool $ORACLE_HOME/rdbms/admin/utlu121s.sql to display the summary of upgrade process.If any error(s) declared in output these errors must be exmained.
  15. Upgrade log file which is located at $ORACLE_HOME/diagnostics/catupgrd0.log is checked for "BEGIN catuppst.sql" to verify catuppst.sql ran during upgrade process.If this sql has not run then execute it .
  16. Run utlrp.sql to recompile invalid objects.
  17. Change parameter compatible in init.ora to "12.0.0"
  18. Shutdown database
  19. Recreate password file
  20. Startup database
After these steps new db version is 12c and it has been ugraded successfully. If you have a downtime and necessary disk size , this method can be used for upgrade to new versions.

No comments:

Post a Comment