閱讀768 返回首頁    go 阿裏雲 go 技術社區[雲棲]


Oracle--ORA-01012問題

sqlplus / as sysdba 登錄oracle時報錯ORA-01012: not logged on
發生原因:關閉數據庫是shutdown 後麵沒有接關閉參數中的任何一個。
以下是shutdown使用的一些參數
nomal --->所有連接都斷開時才能關閉;
transactional --->等待事務結束後,主動斷開連接;
immediate --->主動斷開事務和連接;
abort --->立刻關閉數據庫,這個操作是危險的,不會同步數據,不觸發檢查點,回滾段直接清 空,相當於掉電,每次啟動都要實例恢複。

[root@iZ2zeh44pi6rlahxj7s9azZ ~]# su - oracle

[oracle@iZ2zeh44pi6rlahxj7s9azZ ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 7 10:43:18 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected.

SQL> startup;
ORA-01012: not logged on

SQL> select * from all_tables;
select * from all_tables
*
ERROR at line 1:
ORA-01012: not logged on
Process ID: 0
Session ID: 0 Serial number: 0


[root@iZ2zeh44pi6rlahxj7s9azZ ~]# ps -ef | grep ora_dbw0_$Oracle_SID
[root@iZ2zeh44pi6rlahxj7s9azZ ~]# kill -9 pid
[root@iZ2zeh44pi6rlahxj7s9azZ ~]# su - oracle
[oracle@iZ2zeh44pi6rlahxj7s9azZ oracle]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 7 11:31:23 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> startup
ORACLE instance started.

Total System Global Area  768294912 bytes
Fixed Size            2257192 bytes
Variable Size          503320280 bytes
Database Buffers      260046848 bytes
Redo Buffers            2670592 bytes
Database mounted.
Database opened.



[root@iZ2zeh44pi6rlahxj7s9azZ ~]# sysresv

IPC Resources for ORACLE_SID "dtstack" :
Shared Memory:
ID        KEY
262145      0x00000000
294914      0x00000000
327683      0x7d9066c0
Semaphores:
ID        KEY
786437      0x50f506b0
Unable to determine if Oracle instance alivefor sid "dtstack"
[root@iZ2zeh44pi6rlahxj7s9azZ ~]# ipcrm -m 262145
[root@iZ2zeh44pi6rlahxj7s9azZ ~]# ipcrm -m 294914
[root@iZ2zeh44pi6rlahxj7s9azZ ~]# ipcrm -m 327683
[root@iZ2zeh44pi6rlahxj7s9azZ ~]# su - oracle
[oracle@iZ2zeh44pi6rlahxj7s9azZ oracle]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 7 11:31:23 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> startup
ORACLE instance started.

Total System Global Area  768294912 bytes
Fixed Size            2257192 bytes
Variable Size          503320280 bytes
Database Buffers      260046848 bytes
Redo Buffers            2670592 bytes
Database mounted.
Database opened.


注:
sysresv的小工具來查看oracle占用的共享內存段和信號量等係統資源的一些關鍵信息
ipcs命令用於報告Linux中進程間通信設施的狀態,顯示的信息包括消息列表、共享內存和信號量的信息。 
























最後更新:2017-09-07 12:02:30

  上一篇:go  show tables能看到表卻無法讀寫?
  下一篇:go  MySQL 8.0.2起UNDO表空間管理更靈活