ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 备库丢失表空间恢复一例

备库丢失表空间恢复一例

原创 Linux操作系统 作者:nmgzw 时间:2019-05-25 20:39:05 0 删除 编辑
1、备库抱如下错误
Errors in file /u01/app/oracle/diag/rdbms/orcl_p/orcl/trace/orcl_mrp0_2959.trc:
ORA-01111: name for data file 5 is unknown - rename to correct file
ORA-01110: data file 5: '/u01/app/oracle/product/11.0/db_1/dbs/UNNAMED00005'
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01111: name for data file 5 is unknown - rename to correct file
ORA-01110: data file 5: '/u01/app/oracle/product/11.0/db_1/dbs/UNNAMED00005'
2、经查看主库有一个新的表空间增加,但备库没有同步过去
standby_file_management 主备库都已经设置为了AUTO,所以还不清楚具体原因

3、先恢复,orcl_s主库,orcl_p是备库,通过以下方式从主库拷贝到备库
rac3->rman target sys/oracle@orcl_s catalog rmanadmin/rmanadmin@orcl auxiliary sys/oracle@orcl_p

Recovery Manager: Release 11.1.0.6.0 - Production on Fri Jun 17 14:37:00 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: ORCL (DBID=1625453780)
connected to recovery catalog database
connected to auxiliary database: ORCL (DBID=1625453780, not open)

RMAN> BACKUP AS COPY DATAFILE 5 auxiliary format '/u01/app/oracle/oradata/rman/testts.dbf';

Starting backup at 17-JUN-11
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=113 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/ORCL_S/datafile/o1_mf_testts_6zg1xok0_.dbf
output file name=/u01/app/oracle/oradata/rman/testts.dbf tag=TAG20110617T143930 RECID=0 STAMP=0
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 17-JUN-11

RMAN> exit

4、在备库上操作如下:
SQL> alter database rename file '/u01/app/oracle/product/11.0/db_1/dbs/UNNAMED00005' to '/u01/app/oracle/oradata/rman/testts.dbf';
alter database rename file '/u01/app/oracle/product/11.0/db_1/dbs/UNNAMED00005' to '/u01/app/oracle/oradata/rman/testts.dbf'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01275: Operation RENAME is not allowed if standby file management is
automatic.


SQL> show parameter standby

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest                 string      ?/dbs/arch
standby_file_management              string      AUTO
SQL> alter system set standby_file_management=manual;

System altered.

SQL> alter database rename file '/u01/app/oracle/product/11.0/db_1/dbs/UNNAMED00005' to '/u01/app/oracle/oradata/rman/testts.dbf';

Database altered.

SQL> recover standby database;
ORA-00279: change 14419654 generated at 06/14/2011 15:03:20 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/flash_recovery_area/ORCL_P/archivelog/2011_06_14/o1_mf_1_8_6zgtf
bmj_.arc
ORA-00280: change 14419654 for thread 1 is in sequence #8


Specify log: {=suggested | filename | AUTO | CANCEL}
auto

。。。。

恢复结束后正常。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25702/viewspace-700142/,如需转载,请注明出处,否则将追究法律责任。

下一篇: ora-29275错误
请登录后发表评论 登录
全部评论

注册时间:2002-10-18

  • 博文量
    71
  • 访问量
    59354