Oracle HOWTO: create Enterprise Manager repository on Windows

Go to Michael Dvorkin's user page

Prerequisites
Oracle Server 10.2

Steps to create new repository
1. Create new repository using emca

emca -config dbcontrol db -repos create -silent -PORT  -SERVICE_NAME  -SYS_PWD -SID  -DBSNMP_PWD -SYSMAN_PWD -DBCONTROL_HTTP_PORT  -AGENT_PORT  -RMI_PORT  -JMS_PORT 

Default values:

DB port: 1521 DB Control HTTP port: 1158 DB Control Agent port: 3938 RMI port: 5521 JMS port: 5541

Example:

emca -config dbcontrol db -repos create -silent -PORT 1521 -SERVICE_NAME ORCL -SYS_PWD oracle -SID ORCL -DBSNMP_PWD dbsnmp -SYSMAN_PWD oem_temp -DBCONTROL_HTTP_PORT 1158 -AGENT_PORT 3938 -RMI_PORT 5521 -JMS_PORT 5541

Steps to re-create existing repository
1. Unlock user accounts and change passwords:

alter user dbsnmp account unlock identified by ; alter user sysman account unlock identified by ;

2. Ensure that targets.xml file exists and has the following content:

  

The location of targets.xml file is: \_\sysman\emd\targets.xml

3. Re-create repository using emca:

emca -config dbcontrol db -repos recreate -silent -PORT  -SERVICE_NAME  -SYS_PWD -SID  -DBSNMP_PWD -SYSMAN_PWD -DBCONTROL_HTTP_PORT <DB Control HTTP port> -AGENT_PORT <DB Control Agent port> -RMI_PORT <RMI port> -JMS_PORT <JMS port>

Default values:

DB port: 1521 DB Control HTTP port: 1158 DB Control Agent port: 3938 RMI port: 5521 JMS port: 5541

Example:

emca -config dbcontrol db -repos recreate -silent -PORT 1521 -SERVICE_NAME ORCL -SYS_PWD oracle -SID ORCL -DBSNMP_PWD dbsnmp -SYSMAN_PWD oem_temp -DBCONTROL_HTTP_PORT 1158 -AGENT_PORT 3938 -RMI_PORT 5521 -JMS_PORT 5541

Steps to completely drop old repository and re-create it
1. Start listener

lsnrctl start <LISTENER Name>

2. Drop existing repository

emca -deconfig dbcontrol db -repos drop -silent -PORT <DB port> -SERVICE_NAME <ORACLE_SID> -SYS_PWD -SID <ORACLE_SID> -DBSNMP_PWD -SYSMAN_PWD -DBCONTROL_HTTP_PORT <DB Control HTTP port> -AGENT_PORT <DB Control Agent port> -RMI_PORT <RMI port> -JMS_PORT <JMS port>

Default values:

DB port: 1521 DB Control HTTP port: 1158 DB Control Agent port: 3938 RMI port: 5521 JMS port: 5541

Example:

emca -config dbcontrol db -repos drop -silent -PORT 1521 -SERVICE_NAME ORCL -SYS_PWD oracle -SID ORCL -DBSNMP_PWD dbsnmp -SYSMAN_PWD oem_temp -DBCONTROL_HTTP_PORT 1158 -AGENT_PORT 3938 -RMI_PORT 5521 -JMS_PORT 5541

3. Drop database objects:

sqlplus "sys as sysdba" drop public synonym SETEMVIEWUSERCONTEXT; drop ROLE MGMT_USER; drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS; drop user sysman cascade; drop user MGMT_VIEW cascade; exit;

4. Create new repository:

emca -config dbcontrol db -repos create -silent -PORT <DB port> -SERVICE_NAME <ORACLE_SID> -SYS_PWD -SID <ORACLE_SID> -DBSNMP_PWD -SYSMAN_PWD -DBCONTROL_HTTP_PORT <DB Control HTTP port> -AGENT_PORT <DB Control Agent port> -RMI_PORT <RMI port> -JMS_PORT <JMS port>

Default values:

DB port: 1521 DB Control HTTP port: 1158 DB Control Agent port: 3938 RMI port: 5521 JMS port: 5541

Example:

emca -config dbcontrol db -repos create -silent -PORT 1521 -SERVICE_NAME ORCL -SYS_PWD oracle -SID ORCL -DBSNMP_PWD dbsnmp -SYSMAN_PWD oem_temp -DBCONTROL_HTTP_PORT 1158 -AGENT_PORT 3938 -RMI_PORT 5521 -JMS_PORT 5541

Known Issues
Go to Michael Dvorkin's user page