日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle redo 200mb,Oracle的redo log在各场景下的恢复

發(fā)布時(shí)間:2024/9/27 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle redo 200mb,Oracle的redo log在各场景下的恢复 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Oracle的redo log非常重要,redo log損壞將導(dǎo)致數(shù)據(jù)庫開法開啟或數(shù)據(jù)丟失,針對(duì)redo log在各種場景下如何打開或恢復(fù)數(shù)據(jù)庫,特別模擬測試說明:

各場景包括如下(共6個(gè)場景):

場景一.非歸檔下inactive狀態(tài)的redo 恢復(fù)

場景二.非歸檔下active狀態(tài)的redo 恢復(fù)

場景三.非歸檔下current狀態(tài)的redo恢復(fù)

場景四.歸檔模式下inactive狀態(tài)的redo 恢復(fù)

場景五.歸檔模式下的active狀態(tài)的redo 恢復(fù)

場景六.歸檔模式下的current狀態(tài)的redo恢復(fù)

oracle版本為oracle 11.1.0.7

各場景恢復(fù)操作如下:

一.非歸檔下inactive狀態(tài)的redo 恢復(fù)

session 1:

查看歸檔模式:---非歸檔

SQL> archive log list

Database log mode No Archive Mode

Automatic archival Disabled

Archive destination /kttest1-1_data1/emsdev/arch

Oldest online log sequence 3

Current log sequence 8

查看log情況:

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 10 104857600 1 NO INACTIVE 1.2790E+13 30-MAY-14

2 1 13 104857600 1 NO CURRENT 1.2790E+13 30-MAY-14

3 1 12 104857600 1 NO ACTIVE 1.2790E+13 30-MAY-14

SQL> col member for a70

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER

---------- ------- ------- ----------------------------------------------------------------------

IS_

---

3 ONLINE /kttest1-1_data1/emsdev/redo03.dbf

NO

1 ONLINE /kttest1-1_data1/emsdev/redo01.dbf

NO

2 ONLINE /kttest1-1_data1/emsdev/redo02.dbf

NO

SQL> alter system checkpoint;

System altered.

SQL> alter system checkpoint;

System altered.

session 2:

root@kttest1-1 # dd if=/dev/null of=/kttest1-1_data1/emsdev/redo02.dbf bs=512 count=10

0+0 records in

0+0 records out

session 1:

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

FIRST_CHANGE# FIRST_TIM

------------- ---------

1 1 23 104857600 1 NO INACTIVE

1.2792E+13 03-JUN-14

2 1 22 104857600 1 NO INACTIVE

1.2792E+13 02-JUN-14

3 1 24 104857600 1 NO CURRENT

1.2792E+13 03-JUN-14

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

ORA-00320: cannot read file header from log 2 of thread 1

ORA-00312: online log 2 thread 1: '/kttest1-1_data1/emsdev/redo02.dbf'

SQL> alter database clear logfile group 2;

Database altered.

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-00320: cannot read file header from log 2 of thread 1

ORA-00312: online log 2 thread 1: '/kttest1-1_data1/emsdev/redo02.dbf'

SQL> alter database drop logfile group 2;

Database altered.

SQL> alter database open;

Database altered.

SQL> alter database add logfile group 2 ('/kttest1-1_data1/emsdev/redo02.dbf') size 100m;

alter database add logfile group 2 ('/kttest1-1_data1/emsdev/redo02.dbf') size 300m

*

ERROR at line 1:

ORA-00301: error in adding log file '/kttest1-1_data1/emsdev/redo02.dbf' - file

cannot be created

ORA-27038: created file already exists

Additional information: 1

SQL> alter database add logfile group 2 ('/kttest1-1_data1/emsdev/redo02.dbf') size 100m reuse;

Database altered.

二.非歸檔下active狀態(tài)的redo 恢復(fù)

如果非current redo 損壞,但是包含active事務(wù),那么情況完全不同。

----Session 1

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

FIRST_CHANGE# FIRST_TIM

------------- ---------

1 1 26 104857600 1 NO CURRENT

1.2792E+13 04-JUN-14

2 1 25 314572800 1 NO ACTIVE

1.2792E+13 04-JUN-14

3 1 24 104857600 1 NO INACTIVE

1.2792E+13 03-JUN-14

SQL> col member for a70

SQL> select * from v$logfile;

GROUP# STATUS TYPE

---------- ------- -------

MEMBER IS_

---------------------------------------------------------------------- ---

3 ONLINE

/kttest1-1_data1/emsdev/redo03.dbf NO

1 ONLINE

/kttest1-1_data1/emsdev/redo01.dbf NO

2 ONLINE

/kttest1-1_data1/emsdev/redo02.dbf NO

session 2:

root@kttest1-1 # dd if=/dev/null of=/kttest1-1_data1/emsdev/redo02.dbf bs=512 count=10

0+0 records in

0+0 records out

---Session 1

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

FIRST_CHANGE# FIRST_TIM

------------- ---------

1 1 26 104857600 1 NO CURRENT

1.2792E+13 04-JUN-14

2 1 25 314572800 1 NO ACTIVE

1.2792E+13 04-JUN-14

3 1 24 104857600 1 NO INACTIVE

1.2792E+13 03-JUN-14

SQL>SQL> shutdown abort

ORACLE instance shut down.

SQL> select * from v$log;

select * from v$log

*

ERROR at line 1:

ORA-01034: ORACLE not available

Process ID: 3544

Session ID: 83 Serial number: 3

SQL> conn /as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

ORA-00320: cannot read file header from log 2 of thread 1

ORA-00312: online log 2 thread 1: '/kttest1-1_data1/emsdev/redo02.dbf'

ORA-27069: attempt to do I/O beyond the range of the file

Additional information: 1

Additional information: 1

SQL> alter database clear logfile group 2;

alter database clear logfile group 2

*

ERROR at line 1:

ORA-01624: log 2 needed for crash recovery of instance emsdev1 (thread 1)

ORA-00312: online log 2 thread 1: '/kttest1-1_data1/emsdev/redo02.dbf'

SQL> alter database drop logfile group 2;

alter database drop logfile group 2

*

ERROR at line 1:

ORA-01624: log 2 needed for crash recovery of instance emsdev1 (thread 1)

ORA-00312: online log 2 thread 1: '/kttest1-1_data1/emsdev/redo02.dbf'

SQL> recover database until cancel;

ORA-00279: change 12792226234738 generated at 06/04/2014 09:35:35 needed for

thread 1

ORA-00289: suggestion : /kttest1-1_data1/emsdev/arch/1_32_848646308.arch

ORA-00280: change 12792226234738 for thread 1 is in sequence #32

Specify log: {=suggested | filename | AUTO | CANCEL}

auto

ORA-00308: cannot open archived log

'/kttest1-1_data1/emsdev/arch/1_32_848646308.arch'

ORA-27037: unable to obtain file status

SVR4 Error: 2: No such file or directory

Additional information: 3

ORA-00308: cannot open archived log

'/kttest1-1_data1/emsdev/arch/1_32_848646308.arch'

ORA-27037: unable to obtain file status

SVR4 Error: 2: No such file or directory

Additional information: 3

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/kttest1-1_data1/emsdev/system01.dbf'

32沒有歸檔,不能這樣恢復(fù)

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

FIRST_CHANGE# FIRST_TIM

------------- ---------

1 1 32 104857600 1 NO ACTIVE

1.2792E+13 04-JUN-14

3 1 34 104857600 1 NO CURRENT

1.2792E+13 04-JUN-14

2 1 33 104857600 1 NO ACTIVE

1.2792E+13 04-JUN-14

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/kttest1-1_data1/emsdev/system01.dbf'

SQL> show parameter pfile

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile string

SQL> shutdown immediate

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

SQL>

在pfile文件中加入兩個(gè)參數(shù):

*._allow_resetlogs_corruption=true

*._allow_error_simulation=true ----從oracle 10g開始,引入的另外一個(gè)參數(shù)。

SQL> conn /as sysdba

Connected to an idle instance.

SQL> startup mount

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

SQL> alter database open resetlogs;

Database altered.

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

三.非歸檔下current狀態(tài)的redo恢復(fù)

session 1:

SQL> create table test as select * from dba_extents;

Table created.

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

FIRST_CHANGE# FIRST_TIM

------------- ---------

1 1 1 104857600 1 NO CURRENT

1.2792E+13 04-JUN-14

2 1 0 104857600 1 YES UNUSED

0

3 1 0 104857600 1 YES UNUSED

session 2 :

root@kttest1-1 # dd if=/dev/null of=/kttest1-1_data1/emsdev/redo01.dbf bs=512 count=10

0+0 records in

0+0 records out

session 1:

SQL> delete from test where rownum <100000;

45074 rows deleted.

SQL> commit;

Commit complete.

SQL> shutdown immediate

ORA-03113: end-of-file on communication channel

Process ID: 14382

Session ID: 83 Serial number: 3

SQL> startup

ORA-24324: service handle not initialized

ORA-01041: internal error. hostdef extension doesn't exist

SQL> conn /as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

ORA-00316: log 1 of thread 1, type 0 in header is not log file

ORA-00312: online log 1 thread 1: '/kttest1-1_data1/emsdev/redo01.dbf'

SQL> recover database until cancel;

ORA-00279: change 12792226263763 generated at 06/04/2014 10:45:34 needed for

thread 1

ORA-00289: suggestion : /kttest1-1_data1/emsdev/arch/1_1_849350732.arch

ORA-00280: change 12792226263763 for thread 1 is in sequence #1

Specify log: {=suggested | filename | AUTO | CANCEL}

auto

ORA-00308: cannot open archived log

'/kttest1-1_data1/emsdev/arch/1_1_849350732.arch'

ORA-27037: unable to obtain file status

SVR4 Error: 2: No such file or directory

Additional information: 3

ORA-00308: cannot open archived log

'/kttest1-1_data1/emsdev/arch/1_1_849350732.arch'

ORA-27037: unable to obtain file status

SVR4 Error: 2: No such file or directory

Additional information: 3

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/kttest1-1_data1/emsdev/system01.dbf'

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/kttest1-1_data1/emsdev/system01.dbf'

在pfile文件中加入兩個(gè)參數(shù):

*._allow_resetlogs_corruption=true

*._allow_error_simulation=true

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.

如果無法直接open resetlogs打開的話,要檢查一下alert.log報(bào)錯(cuò):

Thu Jul 18 16:38:42 2013

SMON: enabling cache recovery

Thu Jul 18 16:38:43 2013

Errors in file /oracle/admin/orcl/udump/orcl_ora_11149.trc:

ORA-00600: internal error code, arguments: [2662], [0], [4099916], [0], [4100136], [4194313], [], []

Thu Jul 18 16:38:43 2013

Error 600 happened during db open, shutting down database

USER: terminating instance due to error 600

Instance terminated by USER, pid = 11149

ORA-1092 signalled during: alter database open resetlogs...

如出現(xiàn)ora-00600 [2662]報(bào)錯(cuò),需要推進(jìn)scn。推進(jìn)方法如下:

ORA-600 [2662] [a] [b] [c] [d] [e]

Arg [a] Current SCN WRAP

Arg [b] Current SCN BASE

Arg [c] dependent SCN WRAP

Arg [d] dependent SCN BASE

Arg [e] Where present this is the DBA where the dependent SCN came from.

算法計(jì)算規(guī)則如下:Arg [c]*4得出一個(gè)數(shù)值,假設(shè)為V_Wrap,

如果Arg [d]=0,則V_Wrap值為需要的level

Arg [d] < 1073741824,V_Wrap+1為需要的level

Arg [d] < 2147483648,V_Wrap+2為需要的level

Arg [d] < 3221225472,V_Wrap+3為需要的level

數(shù)據(jù)庫處于mount狀態(tài)下,執(zhí)行:alter session set events '10015 trace name adjust_scn level 1';

再alter database open;

可以檢查v$datafile與v$datafile_header的substr(checkpoint_change#,1,14)大小相同

四.歸檔模式下的red log恢復(fù)

1)inactive logfile損壞的情況

session 1:

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

FIRST_CHANGE# FIRST_TIM

------------- ---------

1 1 4 104857600 1 NO CURRENT

1.2792E+13 04-JUN-14

2 1 2 104857600 1 YES INACTIVE

1.2792E+13 04-JUN-14

3 1 3 104857600 1 YES INACTIVE

1.2792E+13 04-JUN-14

SQL> col member for a70

SQL> select * from v$logfile;

GROUP# STATUS TYPE

---------- ------- -------

MEMBER IS_

---------------------------------------------------------------------- ---

3 ONLINE

/kttest1-1_data1/emsdev/redo03.dbf NO

1 ONLINE

/kttest1-1_data1/emsdev/redo01.dbf NO

2 ONLINE

/kttest1-1_data1/emsdev/redo02.dbf NO

session 2:

root@kttest1-1 # dd if=/dev/null of=/kttest1-1_data1/emsdev/redo03.dbf bs=512 count=10

0+0 records in

0+0 records out

在這一步,如果不將數(shù)據(jù)庫進(jìn)行shutdown,繼續(xù)進(jìn)行l(wèi)ogfile的切換,那么redo03仍然是可以寫的,然而存在潛在風(fēng)險(xiǎn)。

session 1:

SQL> shutdown abort

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

ORA-00320: cannot read file header from log 3 of thread 1

ORA-00312: online log 3 thread 1: '/kttest1-1_data1/emsdev/redo03.dbf'

SQL> alter database clear logfile group 3;

Database altered.

SQL> alter database drop logfile group 3;

Database altered.

SQL> alter database add logfile group 3 ('/kttest1-1_data1/emsdev/redo03.dbf') size 100m reuse;

Database altered.

SQL> alter database open; ++++ 這里地方由于原來舊有的redo03被進(jìn)程持有,可能句柄未釋放,所以仍然報(bào)錯(cuò),重啟實(shí)例即可.

alter database open

*

ERROR at line 1:

ORA-00320: cannot read file header from log 3 of thread 1

ORA-00312: online log 3 thread 1: '/kttest1-1_data1/emsdev/redo03.dbf'

SQL> startup

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

Database opened.

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS

---------- ---------- ---------- ---------- ---------- --- ----------------

FIRST_CHANGE# FIRST_TIM

------------- ---------

1 1 4 104857600 1 YES INACTIVE

1.2792E+13 04-JUN-14

2 1 2 104857600 1 YES INACTIVE

1.2792E+13 04-JUN-14

3 1 5 104857600 1 NO CURRENT

1.2792E+13 04-JUN-14

SQL> alter system switch logfile;

System altered.

2. 歸檔模式下current logfile損壞

場景一:

session 1:

SQL> set line 200

SQL> col member for a30

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 4 104857600 1 YES INACTIVE 1.2792E+13 04-JUN-14

2 1 6 104857600 1 NO CURRENT 1.2792E+13 04-JUN-14

3 1 5 104857600 1 YES INACTIVE 1.2792E+13 04-JUN-14

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_

---------- ------- ------- ------------------------------ ---

3 ONLINE /kttest1-1_data1/emsdev/redo03 NO

.dbf

1 ONLINE /kttest1-1_data1/emsdev/redo01 NO

.dbf

2 ONLINE /kttest1-1_data1/emsdev/redo02 NO

.dbf

session 2:

root@kttest1-1 # dd if=/dev/null of=/kttest1-1_data1/emsdev/redo02.dbf bs=512 count=10

0+0 records in

0+0 records out

session 1:

SQL> shutdown immediate

ORA-03113: end-of-file on communication channel

Process ID: 15430

Session ID: 74 Serial number: 1

SQL> conn /as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

ORA-00316: log 2 of thread 1, type 0 in header is not log file

ORA-00312: online log 2 thread 1: '/kttest1-1_data1/emsdev/redo02.dbf'

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 4 104857600 1 YES INACTIVE 1.2792E+13 04-JUN-14

3 1 5 104857600 1 YES INACTIVE 1.2792E+13 04-JUN-14

2 1 6 104857600 1 NO CURRENT 1.2792E+13 04-JUN-14

SQL> conn /as sysdba

Connected.

SQL> shutdown immediate

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

在pfile文件中加入兩個(gè)參數(shù):

*._allow_resetlogs_corruption=true

*._allow_error_simulation=true

SQL> startup

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> recover database until cancel;

ORA-00279: change 12792226298118 generated at 06/04/2014 14:21:06 needed for

thread 1

ORA-00289: suggestion : /kttest1-1_data1/emsdev/arch/1_6_849351843.arch

ORA-00280: change 12792226298118 for thread 1 is in sequence #6

Specify log: {=suggested | filename | AUTO | CANCEL}

auto

ORA-00308: cannot open archived log

'/kttest1-1_data1/emsdev/arch/1_6_849351843.arch'

ORA-27037: unable to obtain file status

SVR4 Error: 2: No such file or directory

Additional information: 3

ORA-00308: cannot open archived log

'/kttest1-1_data1/emsdev/arch/1_6_849351843.arch'

ORA-27037: unable to obtain file status

SVR4 Error: 2: No such file or directory

Additional information: 3

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01194: file 1 needs more recovery to be consistent

ORA-01110: data file 1: '/kttest1-1_data1/emsdev/system01.dbf'

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01092: ORACLE instance terminated. Disconnection forced

Process ID: 16850

Session ID: 166 Serial number: 3

檢查alert.log發(fā)現(xiàn)如下報(bào)錯(cuò):

Errors in file /oracle/emsdev/diag/rdbms/emsdev1/emsdev1/trace/emsdev1_ora_16850.trc (incident=107308):

ORA-00600: internal error code, arguments: [2662], [2978], [1813690638], [2978], [1813691502], [4194432], [], [], [], [], [], []

Incident details in: /oracle/emsdev/diag/rdbms/emsdev1/emsdev1/incident/incdir_107308/emsdev1_ora_16850_i107308.trc

Wed Jun 04 14:38:11 2014

Errors in file /oracle/emsdev/diag/rdbms/emsdev1/emsdev1/trace/emsdev1_ora_16850.trc:

ORA-00600: internal error code, arguments: [2662], [2978], [1813690638], [2978], [1813691502], [4194432], [], [], [], [], [], []

Error 600 happened during db open, shutting down database

USER (ospid: 16850): terminating the instance due to error 600

Instance terminated by USER, pid = 16850

ORA-1092 signalled during: alter database open resetlogs...

ORA-1092 : opiodr aborting process unknown ospid (16850_1)

Wed Jun 04 14:38:15 2014

ORA-1092 : opitsk aborting process

/* 如出現(xiàn)ora-00600 [2662]報(bào)錯(cuò),需要推進(jìn)scn。推進(jìn)方法如下:

ORA-600 [2662] [a] [b] [c] [d] [e]

Arg [a] Current SCN WRAP

Arg [b] Current SCN BASE

Arg [c] dependent SCN WRAP

Arg [d] dependent SCN BASE

Arg [e] Where present this is the DBA where the dependent SCN came from.

算法計(jì)算規(guī)則如下:Arg [c]*4得出一個(gè)數(shù)值,假設(shè)為V_Wrap,

如果Arg [d]=0,則V_Wrap值為需要的level

Arg [d] < 1073741824,V_Wrap+1為需要的level

Arg [d] < 2147483648,V_Wrap+2為需要的level

Arg [d] < 3221225472,V_Wrap+3為需要的level

數(shù)據(jù)庫處于mount狀態(tài)下,執(zhí)行:alter session set events '10015 trace name adjust_scn level 1';

再alter database open;

可以檢查v$datafile與v$datafile_header的substr(checkpoint_change#,1,14)大小相同 */

按以上方法計(jì)算出需要推進(jìn)的scn大小為11914

session 1:

SQL> conn /as sysdba

Connected to an idle instance.

SQL> startup mount

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

SQL> alter session set events '10015 trace name adjust_scn level 11914';

Session altered.

SQL> select substr(checkpoint_change#,1,14) as df_scn from v$datafile;

DF_SCN

--------------------------------------------------------

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

DF_SCN

--------------------------------------------------------

12792226298122

12792226298122

13 rows selected.

SQL> select substr(checkpoint_change#,1,14) as dfh_scn from v$datafile;

DFH_SCN

--------------------------------------------------------

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

12792226298122

DFH_SCN

--------------------------------------------------------

12792226298122

12792226298122

13 rows selected.

SQL> alter database open;

Database altered.

場景二:

+++++Session 1

SQL> conn /as sysdba

Connected.

SQL> set lines 200

SQL> col member for a60

SQL> select * from v$Log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 7 10485760 1 NO CURRENT 1073767933 22-JUL-13

2 1 5 10485760 1 YES INACTIVE 1073742213 21-JUL-13

3 1 6 52428800 1 YES INACTIVE 1073742215 21-JUL-13

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_

---------- ------- ------- ------------------------------------------------------------ ---

2 ONLINE /home/ora10g/oradata/roger/redo02.log NO

3 ONLINE /home/ora10g/oradata/roger/redo03.log NO

1 ONLINE /home/ora10g/oradata/roger/redo01.log NO

SQL>

SQL> alter system switch logfile;

System altered.

++++Session 2

[ora10g@killdb ~]$ dd if=/dev/null of=/home/ora10g/oradata/roger/redo02.log bs=512 count=10

0+0 records in

0+0 records out

++++Session 1

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area 167772160 bytes

Fixed Size 1272600 bytes

Variable Size 96470248 bytes

Database Buffers 67108864 bytes

Redo Buffers 2920448 bytes

Database mounted.

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'

SQL> select * from v$Log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 7 10485760 1 YES INACTIVE 1073767933 22-JUL-13

3 1 6 52428800 1 YES INACTIVE 1073742215 21-JUL-13

2 1 8 10485760 1 NO CURRENT 1073770766 22-JUL-13

SQL> recover database until cancel;

Media recovery complete.

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文件中加入兩個(gè)參數(shù):

*._allow_resetlogs_corruption=true

*._allow_error_simulation=true

SQL> startup mount pfile='/tmp/pfile.ora';

ORACLE instance started.

Total System Global Area 167772160 bytes

Fixed Size 1272600 bytes

Variable Size 96470248 bytes

Database Buffers 67108864 bytes

Redo Buffers 2920448 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-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>

SQL> alter system switch logfile;

System altered.

3. 歸檔模式下active logfile損壞

場景一:

session 1:

SQL> set line 300

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 1 104857600 1 YES INACTIVE 1.2793E+13 04-JUN-14

2 1 2 104857600 1 NO CURRENT 1.2793E+13 04-JUN-14

3 1 0 104857600 1 YES UNUSED 0

SQL> alter system switch logfile;

System altered.

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------

1 1 1 104857600 1 YES INACTIVE 1.2793E+13 04-JUN-14

2 1 2 104857600 1 YES ACTIVE 1.2793E+13 04-JUN-14

3 1 3 104857600 1 NO CURRENT 1.2794E+13 04-JUN-14

session 2:

root@kttest1-1 # dd if=/dev/null of=/kttest1-1_data1/emsdev/redo02.dbf bs=512 count=10

0+0 records in

0+0 records out

session 1:

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area 3207790592 bytes

Fixed Size 2119072 bytes

Variable Size 381586016 bytes

Database Buffers 2818572288 bytes

Redo Buffers 5513216 bytes

Database mounted.

ORA-00320: cannot read file header from log 2 of thread 1

ORA-00312: online log 2 thread 1: '/kttest1-1_data1/emsdev/redo02.dbf'

SQL> alter database clear logfile group 2;

Database altered.

SQL> alter database drop logfile group 2;

Database altered.

SQL> alter database open;

Database altered.

SQL> alter database add logfile group 2 ('/kttest1-1_data1/emsdev/redo02.dbf') size 100m reuse;

Database altered.

場景二:

恢復(fù)方法與非歸檔模式下的active redo log恢復(fù)相同

總結(jié)

以上是生活随笔為你收集整理的oracle redo 200mb,Oracle的redo log在各场景下的恢复的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 黑人一级 | 天堂久久久久久 | 真实的国产乱xxxx在线 | 欧美午夜精品久久久久久蜜 | 粉嫩av一区二区白浆 | 国产一区网站 | 国产免费叼嘿网站免费 | 亚洲一区二区三区四 | 护士的小嫩嫩好紧好爽 | www三级 | 青青草97国产精品麻豆 | 久久www视频 | 亚洲播放器| 天天爱天天做 | av国语| 国产一区视频在线观看免费 | 久久国产电影 | 亚洲国产欧美在线 | 又黄又爽视频在线观看 | 国产精品天美传媒 | 日韩一区av在线 | 91色片 | 亚洲一区二区观看 | 婷婷一级片| 国产精品传媒一区二区 | 日韩少妇诱惑 | 99热超碰 | 顶级嫩模啪啪呻吟不断好爽 | 成人午夜免费福利 | 欧美极品jizzhd欧美仙踪林 | 欧美一区二区在线播放 | 久久久男人的天堂 | 91一区二区| 国产午夜免费 | 日韩精品一区二区免费视频 | 国产精品传媒一区二区 | 青青青国产视频 | 两个女人互添下身爱爱 | 天天做天天爽 | 亚洲一区二区在线观看视频 | 国产欧美日韩亚洲 | 久久99精品国产麻豆婷婷 | 亚洲国产成 | 二区三区偷拍浴室洗澡视频 | 国产麻豆免费视频 | 91沈先生在线 | 人妻少妇精品一区二区三区 | 日韩无码电影 | 久久精品www人人爽人人 | 91亚洲精品一区二区乱码 | 污污污污污污www网站免费 | 国产精品视频大全 | 亚洲成人免费视频 | 久草免费在线视频观看 | 啪啪av网站 | 男女草比视频 | 欧美少妇性生活 | 色婷婷免费 | 里番acg★同人里番本子大全 | 精品少妇人妻av免费久久久 | 色a在线 | 毛片毛片毛片毛片毛片毛片毛片毛片毛片毛片 | 中国亚洲老头同性gay男男… | 亚洲电影一区二区三区 | 日本老小玩hd老少配 | 成人漫画网站 | 在线免费观看污网站 | 男生裸体视频 | 成人小视频免费在线观看 | 国产老头户外野战xxxxx | 伊人精品一区二区三区 | 看久久| 亚洲无套 | 日本xx视频免费观看 | 久久久久久国产精品三区 | va在线播放 | 国产在线青青草 | 日本免费网 | 一级在线播放 | 美女久久精品 | 美女屁股无遮挡 | 911福利视频 | 国产午夜精品久久久久久久久久 | 伊人狠狠操 | 成人性生交大片免费看r链接 | 国内久久久久 | xxx久久| 激情五月视频 | 艳妇乳肉豪妇荡乳av无码福利 | 亚洲AV无码精品黑人黑人 | 欧美一区二区三区在线观看 | 北京富婆泄欲对白 | 搡国产老太xxx网站 高h喷汁呻吟3p | 麻豆天天躁天天揉揉av | 久久天堂av综合合色蜜桃网 | 欧美资源 | 国产一区二区视频免费在线观看 | 男人天堂手机在线观看 | 中文字幕十一区 |