欢迎来到天天文库
浏览记录
ID:1634992
大小:59.50 KB
页数:9页
时间:2017-11-12
《oracle备份恢复实例-cuug沙龙课件》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、完全恢复:前提条件:所需要的归档日志文件和onlineredolog都在方式一、数据库在打开的情况下进行恢复适合的环境:普通数据文件损坏(非system、undo的表空间的数据文件)环境准备:1、以scott用户登入,往test表当中插入数据,并导致日志切换至少3组以上。SQL>selectcount(*)fromtest;COUNT(*)----------1122、最后再进行insert操作,但是没有提交:SQL>selectcount(*)fromtest;COUNT(*)----------1123、主机
2、断电,导致users表空间的某个数据文件损坏。SQL>shutdownabortORACLEinstanceshutdown.rm-rf/u01/app/oracle/oradata/cuug/cuug/users*4、主机加电,尝试打开数据库[oracle@cuug95~]$sqlplus'/assysdba'SQL*Plus:Release10.2.0.1.0-ProductiononSunAug2106:39:552011Copyright(c)1982,2005,Oracle.Allrightsreser
3、ved.Connectedtoanidleinstance.SQL>startupORACLEinstancestarted.TotalSystemGlobalArea167772160bytesFixedSize1218316bytesVariableSize67111156bytesDatabaseBuffers96468992bytesRedoBuffers2973696bytesDatabasemounted.ORA-01157:cannotidentify/lockdatafile4-seeDBWRtr
4、acefileORA-01110:datafile4:'/u01/app/oracle/oradata/cuug/cuug/users01.dbf'数据库打开失败,提示某个数据文件无法识别,查看警告日志文件,获得更加详细的信息。5、从最近的备份中转储(restore)所需的数据文件到目标位置:RMAN>restoretablespaceusers;6、尝试打开数据库SQL>alterdatabaseopen;alterdatabaseopen*ERRORatline1:ORA-01113:file4needsme
5、diarecoveryORA-01110:datafile4:'/u01/app/oracle/oradata/cuug/cuug/users01.dbf'7、oracle判断某个数据文件需要做recovery的依据是检查点号,查看控制文件中各个数据文件所应该有的检查点号:selectname,CHECKPOINT_CHANGE#fromv$datafileNAMECHECKPOINT_CHANGE#---------------------------------------------------------
6、-----------/u01/app/oracle/oradata/cuug/cuug/system01.dbf1285655/u01/app/oracle/oradata/cuug/cuug/undotbs01.dbf1285655/u01/app/oracle/oradata/cuug/cuug/sysaux01.dbf1285655/u01/app/oracle/oradata/cuug/cuug/users01.dbf1285655/u01/app/oracle/oradata/cuug/cuug/ex
7、ample01.dbf1285655/u01/app/oracle/oradata/cuug/cuug/users02.dbf1285655查看数据文件头实际的检查点号:SQL>selectname,CHECKPOINT_CHANGE#fromv$datafile_header;NAMECHECKPOINT_CHANGE#--------------------------------------------------------------------/u01/app/oracle/oradata/cuug/
8、cuug/system01.dbf1285655/u01/app/oracle/oradata/cuug/cuug/undotbs01.dbf1285655/u01/app/oracle/oradata/cuug/cuug/sysaux01.dbf1285655/u01/app/oracle/oradata/cuug/cuug/users01.dbf1284481/u01
此文档下载收益归作者所有