11gr2 RAC环境配置OEM 报ORA-12514错误

简介:

   今天一个客户打电话过来说他们的OEM出了问题用不起,OEM这个东西得说了很多次,但是自己从来没有玩过。下面就在自己的测试环境来玩一点,结果报错了。

     环境:OS:RHEL 5.6 X86_64   DB:11.2.0.2 RAC

     1,开始配置OEM

 
  1. [oracle@11rac1 ~]$ emca -config dbcontrol db -repos create -cluster 
  2.  
  3. STARTED EMCA at Nov 7, 2012 11:00:18 PM 
  4. EM Configuration Assistant, Version 11.2.0.0.2 Production 
  5. Copyright (c) 2003, 2005, Oracle.  All rights reserved. 
  6.  
  7. Enter the following information: 
  8. Database unique name: power 
  9. Service name: power 
  10. Listener port number: 1521 
  11. Listener ORACLE_HOME [ /u01/app/11.2.0/grid ]:  
  12. Password for SYS user:   
  13. Password for DBSNMP user:   
  14. Password for SYSMAN user:   
  15. Cluster name: test 
  16. Email address for notifications (optional):  
  17. Outgoing Mail (SMTP) server for notifications (optional):  
  18. ASM ORACLE_HOME [ /u01/app/11.2.0/grid ]:  
  19. ASM port [ 1521 ]:  
  20. ASM username [ ASMSNMP ]: 
  21. #这里报不能解析ASM
  22. ASM user password:   
  23. Nov 7, 2012 11:01:43 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely 
  24. WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 
  25.  
  26. Nov 7, 2012 11:01:48 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely 
  27. WARNING: ORA-12154: TNS:could not resolve the connect identifier specified 
  28.  
  29. Nov 7, 2012 11:01:49 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely 
  30. WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 
  31.  
  32. Nov 7, 2012 11:01:54 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely 
  33. WARNING: ORA-12154: TNS:could not resolve the connect identifier specified 
  34.  
  35. Password validation failed. Some of the possible reasons may be: 
  36.   
  37. 1) Invalid username/password.  
  38. 2) Database is not up.  
  39. 3) Scan listener not up.  
  40. 4) Database service is not registered with scan listener.  
  41. 5) Password file may be missing or configured incorrectly.  
  42.  
  43. ASM user password:   
  44. ASM user password: Nov 7, 2012 11:12:21 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely 
  45. WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 
  46.  
  47. Nov 7, 2012 11:12:26 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely 
  48. WARNING: ORA-12154: TNS:could not resolve the connect identifier specified 
  49.  
  50. Nov 7, 2012 11:12:26 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely 
  51. WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 
  52.  
  53. Nov 7, 2012 11:12:32 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely 
  54. WARNING: ORA-12154: TNS:could not resolve the connect identifier specified 
  55.  
  56. Password validation failed. Some of the possible reasons may be: 
  57.   
  58. 1) Invalid username/password.  
  59. 2) Database is not up.  
  60. 3) Scan listener not up.  
  61. 4) Database service is not registered with scan listener.  
  62. 5) Password file may be missing or configured incorrectly.  

   2.查看监听消息

 
  1. [grid@11rac1 ~]$ ps -ef|grep lsn 
  2. grid      3957     1  0 09:15 ?        00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit 
  3. grid      3990     1  0 09:15 ?        00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit 
  4. grid      7006  6976  0 09:40 pts/0    00:00:00 grep lsn 
  5. [grid@11rac1 ~]$ lsnrctl status listener 
  6.  
  7. LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 08-NOV-2012 09:40:51 
  8.  
  9. Copyright (c) 1991, 2010, Oracle.  All rights reserved. 
  10.  
  11. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) 
  12. STATUS of the LISTENER 
  13. ------------------------ 
  14. Alias                     LISTENER 
  15. Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production 
  16. Start Date                08-NOV-2012 09:15:15 
  17. Uptime                    0 days 0 hr. 25 min. 36 sec 
  18. Trace Level               off 
  19. Security                  ONLocal OS Authentication 
  20. SNMP                      OFF 
  21. Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora 
  22. Listener Log File         /u01/app/11.2.0/grid/log/diag/tnslsnr/11rac1/listener/alert/log.xml 
  23. Listening Endpoints Summary... 
  24.   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) 
  25.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.40)(PORT=1521))) 
  26.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.45)(PORT=1521))) 
  27. Services Summary... 
  28. Service "+ASM" has 1 instance(s). 
  29.   Instance "+ASM1", status READY, has 1 handler(s) for this service... 
  30. Service "power" has 1 instance(s). 
  31.   Instance "power1", status READY, has 1 handler(s) for this service... 
  32. Service "powerXDB" has 1 instance(s). 
  33.   Instance "power1", status READY, has 1 handler(s) for this service... 
  34. The command completed successfully 
  35. [grid@11rac1 ~]$ lsnrctl status listener_scan1 
  36.  
  37. LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 08-NOV-2012 09:41:04 
  38.  
  39. Copyright (c) 1991, 2010, Oracle.  All rights reserved. 
  40.  
  41. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))) 
  42. STATUS of the LISTENER 
  43. ------------------------ 
  44. Alias                     LISTENER_SCAN1 
  45. Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production 
  46. Start Date                08-NOV-2012 09:15:18 
  47. Uptime                    0 days 0 hr. 25 min. 45 sec 
  48. Trace Level               off 
  49. Security                  ONLocal OS Authentication 
  50. SNMP                      OFF 
  51. Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora 
  52. Listener Log File         /u01/app/11.2.0/grid/log/diag/tnslsnr/11rac1/listener_scan1/alert/log.xml 
  53. Listening Endpoints Summary... 
  54.   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1))) 
  55.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.49)(PORT=1521))) 
  56. Services Summary... 
  57. Service "power" has 2 instance(s). 
  58.   Instance "power1", status READY, has 1 handler(s) for this service... 
  59.   Instance "power2", status READY, has 1 handler(s) for this service... 
  60. Service "powerXDB" has 2 instance(s). 
  61.   Instance "power1", status READY, has 1 handler(s) for this service... 
  62.   Instance "power2", status READY, has 1 handler(s) for this service... 
  63. The command completed successfully 
  64. [grid@11rac1 ~]$ sqlplus asmsnmp/oracle@scan:1521/+ASM as sysdba 
  65.  
  66. SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 8 09:41:30 2012 
  67.  
  68. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  69.  
  70. ERROR: 
  71. ORA-12514: TNS:listener does not currently know of service requested in connect 
  72. descriptor 
  73.  
  74.  
  75. Enter user-name:     
  76.  
  77. [grid@11rac1 ~]$ sqlplus asmsnmp/oracle@192.168.100.40:1521/+ASM as sysdba 
  78.  
  79. SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 8 09:44:57 2012 
  80.  
  81. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  82.  
  83.  
  84. Connected to
  85. Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production 
  86. With the Real Application Clusters and Automatic Storage Management options 
  87.  
  88. SQL> select instance_name from v$instance; 
  89.  
  90. INSTANCE_NAME 
  91. ---------------- 
  92. +ASM1 
  93.  
  94. [grid@11rac1 ~]$ cd $ORACLE_HOME/network/admin 
  95. [grid@11rac1 admin]$ cat listener.ora 
  96. LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent 
  97. LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent 
  98. ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent 
  99. ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent 
  100. [grid@11rac1 admin]$ cat endpoints_listener.ora 
  101. LISTENER_11RAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=11rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.40)(PORT=1521)(IP=FIRST))))    # line added by Agent 

    发现ASM的监听跑在LISTENER上面,没有注册到LISTENER_SCAN1里面,而OEM使用提LISTENER_SCAN1监听。

   3.手动注册监听,并查看状态

 
  1. [grid@11rac1 ~]$ sqlplus / as sysdba 
  2.  
  3. SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 8 12:07:09 2012 
  4.  
  5. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  6.  
  7.  
  8. Connected to
  9. Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production 
  10. With the Real Application Clusters and Automatic Storage Management options 
  11.  
  12. SQL> show parameter remote 
  13.  
  14. NAME                                 TYPE        VALUE 
  15. ------------------------------------ ----------- ------------------------------ 
  16. remote_listener                      string 
  17. remote_login_passwordfile            string      EXCLUSIVE 
  18. remote_os_authent                    boolean     FALSE 
  19. remote_os_roles                      boolean     FALSE 
  20. SQL> alter system set remote_listener='scan:1521' scope=both sid='*'
  21.  
  22. System altered. 
  23.  
  24. SQL> alter system register; 
  25.  
  26. System altered. 
  27.  
  28. SQL> exit 
  29. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production 
  30. With the Real Application Clusters and Automatic Storage Management options 
  31. [grid@11rac1 ~]$ ps -ef|grep lsn 
  32. grid      3957     1  0 09:15 ?        00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit 
  33. grid      3990     1  0 09:15 ?        00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit 
  34. grid     16378 16263  0 12:08 pts/0    00:00:00 grep lsn 
  35. [grid@11rac1 ~]$ lsnrctl status listener_scan1 
  36.  
  37. LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 08-NOV-2012 12:08:54 
  38.  
  39. Copyright (c) 1991, 2010, Oracle.  All rights reserved. 
  40.  
  41. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))) 
  42. STATUS of the LISTENER 
  43. ------------------------ 
  44. Alias                     LISTENER_SCAN1 
  45. Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production 
  46. Start Date                08-NOV-2012 09:15:18 
  47. Uptime                    0 days 2 hr. 53 min. 35 sec 
  48. Trace Level               off 
  49. Security                  ONLocal OS Authentication 
  50. SNMP                      OFF 
  51. Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora 
  52. Listener Log File         /u01/app/11.2.0/grid/log/diag/tnslsnr/11rac1/listener_scan1/alert/log.xml 
  53. Listening Endpoints Summary... 
  54.   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1))) 
  55.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.49)(PORT=1521))) 
  56. Services Summary... 
  57. Service "+ASM" has 2 instance(s). 
  58.   Instance "+ASM1", status READY, has 1 handler(s) for this service... 
  59.   Instance "+ASM2", status READY, has 1 handler(s) for this service... 
  60. Service "power" has 2 instance(s). 
  61.   Instance "power1", status READY, has 1 handler(s) for this service... 
  62.   Instance "power2", status READY, has 1 handler(s) for this service... 
  63. Service "powerXDB" has 2 instance(s). 
  64.   Instance "power1", status READY, has 1 handler(s) for this service... 
  65.   Instance "power2", status READY, has 1 handler(s) for this service... 
  66. The command completed successfully 

    4.再次配置OEM

 
  1. [oracle@11rac1 ~]$ emca -config dbcontrol db -repos recreate -cluster 
  2.  
  3. STARTED EMCA at Nov 8, 2012 12:13:04 PM 
  4. EM Configuration Assistant, Version 11.2.0.0.2 Production 
  5. Copyright (c) 2003, 2005, Oracle.  All rights reserved. 
  6.  
  7. Enter the following information: 
  8. Database unique name: power 
  9. Service name: power 
  10. Listener port number: 1521 
  11. Listener ORACLE_HOME [ /u01/app/11.2.0/grid ]:  
  12. Password for SYS user:   
  13. Password for SYS user: oracle 
  14. Password for SYSMAN user:   
  15. Cluster name: test 
  16. Email address for notifications (optional):  
  17. Outgoing Mail (SMTP) server for notifications (optional):  
  18. ASM ORACLE_HOME [ /u01/app/11.2.0/grid ]:  
  19. ASM port [ 1521 ]:  
  20. ASM username [ ASMSNMP ]:  
  21. ASM user password:   
  22. ----------------------------------------------------------------- 
  23.  
  24. You have specified the following settings 
  25.  
  26. Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1 
  27.  
  28. Database instance hostname ................ Listener ORACLE_HOME ................ /u01/app/11.2.0/grid 
  29. Listener port number ................ 1521 
  30. Cluster name ................ test 
  31. Database unique name ................ power 
  32. Email address for notifications ...............  
  33. Outgoing Mail (SMTP) server for notifications ...............  
  34. ASM ORACLE_HOME ................ /u01/app/11.2.0/grid 
  35. ASM port ................ 1521 
  36. ASM user role ................ SYSDBA 
  37. ASM username ................ ASMSNMP 
  38.  
  39. ----------------------------------------------------------------- 
  40. ---------------------------------------------------------------------- 
  41. WARNING : While repository is dropped the database will be put in quiesce mode. 
  42. ---------------------------------------------------------------------- 
  43. Do you wish to continue? [yes(Y)/no(N)]: Y 
  44. Nov 8, 2012 12:13:30 PM oracle.sysman.emcp.EMConfig perform 
  45. INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/power/emca_2012_11_08_12_13_03.log. 
  46. Nov 8, 2012 12:13:32 PM oracle.sysman.emcp.EMReposConfig invoke 
  47. INFO: Dropping the EM repository (this may take a while) ... 
  48. Nov 8, 2012 12:16:59 PM oracle.sysman.emcp.EMReposConfig invoke 
  49. INFO: Repository successfully dropped 
  50. Nov 8, 2012 12:17:00 PM oracle.sysman.emcp.EMReposConfig createRepository 
  51. INFO: Creating the EM repository (this may take a while) ... 
  52. hNov 8, 2012 12:27:24 PM oracle.sysman.emcp.EMReposConfig invoke 
  53. INFO: Repository successfully created 
  54. Nov 8, 2012 12:27:33 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository 
  55. INFO: Uploading configuration data to EM repository (this may take a while) ... 
  56. Nov 8, 2012 12:28:36 PM oracle.sysman.emcp.EMReposConfig invoke 
  57. INFO: Uploaded configuration data successfully 
  58. Nov 8, 2012 12:28:36 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles 
  59. INFO: Propagating /u01/app/oracle/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_11rac1_power to remote nodes ... 
  60. Nov 8, 2012 12:28:39 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles 
  61. INFO: Propagating /u01/app/oracle/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_11rac2_power to remote nodes ... 
  62. Nov 8, 2012 12:28:43 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs 
  63. INFO: Propagating /u01/app/oracle/product/11.2.0/db_1/11rac1_power to remote nodes ... 
  64. Nov 8, 2012 12:28:45 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs 
  65. INFO: Propagating /u01/app/oracle/product/11.2.0/db_1/11rac2_power to remote nodes ... 
  66. Nov 8, 2012 12:28:47 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole 
  67. INFO: Securing Database Control (this may take a while) ... 
  68. Nov 8, 2012 12:29:08 PM oracle.sysman.emcp.util.DBControlUtil startOMS 
  69. INFO: Starting Database Control (this may take a while) ... 
  70. Nov 8, 2012 12:30:33 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration 
  71. INFO: Database Control started successfully 
  72. Nov 8, 2012 12:30:33 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration 
  73. INFO: >>>>>>>>>>> The Database Control URL is https://11rac1:5500/em <<<<<<<<<<< 
  74. Nov 8, 2012 12:32:23 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage 
  75. INFO:  
  76. ****************  Current Configuration  **************** 
  77.  INSTANCE            NODE           DBCONTROL_UPLOAD_HOST 
  78. ----------        ----------        --------------------- 
  79.  
  80. power             11rac1             11rac1 
  81. power             11rac2             11rac1 
  82.  
  83.  
  84. Nov 8, 2012 12:32:23 PM oracle.sysman.emcp.EMDBPostConfig invoke 
  85. WARNING:  
  86. ************************  WARNING  ************************ 
  87.  
  88. Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/db_1/11rac1_power/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.  
  89.  
  90. *********************************************************** 
  91. Enterprise Manager configuration completed successfully 
  92. FINISHED EMCA at Nov 8, 2012 12:32:23 PM 

已经显示successfully ,表示已经成功了。

  5.查看运行状态。

 
  1. [oracle@11rac1 ~]$ emca -displayConfig dbcontrol -cluster 
  2.  
  3. STARTED EMCA at Nov 8, 2012 1:54:57 PM 
  4. EM Configuration Assistant, Version 11.2.0.0.2 Production 
  5. Copyright (c) 2003, 2005, Oracle.  All rights reserved. 
  6.  
  7. Enter the following information: 
  8. Database unique name: power 
  9. Service name: power 
  10. Do you wish to continue? [yes(Y)/no(N)]: Y 
  11. Nov 8, 2012 1:55:02 PM oracle.sysman.emcp.EMConfig perform 
  12. INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/power/emca_2012_11_08_13_54_57.log. 
  13. Nov 8, 2012 1:55:05 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage 
  14. INFO:  
  15. ****************  Current Configuration  **************** 
  16.  INSTANCE            NODE           DBCONTROL_UPLOAD_HOST 
  17. ----------        ----------        --------------------- 
  18.  
  19. power             11rac1             11rac1 
  20. power             11rac2             11rac1 
  21.  
  22.  
  23. Enterprise Manager configuration completed successfully 
  24. FINISHED EMCA at Nov 8, 2012 1:55:05 PM 
  25. [oracle@11rac1 ~]$ emctl -help 
  26. Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.  
  27. [oracle@11rac1 ~]$ export ORACLE_UNQNAME=power 
  28. [oracle@11rac1 ~]$ emctl status dbconsole 
  29. Oracle Enterprise Manager 11g Database Control Release 11.2.0.2.0  
  30. Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved. 
  31. https://11rac1:5500/em/console/aboutApplication 
  32. Oracle Enterprise Manager 11g is running.  
  33. ------------------------------------------------------------------ 
  34. Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/11rac1_power/sysman/log  

 一切正常.OEM配置成功。






     本文转自7343696 51CTO博客,原文链接:http://blog.51cto.com/luoping/1053873,如需转载请自行联系原作者


相关文章
|
Shell Linux
Rhel7安装RAC 11gR2时运行root.sh报错找不到ohas服务妙招
Rhel7安装RAC 11gR2时运行root.sh报错找不到ohas服务妙招
242 0
|
网络协议 Linux
|
网络协议 Oracle 关系型数据库
|
Oracle 关系型数据库 Linux
|
Oracle 关系型数据库 数据库
|
存储 文字识别 Oracle