开发者社区> snowofsummer> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

RAC 恢复数据库文件大小显示为0

简介:
+关注继续查看
Rac数据库恢复之后,数据库文件名称改变,恢复就的控制文件之后,数据库不能识别之前已经恢复的数据库文件。
RMAN> CATALOG START WITH '+DATA/orcl';
RMAN> SWITCH DATABASE TO COPY;

#####################
#####################


RMAN> restore controlfile from '/soft/cont_bak_0dtb3vab_1_1.bak';

Starting restore at 21-AUG-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=26 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/cntrlorcl1.dbf
Finished restore at 21-AUG-18

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> report schema;  《==========旧的数据文件信息,存储在控制文件。
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    810      SYSTEM               ***     +DATA/jmrac/datafile/system.274.983202761
2    690      SYSAUX               ***     +DATA/jmrac/datafile/sysaux.275.983202761
3    95       UNDOTBS1             ***     +DATA/jmrac/datafile/undotbs1.276.983202761
4    36       USERS                ***     +DATA/jmrac/datafile/users.277.983202761
5    330      EXAMPLE              ***     +DATA/orcl/datafile/example.295.984743873
6    50       UNDOTBS2             ***     +DATA/orcl/datafile/undotbs2.294.984743873

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       +DATA/orcl/tempfile/temp.284.983202853

RMAN> restore database;

Starting restore at 21-AUG-18
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/jmrac/datafile/system.274.983202761
channel ORA_DISK_1: restoring datafile 00002 to +DATA/jmrac/datafile/sysaux.275.983202761
channel ORA_DISK_1: restoring datafile 00003 to +DATA/jmrac/datafile/undotbs1.276.983202761
channel ORA_DISK_1: restoring datafile 00004 to +DATA/jmrac/datafile/users.277.983202761
channel ORA_DISK_1: restoring datafile 00005 to +DATA/orcl/datafile/example.295.984743873
channel ORA_DISK_1: restoring datafile 00006 to +DATA/orcl/datafile/undotbs2.294.984743873
channel ORA_DISK_1: reading from backup piece /soft/back_0btb3v8h_1_1_ORCL.bak
channel ORA_DISK_1: piece handle=/soft/back_0btb3v8h_1_1_ORCL.bak tag=TAG20180821T114625
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 21-AUG-18

RMAN> report schema;  《==========恢复之后数据库文件名称自动改成新的文件信息
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    810      SYSTEM               ***     +DATA/orcl/datafile/system.294.984744009
2    690      SYSAUX               ***     +DATA/orcl/datafile/sysaux.295.984744009
3    95       UNDOTBS1             ***     +DATA/orcl/datafile/undotbs1.276.984744009
4    36       USERS                ***     +DATA/orcl/datafile/users.274.984744009
5    330      EXAMPLE              ***     +DATA/orcl/datafile/example.277.984744009
6    50       UNDOTBS2             ***     +DATA/orcl/datafile/undotbs2.275.984744009

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       +DATA/orcl/tempfile/temp.284.983202853

RMAN> 


========================
如果在次重新恢复控制文件:
RMAN> restore controlfile from '/soft/cont_bak_0dtb3vab_1_1.bak';

Starting restore at 21-AUG-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=26 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/cntrlorcl1.dbf
Finished restore at 21-AUG-18

RMAN> report schema;

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    0        SYSTEM               ***     +DATA/jmrac/datafile/system.274.983202761
2    0        SYSAUX               ***     +DATA/jmrac/datafile/sysaux.275.983202761
3    0        UNDOTBS1             ***     +DATA/jmrac/datafile/undotbs1.276.983202761
4    0        USERS                ***     +DATA/jmrac/datafile/users.277.983202761
5    0        EXAMPLE              ***     +DATA/orcl/datafile/example.285.983202859
6    0        UNDOTBS2             ***     +DATA/orcl/datafile/undotbs2.286.983203157

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       +DATA/orcl/tempfile/temp.284.983202853


RMAN> 

RMAN> CATALOG START WITH '+DATA/orcl';

searching for all files that match the pattern +DATA/orcl

List of Files Unknown to the Database
=====================================
File Name: +data/ORCL/DATAFILE/SYSTEM.294.984744009
File Name: +data/ORCL/DATAFILE/SYSAUX.295.984744009
File Name: +data/ORCL/DATAFILE/EXAMPLE.277.984744009
File Name: +data/ORCL/DATAFILE/UNDOTBS1.276.984744009
File Name: +data/ORCL/DATAFILE/UNDOTBS2.275.984744009
File Name: +data/ORCL/DATAFILE/USERS.274.984744009

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +data/ORCL/DATAFILE/SYSTEM.294.984744009
File Name: +data/ORCL/DATAFILE/SYSAUX.295.984744009
File Name: +data/ORCL/DATAFILE/EXAMPLE.277.984744009
File Name: +data/ORCL/DATAFILE/UNDOTBS1.276.984744009
File Name: +data/ORCL/DATAFILE/UNDOTBS2.275.984744009
File Name: +data/ORCL/DATAFILE/USERS.274.984744009

RMAN> SWITCH DATABASE TO COPY;

datafile 1 switched to datafile copy "+DATA/orcl/datafile/system.294.984744009"
datafile 2 switched to datafile copy "+DATA/orcl/datafile/sysaux.295.984744009"
datafile 3 switched to datafile copy "+DATA/orcl/datafile/undotbs1.276.984744009"
datafile 4 switched to datafile copy "+DATA/orcl/datafile/users.274.984744009"
datafile 5 switched to datafile copy "+DATA/orcl/datafile/example.277.984744009"
datafile 6 switched to datafile copy "+DATA/orcl/datafile/undotbs2.275.984744009"

RMAN> report schema;

RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name ORCL

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    810      SYSTEM               ***     +DATA/orcl/datafile/system.294.984744009
2    690      SYSAUX               ***     +DATA/orcl/datafile/sysaux.295.984744009
3    95       UNDOTBS1             ***     +DATA/orcl/datafile/undotbs1.276.984744009
4    36       USERS                ***     +DATA/orcl/datafile/users.274.984744009
5    330      EXAMPLE              ***     +DATA/orcl/datafile/example.277.984744009
6    50       UNDOTBS2             ***     +DATA/orcl/datafile/undotbs2.275.984744009

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       +DATA/orcl/tempfile/temp.284.983202853

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
RAC 数据库恢复到单实例下并且基于时间点恢复
RAC 下基于时间点的恢复1、源库进行备份 我这里进行了2次备份2、拷贝2次的备份集到目标机器上,在目标机器上建立好SPFILE.3、使用recover controlfile from 进行控制文件恢复,这个没什么好说的确定好控制文件所在备份集进行恢复就可以了。
1213 0
RAC_Oracle集群服务安装RAC(案例)
2015-01-23 Created By BaoXinjian           Thanks and RegardsERP技术讨论群: 288307890 技术交流,技术讨论,欢迎加入 Technology Blog Created By Oracle ERP - 鲍新建
719 0
+关注
179
文章
174
问答
文章排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载