现在的位置: 首页 > 综合 > 正文

RAC监听,实例名与服务名不一致一例 [(原创)](ORA-27101,ORA-01034)

2014年08月02日 ⁄ 综合 ⁄ 共 2747字 ⁄ 字号 评论关闭

11.2.0.3for RHEL5.6

[oracle@lxasm ~]$ sqlplus system/qazwsx@lxasmorc1


SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 19 01:21:47 2013


Copyright (c) 1982, 2011, 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

明明信息已经注册到监听上去了,以及数据库也是启动了的

--用本地认证登录进行验证是否启动数据库

 [oracle@lxasm ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 19 01:22:33 2013

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options


SQL> 

查看参数:

SQL>  show parameter name
 NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
O7_DICTIONARY_ACCESSIBILITY            boolean     FALSE
awr_snapshot_time_offset               integer     0
control_management_pack_access         string      DIAGNOSTIC+TUNING
cursor_bind_capture_destination        string      memory+disk
db_file_name_convert                   string
db_name                                string      lxasmorc
db_unique_name                         string      lxasmorcl
enable_ddl_logging                     boolean     FALSE
global_names                           boolean     FALSE
instance_name                          string      lxasmorc1
java_jit_enabled                       boolean     TRUE
service_names                          string  lxasmorcl 
通过检查发现,instance_name和service_names不一样  一个是L(小写)一个是1

现在是instance 
lxasmorc1
所以注册上去后,通过@lxasmorc1这种方式连接 会去查找  
 lxasmorc1    Service name,然而这里服务名是 lxasmorcl (L)
所以判断认为实例没有启动

解决方案: 

创建pfile并关闭数据库
[oracle@lxasm dbs]$ export ORACLE_SID=lxasmorc1  (这里只是说明一下,依然是1SID,如果你没更改,可不export)

[oracle@lxasm ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 19 01:22:33 2013

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL>create pfile from spfile;
 
SQL>shutdown immediate;
将pfile改名后尝试启动
[oracle@lxasm dbs]$  cp initlxasmorc1.ora initlxasmorcl.ora 

 [oracle@lxasm dbs]$ export ORACLE_SID=lxasmorcl
[oracle@lxasm dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 19 01:26:05 2013

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

Connected to an idle instance.

SQL> startup

ORA-29760: instance_number parameter not specified 

这时候报这个错。继续修复修改pfile中的instance_number参数

 
[oracle@lxasm dbs]$  vi initlxasmorcl.ora 
修改pfile中的
 lxasmorc1.instance_number=1 
 变为
 lxasmorcl.instance_number=1  
 
 

保存 退出

[oracle@lxasm dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 19 01:26:05 2013

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

Connected to an idle instance. 
SQL>startup pfile='?/dbs/initlxasmorcl.ora'
 启动成功!

这里注意,再成功后,要把dbs目录下的密码文件也改名正确(orc1 变为 orcl)
再登陆进去 赋予sys ,system sysdba权限。否则sqlplus  system/password@lxasmorcl as sysdba无法登陆的(报没有权限错误)
 
还有一个收获,就是你安装完grid,安装完程序,最好顺便也把库建了,而不是甩给别的同事,因为很有可能就会出现  l 1不分的情况。。
当然,是在你没有交代清楚,同事也没问的情况下

抱歉!评论已关闭.