Oracle使用RMAN复制数据库(二)

2014-11-24 08:53:38 · 作者: · 浏览: 3
umber=00003 name=/u01/app/oracle/oradata/ORA11GR2/undotbs01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/ORA11GR2/example01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/ORA11GR2/users01.dbf

channel ORA_DISK_1: starting piece 1 at 31-MAR-13

channel ORA_DISK_1: finished piece 1 at 31-MAR-13

piece handle=/u01/app/FRA/ORA11GR2/backupset/2013_03_31/o1_mf_nnndf_TAG20130331T154059_8oht4jr1_.bkp tag=TAG20130331T154059 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:04:33

Finished backup at 31-MAR-13

Starting backup at 31-MAR-13

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=14 RECID=7 STAMP=811525533

channel ORA_DISK_1: starting piece 1 at 31-MAR-13

channel ORA_DISK_1: finished piece 1 at 31-MAR-13

piece handle=/u01/app/FRA/ORA11GR2/backupset/2013_03_31/o1_mf_annnn_TAG20130331T154533_8ohtdxrl_.bkp tag=TAG20130331T154533 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 31-MAR-13

Starting Control File and SPFILE Autobackup at 31-MAR-13

piece handle=/u01/app/FRA/ORA11GR2/autobackup/2013_03_31/o1_mf_s_811525535_8ohtf2n9_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 31-MAR-13

RMAN>

1.1.2. 目标服务器上复制数据库

1) 创建密码文件

[oracle@ocmu ~]$ cd $ORACLE_HOME/dbs

[oracle@ocmu dbs]$ orapwd file= orapwORA11GR2 password=oracle entries=10

[oracle@ocmu dbs]$ ls orapw*

orapwORA11GR2

[oracle@ocmu dbs]$

2) 编辑tnsnames

[oracle@ocmu ~]$ cd $ORACLE_HOME/network/admin

[oracle@ocmu admin]$ vi tnsnames.ora

ORA11GR2 =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = ocmu)(PORT = 1521))

)

(CONNECT_DATA =

(ORACLE_SID = ORA11GR2)

)

)

3) 将源库的pfile文件拷贝到目标数据库

[oracle@ocmu ~]$ cd $ORACLE_HOME/dbs

[oracle@ocmu dbs]$

scp 192.168.1.200:/u01/app/oracle/product/11.2.0/db_1/dbs/initORA11GR2.ora .

The authenticity of host '192.168.1.200 (192.168.1.200)' can't be established.

RSA key fingerprint is 35:b3:59:37:e6:a1:3b:34:7d:01:84:ee:5d:9b:48:24.

Are you sure you want to continue connecting (yes/no) yes

Warning: Permanently added '192.168.1.200' (RSA) to the list of known hosts.

oracle@192.168.1.200's password:

initORA11GR2.ora 100% 948 0.9KB/s 00:00

[oracle@ocmu dbs]$

4) 创建相关目录

--创建数据文件存放目录

[oracle@ocmu ~]$ mkdir -p /u01/app/oracle/oradata/ORA11GR2

--创建快速恢复区目录

[oracle@ocmu ~]$ mkdir -p /u01/app/FRA/ORA11GR2

--创建admup转储目录

[oracle@ocmu ~]$ mkdir -p /u01/app/oracle/admin/ORA11GR2/adump

5) 将源库快速恢复区内容拷贝到目标库

[oracle@ocmu ~]$ cd /u01/app/FRA/ORA11GR2

[oracle@ocmu ORA11GR2]$ ls

[oracle@ocmu ORA11GR2]$

scp -r 192.168.1.200:/u01/app/FRA/ORA11GR2/archivelog .

oracle@192.168.1.200's password:

o1_mf_1_12_8ohorqkc_.arc 100% 48MB 24.1MB/s 00:02

o1_mf_1_11_8ohorc4n_.arc 100% 48MB 24.1MB/s 00:02

o1_mf_1_9_8ohoq8dx_.arc 100% 46MB 3.8MB/s 00:12

o1_mf_1_14_8ohtdx3d_.arc 100% 357KB 357.0KB/s 00:00

o1_mf_1_13_8oht26d8_.arc 100% 21MB 21.1MB/s 00:01

o1_mf_1_10_8ohoqxot_.arc 100% 48MB 24.1MB/s 00:02

o1_mf_1_8_8ohops0g_.arc 100% 44MB 3.1MB/s 00:14

[oracle@ocmu ORA11GR2]$

scp -r 192.168.1.200:/u01/app/FRA/ORA11GR2/autobackup .

oracle@192.168.1.200's password:

o1_mf_s_811