归档模式下redo丢失或损坏(current状态)
2015-12-30 09:54
363 查看
归档模式下current logfile丢失或损坏恢复
+++++Session 1
SQL> set linesize 200 pagesize 2000
SQL> col member format a50
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- -------------- -------------------------------
1 1 4 52428800 512 1 NO CURRENT 1670955 29-DEC-15 2.8147E+14
2 1 2 20971520 512 1 YES INACTIVE 1670943 29-DEC-15 1670949 29-DEC-15
3 1 3 52428800 512 1 YES INACTIVE 1670949 29-DEC-15 1670955 29-DEC-15
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------
1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log NO
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log NO
3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log NO
SQL&get; alter system switch logfile;
System altered.
++++Session 2
[root@zw_test_26_75 ~]# dd if=/dev/null of=/u01/app/oracle/oradata/orcl/redo01.log bs=512 count=10
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000121435 s, 0.0 kB/s
++++Session 1
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 952020992 bytes
Fixed Size 2258960 bytes
Variable Size 314574832 bytes
Database Buffers 629145600 bytes
Redo Buffers 6041600 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/redo01.log'
ORA-27048: skgfifi: file header information is invalid
Additional information: 13
SQL> recover database until cancel;
Media recovery complete.
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00327: log 2 of thread 1, physical size less than needed
ORA-00312: online log 2 thread 1: '/home/ora10g/oradata/roger/redo02.log'
创建pfile添加隐含参数
#*._allow_resetlogs_corruption=true
#*._allow_error_simulation=true
SQL> startup mount pfile='/tmp/pfile.ora';
ORACLE instance started.
Total System Global Area 952020992 bytes
Fixed Size 2258960 bytes
Variable Size 314574832 bytes
Database Buffers 629145600 bytes
Redo Buffers 6041600 bytes
Database mounted.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-16433: The database must be opened in read/write mode.
或者下面那个错
SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-00600: internal error code, arguments: [2130], [0], [8], [2], [], [], [], []
SQL> show parameter resetlog
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
_allow_resetlogs_corruption boolean TRUE
SQL> show parameter allow
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
_allow_error_simulation boolean TRUE
_allow_resetlogs_corruption boolean TRUE
SQL> alter database open;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@zw_test_26_75 tmp]$ vi pfile.ora
去掉隐含参数
#*._allow_resetlogs_corruption=true
#*._allow_error_simulation=true
SQL> startup
ORACLE instance started.
Total System Global Area 952020992 bytes
Fixed Size 2258960 bytes
Variable Size 314574832 bytes
Database Buffers 629145600 bytes
Redo Buffers 6041600 bytes
Database mounted.
Database opened.
归档模式下current logfile丢失或损坏恢复
+++++Session 1
SQL> set linesize 200 pagesize 2000
SQL> col member format a50
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- -------------- -------------------------------
1 1 4 52428800 512 1 NO CURRENT 1670955 29-DEC-15 2.8147E+14
2 1 2 20971520 512 1 YES INACTIVE 1670943 29-DEC-15 1670949 29-DEC-15
3 1 3 52428800 512 1 YES INACTIVE 1670949 29-DEC-15 1670955 29-DEC-15
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------
1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log NO
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log NO
3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log NO
SQL&get; alter system switch logfile;
System altered.
++++Session 2
[root@zw_test_26_75 ~]# dd if=/dev/null of=/u01/app/oracle/oradata/orcl/redo01.log bs=512 count=10
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000121435 s, 0.0 kB/s
++++Session 1
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 952020992 bytes
Fixed Size 2258960 bytes
Variable Size 314574832 bytes
Database Buffers 629145600 bytes
Redo Buffers 6041600 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/redo01.log'
ORA-27048: skgfifi: file header information is invalid
Additional information: 13
SQL> recover database until cancel;
Media recovery complete.
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00327: log 2 of thread 1, physical size less than needed
ORA-00312: online log 2 thread 1: '/home/ora10g/oradata/roger/redo02.log'
创建pfile添加隐含参数
#*._allow_resetlogs_corruption=true
#*._allow_error_simulation=true
SQL> startup mount pfile='/tmp/pfile.ora';
ORACLE instance started.
Total System Global Area 952020992 bytes
Fixed Size 2258960 bytes
Variable Size 314574832 bytes
Database Buffers 629145600 bytes
Redo Buffers 6041600 bytes
Database mounted.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-16433: The database must be opened in read/write mode.
或者下面那个错
SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-00600: internal error code, arguments: [2130], [0], [8], [2], [], [], [], []
SQL> show parameter resetlog
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
_allow_resetlogs_corruption boolean TRUE
SQL> show parameter allow
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
_allow_error_simulation boolean TRUE
_allow_resetlogs_corruption boolean TRUE
SQL> alter database open;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@zw_test_26_75 tmp]$ vi pfile.ora
去掉隐含参数
#*._allow_resetlogs_corruption=true
#*._allow_error_simulation=true
SQL> startup
ORACLE instance started.
Total System Global Area 952020992 bytes
Fixed Size 2258960 bytes
Variable Size 314574832 bytes
Database Buffers 629145600 bytes
Redo Buffers 6041600 bytes
Database mounted.
Database opened.
相关文章推荐
- Android中嵌入极光推送SDK存在冲突问题
- 最短路径算法
- 查看iOS崩溃日志从 Mac OS X上
- sikuli
- Android HttpClient框架get和post方式提交数据(非原创)
- $(obj).data() 绑定和获取数据的应用
- Spark读取数据库(Mysql)的四种方式讲解
- View的绘制流程(三)--------view的layout和draw过程
- PHP 汉字转拼音 utf-8
- 使用php扩展trie_filter,利用词库,过滤敏感词
- codeforces 612C Replace To Make Regular Bracket Sequence
- 如何给20151230版caffe添加新的层 (一)
- 那天,我扒了微信产品经理的博客
- Linux Top 命令解析
- 计算日期方法
- Gallery与ImageSwitch的使用
- Tornado,了解一下
- 强大的 ant scp 和 sshexec
- 实战申请Let's Encrypt永久免费SSL证书过程教程及常见问题
- 试图搞懂MDK程序下载到flash--MDK配置选项Linker、Target、Debug的理解分析