Oracle 10.2.0.5 RAC 通过emca 配置 DB Control

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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17252115/viewspace-750166/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值