解决问题列表
1 Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.
2 EM安装完成后仍启动failed.(TZ时区问题)
ORACLE环境说明
1) ORACLE版本
sys@HORACLED> select * from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
2) RAC两个结点:
HOSTNAME SID SERVICE_NAME
vmydb1 HoracleD1 HoraceDB
vmydb2 HoracleD2 HoraceDB
3) host文件
[oracle@vmydb1 log]$ view /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.65.231 vmydb1 vmydb1.oracle.com
192.168.65.232 vmydb1-vip
192.168.65.233 vmydb2 vmydb2.oracle.com
192.168.65.234 vmydb2-vip
#scan ip
192.168.65.236 vmydb-cluster vmydb-cluster-scan
172.168.1.18 vmydb1-priv
172.168.1.19 vmydb2-priv
日记正文
OC4J Configuration issue. /s01/oracle/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_vmydb1_HoracleDB not found.
total 28
drwxr-xr-x 5 oracle oinstall 4096 Apr 22 12:49 OC4J_Workflow_Component_Container
drwxr-x--- 6 oracle oinstall 4096 Apr 22 12:49 OC4J_DBConsole
drwxr-xr-x 5 oracle oinstall 4096 Apr 22 12:49 OC4J_Workflow_Management_Container
drwxr-xr-x 3 oracle oinstall 4096 Apr 22 12:49 oc4j_applications
drwxr-xr-x 2 oracle oinstall 4096 Apr 22 12:58 utilities
drwxr-xr-x 14 oracle oinstall 4096 Apr 22 12:58 home
-rw-r--r-- 1 oracle oinstall 1027 Apr 22 13:11 deploy_db_wf.ini
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 10-5月 -2014 21:49:51
Copyright (c) 1991, 2011, 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.3.0 - Production
Start Date 10-5月 -2014 16:37:40
Uptime 0 days 2 hr. 12 min. 21 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /g01/11ggrid/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /g01/11ggrid/app/11.2.0/grid/log/diag/tnslsnr/vmydb1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.65.236)(PORT=1521)))
Services Summary...
Service "HoracleDB" has 2 instance(s).
Instance "HoracleD1", status READY, has 1 handler(s) for this service...
Instance "HoracleD2", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 10-5月 -2014 21:50:44
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 10-5月 -2014 16:37:59
Uptime 0 days 2 hr. 12 min. 46 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /g01/11ggrid/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /g01/orabase/diag/tnslsnr/vmydb1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.65.231)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.65.232)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "HoracleDB" has 1 instance(s).
Instance "HoracleD1", status READY, has 1 handler(s) for this service...
The command completed successfully
SQL*Plus: Release 11.2.0.3.0 Production on 星期六 5月 10 22:08:52 2014
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 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
System altered.
SQL> alter system register;
System altered.
STARTED EMCA at May 10, 2014 10:17:11 PM
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: HoracleDB
Service name: HoracleDB
Listener port number: 1521
Listener ORACLE_HOME [ /g01/11ggrid/app/11.2.0/grid ]:
Password for SYS user:
Password for DBSNMP user:
May 10, 2014 10:17:56 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: Error during db connection : ORA-28000: the account is locked
May 10, 2014 10:18:02 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: ORA-28000: the account is locked
Password for SYSMAN user:
Cluster name: Horacle_cluster
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /g01/11ggrid/app/11.2.0/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password:
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Database instance hostname ................ Listener ORACLE_HOME ................ /g01/11ggrid/app/11.2.0/grid
Listener port number ................ 1521
Cluster name ................ Horacle_cluster
Database unique name ................ HoracleDB
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /g01/11ggrid/app/11.2.0/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
May 10, 2014 10:20:04 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /s01/orabase/cfgtoollogs/emca/HoracleDB/emca_2014_05_10_22_17_09.log.
May 10, 2014 10:20:07 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
May 10, 2014 10:20:09 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
May 10, 2014 10:20:10 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
May 10, 2014 11:30:17 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
May 10, 2014 11:30:53 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
May 10, 2014 11:42:19 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
May 10, 2014 11:42:26 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /s01/oracle/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_vmydb1_HoracleDB to remote nodes ...
May 10, 2014 11:42:29 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /s01/oracle/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_vmydb2_HoracleDB to remote nodes ...
May 10, 2014 11:42:35 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /s01/oracle/app/oracle/product/11.2.0/dbhome_1/vmydb1_HoracleDB to remote nodes ...
May 10, 2014 11:42:38 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /s01/oracle/app/oracle/product/11.2.0/dbhome_1/vmydb2_HoracleDB to remote nodes ...
May 10, 2014 11:43:04 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
May 10, 2014 11:43:34 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
May 10, 2014 11:47:40 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://vmydb1:1158/em <<<<<<<<<<<
May 10, 2014 11:47:50 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
**************** Current Configuration ****************
INSTANCE NODE DBCONTROL_UPLOAD_HOST
---------- ---------- ---------------------
HoracleDB vmydb1 vmydb1
HoracleDB vmydb2 vmydb1
May 10, 2014 11:47:50 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************
Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /s01/oracle/app/oracle/product/11.2.0/dbhome_1/vmydb1_HoracleDB/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.
***********************************************************
May 10, 2014 11:47:50 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING: Error starting Database Control on nodes vmydb2. Execute the following command(s) on nodes: vmydb2.
1) Set the environment variable ORACLE_UNQNAME to Database unique name
2) /s01/oracle/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole
Error starting Database Control on nodes vmydb2. Execute the following command(s) on nodes: vmydb2.
1) Set the environment variable ORACLE_UNQNAME to Database unique name
2) /s01/oracle/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://vmydb1:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /s01/oracle/app/oracle/product/11.2.0/dbhome_1/vmydb1_HoracleDB/sysman/log
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://vmydb1:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ............................................................................................. failed.
If you modified the timezone setting in the environment, please stop the agent and exectute 'emctl resetTZ agent' and also execute the script mgmt_target.set_agent_tzrgn(<agent_name>, <new_tz_rgn>) to get the value propagated to repository.
agentTZRegion=PRC
agentTZRegion=US/Eastern,
[oracle@vmydb2 ~]$ emctl resetTZ agent
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
Updating /s01/oracle/app/oracle/product/11.2.0/dbhome_1/vmydb2_HoracleDB/sysman/config/emd.properties...
Successfully updated /s01/oracle/app/oracle/product/11.2.0/dbhome_1/vmydb2_HoracleDB/sysman/config/emd.properties.
Login as the em repository user and run the script:
exec mgmt_target.set_agent_tzrgn('vmydb2:3938','PRC')
and commit the changes
This can be done for example by logging into sqlplus and doing
SQL> exec mgmt_target.set_agent_tzrgn('vmydb2:3938','PRC')
SQL> commit
agentTZRegion=PRC
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://vmydb1:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control .............................. started.
------------------------------------------------------------------
Logs are generated in directory /s01/oracle/app/oracle/product/11.2.0/dbhome_1/vmydb2_HoracleDB/sysman/log