在一次启动oracle 数据库(测试环境)的时候,出现了ora-ORA-01012
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup;
ORA-01012: not logged on
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup;
ORA-01012: not logged on
SQL> exit
Disconnected
出现这个问题的原因是关闭数据库的时候操作不规范,因为当时直接关闭数据库的时候
shutdown immediate
等待时间比较长,当时就想取消该操作,按下ctrl+c没有反应,直接关闭了该连接。
这个时候 如果直接连接数据库的话会出现
Connected to an idle instance.
但是如果直接startup的话就会报ora-01012的错。
这个是应该是因为关闭得不够干净的原因吧,因为在操作系统查看进程的时候 ps -ef |grep ora 还会有大把的进程没有关闭掉
oracle@srv55 ~]$ ps -ef |grep ora
oracle 50529 1 0 Apr12 ? 00:17:19 /home/oracle/u01/oracle/product/11.2.0/db_1/bin/tnslsnr LISTENER -inherit
oracle 67708 1 0 Apr13 ? 00:01:01 ora_pmon_eshore
oracle 67710 1 0 Apr13 ? 00:00:47 ora_psp0_eshore
oracle 67712 1 0 Apr13 ? 01:04:52 ora_vktm_eshore
oracle 67716 1 0 Apr13 ? 00:00:09 ora_gen0_eshore
oracle 67718 1 0 Apr13 ? 00:00:14 ora_diag_eshore
oracle 67720 1 0 Apr13 ? 00:00:31 ora_dbrm_eshore
oracle 67722 1 0 Apr13 ? 00:12:52 ora_dia0_eshore
oracle 67724 1 0 Apr13 ? 00:00:10 ora_mman_eshore
oracle 67726 1 0 Apr13 ? 00:00:53 ora_dbw0_eshore
oracle 67728 1 0 Apr13 ? 00:00:51 ora_dbw1_eshore
oracle 67730 1 0 Apr13 ? 00:01:12 ora_dbw2_eshore
oracle 67732 1 0 Apr13 ? 00:00:52 ora_dbw3_eshore
oracle 67734 1 0 Apr13 ? 00:00:50 ora_dbw4_eshore
oracle 67736 1 0 Apr13 ? 00:01:20 ora_dbw5_eshore
oracle 67738 1 0 Apr13 ? 00:06:09 ora_lgwr_eshore
oracle 67740 1 0 Apr13 ? 00:01:50 ora_ckpt_eshore
oracle 67742 1 0 Apr13 ? 00:00:21 ora_smon_eshore
oracle 67744 1 0 Apr13 ? 00:00:03 ora_reco_eshore
oracle 80981 1 0 Apr13 ? 00:00:04 ora_q003_pridtct
oracle 104531 1 0 Apr17 ? 00:00:00 oraclepridtct (LOCAL=NO)
oracle 104586 1 0 Apr17 ? 00:00:00 oraclepridtct (LOCAL=NO)
oracle 104851 1 0 Apr17 ? 00:00:00 oraclepridtct (LOCAL=NO)
oracle 106810 1 0 Apr09 ? 00:02:24 ora_pmon_pridtct
由于篇幅问题,只显示一部份,我的数据库sid为eshore
当我把这些进程杀了之后(其实我只是kill -9 67708),然后再启动,数据库就能正常启动了