测试环境和生产库数据库名称相同,但dbid不同,执行catalog时报错,需修改dbid一致,如下:
[oracle@lkdb u01]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Jul 16 15:35:06 2016Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: LKDB (DBID=1488801557)
RMAN> catalog start with '/u01/orcl_arch_full_gprangja_1_1';
using target database control file instead of recovery catalog
searching for all files that match the pattern /u01/orcl_arch_full_gprangja_1_1
List of Files Unknown to the Database
=====================================
File Name: /u01/orcl_arch_full_gprangja_1_1
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
no files cataloged
List of Files Which Where Not Cataloged
=======================================
File Name: /u01/orcl_arch_full_gprangja_1_1
RMAN-07518: Reason: Foreign database file DBID: 1460399894 Database Name: LKDB
SQL> select dbid from v$database;
DBID
----------
1488801557
SQL> exec dbms_backup_restore.nidbegin('lkdb','LKDB','1460399894','1488801557',0,0,10);
PL/SQL procedure successfully completed.
SQL> variable a number;
SQL> variable b number
SQL> variable c number;
SQL> exec dbms_backup_restore.nidprocessdf(0,0,:a,:b,:c);
PL/SQL procedure successfully completed.
SQL> print a;
A
----------
0