oracle 11g rac配置em dbconsole ORA-12514
1. 问题
[oracle@db-oracle-node1 log]$ emca -config dbcontrol db -repos recreate -cluster
STARTED EMCA at Apr 14, 2021 9:56:06 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database unique name: honor
Service name: honor
Listener ORACLE_HOME [ /u01/app/11.2/grid ]:
Password for SYS user:
Database Control is already configured for the database honor
You have chosen to configure Database Control for managing the database honor
This will remove the existing configuration and the default settings and perform a fresh configuration
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: yes
Password for DBSNMP user:
Password for SYSMAN user:
Password for SYSMAN user: Cluster name: db-orac-cluster
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /u01/app/11.2/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password:
Apr 14, 2021 9:59:53 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
2. 问题解决
这个问题为ASM实例未注册到SCAN Listener导致。
[grid@db-oracle-node1 trace]$ lsnrctl status listener_scan1
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-APR-2021 10:01:05
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 14-APR-2021 08:15:09
Uptime 0 days 1 hr. 45 min. 56 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2/grid/network/admin/listener.ora
Listener Log File /u01/app/11.2/grid/log/diag/tnslsnr/db-oracle-node1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.204.200)(PORT=1521)))
Services Summary...
Service "honor" has 1 instance(s).
Instance "honor1", status READY, has 1 handler(s) for this service...
Service "honorXDB" has 1 instance(s).
Instance "honor1", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@db-oracle-node1 trace]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Wed Apr 14 10:01:38 2021
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> show parameter remote;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_listener string
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
SQL> alter system set remote_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.204.200)(PORT=1521)))','(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.204.181)(PORT=1521)))';
System altered.
SQL> !lsnrctl status listener_scan1;
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-APR-2021 10:02:48
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 14-APR-2021 08:15:09
Uptime 0 days 1 hr. 47 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2/grid/network/admin/listener.ora
Listener Log File /u01/app/11.2/grid/log/diag/tnslsnr/db-oracle-node1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.204.200)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "honor" has 1 instance(s).
Instance "honor1", status READY, has 1 handler(s) for this service...
Service "honorXDB" has 1 instance(s).
Instance "honor1", status READY, has 1 handler(s) for this service...
The command completed successfully
3. 重新运行
[oracle@db-oracle-node1 log]$ emca -config dbcontrol db -repos recreate -cluster
STARTED EMCA at Apr 14, 2021 10:02:56 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database unique name: honor
Service name: honor
Listener ORACLE_HOME [ /u01/app/11.2/grid ]:
Password for SYS user:
Database Control is already configured for the database honor
You have chosen to configure Database Control for managing the database honor
This will remove the existing configuration and the default settings and perform a fresh configuration
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: yes
Password for DBSNMP user:
Password for SYSMAN user:
Cluster name: db-orac-cluster
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /u01/app/11.2/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password:
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /u01/app/oracle/product/11.2/db_1
Database instance hostname ................ Listener ORACLE_HOME ................ /u01/app/11.2/grid
Listener port number ................ 1521
Cluster name ................ db-orac-cluster
Database unique name ................ honor
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /u01/app/11.2/grid
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ ASMSNMP
-----------------------------------------------------------------
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: yes
Apr 14, 2021 10:07:25 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/honor/emca_2021_04_14_10_02_56.log.
Apr 14, 2021 10:07:28 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Apr 14, 2021 10:07:52 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Apr 14, 2021 10:11:58 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Apr 14, 2021 10:12:00 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Apr 14, 2021 10:21:59 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Apr 14, 2021 10:22:10 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Apr 14, 2021 10:23:46 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Apr 14, 2021 10:23:48 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /u01/app/oracle/product/11.2/db_1/oc4j/j2ee/OC4J_DBConsole_db-oracle-node1_honor to remote nodes ...
Apr 14, 2021 10:24:00 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /u01/app/oracle/product/11.2/db_1/db-oracle-node1_honor to remote nodes ...
Apr 14, 2021 10:24:01 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Apr 14, 2021 10:24:02 AM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/11.2/db_1/bin/emctl config emkey -repos -host db-oracle-node1 -sid honor
Apr 14, 2021 10:24:02 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
WARNING: Configuring EM-Key failed for node db-oracle-node1.
Apr 14, 2021 10:24:02 AM oracle.sysman.emcp.EMDBPostConfig setRACWarnMsg
INFO: Error securing Database Control. Database Control has not been brought-up on nodes db-oracle-node1 . Execute the following command(s) on nodes: db-oracle-node1 .
1) Set the environment variable ORACLE_UNQNAME to Database unique name
2) /u01/app/oracle/product/11.2/db_1/bin/emctl config emkey -repos -sysman_pwd < Password for SYSMAN user > -host -sid < Database unique name >
3) /u01/app/oracle/product/11.2/db_1/bin/emctl secure dbconsole -sysman_pwd < Password for SYSMAN user > -host -sid < Database unique name >
4) /u01/app/oracle/product/11.2/db_1/bin/emctl start dbconsole
To secure Em Key, run /u01/app/oracle/product/11.2/db_1/bin/emctl config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
Apr 14, 2021 10:24:04 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://db-oracle-node1:1158/em <<<<<<<<<<<
Apr 14, 2021 10:24:04 AM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
**************** Current Configuration ****************
INSTANCE NODE DBCONTROL_UPLOAD_HOST
---------- ---------- ---------------------
honor db-oracle-node1 db-oracle-node1
Error securing Database Control. Database Control has not been brought-up on nodes db-oracle-node1 . Execute the following command(s) on nodes: db-oracle-node1 .
1) Set the environment variable ORACLE_UNQNAME to Database unique name
2) /u01/app/oracle/product/11.2/db_1/bin/emctl config emkey -repos -sysman_pwd < Password for SYSMAN user > -host -sid < Database unique name >
3) /u01/app/oracle/product/11.2/db_1/bin/emctl secure dbconsole -sysman_pwd < Password for SYSMAN user > -host -sid < Database unique name >
4) /u01/app/oracle/product/11.2/db_1/bin/emctl start dbconsole
To secure Em Key, run /u01/app/oracle/product/11.2/db_1/bin/emctl config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
[oracle@db-oracle-node1 log]$
[oracle@db-oracle-node1 ~]$ /u01/app/oracle/product/11.2/db_1/bin/emctl config emkey -repos -sysman_pwd 111111 -host db-oracle-node1 -sid honor
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
The Em Key has been configured successfully.
[oracle@db-oracle-node1 ~]$ /u01/app/oracle/product/11.2/db_1/bin/emctl secure dbconsole -sysman_pwd 111111 -host db-oracle-node1 -sid honor
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
http://db-oracle-node1:1158/em/console/aboutApplication
DBCONSOLE already stopped... Done.
Agent is already stopped... Done.
Securing dbconsole... Started.
Please enter repository schema password:
Securing dbconsole... Sucessful.
[oracle@db-oracle-node1 ~]$ /u01/app/oracle/product/11.2/db_1/bin/emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
https://db-oracle-node1:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ......... started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2/db_1/db-oracle-node1_honor/sysman/log