orapwd file=$ORACLE_HOME/dbs/orapwocp password=oracle force=y ignorecase=y;
--注:普通用户的密码大小写是否区分由初始参数sec_case_sensitive_logon,不归密码文件处理
找alert_sid.log日志
***场景1:在线日志无损的情况下的重建
rm -rf control*
shutdown abort;
startup nomount;
CREATE CONTROLFILE REUSE DATABASE "BXDB" NORESETLOGS...
reocver database;
alter database open;
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/bxdb/temp01.dbf' reuse;
***场景2:在线日志损坏的情况下的重建
shutdown immediate; --注这里要正常关闭数据库,否则会要求system做恢复???
rm -rf control*
rm -rf redo*
startup nomount;
CREATE CONTROLFILE REUSE DATABASE "BXDB" RESETLOGS...
recover database until cancel using BACKUP CONTROLFILE;--RMAN>recover database until sequence 2;
alter database open resetlogs;
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/bxdb/temp01.dbf' reuse;
***场景3:具有只读数据文件情况下的重建
startup nomount;
CREATE CONTROLFILE REUSE DATABASE "BXDB" NORESETLOGS...
recover database; --recover database using backup controlfile;
alter database open; --alter database open resetlogs;
alter database rename file '/u01/app/oracle/product/11g/dbs/MISSING00005' to '/u01/app/oracle/oradata/bxdb/tp2.dbf';
alter tablespace tp12 online; --不能设数据文件在线(alter database datafile 7;)
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/ocp/temp01.dbf' reuse;
***场景4:使用控制文件快照恢复
cp /u01/app/oracle/product/11g/dbs/snapcf_ocp.f /u01/app/oracle/oradata/ocp/control01.ctl
cp /u01/app/oracle/product/11g/dbs/snapcf_ocp.f /u01/app/oracle/oradata/ocp/control02.ctl
cp /u01/app/oracle/product/11g/dbs/snapcf_ocp.f /u01/app/oracle/oradata/ocp/control03.ctl
startup mount;
recover database using backup controlfile; --RMAN>recover database;
alter database open resetlogs;
rm -rf tp5.dbf;
alter database datafile 8 offline;
alter database create datafile '/u01/app/oracle/oradata/ocp/tp12.dbf';
select * from t20; ---报错没找到文件
recover datafile 8;
alter database datafile 8 online;
alter tablesapce temp add tempfile '/u01/app/oracle/oradata/oca/temp02.dbf' size 20M autoextend on;
alter tablesapce temp drop tempfile '/u01/app/oracle/oradata/oca/temp01.dbf';
***场景1:每个日志组有两个在线日志成员,1号组是其中一个redo01B.log损坏了
alter database drop logfile member '/u01/app/oracle/oradata/oca/redo01B.log';
alter database add logfile member '/u01/app/oracle/oradata/oca/redo01B.log' to group 1;
***场景2:每个日志组有两个在线日志成员,1号组的所有日志(redo01A.log和redo01B.log)损坏了
alter database clear logfile group 1;
alter database clear unarchived logfile group 1;
***场景3:所有日志组全部损坏了
rm -rf redo*
shutdown immediate;
startup mount;
recover database until cancel;
alter database open resetlogs;
**********本博客所有内容均为原创,如有转载请注明作者和出处!!!**********
Name: guoyJoe
QQ: 252803295
Email: oracledba_cn@hotmail.com
Blog: http://blog.csdn.net/guoyJoe
ITPUB: http://www.itpub.net/space-uid-28460966.html
OCM: http://education.oracle.com/education/otn/YGuo.HTM
_____________________________________________________________
加群验证问题:哪些SGA结构是必需的,哪些是可选的?否则拒绝申请!!!
答案在:http://blog.csdn.net/guoyjoe/article/details/8624392
Oracle@Paradise 总群:127149411
Oracle@Paradise No.1群:177089463(已满)
Oracle@Paradise No.2群:121341761
Oracle@Paradise No.3群:140856036
转载于:https://blog.51cto.com/guoyjoe/1429067