ORA-01122 ORA-01110 ORA-01207 เมื่อ Control File ของ Oracle เกิดความเสียหาย

RobinVan's picture

เมื่อ Control file เกิดความเสียหาย และถึงคราวที่ DBA ต้องแก้ไข
มาดูคำแนะนำจาก  oracle และตามด้วยการปฎิบัติแก้ไขจริง

 

 

 

 

 


Symptoms
ORA-1122 :database file %s failed verification check
ORA-1110 : datafile :
ORA-1207: ORA 1207 file is more recent than control file
Cause
The information in this file is inconsistent with information from the control file.
The datafile header CHECKPOINT count is beyond the controlfile CHECKPOINT count.
Solution
1.Mount the database
SQL>Startup mount

2. trace the control file

SQL> Alter database backup controlfile to trace;

3. Create a control file creation script from the tracefile generated in user_dump_dest.

Use the Noresetlogs option

4.shutdown the database and start it NOMOUNT mode

SQL>shutdown abort
SQL>startup NoMount

5.Create the control file

Use the script generated by the 'backup controlfile to trace' command above.

Reference: Note 1012929.6 How to Recreate the Controlfile

6.Recover database

SQL>recover database ;

7.Open the database

SQL>Alter database open ;

ข้างบนเป็นคำแนะนำจาก website ของ oracle
และเรามา ปฎิบัติจริงๆ กัน

1) Shutdown Abort (เพราะตอนนี้  oracle ของผมรันอยู่)
2)  เข้า Sqlplus ด้วย sysdba
      sqlplus "/as sysdba"  หรือ  sqlplus / as sysdba (แล้วแต่ชอบ)
3) SQL>Startup mount
4) Alter database backup controlfile to trace;
 ก็จะเกิดไฟล์  .trc  ใน directory udump
 ณ ตอนนี้ .trc ได้เกิดขึ้นแล้ว ที่ directory user_dump_dest.
 ซึ่งเครื่อง server ของผมเก็บที่ directory /oracle/admin/BLD/udump (BLD คือ ชื่อ Database)
5) ตามไป Directory ที่ file  .trc อยู่
    ตามไปหาไฟล์ ล่าสุด
    เมื่อเจอแล้ว ถ้าเรา  vi ดู  มันคือ script ที่ oracle จัดไว้ให้เรานั่นเอง

$ls -ltr

 -rwxrwxrwx   1 oracle   oinstall     798 Mar  5 13:54 bldb_ora_12353.trc
 -rwxrwxrwx   1 oracle   oinstall     632 Mar  5 13:54 bldb_ora_12427.trc
 -rwxrwxrwx   1 oracle   oinstall    7281 Mar  5 13:54 bldb_ora_12458.trc
 -rwxrwxrwx   1 oracle   oinstall     798 Mar  5 14:00 bldb_ora_14500.trc
 -rwxrwxrwx   1 oracle   oinstall     632 Mar  5 14:00 bldb_ora_14527.trc
 -rwxrwxrwx   1 oracle   oinstall   43421 Mar  5 14:18 bldb_ora_14568.trc
 -rwxrwxrwx   1 oracle   oinstall     798 Mar  5 14:21 bldb_ora_21518.trc
 -rwxrwxrwx   1 oracle   oinstall   14104 Mar  5 14:26 bldb_ora_22926.trc
 -rwxrwxrwx   1 oracle   oinstall     798 Mar  5 14:32 bldb_ora_25104.trc
 -rwxrwxrwx   1 oracle   oinstall     632 Mar  5 14:32 bldb_ora_25131.trc
 -rwxrwxrwx   1 oracle   oinstall    8804 Mar  5 14:32 bldb_ora_25132.trc
 -rw-r-----   1 oracle   oinstall    1686 Mar  5 14:46 bldb_ora_29640.trc
 -rw-r-----   1 oracle   oinstall     798 Mar  5 14:46 bldb_ora_29831.trc
 -rw-r-----   1 oracle   oinstall    1685 Mar  5 14:47 bldb_ora_29858.trc
 -rw-r-----   1 oracle   oinstall     798 Mar  5 14:48 bldb_ora_30273.trc
 -rw-r-----   1 oracle   oinstall    6497 Mar  5 14:48 bldb_ora_30301.trc
 -rw-r-----   1 oracle   oinstall     798 Mar  5 14:48 bldb_ora_30505.trc
 -rw-r-----   1 oracle   oinstall     632 Mar  5 14:48 bldb_ora_30532.trc
 -rw-r-----   1 oracle   oinstall    1882 Mar  5 14:48 bldb_ora_30573.trc

6)  เอาไฟล์ล่าสุดที่เราที่ oracle สร้างขึ้นมา คือ bldb_ora_30573.trc

เข้า ด้วย  sqlplus "/as sysdba"  หรือ  sqlplus / as sysdba  แล้วแต่สะดวก
SQL>shutdonw abort
SQL>@bldb_ora_30573.trc 

7)  Startup  Database ขึ้นมาใหม่ และแล้ว  error  ORA-001122 ORA-01110 ORA-01207
      ก็จะหายไปแล้ว  ทีนี้  Backup สักหน่อย ก็ดีนะครับ

 SQL> shutdown abort;
 ORACLE instance shut down.
 SQL> startup
 ORACLE instance started.

 Total System Global Area  285212672 bytes
 Fixed Size                  2176208 bytes
 Variable Size             180210480 bytes
 Database Buffers          100663296 bytes
 Redo Buffers                2162688 bytes
 Database mounted.
 Database opened.

Powered by Devwinner.com 2011 - Design by DevWin Team