[20180412]手工拷貝檔案到另外主機.txt

lfree發表於2018-04-12

[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.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2152836/,如需轉載,請註明出處,否則將追究法律責任。

相關文章