Monday, October 3, 2011

Oracle Enterprise Manager

I deploy my databases without Enterprise Manager installed. To create a cookie cutter quick and easy tarball deployment with a configured EM/dbconsole would take me far longer than it's worth. So instead I've streamlined the steps involved with uninstalling and reinstalling EM/dbconsole. I have only tested the following steps on 10/11g.

Let's drop the preliminary repository drop first:
sqlplus "/ as sysdba"
exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force=>TRUE);
alter user sys identified by oracle;
alter user system identified by oracle;
drop user sysman cascade;
drop role MGMT_USER;
drop user MGMT_VIEW cascade;
drop public synonym MGMT_TARGET_BLACKOUTS;
drop public synonym SETEMVIEWUSERCONTEXT;


Now we go about creating the password file:
sqlplus "/ as sysdba"
alter system set remote_login_passwordfile=exclusive scope=spfile;
!orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle entries=5 


Okay, now to do some more dropping:
$ORACLE_HOME/bin/emca -deconfig dbcontrol db
$ORACLE_HOME/bin/emca -deconfig dbcontrol db -repos drop
rm -r $ORACLE_HOME/$HOSTNAME\_nams
rm -r $ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_$HOSTNAME\_nams


And finally time to create:
$ORACLE_HOME/bin/emca -config dbcontrol db -repos create 

Now lets start it up!
emctl dbconsole start
check /etc/sendmail.cf for outgoing server.

0 comments:

Post a Comment