在一個新環境中恢複Database Backup。在資料檔案還原階段,就出現了錯誤。
環境說明:Oracle 10.2.0.3 for solaris 10,備份資料庫是RAC,恢複則在單一實例上進行。
操作出現過程如下:
第一步,將資料庫恢複到某個時間點,恢複出錯。
RMAN> run
2> {
3> allocate channel ch01 type disk;
4> allocate channel ch02 type disk;
5> set until time "to_date('2012-06-25 23:00:00','yyyy-mm-dd hh24:mi:ss')";
6> set newname for datafile 1 to '/stor2T/app/oracle/oradata/urpdb/system01.dbf';
7> set newname for datafile 2 to '/stor2T/app/oracle/oradata/urpdb/undotbs1.dbf';
8> restore datafile 1;
9> restore datafile 2;
10> switch datafile all;
11> release channel ch01;
12> release channel ch02;
13> }
using target database control file instead of recovery catalog
allocated channel: ch01
channel ch01: sid=155 devtype=DISK
allocated channel: ch02
channel ch02: sid=156 devtype=DISK
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 27-JUN-12
released channel: ch01
released channel: ch02
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/27/2012 16:09:51
ORA-01861: literal does not match format string
我想,這可能是時間格式問題,先迴避它吧。
第二步,換成成UNTIL SCN去還原資料檔案。
RMAN> run
2> {
3> allocate channel ch01 type disk;
4> allocate channel ch02 type disk;
5> set until scn 3054150330;
6> set newname for datafile 1 to '/stor2T/app/oracle/oradata/urpdb/system01.dbf';
7> restore datafile 1;
8> switch datafile all;
9> release channel ch01;
10> release channel ch02;
11> }
allocated channel: ch01
channel ch01: sid=155 devtype=DISK
allocated channel: ch02
channel ch02: sid=156 devtype=DISK
executing command: SET until clause
executing command: SET NEWNAME
Starting restore at 27-JUN-12
released channel: ch01
released channel: ch02
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/27/2012 16:12:38
ORA-01861: literal does not match format string
RMAN>
即使使用SCN也是報錯。
第三步,檢查備份結果集,也報錯。
RMAN> list backupset summary;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of list command at 06/27/2012 16:29:18
ORA-01861: literal does not match format string
這下麻煩了。難道問題是出在環境變數上嗎?
檢查環境變數設定,和資料庫初始化參數設定。
env|grep NLS_DATE_FORAMT
結果顯示的已經是'yyyy-mm-dd hh24:mi:ss'格式了。
再查metalink,發現有bug