控制文件和數據文件完好,日誌文件全部丟失,正常關機,不需備份,數據不丟
-----------------控制文件和數據文件完好,日誌文件全部丟失,正常關機,不需備份,數據不丟-------------------
-----------------------------------------模擬日誌文件全部丟失------------------------------------
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@station ~]$ reset
[oracle@station ~]$ sqlplus /nolog
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@station ~]$ reset
[oracle@station ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 8 12:52:53 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> create table hr.strom (a number) tablespace users;
Connected.
SQL> create table hr.strom (a number) tablespace users;
Table created.
SQL> alter system switch logfile;
System altered.
SQL> insert into hr.strom values(1);
1 row created.
SQL> alter system switch logfile;
System altered.
SQL> commit;
Commit complete.
SQL> alter system switch logfile;
System altered.
SQL> insert into hr.strom values(2);
1 row created.
SQL> alter system switch logfile;
System altered.
SQL> commit;
Commit complete.
SQL> insert into hr.strom values(3);
1 row created.
SQL> commit;
Commit complete.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !
[oracle@station ~]$ cd /u01/app/oracle/oradata/ORCL/onlinelog/
[oracle@station onlinelog]$ rm -rf *
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !
[oracle@station ~]$ cd /u01/app/oracle/oradata/ORCL/onlinelog/
[oracle@station onlinelog]$ rm -rf *
[oracle@station onlinelog]$ cd /u01/app/oracle/flash_recovery_area/ORCL/onlinelog/
[oracle@station onlinelog]$ ls
o1_mf_1_7wntkonc_.log o1_mf_2_7wntkqob_.log o1_mf_3_7wntksjg_.log
[oracle@station onlinelog]$ rm -rf *
[oracle@station onlinelog]$ ls
o1_mf_1_7wntkonc_.log o1_mf_2_7wntkqob_.log o1_mf_3_7wntksjg_.log
[oracle@station onlinelog]$ rm -rf *
-----------------------------------------模擬日誌文件全部丟失------------------------------------
SQL> startup
ORACLE instance started.
ORACLE instance started.
Total System Global Area 281018368 bytes
Fixed Size 2020192 bytes
Variable Size 134220960 bytes
Database Buffers 142606336 bytes
Redo Buffers 2170880 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1:
'/u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_7wntknox_.log'
ORA-00312: online log 1 thread 1:
'/u01/app/oracle/flash_recovery_area/ORCL/onlinelog/o1_mf_1_7wntkonc_.log'
-----------------------------------------查看日誌文件存在------------------------------------
SQL> ! ls /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_7wntknox_.log
ls: /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_7wntknox_.log: No such file or directory
Fixed Size 2020192 bytes
Variable Size 134220960 bytes
Database Buffers 142606336 bytes
Redo Buffers 2170880 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1:
'/u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_7wntknox_.log'
ORA-00312: online log 1 thread 1:
'/u01/app/oracle/flash_recovery_area/ORCL/onlinelog/o1_mf_1_7wntkonc_.log'
-----------------------------------------查看日誌文件存在------------------------------------
SQL> ! ls /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_7wntknox_.log
ls: /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_7wntknox_.log: No such file or directory
SQL> ! ls /u01/app/oracle/flash_recovery_area/ORCL/onlinelog/o1_mf_1_7wntkonc_.log
ls: /u01/app/oracle/flash_recovery_area/ORCL/onlinelog/o1_mf_1_7wntkonc_.log: No such file or directory
ls: /u01/app/oracle/flash_recovery_area/ORCL/onlinelog/o1_mf_1_7wntkonc_.log: No such file or directory
-----------------------------------------查看日誌文件存在------------------------------------
-----------------------------------------查看日誌文件狀態------------------------------------
SQL> select group#,members,status from v$log;
SQL> select group#,members,status from v$log;
GROUP# MEMBERS STATUS
---------- ---------- ----------------
1 2 CURRENT
3 2 INACTIVE
2 2 INACTIVE
-----------------------------------------查看日誌文件狀態------------------------------------
---------- ---------- ----------------
1 2 CURRENT
3 2 INACTIVE
2 2 INACTIVE
-----------------------------------------查看日誌文件狀態------------------------------------
SQL> recover database until cancel; ---進行這個操作完成,等於重新刷新日誌(賬本),屬於不完全恢復,但是卻達到了完全恢復的效果,而且數據並沒有丟!
Media recovery complete.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
Media recovery complete.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> ! ls -l /u01/app/oracle/oradata/ORCL/onlinelog
total 153780
-rw-r----- 1 oracle oinstall 52429312 Jun 8 13:15 o1_mf_1_7x4drff8_.log
-rw-r----- 1 oracle oinstall 52429312 Jun 8 13:15 o1_mf_2_7x4drlf5_.log
-rw-r----- 1 oracle oinstall 52429312 Jun 8 13:15 o1_mf_3_7x4drro7_.log
total 153780
-rw-r----- 1 oracle oinstall 52429312 Jun 8 13:15 o1_mf_1_7x4drff8_.log
-rw-r----- 1 oracle oinstall 52429312 Jun 8 13:15 o1_mf_2_7x4drlf5_.log
-rw-r----- 1 oracle oinstall 52429312 Jun 8 13:15 o1_mf_3_7x4drro7_.log
SQL> select * from hr.strom;
A
----------
1
2
3
-----------------控制文件和數據文件完好,日誌文件全部丟失,正常關機,不需備份,數據不丟-------------------
----------
1
2
3
-----------------控制文件和數據文件完好,日誌文件全部丟失,正常關機,不需備份,數據不丟-------------------