Server details
Node 1:
[oracle@target backup]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Node 2:
[oracle@source backup]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
1) Take 0 level
backup of source database
[oracle@source]$ mkdir /u01/app/backup/
[oracle@source]$ cd /u01/app/backup/
[oracle@source backup]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Nov
27 02:50:21 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB11G (DBID=366062519)
RMAN>
RMAN> RUN
2> {
3> configure controlfile autobackup on;
4> set command id to 'ORCLOnlineBackupFull';
5> ALLOCATE CHANNEL c1 DEVICE TYPE disk;
6> ALLOCATE CHANNEL c2 DEVICE TYPE disk;
7> backup AS COMPRESSED BACKUPSET full database tag
ORCL_FULL format '/u01/app/backup/%d_%T_%s_%p_FULL' ;
8> sql 'alter system archive log current';
9> backup tag ORCL_ARCHIVE format
'/u01/app/backup/%d_%T_%s_%p_ARCHIVE' archivelog all delete all input ;
10> backup tag ORCL_CONTROL current controlfile format
'/u01/app/backup/%d_%T_%s_%p_CONTROL';
11> backup tag spfile_pfile spfile format
'/u01/app/backup/%d_%T_%s_%p_spfile';
12> release channel c1;
13> release channel c2;
14> }
using target database control file instead of recovery
catalog
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
executing command: SET COMMAND ID
allocated channel: c1
channel c1: SID=33 device type=DISK
allocated channel: c2
channel c2: SID=41 device type=DISK
Starting backup at 27-NOV-15
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001
name=/u01/app/oracle/oradata/DB11G/system01.dbf
input datafile file number=00005
name=/u01/app/oracle/oradata/DB11G/example01.db
channel c1: starting piece 1 at 27-NOV-15
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002
name=/u01/app/oracle/oradata/DB11G/sysaux01.dbf
input datafile file number=00003
name=/u01/app/oracle/oradata/DB11G/undotbs01.db
input datafile file number=00004
name=/u01/app/oracle/oradata/DB11G/users01.dbf
channel c2: starting piece 1 at 27-NOV-15
channel c2: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_37_1_FULL
tag=ORCL_FULL comment=NONE
channel c2: backup set complete, elapsed time: 00:00:46
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_36_1_FULL
tag=ORCL_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:56
Finished backup at 27-NOV-15
Starting Control File and SPFILE Autobackup at 27-NOV-15
piece
handle=/u01/app/oracle/product/11.2.0/db_1/dbs/c-366062519-20151127-00
comment=NONE
Finished Control File and SPFILE Autobackup at 27-NOV-15
sql statement: alter system archive log current
Starting backup at 27-NOV-15
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=11 RECID=9
STAMP=896841558
channel c1: starting piece 1 at 27-NOV-15
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=12 RECID=10
STAMP=896842340
input archived log thread=1 sequence=13 RECID=11
STAMP=896842340
channel c2: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_39_1_ARCHIVE
tag=ORCL_ARCHIVE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
channel c1: deleting archived log(s)
archived log file name=/u01/archive/1_11_896392954.dbf
RECID=9 STAMP=896841558
channel c2: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_40_1_ARCHIVE
tag=ORCL_ARCHIVE comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c2: deleting archived log(s)
archived log file name=/u01/archive/1_12_896392954.dbf
RECID=10 STAMP=896842340
archived log file name=/u01/archive/1_13_896392954.dbf
RECID=11 STAMP=896842340
Finished backup at 27-NOV-15
Starting backup at 27-NOV-15
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_41_1_CONTROL
tag=ORCL_CONTROL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-NOV-15
Starting backup at 27-NOV-15
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_42_1_spfile
tag=SPFILE_PFILE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-NOV-15
Starting Control File and SPFILE Autobackup at 27-NOV-15
piece
handle=/u01/app/oracle/product/11.2.0/db_1/dbs/c-366062519-20151127-01
comment=NONE
Finished Control File and SPFILE Autobackup at 27-NOV-15
released channel: c1
released channel: c2
2) Create same backup
location on target database server and transfer all backup file to same
location.
[oracle@target ~]$ mkdir /u01/app/backup/
[oracle@source backup]$ ls -ltr
total 303000
-rw-r----- 1 oracle oinstall
76931072 Nov 27 02:52 DB11G_20151127_37_1_FULL
-rw-r----- 1 oracle oinstall 212533248 Nov 27 02:52
DB11G_20151127_36_1_FULL
-rw-r----- 1 oracle oinstall 2514432 Nov 27 02:52
DB11G_20151127_40_1_ARCHIVE
-rw-r----- 1 oracle oinstall 8061440 Nov 27 02:52
DB11G_20151127_39_1_ARCHIVE
-rw-r----- 1 oracle oinstall 9797632 Nov 27 02:52
DB11G_20151127_41_1_CONTROL
-rw-r----- 1 oracle oinstall 98304 Nov 27 02:52
DB11G_20151127_42_1_spfile
[oracle@source backup]$ scp * oracle@target:/u01/app/backup/
The authenticity of host 'target (192.168.223.130)' can't be
established.
RSA key fingerprint is
87:f6:a9:cc:0d:63:8c:40:6d:ee:17:2f:05:dd:ac:ad.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'target,192.168.223.130' (RSA) to
the list of known hosts.
oracle@target's password:
DB11G_20151127_36_1_FULL
100% 203MB 50.7MB/s
00:04
DB11G_20151127_37_1_FULL 100% 73MB
36.7MB/s 00:02
DB11G_20151127_39_1_ARCHIVE
100% 7873KB 7.7MB/s 00:01
DB11G_20151127_40_1_ARCHIVE
100% 2456KB 2.4MB/s 00:00
DB11G_20151127_41_1_CONTROL
100% 9568KB 9.3MB/s 00:00
DB11G_20151127_42_1_spfile
100% 96KB 96.0KB/s
00:00
[oracle@target ~]$ cd /u01/app/backup/
[oracle@target backup]$ ls -ltr
total 303000
-rw-r----- 1 oracle oinstall 212533248 Nov 26 16:41
DB11G_20151127_36_1_FULL
-rw-r----- 1 oracle oinstall
76931072 Nov 26 16:41 DB11G_20151127_37_1_FULL
-rw-r----- 1 oracle oinstall 9797632 Nov 26 16:41
DB11G_20151127_41_1_CONTROL
-rw-r----- 1 oracle oinstall 2514432 Nov 26 16:41
DB11G_20151127_40_1_ARCHIVE
-rw-r----- 1 oracle oinstall 8061440 Nov 26 16:41
DB11G_20151127_39_1_ARCHIVE
-rw-r----- 1 oracle oinstall 98304 Nov 26 16:41
DB11G_20151127_42_1_spfile
[oracle@target backup]$
3) Create structure
on target database same as source database.
[oracle@target oracle]$ mkdir -p
/u01/app/oracle/oradata/DB11G
[oracle@source DB11G]$ mkdir -p
/u01/app/oracle/admin/DB11G/dpdump
[oracle@source DB11G]$ mkdir -p
/u01/app/oracle/admin/DB11G/pfile
[oracle@source DB11G]$ mkdir -p
/u01/app/oracle/admin/DB11G/adump
[oracle@source DB11G]$
4) Restore
spfile,contofile,database using rman (on target database).
[oracle@target dbs]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Nov
26 17:25:00 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system
parameters
LRM-00109: could not open parameter file
'/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora'
starting Oracle instance without parameter file for
retrieval of spfile
Oracle instance started
Total System Global Area
158662656 bytes
Fixed Size 2226456 bytes
Variable Size
92276456 bytes
Database Buffers
58720256 bytes
Redo Buffers 5439488 bytes
RMAN> restore spfile from
'/u01/app/backup/DB11G_20151127_42_1_spfile';
Starting restore at 26-NOV-15
using target database control file instead of recovery
catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP
/u01/app/backup/DB11G_20151127_42_1_spfile
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 26-NOV-15
RMAN> shutdown immediate;
Oracle instance shut down
RMAN>exit
[oracle@target dbs]$ sqlplus
SQL*Plus: Release 11.2.0.3.0 Production on Thu Nov 26
17:51:36 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter user-name: /as sysdba
SQL> create pfile from spfile;
File created.
SQL> create pfile from spfile;
File created.
SQL> startup nomount
pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora';
ORACLE instance started.
Total System Global Area
839282688 bytes
Fixed Size
2233000 bytes
Variable Size
520097112 bytes
Database Buffers
314572800 bytes
Redo Buffers
2379776 bytes
SQL> exit
[oracle@target admin]$ echo $ORACLE_SID
DB11G
[oracle@target admin]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Nov
26 17:52:32 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB11G (not mounted)
RMAN> restore controlfile from '/u01/app/backup/DB11G_20151127_41_1_CONTROL';
Starting restore at 26-NOV-15
using target database control file instead of recovery
catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/DB11G/control01.ctl
output file name=/u01/app/oracle/oradata/DB11G/control02.ctl
Finished restore at 26-NOV-15
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 26-NOV-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
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
/u01/app/oracle/oradata/DB11G/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to
/u01/app/oracle/oradata/DB11G/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to
/u01/app/oracle/oradata/DB11G/users01.dbf
channel ORA_DISK_1: reading from backup piece
/u01/app/backup/DB11G_20151127_37_1_FULL
channel ORA_DISK_1: piece
handle=/u01/app/backup/DB11G_20151127_37_1_FULL tag=ORCL_FULL
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
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
/u01/app/oracle/oradata/DB11G/system01.dbf
channel ORA_DISK_1: restoring datafile 00005 to
/u01/app/oracle/oradata/DB11G/example01.dbf
channel ORA_DISK_1: reading from backup piece
/u01/app/backup/DB11G_20151127_36_1_FULL
channel ORA_DISK_1: piece
handle=/u01/app/backup/DB11G_20151127_36_1_FULL tag=ORCL_FULL
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:47
Finished restore at 26-NOV-15
RMAN> recover database;
Starting recover at 26-NOV-15
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=12
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=13
channel ORA_DISK_1: reading from backup piece
/u01/app/backup/DB11G_20151127_40_1_ARCHIVE
channel ORA_DISK_1: piece
handle=/u01/app/backup/DB11G_20151127_40_1_ARCHIVE tag=ORCL_ARCHIVE
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/archive/1_12_896392954.dbf
thread=1 sequence=12
archived log file name=/u01/archive/1_13_896392954.dbf
thread=1 sequence=13
unable to find archived log
archived log thread=1 sequence=14
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03002: failure of recover command at 11/26/2015
17:56:57
RMAN-06054: media recovery requesting unknown archived log
for thread 1 with sequence 14 and starting SCN of 1075281
RMAN> alter database open RESETLOGS;
database opened
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> exit
[oracle@target dbs]$ sqlplus
SQL*Plus: Release 11.2.0.3.0 Production on Thu Nov 26
17:59:24 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to an idle instance.
SQL> startup
pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora';
ORACLE instance started.
Total System Global Area
839282688 bytes
Fixed Size
2233000 bytes
Variable Size
520097112 bytes
Database Buffers
314572800 bytes
Redo Buffers
2379776 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile;
File created.
SQL> startup force;
ORACLE instance started.
Total System Global Area
839282688 bytes
Fixed Size
2233000 bytes
Variable Size
520097112 bytes
Database Buffers
314572800 bytes
Redo Buffers
2379776 bytes
Database mounted.
Database opened.
SQL> select name from v$database;
NAME
---------
DB11G
SQL>
*****END*****
No comments:
Post a Comment