今天打算在重启操作系统前关闭数据库却遇到ORA-00000错误;如下:
[oracle@auxdb1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 27 12:46:59 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected.
SQL> shutdown immediate
ORA-00000: normal, successful completion
SQL> select open_mode from v$database;
select open_mode from v$database
*
ERROR at line 1:
ORA-01012: not logged on
Process ID: 0
Session ID: 0 Serial number: 0
SQL> exit
Disconnected 显示状态为Connected,而且也有相关oracle进程:
[root@localhost ~]# ps -ef|grep ora_
oracle 3948 1 0 12:34 ?
00:00:00 ora_pmon_orcl
oracle 3950 1 0 12:34 ?
00:00:00 ora_psp0_orcl
oracle 3952 1 0 12:34 ?
00:00:00 ora_vktm_orcl
oracle 3956 1 0 12:34 ?
00:00:00 ora_gen0_orcl
oracle 3958 1 0 12:34 ?
00:00:00 ora_diag_orcl
oracle 3960 1 0 12:34 ?
00:00:00 ora_dbrm_orcl
oracle 3962 1 0 12:34 ?
00:00:00 ora_dia0_orcl
oracle 3964 1 0 12:34 ?
00:00:01 ora_mman_orcl
oracle 3966 1 0 12:34 ?
00:00:00 ora_dbw0_orcl
oracle 3968 1 0 12:34 ?
00:00:00 ora_lgwr_orcl
oracle 3970 1 0 12:34 ?
00:00:00 ora_ckpt_orcl
oracle 3972 1 0 12:34 ?
00:00:00 ora_smon_orcl
oracle 3974 1 0 12:34 ?
00:00:00 ora_reco_orcl
oracle 3976 1 0 12:34 ?
00:00:00 ora_mmon_orcl
oracle 3978 1 0 12:34 ?
00:00:00 ora_mmnl_orcl
oracle 3980 1 0 12:34 ?
00:00:00 ora_d000_orcl
oracle 3982 1 0 12:34 ?
00:00:00 ora_s000_orcl
oracle 3990 1 0 12:34 ?
00:00:00 ora_qmnc_orcl
oracle 3992 1 0 12:35 ?
00:00:00 ora_q000_orcl
oracle 3994 1 0 12:35 ?
00:00:00 ora_q001_orcl
oracle 4006 1 0 12:35 ?
00:00:00 ora_cjq0_orcl
oracle 4035 1 0 12:40 ?
00:00:00 ora_smco_orcl
oracle 4037 1 0 12:40 ?
00:00:00 ora_w000_orcl
root 4098 4069 0 12:50 pts/3
00:00:00 grep ora_
后来才发现是修改了主机名,而未把主机名添加到hosts文件导致的,将主机名添加到/etc/hosts文件即可:
[oracle@auxdb1 ~]$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1
localhost.localdomain localhost
::1 localhost6.localdomain6
localhost6
[oracle@auxdb1 ~]$ exit
logout
[root@auxdb1 ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1
localhost.localdomain localhost
::1 localhost6.localdomain6
localhost6
192.168.56.202 auxdb1
~
"/etc/hosts" 5L, 209C written
[root@auxdb1 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1
localhost.localdomain localhost
::1 localhost6.localdomain6
localhost6
192.168.56.202 auxdb1
[root@auxdb1 ~]# su - oracle
[oracle@auxdb1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 27 12:49:39 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing
options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> |