现象
[root@skate01 ~]# su - oracle
[oracle@skate01 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Tue Feb 21 00:26:35 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01075: you are currently logged on
[oracle@skate01 ~]$
为了快速登录oracle,好迅速启动oracle,这里提供一种超暴力的方法
1.使用Linux的kill命令杀死所有与oracle有关的进程
$ ps -ef |grep $ORACLE_SID|grep -v grep|awk '{print $2}' | xargs kill -9
2.使用Linux的ipcs和ipcsrm命令释放oracle占用的共享内存
$ ipcs -m | grep oracle | awk '{print $2}' | xargs ipcrm shm
操作步骤:
[root@skate01 ~]# su - oracle
[oracle@skate01 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Tue Feb 21 00:35:11 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01075: you are currently logged on
Enter user-name: sys
Enter password:
ERROR:
ORA-00600: internal error code, arguments: [KGHLKREM1], [0x838000020], [], [],
[], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [KGHLKREM1], [0x838000020], [], [],
[], [], [], [], [], [], [], []
[oracle@skate01 ~]$
[oracle@skate01 ~]$
kill和oracle有关的进程
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep|awk '{print $2}'
1562
1564
1566
1570
1572
1574
1576
1578
1580
1582
1584
1586
1588
1592
1594
1596
3781
3862
3864
3866
3868
10085
10861
12321
12325
12327
12329
12331
12333
12335
12337
12339
12341
25253
25255
25311
29661
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep
oracle 1562 1 0 2011 ? 00:01:38 ora_pmon_skate01
oracle 1564 1 0 2011 ? 00:00:05 ora_psp0_skate01
oracle 1566 1 0 2011 ? 00:00:00 ora_vktm_skate01
oracle 1570 1 0 2011 ? 00:00:00 ora_gen0_skate01
oracle 1572 1 0 2011 ? 00:00:15 ora_diag_skate01
oracle 1574 1 0 2011 ? 00:00:00 ora_dbrm_skate01
oracle 1576 1 0 2011 ? 05:27:59 ora_dia0_skate01
oracle 1578 1 0 2011 ? 00:00:04 ora_mman_skate01
oracle 1580 1 21 2011 ? 14-07:36:04 ora_dbw0_skate01
oracle 1582 1 0 2011 ? 00:04:16 ora_lgwr_skate01
oracle 1584 1 0 2011 ? 00:13:26 ora_ckpt_skate01
oracle 1586 1 0 2011 ? 00:00:38 ora_smon_skate01
oracle 1588 1 0 2011 ? 00:00:00 ora_reco_skate01
oracle 1592 1 0 2011 ? 00:32:15 ora_mmnl_skate01
oracle 1594 1 0 2011 ? 00:00:00 ora_d000_skate01
oracle 1596 1 0 2011 ? 00:00:00 ora_s000_skate01
avahi 3781 1 0 2011 ? 00:00:00 avahi-daemon: registering [skate01.local]
oracle 3862 1 0 2011 ? 01:21:24 ora_arc0_skate01
oracle 3864 1 0 2011 ? 01:20:30 ora_arc1_skate01
oracle 3866 1 0 2011 ? 00:00:19 ora_arc2_skate01
oracle 3868 1 0 2011 ? 01:20:49 ora_arc3_skate01
oracle 10861 1 0 Feb20 ? 00:00:00 ora_mmon_skate01
oracle 12321 1 0 2011 ? 00:00:01 ora_mrp0_skate01
oracle 12325 1 4 2011 ? 3-00:19:33 ora_pr00_skate01
oracle 12327 1 0 2011 ? 02:39:29 ora_pr01_skate01
oracle 12329 1 0 2011 ? 02:21:16 ora_pr02_skate01
oracle 12331 1 0 2011 ? 02:29:30 ora_pr03_skate01
oracle 12333 1 0 2011 ? 02:30:53 ora_pr04_skate01
oracle 12335 1 0 2011 ? 02:34:36 ora_pr05_skate01
oracle 12337 1 0 2011 ? 02:17:54 ora_pr06_skate01
oracle 12339 1 0 2011 ? 02:24:47 ora_pr07_skate01
oracle 12341 1 0 2011 ? 02:22:16 ora_pr08_skate01
oracle 25253 1 1 2011 ? 18:28:18 oracleskate01 (LOCAL=NO)
oracle 25255 1 0 2011 ? 00:00:03 oracleskate01 (LOCAL=NO)
oracle 25311 1 0 2011 ? 00:02:45 oracleskate01 (LOCAL=NO)
oracle 29661 1 0 Jan24 ? 00:00:08 oracleskate01 (LOCAL=NO)
[oracle@skate01 ~]$ ipcs -m | grep oracle | awk '{print $2}'
2818055
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep|awk '{print $2}' | xargs kill -9
kill 3781: Operation not permitted
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep|awk '{print $2}'
3781
10462
10464
10469
10471
10473
10475
10477
10479
10481
10483
10485
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep|awk '{print $2}' | xargs kill -9
kill 3781: Operation not permitted
[oracle@skate01 ~]$ ps -ef |grep ora_|grep -v grep|awk '{print $2}'
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep
avahi 3781 1 0 2011 ? 00:00:00 avahi-daemon: registering [skate01.local]
oracle 10499 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10501 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10503 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10505 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10507 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10509 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10511 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10513 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10515 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10517 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10519 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14007 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14009 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14011 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14013 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14015 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14017 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14019 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14021 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14023 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14025 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14027 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep |grep -v avahi
oracle 10499 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10501 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10503 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10505 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10507 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10509 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10511 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10513 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10515 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10517 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 10519 1 0 00:39 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14007 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14009 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14011 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14013 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14015 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14017 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14019 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14021 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14023 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14025 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 14027 1 0 00:40 ? 00:00:00 oracleskate01 (LOCAL=NO)
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep |grep -v avahi |awk '{print $2}' | xargs kill -9
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep |grep -v avahi
释放共享段
[oracle@skate01 ~]$ ipcs -m | grep oracle | awk '{print $2}'
2818055
[oracle@skate01 ~]$ ipcs -m | grep oracle | awk '{print $2}' | xargs ipcrm shm
resource(s) deleted
[oracle@skate01 ~]$
[oracle@skate01 ~]$ ipcs -m | grep oracle | awk '{print $2}'
[oracle@skate01 ~]$ ps -ef | grep ora_
oracle 17907 14155 0 00:46 pts/3 00:00:00 grep ora_
[oracle@skate01 ~]$ ps -ef |grep $ORACLE_SID|grep -v grep
avahi 3781 1 0 2011 ? 00:00:00 avahi-daemon: registering [skate01.local]
oracle 17862 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17871 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17873 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17875 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17877 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17879 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17881 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17883 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17885 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17887 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17889 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
oracle 17891 1 0 00:45 ? 00:00:00 oracleskate01 (LOCAL=NO)
这时可以正常登录了
[oracle@skate01 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Tue Feb 21 00:47:36 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 3.5275E+10 bytes
Fixed Size 2233656 bytes
Variable Size 3623881416 bytes
Database Buffers 3.1541E+10 bytes
Redo Buffers 108003328 bytes
SQL> alter database mount standby database;
Database altered.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL>
检查数据库是否正常
注意:
手工杀掉oracle进程和手工释放共享内存是非常危险的,不到万不得已,千万不要使用,容易造成数据不一致。这个方法是作为没有办法的办法。
--转自