How can Restor database to another server


1 step:
rman
connect target /;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/data/Exp_Backup/ctl_%F.bck';
RMAN>show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name AZKKDEV are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/export/home2/ctl_%F.bck';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_AZKKDEV.f'; # default
2 step in Primary database:
sqlplus "/ as sysdba";
create pfile='/data/Exp_Backup/init.ora' from spfile;
rman
connect target /;
run
{
backup database format '/data/Exp_Backup/full_%d_%T_%s.bck';
backup archivelog all format '/data/Exp_Backup/arch_%d_%T_%s.bck';
}
bash-3.2$ vi init.ora 
"init.ora" 27 lines, 1029 characters 
*.log_archive_dest_1='LOCATION=/data/Arch_AZDCSDB'
AZDCSDB.__db_cache_size=1426063360
AZDCSDB.__java_pool_size=16777216
AZDCSDB.__large_pool_size=16777216
AZDCSDB.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
AZDCSDB.__pga_aggregate_target=137791275008
AZDCSDB.__sga_target=4294967296
AZDCSDB.__shared_io_pool_size=184549376
AZDCSDB.__shared_pool_size=2550136832
AZDCSDB.__streams_pool_size=33554432
*.audit_file_dest='/u01/app/oracle/admin/AZDCSDB/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/data/AZDCSDB/controlfile/control01.ctl','/data/AZDCSDB/controlfile/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='AZDCSDB'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=AZDCSDBXDB)'
*.open_cursors=300
*.pga_aggregate_target=137780789248
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=4293918720
*.undo_tablespace='UNDOTBS1'
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"init.ora" 26 lines, 978 characters 
bash-3.2$ 
bash-3.2$ 
bash-3.2$ 
bash-3.2$ 
bash-3.2$ ps -afe | grep smon
 oracle 7340 1 0 May 14 ? 15:16 ora_smon_DCSTST
 oracle 12926 12831 0 15:00:46 pts/2 0:00 grep smon
bash-3.2$ 
bash-3.2$ 
bash-3.2$ export ORACLE_SID=AZDCSDB
bash-3.2$ echo $ORACLE_SID
AZDCSDB
bash-3.2$ sqlplus "/ as sysdba";
SQL*Plus: Release 11.2.0.3.0 Production on Wed Aug 27 15:01:07 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='/data/Exp_Backup/init.ora';
ORACLE instance started.
Total System Global Area 4277059584 bytes
Fixed Size 2166160 bytes
Variable Size 2617250416 bytes
Database Buffers 1610612736 bytes
Redo Buffers 47030272 bytes
SQL> 
SQL> 
SQL>
bash-3.2$ rman
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Aug 27 15:14:06 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target /;
connected to target database: AZDCSDB (not mounted)
RMAN> restore controlfile from '/data/Exp_Backup/ctl_c-1238208279-20140827-00.bck'
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN>
RMAN> catalog start with '/data/Exp_backup/';
Starting implicit crosscheck backup at 27-AUG-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=225 device type=DISK
Crosschecked 2 objects
Finished implicit crosscheck backup at 27-AUG-14
Starting implicit crosscheck copy at 27-AUG-14
using channel ORA_DISK_1
Finished implicit crosscheck copy at 27-AUG-14
searching for all files in the recovery area
cataloging files...
no files cataloged
searching for all files that match the pattern /data/Exp_backup/
no files found to be unknown to the database
RMAN>
RMAN> restore database;
Starting restore at 27-AUG-14
using channel ORA_DISK_1
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 00001 to /data/AZDCSDB/datafile/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /data/AZDCSDB/datafile/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /data/AZDCSDB/datafile/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /data/AZDCSDB/datafile/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /data/AZDCSDB/datafile/DCS_LIVE01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /data/AZDCSDB/datafile/history01.dbf
channel ORA_DISK_1: reading from backup piece /data/Exp_Backup/full_AZDCSDB_20140827_694.bck
channel ORA_DISK_1: piece handle=/data/Exp_Backup/full_AZDCSDB_20140827_694.bck tag=TAG20140827T114202
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 27-AUG-14
RMAN>
RMAN> list archivelog all;
List of Archived Log Copies for database with db_unique_name AZDCSDB
=====================================================================
Key Thrd Seq S Low Time 
------- ---- ------- - ---------
2064 1 2094 A 26-AUG-14
 Name: /data/Arch_AZDCSDB/1_2094_847968411.dbf
2065 1 2095 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2095_847968411.dbf
2066 1 2096 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2096_847968411.dbf
2067 1 2097 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2097_847968411.dbf
2068 1 2098 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2098_847968411.dbf
2069 1 2099 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2099_847968411.dbf
2070 1 2100 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2100_847968411.dbf
2071 1 2101 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2101_847968411.dbf
2072 1 2102 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2102_847968411.dbf
2073 1 2103 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2103_847968411.dbf
2074 1 2104 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2104_847968411.dbf
2075 1 2105 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2105_847968411.dbf
2076 1 2106 A 27-AUG-14
 Name: /data/Arch_AZDCSDB/1_2106_847968411.dbf
run {
set until sequence 2107 thread 1;
recover database;
}
run {
set until sequence 2108 thread 1;
recover database;
}
RMAN> run {
2> set until sequence 2107 thread 1;
3> recover database;
4> }
executing command: SET until clause
Starting recover at 27-AUG-14
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=2106
channel ORA_DISK_1: reading from backup piece /data/Exp_Backup/arch_AZDCSDB_20140827_695.bck
channel ORA_DISK_1: piece handle=/data/Exp_Backup/arch_AZDCSDB_20140827_695.bck tag=TAG20140827T114238
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/fast_recovery_area/AZDCSDB/archivelog/2014_08_27/o1_mf_1_2106_9zvd9zrt_.arc thread=1 sequence=2106
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/AZDCSDB/archivelog/2014_08_27/o1_mf_1_2106_9zvd9zrt_.arc RECID=2077 STAMP=856711312
media recovery complete, elapsed time: 00:00:03
Finished recover at 27-AUG-14
RMAN> sql 'alter database open resetlogs';

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: