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

  1. 云栖社区>
  2. 博客>
  3. 正文

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

snowofsummer 2018-08-21 12:25:36 浏览1162
展开阅读全文
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

网友评论

登录后评论
0/500
评论
snowofsummer
+ 关注