Visit Counter

Tuesday, March 14, 2017

Restore Oracle Database on Different Host but same file location


Oracle 12c Database
Solaris 11.2 Sparc 64-bit


Scenario: 

I restored full database from source to destination server but not a different location.
I already took the full backup of source and moved destination server. Actually my source server having large memory...So manually I created parameter file (Pfile) to start up the database.



-bash-4.1$ cat initinforln.ora
inforln.__data_transfer_cache_size=0
inforln.__db_cache_size=3422552064
inforln.__java_pool_size=16777216
inforln.__large_pool_size=33554432
inforln.__oracle_base='/ora/app/oracle12c'#ORACLE_BASE set from environment
inforln.__pga_aggregate_target=1509949440
inforln.__sga_target=4529848320
inforln.__shared_io_pool_size=234881024
inforln.__shared_pool_size=805306368
inforln.__streams_pool_size=0
*.audit_file_dest='/ora/app/oracle12c/admin/inforln/adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='/ora/app/oracle/oradata/inforln/control01.ctl','/ora/app/oracle12c/fast_recovery_area/inforln/control02.ctl'
*.db_block_size=32768
*.db_domain=''
*.db_name='inforln'
*.db_recovery_file_dest='/ora/app/oracle12c/fast_recovery_area'
*.db_recovery_file_dest_size=4815m
*.diagnostic_dest='/ora/app/oracle12c'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=inforlnXDB)'
*.enable_pluggable_database=true
#*.local_listener='LISTENER_INFORLN'
*.log_archive_dest_1='LOCATION=/ora/app/oracle/oradata/archive1'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=1437m
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=4313m
*.undo_tablespace='UNDOTBS1'
*._use_osm=FALSE
-bash-4.1$







SQL> select dbid from v$database;

      DBID
----------
1270400239




RMAN> list backup


....

....

....

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
55      22.55M     DISK        00:00:01     07-MAR-17
        BP Key: 55   Status: AVAILABLE  Compressed: NO  Tag: TAG20170307T121936
        Piece Name: /ora/dbfullbk/full_1qruhiaq_58_1

  List of Archived Logs in backup set 55
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    486     11861751   07-MAR-17 11864486   07-MAR-17

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
56      Full    17.48M     DISK        00:00:03     07-MAR-17
        BP Key: 56   Status: AVAILABLE  Compressed: NO  Tag: TAG20170307T121941
        Piece Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/2017_03_07/o1_mf_s_938002781_dcwysjqh_.bkp
  SPFILE Included: Modification time: 06-MAR-17
  SPFILE db_unique_name: INFORLN
  Control File Included: Ckp SCN: 11864497     Ckp time: 07-MAR-17



COPY CONTROLFILE AUTOBACUP FILE FROM SOURCE SERVER


$ scp o1_mf_s_938002781_dcwysjqh_.bkp 1           92.0.0.47:/ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/2017_03_07/
Password:
o1_mf_s_938002781_dc 100% |*********************************************************************| 17920 KB    00:00



DESTINATION SERVER




RMAN> restore controlfile from '/ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/2017_03_07/o1_mf_s_938002781_dcwysjqh_.bkp';

Starting restore at 14-MAR-17
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/ora/app/oracle/oradata/inforln/control01.ctl
output file name=/ora/app/oracle12c/fast_recovery_area/inforln/control02.ctl
Finished restore at 14-MAR-17



RMAN> alter database mount;


COPY DATABASE BACKUP FILE TO DESTINATION SERVER

I moved from source database folder to destination folder path given below. Source path same

#scp * 192.0.0.47:/ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup




RMAN> catalog start with '/ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup';

searching for all files that match the pattern /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup

List of Files Unknown to the Database
=====================================
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1mruhh66_54_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1pruhi99_57_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1qruhiaq_58_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1oruhi6a_56_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1nruhi06_55_1

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1mruhh66_54_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1pruhi99_57_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1qruhiaq_58_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1oruhi6a_56_1
File Name: /ora/app/oracle12c/fast_recovery_area/INFORLN/autobackup/full_1nruhi06_55_1


Now Restore Database plus recover


RMAN> run {
2> restore database;
3> recover database;
4> }

Starting restore at 14-MAR-17
using channel ORA_DISK_1

skipping datafile 1; already restored to file /ora/app/oracle/oradata/inforln/system01.dbf
skipping datafile 3; already restored to file /ora/app/oracle/oradata/inforln/sysaux01.dbf
skipping datafile 5; already restored to file /ora/app/oracle/oradata/inforln/undotbs01.dbf
skipping datafile 6; already restored to file /ora/app/oracle/oradata/inforln/users01.dbf
skipping datafile 7; already restored to file /ora/app/oracle/oradata/inforln/pinforln/system01.dbf
skipping datafile 8; already restored to file /ora/app/oracle/oradata/inforln/pinforln/sysaux01.dbf
skipping datafile 9; already restored to file /ora/app/oracle/oradata/inforln/pinforln/pinforln_users01.dbf
skipping datafile 10; already restored to file /ora/app/oracle/oradata/inforln/pinforln/xdb_INFORLN01.dbf
skipping datafile 11; already restored to file /ora/app/oracle/oradata/inforln/pinforln/idx_INFORLN01.dbf
skipping datafile 12; already restored to file /ora/app/oracle/oradata/inforln/pinforln/undots01.dbf
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /ora/app/oracle/oradata/inforln/pdbseed/system01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /ora/app/oracle/oradata/inforln/pdbseed/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /ora/dbfullbk/full_1pruhi99_57_1
channel ORA_DISK_1: piece handle=/ora/dbfullbk/full_1pruhi99_57_1 tag=TAG20170307T121358
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 14-MAR-17

Starting recover at 14-MAR-17
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=486
channel ORA_DISK_1: reading from backup piece /ora/dbfullbk/full_1qruhiaq_58_1
channel ORA_DISK_1: piece handle=/ora/dbfullbk/full_1qruhiaq_58_1 tag=TAG20170307T121936
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/ora/app/oracle/oradata/archive1/1_486_933728367.dbf thread=1 sequence=486
unable to find archived log
archived log thread=1 sequence=487
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/14/2017 12:34:13
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 487 and starting SCN of 11864486


I copied missing archives from source to destination server.

RMAN> run {
allocate channel t1 type disk;
recover database;
release channel t1;
}



RMAN>exit



-bash-4.1$ ./rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Mar 14 14:24:14 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: INFORLN (DBID=1270400239, not open)

RMAN> alter database open resetlogs;

using target database control file instead of recovery catalog
Statement processed

RMAN> exit




Refer:


https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=247610951693761&id=1300586.1&_afrWindowMode=0&_adf.ctrl-state=vsv5cduf0_74


1 comment:

  1. It is really a great and useful piece of info. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

    Dot Net Training in Chennai

    Software Testing Training in Chennai

    ReplyDelete