[20180412]手工拷贝文件到另外主机.txt
--//讨论链接:http://www.itpub.net/thread-2101193-1-1.html
--//自己测试是否可以拷贝成功.
--//理论讲很难实现,主库一个路径如何放到dataguard2个目录路径,我的观点仅仅保留一个.
1.环境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
2.测试:
rlwrap rman target sys/oracle@book auxiliary sys/oracle@bookdg
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored
--//执行如下:
RMAN>
backup as copy reuse
datafile 5 auxiliary format "/tmp/example01.dbf"
datafile 6 auxiliary format "/home/oracle/tea01.dbf" ;
Starting backup at 2018-04-12 09:34:07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=67 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=80 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=94 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/mnt/ramdisk/book/example01.dbf
channel ORA_DISK_2: starting datafile copy
input datafile file number=00006 name=/mnt/ramdisk/book/tea01.dbf
output file name=/home/oracle/tea01.dbf tag=TAG20180412T093408
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:03
output file name=/tmp/example01.dbf tag=TAG20180412T093408
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 2018-04-12 09:34:24
--//在备库检查:
# ls -l /tmp/example01.dbf /home/oracle/tea01.dbf
-rw-r----- 1 oracle oinstall 41951232 2018-04-12 09:34:10 /home/oracle/tea01.dbf
-rw-r----- 1 oracle oinstall 363077632 2018-04-12 09:34:14 /tmp/example01.dbf
--//可以发现文件已经拷贝过来.检查:
$ dbv file=/tmp/example01.dbf
DBVERIFY: Release 11.2.0.4.0 - Production on Thu Apr 12 09:35:49 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
DBVERIFY - Verification starting : FILE = /tmp/example01.dbf
DBVERIFY - Verification complete
Total Pages Examined : 44320
Total Pages Processed (Data) : 6603
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 1149
Total Pages Failing (Index): 0
Total Pages Processed (Other): 2844
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 33724
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 392059041 (3.392059041)
--//在备库检查:
RMAN> list copy of database;
specification does not match any datafile copy in the repository
--//在备库控制文件没有记录.
--//补充我想到一个变通的方法:
我想到一种变通的方法,就是通过链接ln
在主库那边建立:
ln -s /oradata/orcl /oradata/orcl2
这样备库db_file_name_convert参数可以写成:
'/oradata/orcl','/data1','/oradata/orcl2','/data2'
这样就不需要一一对应了.以后建立数据文件使用/oradata/orcl,就放在/data1,
而建立数据文件使用/oradata/orcl2,就放在/data2.