1. 今天在客户端连接服务端时报如下错误
[oracle@asm admin]$ sqlplus sys/xxxx@orcl as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 26 19:49:03 2014 Copyright (c) 1982, 2009, Oracle. All rights reserved. ERROR: ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux-x86_64 Error: 2: No such file or directory Process ID: 0 Session ID: 0 Serial number: 0
2. 但在服务 端数据库正常启动,也能以sys登陆
[oracle@asm ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 26 19:51:56 2014 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL>
3. 查看客户端tnsname.ora配置文件如下
orcl = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.111)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME= orcl) ) )
4. 再三纠结,之后查看数据库servcie name
SQL> show parameter name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_file_name_convert string db_name string orcl db_unique_name string primary global_names boolean FALSE instance_name string orcl lock_name_space string log_file_name_convert string service_names string primary
发现数据库的service_name=primary
原来是这个错误:service name与instance name
5. 把客户端配置文件tnsname.ora改成如下:
ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.111)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = primary) ) )
连接成功