Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1262084
  • 博文数量: 1211
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 14340
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-09 11:20
文章分类

全部博文(1211)

文章存档

2011年(1)

2008年(1210)

我的朋友

分类: 服务器与存储

2008-06-11 17:05:27

准备工作 (这样,insert into test1 values(13);就是没有提交的数据了,如果完全恢复,应该一直可以看到insert into test1 values(12);) 
SQL> conn lunar/lunar 
SQL> select * from test1; 
SQL> insert into test1 values(12); 
commit;
SQL> insert into test1 values(13); 
 
单开一个session,用来shutdow abort
E:\>sqlplus internal 
SQL> shutdown abort 
ORACLE 例程已经关闭。 
 
拷贝所有的控制文件和数据文件(不包括redo) 
mount数据库,按照提示重建口令文件
SQL> startup mount 
ORACLE instance started. 
ORA-01991: invalid password file 'd:\oracle1\ora81\DATABASE\PWDbackup.ORA' 
 
SQL> host
E:\>cd d:\oracle1\ora81\DATABASE 
D:\oracle1\ora81\database>del PWDbackup.ORA 
D:\oracle1\ora81\database>orapwd file=d:\oracle1\ora81\DATABASE\PWDbackup.ORA pa 
ssword=oracle entries=10
/*    orapwd   Usage: orapwd file= password= entries=
      where
        file - name of password file (mand),
        password - password for SYS and INTERNAL (mand),
        entries - maximum number of distinct DBAs and OPERs (opt),
      There are no spaces around the equal-to (=) character. */
D:\oracle1\ora81\database>exit 
这时,试图完全恢复数据库是不成功的 
SQL> recover database; 
ORA-00283: recovery session canceled due to errors 
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done 
用to trace备份控制文件 
SQL>alter database backup controlfile to trace; 
SQL>shutdown immediate; 
ORA-01109: database not open 
Database dismounted. 
ORACLE instance shut down. 
找到并且编辑控制文件
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "BACKUP" NORESETLOGS ARCHIVELOG 
    MAXLOGFILES 32 
    MAXLOGMEMBERS 2 
    MAXDATAFILES 254 
    MAXINSTANCES 1 
    MAXLOGHISTORY 453 
LOGFILE 
 GROUP 1 'D:\BACKUPDB\REDO01.LOG' SIZE 1M, 
 GROUP 2 'D:\BACKUPDB\REDO02.LOG' SIZE 1M, 
 GROUP 3 'D:\BACKUPDB\REDO03.LOG' SIZE 1M 
DATAFILE 
 'D:\BACKUPDB\SYSTEM01.DBF', 
 'D:\BACKUPDB\RBS01.DBF', 
 'D:\BACKUPDB\USERS01.DBF', 
 'D:\BACKUPDB\TEMP01.DBF', 
 'D:\BACKUPDB\TOOLS01.DBF', 
 'D:\BACKUPDB\INDX01.DBF' 
CHARACTER SET ZHS16GBK; 
RECOVER DATABASE 
ALTER SYSTEM ARCHIVE LOG ALL; 
ALTER DATABASE OPEN; 
重建控制文件 
SQL> startup nomount 
SQL> @D:\BACKUPDB\udump\ORA01532.sql
ORA-01081: cannot start already-running ORACLE - shut it down first 
Control file created. 
ORA-00279: change 424112 generated at 10/20/2002 20:40:52 needed for thread 1 
ORA-00289: suggestion : D:\BACKUPDB\ARCHIVE\BACKUPT001S00001.ARC 
ORA-00280: change 424112 for thread 1 is in sequence #1 
ORA-00308: cannot open archived log 'ALTER' 
ORA-27041: unable to open file 
OSD-04002: 无法打开文件 
O/S-Error: (OS 2) 系统找不到指定的文件。
ALTER DATABASE OPEN 
ERROR at line 1: 
ORA-01113: file 1 needs media recovery 
ORA-01110: data file 1: 'D:\BACKUPDB\SYSTEM01.DBF' 
shutdown immediate,然后重新恢复数据库 
SQL> shutdown immediate; 
ORA-01109: database not open 
 
Database dismounted. 
ORACLE instance shut down. 
SQL> startup mount 
ORACLE instance started. 
 
完全恢复数据库 
SQL> recover database; 
ORA-00279: change 424112 generated at 10/20/2002 20:40:52 needed for thread 1 
ORA-00289: suggestion : D:\BACKUPDB\ARCHIVE\BACKUPT001S00001.ARC 
ORA-00280: change 424112 for thread 1 is in sequence #1 
 
Specify log: {=suggested | filename | AUTO | CANCEL} 
auto 
ORA-00279: change 424125 generated at 10/20/2002 20:44:14 needed for thread 1 
ORA-00289: suggestion : D:\BACKUPDB\ARCHIVE\BACKUPT001S00002.ARC 
ORA-00280: change 424125 for thread 1 is in sequence #2 
ORA-00278: log file 'D:\BACKUPDB\ARCHIVE\BACKUPT001S00001.ARC' no longer needed 
for this recovery 
⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯..
Log applied. 
Media recovery complete. 
打开数据库 
SQL> alter database open; 
SQL> conn lunar/lunar 
SQL> select * from test1; 
 
说明: 
1. 拷贝所有的控制文件和数据文件(不包括redo)   
2. mount数据库,按照提示重建口令文件   
3. 这时,试图完全恢复数据库是不成功的   
4. 用to trace备份控制文件   
5. 找到并且编辑控制文件   
6. 重建控制文件   
7. shutdown immediate,然后重新恢复数据库   
8. 完全恢复数据库   
9. 打开数据库  
阅读(521) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~