Tuesday, August 11, 2009

How To Drop, Create And Recreate DB Control In A 10g Database

Subject: How To Drop, Create And Recreate DB Control In A 10g Database
Doc ID: 278100.1 Type: BULLETIN
Modified Date : 08-SEP-2008 Status: PUBLISHED

In this Document
Purpose
Scope and Application
How To Drop, Create And Recreate DB Control In A 10g Database
DB Control options:
A. Delete DB Control Objects:
B. Create DB Control Objects
C. Recreate/ReConfig DB Control
References



--------------------------------------------------------------------------------



Applies to:
Enterprise Manager Grid Control - Version: 10.1.0.2 to 11.1.0.0
Information in this document applies to any platform.
DBConsole
Purpose
This article provides detailed instructions on how to 1) create, 2) drop and 3)recreate the repository and configuration files for the DB Control application used to manage a single 10g Database.


Scope and Application
The steps in this article are written for a DBA or System Administrator who needs to create, drop or reconfigure the DB Control Application.

The format of the document will include steps for both 10.1 and 10.2 EMCA because the commands changed between the two releases.

For detailed instructions on DB Control 10.2 for RAC, please consult also:
Note 395162.1 How to manage DB Control 10.2 for RAC Database with emca

How To Drop, Create And Recreate DB Control In A 10g Database
DB Control options:


A. Delete DB Control Objects:
Option 1. Delete DB Control Configuration Files using EMCA scripts
Option 2. Delete DB Control Configuration Files Manually:
Option 3. Delete DB Control Repository Objects using RepManager
Option 4. Delete DB Control Repository Objects Manually
Option 5. Delete DB Control Configuration Files and Repository Objects using EMCA


Option 1. Delete DB Control Configuration Files using EMCA scripts:
For DB Control 10.1.x, run the command: /bin/emca -x For DB Control 10.2.x, run the command: bin/emca -deconfig dbcontrol db



Important Note: the option -deconfig removes the EM jobs from Scheduling before the DB Control is deconfigured. Otherwise the repository, which is not dropped, could be corrupted or inconsistent if EM jobs were scheduled as the time the DB Control is dropped. It could also cause some errors during the DB Control deletion.

Option 2. Delete DB Control Configuration Files Manually:

Remove the following directories from your filesystem:
/
/oc4j/j2ee/OC4J_DBConsole__



NOTE:
On Windows you also need to delete the DB Console service:
- run regedit
- navigate to HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services
- locate the OracleDBConsole entry and delete it

Alternatively on Windows XP and Windows Server 2003 you can run the following from the command line:
'sc delete '

- where is the DB Control service name (typically: OracleDBConsole)

Also available from Microsoft is the delsrv.exe command. (Free download from Microsoft)



Option 3. Delete DB Control Repository using RepManager:
This option is not as complete as the other options. You may find that dropping the repository using the commandline options is a better solution. Also note, RepManager is not used to create a DB Control Repository.
In both 10g R1 and R2 run: /sysman/admin/emdrep/bin/RepManager -action drop


Warning: this command puts the database in Quiesce Mode.
Please consult the Note 375946.1 Running EMCA Results in Database quiesce And No
New Connections or Operations Can Be Performed During the DB Control Repository Creation



Option 4. Delete DB Control Repository Objects Manually Step 1: Drop AQ related objects in the SYSMAN schemaLogon SQLPLUS as user SYSMANSQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'MGMT_NOTIFY_QTABLE',force =>TRUE);Step 2: Drop the DB Control Repository ObjectsLogon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and management objects:SQL> SHUTDOWN IMMEDIATE;SQL> STARTUP RESTRICT;SQL> EXEC sysman.emd_maintenance.remove_em_dbms_jobs;SQL> EXEC sysman.setEMUserContext('',5);SQL> REVOKE dba FROM sysman;SQL> DECLARECURSOR c1 ISSELECT owner, synonym_name nameFROM dba_synonymsWHERE table_owner = 'SYSMAN';BEGINFOR r1 IN c1 LOOPIF r1.owner = 'PUBLIC' THENEXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;ELSEEXECUTE
IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;END IF;END LOOP;END;/SQL> DROP USER mgmt_view CASCADE;SQL> DROP ROLE mgmt_user;SQL> DROP USER sysman CASCADE;SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;
Note: The above will completely delete the DB Control repository from the database; under certain circumstances (e.g. you want to recreate the repository later on) the following statements may be sufficient to remove the repository:

Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and management objects:SQL> drop user sysman cascade;SQL> drop role MGMT_USER;SQL> drop user MGMT_VIEW cascade;SQL> drop public synonym MGMT_TARGET_BLACKOUTS;SQL> drop public synonym SETEMVIEWUSERCONTEXT;

Option 5. Delete DB Control Configuration Files and Repository Objects using EMCA

For DB Control 10.1.x, dropping both the configuration files and the repository objects is a two step process. Run the following two commands:
/bin/emca -x /sysman/admin/emdrep/bin/RepManager -action drop

For DB Control 10.2.x, both configuration files and repository objects can be deleted with a single command. Run the command:
/bin/emca -deconfig dbcontrol db -repos drop


Warning: this command puts the database in Quiesce Mode.
Please consult the Note 375946.1 Running EMCA Results in Database quiesce And No
New Connections or Operations Can Be Performed During the DB Control Repository Creation


B. Create DB Control Objects
Option 1. Create the DB Control Configuration Files
Option 2. Create the DB Control Repository Objects and Configuration Files


Option 1. Create the DB Control Configuration Files
To create only the DB Control configuration files, skipping the repository creation (this would be done for instance if you dropped only the files and left the repository in place):
For DB Control 10.1.x, run the command: /bin/emca -rFor DB Control 10.2.x, run the command: /bin/emca -config dbcontrol db


Option 2. Create the DB Control Repository Objects and Configuration Files
For DB Control 10.1.x, run the command: /bin/emcaFor DB Control 10.2.x, run the command: bin/emca -config dbcontrol db -repos create


Warning: this command puts the database in Quiesce Mode.
Please consult the Note 375946.1 Running EMCA Results in Database quiesce And No
New Connections or Operations Can Be Performed During the DB Control Repository Creation


C. Recreate/ReConfig DB Control
Option 1. Recreate the DB Control Configuration Files only (leave Repository intact)
Option 2. Recreate the DB Control Configuration Files and Repository

In 10.2, the EMCA commands can be used to reconfigure the existing installs without removing them first.

Option 1. Recreate the DB Control Configuration Files only (leave Repository intact):
For DB Control 10.2.x, run the command:
/bin/emca -config dbcontrol db

Option 2. Recreate the DB Control Configuration Files and Repository
For DB Control 10.2.x, run the command:
/bin/emca -config dbcontrol db -repos recreate


Warning: this command puts the database in Quiesce Mode.
Please consult the Note 375946.1 Running EMCA Results in Database quiesce And No
New Connections or Operations Can Be Performed During the DB Control Repository Creation

For additional information on EMCA commandline options, please see the Oracle Enterprise Manager 10g Advanced Configuration Guide or see Note 330130.1 Overview Of The EMCA Commands Available for DB Control 10.2

How to get the Portal Schema Password

Subject: How to get the Portal Schema Password of the Infrastructure database
Doc ID: 198800.1 Type: HOWTO
Modified Date : 16-JUN-2009 Status: PUBLISHED


Checked for relevance on 05-Apr-2007

Problem Description
-------------------
How to get the Portal schema password of the Infrastructure database?


Solution Description
--------------------
1. Start up the Oracle Internet Directory administration tool from
infrastructure machine.

At Unix prompt> $ORACLE_HOME/bin/oidadmin
Or
Windows: Start -> Programs -> 9iAS midtier home -> Integrated Management Tools -> Oracle Directory Manager

1.1. If you are using it for the first time, the following message will be
displayed:
"To use this too you must first connect to a Server.
Click on the OK Button to select a Server..."

1.2. Click the OK button.

1.3. Click on the Add button and type in the following:
Servername:
Port : 4032 (the default port for OID - without SSL).

Click on OK... and Select button.

2. To gain access to the Oracle Directory Manager Connect
User : cn=orcladmin
Password:
Server : host running Oracle Internet Directory and port number
where Oracle Internet Directory is listening

The default port for Oracle Internet Directory is 4032(without SSL)

3. Navigate the Single Sign-On schema (orasso)or Portal schema entry using the administration
tool (9.0.2.x).
=> cn=orcladmin@OID_hostname:OID_port
(for example: cn=orcladmin@infra.acme.com:4032)
=> Entry Management
=> cn=OracleContext
=> cn=Products
=> cn=IAS
=> cn=Infrastructure Databases
=> ReferenceName=:
=> ResourceName=Portal

->For Portal 9.0.4.x, 10.1.2.x and 10.1.4.x this is under:
=> cn=orcladmin@OID_hostname:OID_port
(for example: cn=orcladmin@infra.acme.com:4032)
=> Entry Management
=> cn=OracleContext
=> cn=Products
=> cn=IAS
=> cn=IAS Infrastructure Databases
=> orclReferenceName=asdb.
=> OrclResourceName=PORTAL

Navigate backwards to that in oidadmin gui to look for the orclpasswordattribute.

->Portal 10.1.4.x. You will need to use the ldapsearch command line utility to retrieve the password.
The syntax is similar to this:
ldapsearch -h -p -D cn=orcladmin -w -b "cn=IAS,cn=Products,cn=OracleContext" -s sub -v OrclresourceName=PORTAL| grep orclpasswordattribute

4. Click the above entry and look for the orclpasswordattribute attribute value
on the right panel. This value is the password for the Portal schema.