How to remove and recreate the DB Control Repository in a 10g Database.
On Unix Systems:
- Run 10g DB $OH/sysman/admin/emdrep/bin/RepManager
- NOTE: Type RepManager by itself and you will get a list of options available for the tool
- After you delete the Repository, you will need to remove the configuration files. To do this, run emca -x
- Finally, to created both the schema objects and configuration files run emca and answer the prompts
On Windows Systems:
NOTE: The RepManager script in 10.1.0.2.0 does not work correctly on Windows. For this reason, you will have to manually drop the sysman schema and management objects. The RepManager script should be fully functional in the 10.1.0.3.0 release.
- Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and mangement objects:
SHUTDOWN IMMEDIATE;
STARTUP RESTRICT;
EXEC sysman.emd_maintenance.remove_em_dbms_jobs;
EXEC sysman.setEMUserContext('',5);
REVOKE dba FROM sysman;
DECLARE
CURSOR c1 IS
SELECT owner, synonym_name name
FROM dba_synonyms
WHERE table_owner = 'SYSMAN'
;
BEGIN
FOR r1 IN c1 LOOP
IF r1.owner = 'PUBLIC' THEN
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM 'r1.name;
ELSE
EXECUTE IMMEDIATE 'DROP SYNONYM 'r1.owner'.'r1.name;
END IF;
END LOOP;
END;
DROP USER mgmt_view CASCADE;
DROP ROLE mgmt_user;
DROP USER sysman CASCADE;
ALTER SYSTEM DISABLE RESTRICTED SESSION; - At a command Prompt, run emca -x sid to remove the existing configuration files and then recreate the schema and configuration files with just emca.
For example: emca -x
emca
For Oracle 10g rel 2
- to remove dbconsole, type in the command line
emca -deconfig dbcontrol db -repos drop - to add dbconsole
emca -config dbcontrol db -repos create - to use silent installation
ORACLE_HOME = /opt/oracle/product/10.2.0
PORT = 1521SID = cctest
HOST = cc-oracle.co.clatsop.or.us
DBSNMP_PWD = oracle12
SYSMAN_PWD = oracle12
SYS_PWD = oracle12
DBCONTROL_HTTP_PORT = 1168
Then run the emca with the following options:
emca -config dbcontrol db -silent -respFile
No comments:
Post a Comment