creation size=0 block size=8192 status=0x1c head=4 tail=4 dup=1
tablespace 6, index=6 krfil=6 prev_file=0
unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
Checkpoint cnt:119 scn: 0x0000.0027a09a 10/21/2006 20:43:07
Stop scn: 0x0000.0027a163 10/21/2006 20:47:12
Creation Checkpointed at scn: 0x0000.0000ecc6 07/24/2006 16:35:54
thread:0 rba:(0x0.0.0)
enabled threads: 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
Offline scn: 0x0000.00000000 prev_range: 0
Online Checkpointed at scn: 0x0000.00000000
www.ixdba.net
thread:0 rba:(0x0.0.0)
enabled threads: 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
Hot Backup end marker scn: 0x0000.00000000
aux_file is NOT DEFINED
关闭数据库。
SQL> shutdown immediate
ORA-01031: insufficient privileges
SQL> conn /as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
由于数据文件被offline了,能正常关闭数据库也是正常的。
接下来,重新启动数据库:
SQL> startup
ORACLE instance started.
Total System Global Area 235999352 bytes
Fixed Size 450680 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL>
正常启动!
查看数据文件信息:
SQL> col name format a40
SQL> select file#,status,name from v$datafile;
FILE# STATUS NAME
---------- ------- ----------------------------------------
1 SYSTEM /opt/oracle/oradata/gaojf/system01.dbf
2 ONLINE /opt/oracle/oradata/gaojf/undotbs01.dbf
3 ONLINE /opt/oracle/oradata/gaojf/users01.dbf
4 ONLINE /opt/oracle/oradata/gaojf/tools01.dbf
5 ONLINE /opt/oracle/oradata/gaojf/indx01.dbf
6 RECOVER /opt/oracle/oradata/gaojf/gaojfdb.dbf
6 rows selected.
这个状态也是正常的,由于文件6被offline,所以需要恢复。
恢复文件6:
SQL> recover datafile 6;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 6: '/opt/oracle/oradata/gaojf/gaojfdb.dbf'
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/opt/oracle/oradata/gaojf/gaojfdb.dbf'
QL> quit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
此时要将原来的文件还原,然后执行恢复。
[oracle@localhost gaojf]$ ls
c-969541821-20060925-01 control.sql hotbackup.sql redo03.log tools01.dbf control01.ctl createcontrol.sql indx01.dbf system01.dbf undotbs01.dbf control02.ctl gaojfdb.dbf.bak redo01.log temp01.dbf users01.dbf control03.ctl gaojfdb.dbf.nn redo02.log test
[oracle@localhost gaojf]$ mv gaojfdb.dbf.nn gaojfdb.dbf
[oracle@localhost gaojf]$ sqlplus "/as sysdba"
SQL*Plus: Release 9.2.0.1.0 - Production on Sat Oct 21 22:03:17 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> recover datafile 6;
Media recovery complete.
SQL> alter database datafile 6 online;
Database altered.
SQL> col name format a40
SQL> select file#,status,name from v$datafile;
FILE# STATUS NAME
---------- ------- ----------------------------------------
1 SYSTEM /opt/oracle/oradata/gaojf/system01.dbf
2 ONLINE /opt/oracle/oradata/gaojf/undotbs01.dbf
3 ONLINE /opt/oracle/oradata/gaojf/users01.dbf
4 ONLINE /opt/oracle/oradata/gaojf/tools01.dbf
5 ONLINE /opt/oracle/oradata/gaojf/indx01.dbf
6 ONLINE /opt/oracle/oradata/gaojf/gaojfdb.dbf
6 rows selected.
SQL>
6号文件恢复正常!
至此,这个过程完全解析!