Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Tuesday, August 11, 2015

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-00955: name is already used by an existing object

While creating grid control repository manually I ran into the below issue:



Error:

[oracle@collabn2 admin]$ emca -config dbcontrol db -repos create

STARTED EMCA at Aug 6, 2015 8:33:27 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: PROD2
Listener port number: 1621
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0.2/SHAIKPROD ]:
Password for SYS user:  
Password for DBSNMP user:  
Password for SYSMAN user:  
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.2/SHAIKPROD

Local hostname ................ collabn2.shaiksameer

Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.2/SHAIKPROD

Listener port number ................ 1621

Database SID ................ PROD2

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications ...............


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

Do you wish to continue? [yes(Y)/no(N)]: y
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_2015_08_06_20_47_52.log.
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_repos_create_<date>.log for more details.


INFO: Creating the EM repository (this may take a while) ...
Aug 6, 2015 9:03:26 PM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: ORA-00955: name is already used by an existing object

[oracle@collabn2 PROD2]$ vi /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_repos_create_2015_08_06_21_02_30.log

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-00955: name is already used by an existing object

No errors.
CREATE PUBLIC SYNONYM MGMT_AVAILABILITY FOR MGMT_AVAILABILITY
                     *
ERROR at line 1:
ORA-00955: name is already used by an existing object




[oracle@collabn2 ~]$  emca -deconfig dbcontrol db

STARTED EMCA at Aug 6, 2015 9:19:09 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: PROD2

Do you wish to continue? [yes(Y)/no(N)]: Y
Aug 6, 2015 9:19:13 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_2015_08_06_21_19_09.log.
Aug 6, 2015 9:19:13 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 6, 2015 9:19:13 PM


Fix:-


Logon SQLPLUS as user SYSMAN
SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'MGMT_NOTIFY_QTABLE',force
=>TRUE);

Drop the DB Control Repository Objects
Logon 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> 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;
/
SQL> DROP USER mgmt_view CASCADE;
SQL> DROP ROLE mgmt_user;
SQL> DROP USER sysman CASCADE;
SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;

Finally:-


[oracle@collabn2 ~]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Aug 6, 2015 10:05:25 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: PROD2
Listener port number: 1621
Password for SYS user:  
Password for SYSMAN user:  

Do you wish to continue? [yes(Y)/no(N)]: y
Aug 6, 2015 10:05:35 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_2015_08_06_22_05_24.log.
Aug 6, 2015 10:05:35 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Aug 6, 2015 10:05:35 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 6, 2015 10:06:18 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 6, 2015 10:06:18 PM


[oracle@collabn2 ~]$ emca -config dbcontrol db -repos recreate

STARTED EMCA at Aug 6, 2015 10:06:53 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: PROD2
Listener port number: 1621
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0.2/SHAIKPROD ]:
Password for SYS user:  
Password for DBSNMP user:  
Password for SYSMAN user:  
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.2/SHAIKPROD

Local hostname ................ collabn2.shaiksameer
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.2/SHAIKPROD
Listener port number ................ 1621
Database SID ................ PROD2
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 6, 2015 10:07:07 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_2015_08_06_22_06_53.log.
Aug 6, 2015 10:07:07 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 6, 2015 10:07:08 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Aug 6, 2015 10:07:08 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 6, 2015 10:10:11 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Aug 6, 2015 10:10:12 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Aug 6, 2015 10:10:39 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Aug 6, 2015 10:10:41 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Aug 6, 2015 10:10:41 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Aug 6, 2015 10:10:56 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Aug 6, 2015 10:10:56 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Aug 6, 2015 10:11:21 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Aug 6, 2015 10:11:21 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 6, 2015 10:11:50 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Aug 6, 2015 10:11:50 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://collabn2.shaiksameer:5501/em <<<<<<<<<<<
Aug 6, 2015 10:11:52 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0.2/SHAIKPROD/collabn2_PROD2/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 6, 2015 10:11:52 PM

No comments: