EM資料庫重建 手動刪除資料庫
由於原來的資料庫已經被刪除,再重做oem時需要用到監聽,此時直接重做報如下錯誤:
[oracle@localhost ~]$ emca -repos recreate
Jul 30, 2014 7:15:53 PM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Jul 30, 2014 7:15:54 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/10.2.0/db_1/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl_asm))) -repos_user SYSMAN -action drop -verbose -output_file /u01/app/oracle/10.2.0/db_1/cfgtoollogs/emca/orcl_asm/emca_repos_drop_2014-07-30_07-15-53-PM.log
提示找不到監聽,可是監聽確實存在
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-JUL-2014 19:40:45
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.37.44.111)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 30-JUL-2014 19:15:14
Uptime 0 days 0 hr. 25 min. 31 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.37.44.111)(PORT=1521)))
Services Summary...
Service "orclasm" has 1 instance(s).
Instance "orclasm", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
索性直接建立新的oem
[oracle@localhost ~]$ emca -repos create
STARTED EMCA at Jul 30, 2014 7:22:28 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: orclasm
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
Jul 30, 2014 7:22:37 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/10.2.0/db_1/cfgtoollogs/emca/orcl_asm/emca_2014-07-30_07-22-28-PM.log.
Jul 30, 2014 7:22:37 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jul 30, 2014 7:22:37 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Jul 30, 2014 7:22:37 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/10.2.0/db_1/cfgtoollogs/emca/orcl_asm/emca_repos_create_
Jul 30, 2014 7:22:37 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/10.2.0/db_1/cfgtoollogs/emca/orcl_asm/emca_2014-07-30_07-22-28-PM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/10.2.0/db_1/cfgtoollogs/emca/orcl_asm/emca_2014-07-30_07-22-28-PM.log for more details.
CONFIG: ORA-20001: SYSMAN already exists..
ORA-06512: at line 17
觀察生成的日誌發現sysman使用者已經存在,這是由於用老的em資料庫配置資料庫導致的,刪除該使用者
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-20001: SYSMAN already exists..
ORA-06512: at line 17
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1467)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:841)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:265)
再次執行仍然報錯,還沒完了。。。
CONFIG: ORA-01921: role name 'MGMT_USER' conflicts with another user or role name
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-01921: role name 'MGMT_USER' conflicts with another user or role name
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1467)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:841)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:265)
登入資料庫,這下徹底刪除與em有關的使用者資訊
select grantee, granted_role from dba_role_privs where granted_role = 'MGMT_USER';
drop role mgmt_user;
drop user sysman cascade;
drop user mgmt_view cascade;
SET HEADING OFF;
spool a.sql
SELECT 'DROP PUBLIC SYNONYM ' || SYNONYM_NAME || ';'
FROM ALL_SYNONYMS
WHERE OWNER = 'PUBLIC' AND TABLE_OWNER ='SYSMAN';
spool off
SET HEADING ON;
@a.sql
再次建立資料庫就行了
Jul 30, 2014 7:32:06 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/10.2.0/db_1/cfgtoollogs/emca/orcl_asm/emca_2014-07-30_07-31-53-PM.log.
Jul 30, 2014 7:32:06 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jul 30, 2014 7:39:28 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8494287/viewspace-1349495/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 手動刪除資料庫資料庫
- oracle手動刪除資料庫Oracle資料庫
- 手動刪除oracle資料庫Oracle資料庫
- 已為資料庫映象啟動資料庫,必須刪除資料庫映象才能刪除該資料庫資料庫
- indexedDB 刪除資料庫Index資料庫
- 【RAC】刪除RAC資料庫節點(一)——刪除資料庫例項資料庫
- Laravel 資料庫裡的資料刪除Laravel資料庫
- 批量刪除Oracle資料庫的資料Oracle資料庫
- 2.11 刪除資料庫資料庫
- 如何刪除oracle資料庫Oracle資料庫
- 刪除資料庫指令碼資料庫指令碼
- 手工刪除oracle資料庫Oracle資料庫
- MongoDB資料庫中更新與刪除資料MongoDB資料庫
- 刪除sql server資料庫中所有資料SQLServer資料庫
- redo log全部刪除後,啟動資料庫資料庫
- [MYSQL] 資料庫建立與刪除MySql資料庫
- 刪除資料庫表空間資料庫
- dbca無法刪除資料庫資料庫
- MongoDB 資料庫建立刪除、表(集合)建立刪除、資料增刪改查MongoDB資料庫
- 資料庫收縮,刪除日誌,自動收縮,資料庫分離附加資料庫
- 前幾天手工刪除測試資料庫並重建的指令碼資料庫指令碼
- 【RAC】刪除RAC資料庫節點(四)——刪除資料庫軟體及ASM軟體資料庫ASM
- SQL2K資料庫開發四之刪除資料庫SQL資料庫
- 手動建立資料庫資料庫
- windows下Oracle資料庫完全刪除WindowsOracle資料庫
- indexedDB 刪除物件倉庫所有資料Index物件
- PostgreSQL:資料庫的建立與刪除SQL資料庫
- Oracle資料庫使用者刪除Oracle資料庫
- 如何刪除資料庫使用者?資料庫
- oracle資料庫備份刪除操作Oracle資料庫
- Oracle批量建立、刪除資料庫表Oracle資料庫
- 多例項資料庫刪除例項資料庫
- 小程式批次刪除雲資料庫裡的資料資料庫
- 【RAC】刪除RAC資料庫節點(二)——刪除ASM資料庫ASM
- 【RAC】刪除RAC資料庫節點(五)——刪除ONS資料庫
- 手工建立資料庫及刪除資料庫示例--附建庫時alert日誌資料庫
- [Oracle]Oracle資料庫資料被修改或者刪除恢復資料Oracle資料庫
- Code First 遷移更新資料庫 無需刪除當前資料庫資料庫