oracle 11g RAC 更改remote_listener参数后EM日志报错:ORA-12514, TNS:listener does not currently know of service



环境:oracle 11g + RAC + ASM + raw + 2node + redhat5.7


[root@rac01 ~]# cat /etc/hosts

# add by RAC install
# public  eth1
192.168.1.5    rac01
192.168.1.6    rac02

# vip    eth1:1
192.168.1.222    rac01-vip
192.168.1.223    rac02-vip

# private  eth0
10.10.11.26   rac01-priv
10.10.11.46   rac02-priv

# single client access name  (scan)
192.168.1.225   rac-scan




本人配置 服务端 基于vip的负载均衡,更改remote_listener参数后,EM登入后总是说实例未启动,要求启动

但是实际数据库实例是已经启动的,查看EM日志如下:

2015-01-22 04:57:29,565 [shutdownThread] ERROR app.SessionObjectManager sessionDestroyed.128 -

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
The Connection descriptor used by the client was:
rac-scan:1521/racdb


其实就是oracle用户更改了remote_listener参数导致数据库不再可以通过scan ip登入数据库了,实则就是没有监听它了

先前 remote_listener 参数值为  rac-scan:1521

改为了用于负载均衡的值   LISTENER_RACDB                        ---负载均衡及其他功能均正常

而EM中配置的连接节点二的描述还是写的先前的 rac-scan:1521 固然连接不上了


解决办法:

1.先停止两个节点的EM:

[oracle@rac01 ~]$ emctl stop dbconsole

[oracle@rac02 ~]$ emctl stop dbconsole


2.直接修改EM的配置文件:(将rac-scan改为任意vip地址)

/u01/app/oracle/product/11.2.0.3/db_1/rac01_racdb/sysman/config/emoms.properties

/u01/app/oracle/product/11.2.0.3/db_1/rac01_racdb/sysman/emd/targets.xml     (这个文件先不修改,如果进入EM跳转连接还是会转回登入页面再修改)


[oracle@rac01 config]$ pwd
/u01/app/oracle/product/11.2.0.3/db_1/rac01_racdb/sysman/config
[oracle@rac01 config]$ ls
b64InternetCertificate.txt                  emkey.ora
b64LocalCertificate.txt                     emomsintg.xml
classpath.lst                               emomslogging.properties
dbconsole_emdurls.properties                emoms.properties
emagentlogging.properties                   emoms.properties.bak.2015_01_10_22_00_28_354
emd.properties                              emoms.properties.use.bak
emd.properties.2015-01-10-22-00-38          monwallet
emd.properties.bak.2015_01_10_22_00_28_349  OUIinventories.add
emd.properties.tzbak                        server
[oracle@rac01 config]$vi emoms.properties

#Thu Jan 22 05:16:14 CST 2015
oracle.sysman.emSDK.svlt.ConsoleServerName=rac01\:1158_Management_Service
oracle.sysman.eml.mntr.emdRepPwd=ef249bfd83353da6
emdrep.ping.pingCommand=/bin/ping -c 3 -w 30
em_oob_shutdown=false
LargeRepository=false
oracle.sysman.eml.mntr.emdRepPort=1521
oracle.sysman.eml.mntr.emdRepDBName=racdb
EMD_URL=https\://rac01\:3938/emd/main
em_email_address=%EM_EMAIL_ADDRESS%
oracle.sysman.eml.mntr.emdRepPwdSeed=9022063789100486576
oracle.sysman.emSDK.svlt.ConsoleMode=standalone
em_oob_crash=false
em.oms.dumpModules=omsThread,repos
oracle.sysman.emRep.dbConn.statementCacheSize=50
oracle.sysman.db.isqlplusUrl=http\://rac01\:/isqlplus/dynamic
em_oob_startup=false
oracle.sysman.emSDK.svlt.ConsoleServerPort=1158
oracle.sysman.eml.mntr.emdRepRAC=TRUE
em_from_email_address=%EM_FROM_EMAIL_ADDRESS%
oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE
oracle.sysman.emSDK.svlt.ConsoleServerHost=rac01
oracle.sysman.db.isqlplusWebDBAUrl=http\://rac01\:/isqlplus/dba/dynamic
oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort=1158
oracle.sysman.eml.mntr.emdRepDBID=865396401
em_email_gateway=%EM_EMAIL_GATEWAY%
oracle.sysman.eml.mntr.emdRepSID=racdb1
oracle.sysman.eml.mntr.emdRepServer=rac01
oracle.sysman.emSDK.sec.ReuseLogonPassword=true
oracle.sysman.eml.mntr.emdRepConnectDescriptor=192.168.1.222\:1521/racdb                                               #这里原来是rac-scan,我直接用vip代替。
oracle.sysman.emkeyfile=/u01/app/oracle/product/11.2.0.3/db_1/rac01_racdb/sysman/config/emkey.ora
em.security.xsrf_check_enabled=false
oracle.sysman.eml.mntr.emdRepUser=SYSMAN
em.ip.ui.enable=true
oracle.sysman.emSDK.svlt.PublicServletEnabled=true


3.修改listener.ora和tnsnames.ora

[grid@rac01 ~]$ cat /u01/11.2.0.3/grid/network/admin/listener.ora                                    ---   rac02也同样修改(RAC各个节点的listener.ora文件配置一致)

LISTENER_SCAN1=
    (DESCRIPTION=
      (ADDRESS_LIST=
        (ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))
#        (ADDRESS = (PROTOCOL = TCP)(HOST = rac01)(PORT = 1521))                   ---  bxy
#        (ADDRESS = (PROTOCOL = TCP)(HOST = rac02)(PORT = 1521))                   ---  bxy
      )
    )                # line added by Agent
LISTENER=
    (DESCRIPTION=
      (ADDRESS_LIST=
        (ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))
      )
    )            # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent





[oracle@rac01 log]$ cat /u01/app/oracle/product/11.2.0.3/db_1/network/admin/tnsnames.ora                                             ---   rac02也同样修改

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0.3/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

RACDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.222)(PORT = 1521))
    (CONNECT_DATA =
         (SERVER = DEDICATED)   
         (SERVICE_NAME = racdb) 
         (INSTANCE_NAME = racdb1)
    )
   ) 
RACDB2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.223)(PORT = 1521))
    (CONNECT_DATA =
        (SERVER = DEDICATED)   
        (SERVICE_NAME = racdb)    
        (INSTANCE_NAME = racdb2)
     ) 
    )

RACDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.222)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.223)(PORT = 1521))  
    (LOAD_BALANCE = yes)  
    (CONNECT_DATA =
       (SERVER = DEDICATED)   
       (SERVICE_NAME = racdb)
    )
  )

LISTENERS_RACDB =                                                                                                ---    负载均衡配置
 (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.222)(PORT = 1521)) 
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.223)(PORT = 1521))
  )


ASM =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.5)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (ORACLE_SID = +ASM1)
    )
  )

rac-scan =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.225)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = racdb)
    )
  )



ps:标红处是添加的。



4.节点二也同样修改即可。


5.清空下EM的日志和缓存,重启下实例即可

[oracle@rac01 log]$ pwd
/u01/app/oracle/product/11.2.0.3/db_1/rac01_racdb/sysman/log
[oracle@rac01 log]$ rm -rf *


重启实例:

[grid@rac01 ~]$ srvctl stop listener

[grid@rac01 ~]$ srvctl stop scan_listener


[grid@rac01 ~]$ srvctl start listener

[grid@rac01 ~]$ srvctl start scan_listener




6.然后再在两个节点打开EM就可以正常访问了。

[oracle@rac01 ~]$ emctl start dbconsole

[oracle@rac02 ~]$ emctl start dbconsole



ps:如果登入后点击链接还是会回到登入界面(连接字符xxxxxx)

两个节点关闭EM,root用户重启下全部资源,再清空下EM缓存,再启动EM即可。

[oracle@rac01 ~]$ emctl stop dbconsole

[oracle@rac02 ~]$ emctl stop dbconsole


[root@rac01 ~]# /u01/11.2.0.3/grid/bin/crsctl stop cluster -all

[root@rac01 ~]# /u01/11.2.0.3/grid/bin/crsctl start cluster -all


[oracle@rac01 log]$ pwd
/u01/app/oracle/product/11.2.0.3/db_1/rac01_racdb/sysman/log
[oracle@rac01 log]$ rm -rf *


[oracle@rac01 ~]$ emctl start dbconsole

[oracle@rac02 ~]$ emctl start dbconsole




---end---




你可能感兴趣的:(oracle数据库)