Oracle无法正常关闭

Oracle 无法正常关闭

  1. Stop the listener - you can at least prevent others from connecting to the instance that you’re trying to shut down: bash-3.00$ lsnrctl stop

  2. Get a list of processes hitting the database. You’ll need that before you start killing them off one by one: bash-3.00$ ps -eaf|grep LOCAL

  3. Kill the processes. Take the second column’s output from step #2 and execute the following: bash-3.00$ kill -9 396 - where “396” is the processid you wish to kill.

  1. Enter into SQLPlus and connect as SYSDBA: SQL> conn /as sysdba - you’ll receive "Connected to an idle instance"

  2. Shutdown the database via SQL> shutdown immediate You may be given the following:
    ORA-24324: service handle not initialized
    ORA-24323: value not allowed
    ORA-01090: shutdown in progress - connection is not permitted

  3. Reconnect to SQLPlus via sysdba via SQL> conn /as sysdba

  4. Execute a startup force command.

  5. Don’t forget to start the listener back up

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
-- issue:主库运行了切换到standby, 失败后,发现数据库无法连接,与操作
SQL> alter database commit to switchover to physical standby;
alter database commit to switchover to physical standby
*
ERROR at line 1:
ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected
[root@hzvscmdb alert]# tail -f log.xml
<msg time='2016-11-10T02:09:42.814+00:00' org_id='oracle' comp_id='rdbms'
msg_id='opiexe:3036:2780954927' client_id='' type='NOTIFICATION'
group='admin_ddl' level='16' host_id='hzvscmdb'
host_addr='0.0.0.188' module='sqlplus@hzvscmdb (TNS V1-V3)' pid='24748'>
<txt>ORA-1093 signalled during: alter database commit to switchover to physical standby...
</txt>
</msg>
[oracle@hzvscmdb dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 10 02:40:32 2016
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected.
SQL> shutdown immediate;
ORA-24324: service handle not initialized
ORA-24323: value not allowed
ORA-01094: ALTER DATABASE CLOSE in progress. Connections not permitted
SQL> startup;
ORA-01031: insufficient privileges
--解决方法用 startup force; 是shutdown abort + startup的组合,即强制关闭数据库+ 正常启动数据库
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup;
ORA-01012: not logged on
SQL> startup force;
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2226912 bytes
Variable Size 1124074784 bytes
Database Buffers 469762048 bytes
Redo Buffers 7348224 bytes
Database mounted.
Database opened.