在解決由於一次誤操作而引起的Oracle數據庫大恢復的過程中, 由於shutdown abort實例有時起不到解決的作用,於是我們就采用殺Oracle進程,來刪除其共享內存段的做法,將掛起Oracle數據庫實力強制abort。
1、殺Oracle核心進程
引用
- [ora10g@test bdump]$ ps -ef|grep ora_
- ora10g 14431 1 0 Feb21 ? 00:01:32 ora_pmon_streams
- ora10g 14433 1 0 Feb21 ? 00:00:46 ora_psp0_streams
- ora10g 14435 1 0 Feb21 ? 00:00:47 ora_mman_streams
- ora10g 14437 1 0 Feb21 ? 00:06:57 ora_dbw0_streams
- ora10g 14439 1 0 Feb21 ? 00:06:24 ora_lgwr_streams
- ora10g 14441 1 0 Feb21 ? 00:46:13 ora_ckpt_streams
- ora10g 14443 1 0 Feb21 ? 00:01:02 ora_smon_streams
- ora10g 14445 1 0 Feb21 ? 00:00:00 ora_reco_streams
- ora10g 14447 1 0 Feb21 ? 00:05:53 ora_cjq0_streams
- ora10g 14449 1 0 Feb21 ? 00:03:15 ora_mmon_streams
- ora10g 14451 1 0 Feb21 ? 00:02:47 ora_mmnl_streams
- ora10g 14453 1 0 Feb21 ? 00:00:01 ora_d000_streams
- ora10g 14455 1 0 Feb21 ? 00:00:03 ora_s000_streams
- ora10g 14460 1 0 Feb21 ? 00:00:05 ora_qmnc_streams
- ora10g 14468 1 0 Feb21 ? 00:00:08 ora_q000_streams
- ora10g 14470 1 0 Feb21 ? 00:00:02 ora_q001_streams
- ora10g 13622 1 0 03:08 ? 00:00:00 ora_j000_streams
- ora10g 13710 12028 0 03:13 pts/5 00:00:00 grep ora_
- [ora10g@test bdump]$ kill -9 14431 14433 14435 14437
14439 14441 14443 14445 14447 14449 14451 14453 14455 14460 14468 14470 13622
2、刪除Oracle 共享內存段
引用
- [ora10g@test bdump]$ ipcs
- ------ Shared Memory Segments --------
- key shmid owner perms bytes nattch status
- 0xcc481b8c 1441796 ora10g 640 599785472 00x40b3b558
2818054 ora10g 640 1077936128 0- ------ Semaphore Arrays --------
- key semid owner perms nsems
- 0x0d908ec4 360448 ora10g 640 154
- ------ Message Queues --------
- key msqid owner perms used-bytes messages
- [root@test ~]# ipcrm -m 1441796
- [root@test ~]# ipcrm -s 360448
在一次誤操作引起的Oracle數據庫大恢復的解決辦法中再次嘗試將實例打開,這裡用到了10015事件。
引用
- SQL> alter session set events '
10015 trace name adjust_scn level 1';- Session altered.
- SQL> alter database open;
- alter database open
- *
- ERROR at line 1:
- ORA-01113: file 1 needs media recovery
- ORA-01110: data file 1:
'/ora10g/app/oradata/ldbra/system01.dbf'- SQL> recover database;
- Media recovery complete.
- SQL> alter database open;
- Database altered.
後續工作就是將tempfile添加到temp表空間中,終於恢復成功。
引用
- SQL> alter tablespace temp add tempfile
'/ora10g/app/oradata/ldbra/temp01.dbf' size 50m reuse;- Tablespace altered.