Oracle 10.2.0.5 RAC 通過emca 配置 DB Control

rongshiyuan發表於2012-11-28
1.檢視RAC環境中DB是否存在DB Control repository or Grid Control repository
SQL> conn / as sysdba
Connected.
SQL> select username from DBA_USERS where username = 'SYSMAN';
USERNAME
------------------------------
SYSMAN
 
查詢到SYSMAN,表示在資料庫已有DB Control repository或者Grid Control repository 。
 
2. DB Control repository物件建立在表空間SYSAUX ,Grid Control repository表空間被建立在表空間MGMT_TABLESPACE and MGMT_ECM_DEPOT_TS
SQL> select tablespace_name from dba_tablespaces order by 1;
TABLESPACE_NAME
------------------------------
MACRODB_DATA
MACRODB_TEMP
SYSAUX
SYSTEM
TEMP
TEST
UNDOTBS1
UNDOTBS2
USERS
9 rows selected.
 
如果返回MGMT_TABLESPACE and MGMT_ECM_DEPOT_TS,表示資料庫中已有 Grid Control repository,則不能建立 DB Control ,本例中沒有MGMT_TABLESPACE and MGMT_ECM_DEPOT_TS表空間。
 
3. 如果要刪除原有存在的repository(a Grid Control repository or a DB Control repository ),則:
  1. cd to RDBMS ORACLE_HOME/sysman/admin/emdrep/bin (for a DB Control Repository)
    or
    cd to the OMS ORACLE_HOME/sysman/admin/emdrep/bin (for a Grid Control Repository)
  2. Issue the following command
    $ ./RepManager repository_host repository_port repository_SID
    -sys_password password_for_sys_account -action drop
    * repository_host is the machine name where the Management Repository database is located
    * repository_port is the Management Repository database listener port address, usually 1521 or 1526
    * repository_SID is the Management Repository database system identifier
    * password_for_sys_account is the password of the SYS user for the database. For example, change_on_install.
    * -action drop indicates that you want to drop the Management Repository.

    Note: Dropping a Grid Control or DB Control repository quiesces and unquiesces the database.

本例是刪除已存在的DB Control Repository:

進入目錄$ORACLE_HOME/sysman/admin/emdrep/bin

[oracle@rac1 ~]$ cd $ORACLE_HOME/sysman/admin/emdrep/bin

執行RepManager:
[oracle@rac1 bin]$ ./RepManager rac1 1521 RACDB1 -sys_password  oracle -action drop
Enter repository user name : sysman
Enter repository user password :
Getting temporary tablespace from database...
Found temporary tablespace: TEMP
Checking SYS Credentials ... OK.
Dropping the repository..
Quiescing DB ... Done.
Checking for Repos User ... Exists.
Repos User exists..
Clearing EM Contexts ... OK.
Dropping EM users ...
Done.
Dropping Repos User ... ^[aDone.
Dropping Roles/Synonymns/Tablespaces ... Done.
Unquiescing DB ... Done.
Dropped Repository Successfully.

 

設定好環境變數:$ORACLE_HOME、$ORACLE_SID

檢視cluster name,$ORA_CRS_HOME/bin/cemutlo -n

[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/cemutlo -n
crs

Run emca in interactive mode:

[oracle@rac1 bin]$ emca -config dbcontrol db -repos create -cluster

STARTED EMCA at Nov 28, 2012 3:05:42 PM
EM Configuration Assistant, Version 10.2.0.5.0 Production
Copyright (c) 2003, 2009, Oracle.  All rights reserved.

Enter the following information:
Database unique name: RACDB                     
Listener port number: 1521
Cluster name: crs
Password for SYS user:
Password for SYSMAN user: 
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /opt/ora10g/product/10.2.0/db_1 ]:
ASM port [ 1521 ]:
ASM user role [ SYSDBA ]:
ASM username [ SYS ]:
ASM user password: 
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /opt/ora10g/product/10.2.0/db_1

Database instance hostname ................ rac1
Listener port number ................ 1521
Cluster name ................ crs
Database unique name ................ RACDB
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /opt/ora10g/product/10.2.0/db_1
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ SYS

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Nov 28, 2012 3:26:58 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/ora10g/product/10.2.0/db_1/cfgtoollogs/emca/RACDB/emca_2012-11-28_03-05-42-PM.log.
Nov 28, 2012 3:27:08 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Nov 28, 2012 3:37:51 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Nov 28, 2012 3:38:13 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /opt/ora10g/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_rac1_RACDB1 to remote nodes ...
Nov 28, 2012 3:38:16 PM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /opt/ora10g/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_rac2_RACDB2 to remote nodes ...
Nov 28, 2012 3:38:38 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /opt/ora10g/product/10.2.0/db_1/rac1_RACDB1 to remote nodes ...
Nov 28, 2012 3:38:55 PM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /opt/ora10g/product/10.2.0/db_1/rac2_RACDB2 to remote nodes ...
Nov 28, 2012 3:38:59 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Nov 28, 2012 3:42:44 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Nov 28, 2012 3:48:29 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Nov 28, 2012 3:48:29 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://rac1:5501/em <<<<<<<<<<<
Nov 28, 2012 3:49:10 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
****************  Current Configuration  ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------

RACDB1            rac1              rac1
RACDB2            rac2              rac1


Enterprise Manager configuration completed successfully
FINISHED EMCA at Nov 28, 2012 3:49:11 PM
或者

Run emca in silent mode:
It is also possible to run emca in silent mode, providing a response file with all the parameters needed:

$emca -config dbcontrol db -repos create -cluster -si
lent -respfile /u01/app/oracle/admin/EM102/scripts/emca_configandrep.rsp

with content of file /u01/app/oracle/admin/EM102/scripts/emca_configandrep.rsp as follow:
CLUSTER_NAME=mycrsname
-- if CLUSTER_NAME is not specified, it will be the default cluster name
(usually crs). To check the name of the cluster:
1. cd to the crs $ORACLE_HOME/bin
2. Issue the command ./cemutlo -n
For additional information on the cluster name please consult the note:
Note 378037.1 - How To Install Oracle 10g Grid Agent On Rac
DB_UNIQUE_NAME=EM102
SERVICE_NAME=EM102
SYS_PWD=oracle
SYSMAN_PWD=oracle
DBSNMP_PWD=oracle
PORT=1521


This emca command will:
- create the DB Control repository in the RAC database
- configure the DB Control on the local node and deploy the DB Control on all nodes of the cluster
- start the DB Control on the local node (dbconsole and agent)
- start all the agents on all the other nodes of the cluster


To check the configuration files, log files, targets.xml, contents of upload or recv directories
[oracle@rac1 emd]$ emctl config agent listtargets
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.5.0 
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
[rac1:1831, oracle_emd]
[rac1, host]
[crs, cluster]
[RACDB_RACDB1, oracle_database]
[RACDB, rac_database]
[LISTENER_RAC1_rac1, oracle_listener]
[+ASM1_rac1, osm_instance]

To check the DB Control configuration on the cluster:

[oracle@rac1 emd]$ emca -displayConfig dbcontrol -cluster

STARTED EMCA at Nov 28, 2012 5:16:10 PM
EM Configuration Assistant, Version 10.2.0.5.0 Production
Copyright (c) 2003, 2009, Oracle.  All rights reserved.

Enter the following information:
Database unique name: RACDB

Do you wish to continue? [yes(Y)/no(N)]: Y
Nov 28, 2012 5:16:23 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/ora10g/product/10.2.0/db_1/cfgtoollogs/emca/RACDB/emca_2012-11-28_05-16-10-PM.log.
Nov 28, 2012 5:16:31 PM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
****************  Current Configuration  ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------

RACDB1            rac1              rac1
RACDB2            rac2              rac1


Enterprise Manager configuration completed successfully
FINISHED EMCA at Nov 28, 2012 5:16:31 PM

To check emca log files:

As displayed to the standard output, emca log files are create in $ORACLE_HOME/cfgtoollogs/emca/EM102.
The log files are only created on the local node (the node from which emca has been run).
The log file for DBControl configuration/setup and deployment is emca_.log
The log file for DB Control repository creation is emca_repos_create_.log

For more information on emca log files, please refer to:
Note 330689.1 How To Trace EMCA in RDBMS 10G


 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-750166/,如需轉載,請註明出處,否則將追究法律責任。

相關文章