在解决由于一次误操作而引起的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.
以上的相关内容就是对如何解决一次误操作引起的Oracle数据库大恢复的介绍,望你能有所收获。
【编辑推荐】