Oracle service name与instance name 不一致ORA-27101: shared memory realm does not exist

简介: 1. 今天在客户端连接服务端时报如下错误[oracle@asm admin]$ sqlplus sys/xxxx@orcl as sysdbaSQL*Plus: Release 11.

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)
    )
  )

连接成功


目录
相关文章
|
7月前
|
SQL Oracle 关系型数据库
[已解决]使用sqlplus连接oracle,提示ORA-01034和ORA-27101
[已解决]使用sqlplus连接oracle,提示ORA-01034和ORA-27101
157 0
|
Oracle 关系型数据库
|
SQL Oracle 关系型数据库
在Oracle/SQL Service中通过Function返回Table
本函数用途:返回一个Table 在Oracle中实现,范例: 1 --在Types中: 2 create or replace type objTable as object 3 ( 4 s_usercode varchar2(32767), 5 s_usernam...
856 0
|
SQL Oracle 关系型数据库
在SQL service或Oracle中将数字转换成有千位符号
1、在SQL service中的写法: 1 --Function主体 2 CREATE FUNCTION [dbo].[FnMoneyStyle](@Number float,@strType char(1)) 3 RETURNS VARCHAR(100) 4 AS 5 BE...
1197 0
|
关系型数据库 数据库 数据安全/隐私保护
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name
解决方法:      在启动的时候先设置一下oracle_unqname                     set oracle_unqname=$ORACLE_SID 如果还是失败,在环境变量中添加:      vi ~/.
1041 0
|
Oracle 关系型数据库 Linux
|
2月前
|
存储 Oracle 关系型数据库
Oracle数据库的应用场景有哪些?
【10月更文挑战第15天】Oracle数据库的应用场景有哪些?
202 64