關於rman中set newname的探討
run {
set newname for datafile 1 to '/test_ora/new/system01.dbf';
set newname for datafile 2 to '/test_ora/new/rbs01.dbf';
set newname for datafile 3 to '/test_ora/new/users01.dbf';
set newname for datafile 4 to '/test_ora/new/test01.dbf';
set newname for datafile 5 to '/test_ora/new/test201.dbf';
restore database;
}
After you restore a datafile to a newlocation, then you can run SWITCH to rename the file in the control file to theNEWNAME.If you do not runSWITCH, then the restored file functions as a datafilecopy and is recorded as such in the repository.
[oracle@single rman_bk]$ rmantarget /
Recovery Manager: Release9.2.0.4.0 - Production
Copyright (c) 1995, 2002,Oracle Corporation. All rightsreserved.
connected to target database:TEST (DBID=1935070339)
RMAN> run {
2> set newname for datafile 1 to '/test_ora/new/system01.dbf';
3> set newname for datafile 2 to '/test_ora/new/rbs01.dbf';
4> set newname for datafile 3 to '/test_ora/new/users01.dbf';
5> set newname for datafile 4 to '/test_ora/new/test01.dbf';
6> set newname for datafile 5 to '/test_ora/new/test201.dbf';
7> restore database;
8> }
executing command: SETNEWNAME
using target database controlfile instead of recoverycatalog
executing command: SETNEWNAME
executing command: SETNEWNAME
executing command: SETNEWNAME
executing command: SETNEWNAME
Starting restore at27-OCT-07
allocated channel:ORA_DISK_1
channel ORA_DISK_1: sid=15 devtype=DISK
RMAN-00571:===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS===============
RMAN-00571:===========================================================
RMAN-03002: failure of restore command at 10/27/2007 19:06:57
ORA-19625: error identifying file /test_ora/new/system01.dbf
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Recovery Manager: Release 9.2.0.4.0 -Production
Copyright (c) 1995, 2002,Oracle Corporation. All rightsreserved.
connected to target database:TEST (DBID=1935070339)
RMAN> restoredatabase;
Starting restore at27-OCT-07
using target databasecontrolfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
RMAN-00571:===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS===============
RMAN-00571:===========================================================
RMAN-03002: failure of restore command at 10/27/2007 19:15:26
ORA-19563: datafile copy header validationfailed for file /test_ora/new/system01.dbf
從紅色字型部分可以看出,/test_ora/new/system01.dbf被視作一個datafilecopy,rman試圖將該檔案restore到生產庫的資料存放路徑下,但沒有找到該檔案,於是報錯。
從上述分析可以得出:
rman在setnewname之後的restore過程,是將現有的資料檔案做一份副本,相當於做了一次uman的備份,而該副本的資訊是儲存在rman知識庫中,當再一次進行restore時,rman試圖尋找最新的備份(也就是資料檔案副本),而該資料檔案副本已經被刪除,於是報錯。
4.處理方法:
將rman知識庫中的關於資料檔案副本資訊刪除:
(1)檢查資料檔案副本狀態
RMAN> crosscheck copy;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
validation failed for datafile copy
datafile copy filename=/test_ora/new/system01.dbf recid=41stamp=637095874
validation failed for datafile copy
datafile copy filename=/test_ora/new/rbs01.dbf recid=38stamp=637095858
validation failed for datafile copy
datafile copy filename=/test_ora/new/users01.dbf recid=40stamp=637095868
validation failed for datafile copy
datafile copy filename=/test_ora/new/test01.dbf recid=39stamp=637095859
validation failed for datafile copy
datafile copy filename=/test_ora/new/test201.dbf recid=37stamp=637095855
(2)刪除已經expired的資料檔案副本資訊
RMAN> delete nopromptexpired copy;
released channel:ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
specification does not match any archive log in the recoverycatalog
List of Datafile Copies
Key File S Completion Time CkpSCN CkpTime Name
------- ---- - --------------- ---------- -------------------
41 1 X27-OCT-07 460930 27-OCT-07 /test_ora/new/system01.dbf
38 2 X27-OCT-07 460930 27-OCT-07 /test_ora/new/rbs01.dbf
40 3 X27-OCT-07 460930 27-OCT-07 /test_ora/new/users01.dbf
39 4 X27-OCT-07 460930 27-OCT-07 /test_ora/new/test01.dbf
37 5 X27-OCT-07 482616 27-OCT-07 /test_ora/new/test201.dbf
deleted datafile copy
datafile copy filename=/test_ora/new/system01.dbf recid=41stamp=637095874
deleted datafile copy
datafile copy filename=/test_ora/new/rbs01.dbf recid=38stamp=637095858
deleted datafile copy
datafile copy filename=/test_ora/new/users01.dbf recid=40stamp=637095868
deleted datafile copy
datafile copy filename=/test_ora/new/test01.dbf recid=39stamp=637095859
deleted datafile copy
datafile copy filename=/test_ora/new/test201.dbf recid=37stamp=637095855
Deleted 5 EXPIRED objects
(3).此時,再次進行set newname並restore。
RMAN> run {
2> set newname for datafile 1 to '/test_ora/new/system01.dbf';
3> set newname for datafile 2 to '/test_ora/new/rbs01.dbf';
4> set newname for datafile 3 to '/test_ora/new/users01.dbf';
5> set newname for datafile 4 to '/test_ora/new/test01.dbf';
6> set newname for datafile 5 to '/test_ora/new/test201.dbf';
7> restore database;
8> }
executing command: SETNEWNAME
executing command: SETNEWNAME
executing command: SETNEWNAME
executing command: SETNEWNAME
executing command: SETNEWNAME
Starting restore at27-OCT-07
using channel ORA_DISK_1
channel ORA_DISK_1: restoring datafile 00005
input datafilecopy recid=36 stamp=637095244filename=/oracle/rman_bk/df_5.dbf
destination for restore of datafile 00005:/test_ora/new/test201.dbf
channel ORA_DISK_1: copied datafilecopy of datafile 00005
output filename=/test_ora/new/test201.dbf recid=42stamp=637097488
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backupset
restoring datafile 00001 to /test_ora/new/system01.dbf
restoring datafile 00002 to /test_ora/new/rbs01.dbf
restoring datafile 00003 to /test_ora/new/users01.dbf
restoring datafile 00004 to /test_ora/new/test01.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/product/9.2.0.4/dbs/03ivie8c_1_1tag=TAG20071027T172739 params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 27-OCT-07
試驗完畢。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28673746/viewspace-757989/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RMAN SET NEWNAME
- rman set newname switch 用法
- RMAN : set newname for命令的一點研究
- SET NEWNAME FOR
- 關於python中slicing的探討Python
- [20160720]rman set newname for datafile
- oracle rman 異機還原測試--set newnameOracle
- 關於mongo原子操作的探討Go
- 關於identity列的探討IDE
- 關於MSSQL中計算列上建索引的探討SQL索引
- 關於.Net中屬性的使用探討(一) (轉)
- 關於.Net中屬性的使用探討(二) (轉)
- SEO關於探討URL的知識!
- 程寅:關於支付流程的探討
- 【轉】關於oracle中Move機制的一點探討Oracle
- 關於 performSelector 的一些小探討performSelector
- 關於 DDoS 攻擊事件的探討(轉)事件
- 關於 Xmind 用例線上管理的探討
- 關於 Roguelike 的探討,及基於 Roguelike 的新框架框架
- 乾貨| 關於程式碼對齊的探討
- 關於volatile與指令重排序的探討排序
- iOS 中關於列表滾動流暢方案的一些探討iOS
- 關於apache james郵件伺服器的探討Apache伺服器
- 解決set newname 極慢的問題
- 關於 js 物件 轉 字串 和 深拷貝 的 探討JS物件字串
- 關於如何防止重複簽到的技術探討
- 關於多型實現Singleton模式的探討 (轉)多型模式
- 關於 RAC VIP (Oracle10G RAC) 的探討(zt)Oracle
- 我的理解——關於“ERP過時論”的探討(轉)
- oracle10g_rman_syntac testing_set newname_switch tempfile_datafile_all_tagOracle
- rman中關於archivelog的操作Hive
- 關於結構體中指標的一些探討結構體指標
- 關於enq: TX - index contention 等待的探討與測試ENQIndex
- 關於 PHP-fpm master 程式和 worker 職責探討PHPAST
- 關於C語言結構體對齊問題的探討C語言結構體
- 關於IE8下media query相容的解決方案探討
- 專案管理理論中關於軟體專案外包採購管理的探討(轉)專案管理
- RMAN說,我能備份(16)--RMAN中的SET命令