0

0

Oracle OEM 重建

php中文网

php中文网

发布时间:2016-06-07 17:05:28

|

1642人浏览过

|

来源于php中文网

原创

于是重新装了个系统,刚装好ORACLE数据库,又把OEM搞坏了,因为是Ghost的系统,觉得计算机名不好,于是换了个,之后OEM就挂了。从

这两天首先是把操作系统搞挂了,于是重新装了个系统,刚装好Oracle数据库,又把OEM搞坏了,因为是Ghost的系统,觉得计算机名不好,于是换了个,之后OEM就挂了。从网上了大半天也没搞定. 最终还是在oracle的metelink上找到了答案,20分钟就把OEM修好了。总结如下: ­

OEM重建出现的问题(很多类似的,浪费了N多时间): ­

2009-4-10 3:38:49 oracle.sysman.emcp.EMReposConfig createRepository ­

配置: ORA-01920:用户名'MGMT_VIEW'与另外一个用户名或角色名发生冲突 ­

ORA-06512:在line 40 ­

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-01920:用户名'MGMT_VIEW'与另外一个用户名或角色名发生冲突 ­

ORA-06512:在line 40 ­

­

2009-4-10 3:03:10 oracle.sysman.emcp.EMReposConfig unlockAccounts ­

配置: ORA-06550:第1行,第62列: ­

PLS-00201:必须声明标识符'SYSMAN.MGMT_VIEW_PRIV' ­

ORA-06550:第1行,第62列: ­

PL/SQL: Statement ignored ­

­

­

OEM常用的命令,及实例步骤. ­

创建一个EM资料库 ­

emca -repos create ­

重建一个EM资料库 ­

emca -repos recreate ­

删除一个EM资料库 ­

emca -repos drop ­

配置数据库的Database Control ­

emca -config dbcontrol db ­

删除数据库的Database Control配置 ­

emca -deconfig dbcontrol db ­

重新配置db control的端口,默认端口在1158 ­

emca -reconfig ports ­

emca -reconfig ports -dbcontrol_http_port 1160 ­

emca -reconfig ports -agent_port 3940 ­

先设置ORACLE_SID环境变量后,启动EM console服务 ­

emctl start dbconsole ­

先设置ORACLE_SID环境变量后,停止EM console服务 ­

emctl stop dbconsole ­

先设置ORACLE_SID环境变量后,查看EM console服务的状态 ­

emctl status dbconsole ­

配置dbconsole的步骤 ­

emca -repos create ­

emca -config dbcontrol db ­

emctl start dbconsole ­

重新配置dbconsole的步骤 ­

emca -repos drop ­

emca -repos create ­

emca -config dbcontrol db ­

emctl start dbconsole ­

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

手工重新配置dbconsole的步骤
1,修改DBSNMP密码:
重新配置DBCONSOLE,需要输入DBSNMP密码,但任何密码都会显示错误,需要预先修改。
sql>alter user dbsnmp identified by xxx;
2,删除早期DBCONSOLE创建的用户:
sql>drop role MGMT_USER;
sql>drop user MGMT_VIEW cascade;
sql>drop user sysman cascade;
3,,删除早期DBCONSOLE创建的对象:
sql>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
sql>drop public synonym SETEMVIEWUSERCONTEXT;
4,重新创建DBCONSOLE:(如果是在windows下,要先到注册表删除DBCONSOLE的服务,重启电脑)
$emca -config dbcontrol db -repos create
根据提示,先输入SID,再输入Y继续;
输入端口1521,输入SYS密码,输入DBSNMP密码,输入SYSMAN 密码,输入Y继续
完成。

-----------------------­

 

FROM METALINK ­

422729.1 How to change the Hostname when Oracle10Gand ASM being useds ­

­

­

[url=https://metalink2.oracle.com/help/usaeng/Search/search.html#file:  422729.1]https://metalink2.oracle.com/help/usaeng/Search/search.html#file:  422729.1[/url]            Type:   HOWTO   ­

Modified Date : 13-NOV-2008           Status:MODERATED ­

 

­Applies to:

Oracle Server - Enterprise Edition - Version: 10.1 to 10.2 ­

 

Information in this document applies to any platform.Goal ­

­

How to change the Hostname of the Windows when the10Gwith ASM being used ­

Solution ­

When changing the Hostname, 4 files would be affected. ­

1) Tnsnames.ora ­

2) listener.ora ­

3) Oraclecsservice ­

4) Enterprise Manager ­

­

** Note: AfterChanging the HostnameandBefore Starting the Services,please check the below ** ­

­

1) Tnsnames.oraandListener.ora ­

­

** If theIpaddress is refered in these files,then there willnotbeany problem,elseyouneedtochangetheHostnamein theTnsnamesof theClientsconnecting to the server and theListeneron theServer ­

Tnsnames: ­

(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) -- Tnsnames ­

Listener: ­

LISTENER = ­

(DESCRIPTION_LIST = ­

(DESCRIPTION = ­

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ­

(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) >>>> in ­

Listener ­

) ­

) ­

Oraclecsservice ­

­

TheHostnamewill behard-codedin theCSService, so we need toRecreatethe Service ­

Steps to Recreate the CSService ­

Goto Oracle_Home/bin ­

­

Directory of L:/oracle/product/10.2.0/db10g/BIN ­

L:/oracle/product/10.2.0/db10g/BIN>localconfig delete ­

Step 1: stopping local CSS stack ­

Step 2: deleting OCR repository ­

successfully deleted local CSS setup ­

­

L:/oracle/product/10.2.0/db10g/BIN>localconfig add ­

Step 1: creating new OCR repository ­

Successfully accumulated necessary OCR keys. ­

Creating OCR keys for user '********', privgrp ''.. ­

Operation successful. ­

Step 2: creating new CSS service ­

successfully created local CSS service ­

successfully added CSS to home ­

­

EM ­

­

If theHostnameis changed, then theEM Dbcontrol repositoryhas to berecreated. For this follow the below Note ­

https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=278100.1&blackframe=1How To Drop, Create And Recreate DB Control In A10gDatabase ­

­

­

References ­

[url=https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=278100.1&blackframe=1]https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=278100.1&blackframe=1[/url]- How To Drop, Create And Recreate DB Control In A10gDatabases ­

­

­

­

Subject: ­

­

How To Drop, Create And Recreate DB Control In A10gDatabase ­

[url=https://metalink2.oracle.com/help/usaeng/Search/search.html#file:278100.1]https://metalink2.oracle.com/help/usaeng/Search/search.html#file:278100.1[/url] ­

Type:BULLETIN  Modified Date : 08-SEP-2008  Status: PUBLISHED ­

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 single10gDatabase. ­

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: ­

https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=395162.1&blackframe=1How to manage DB Control 10.2 for RAC Database with emca ­

How To Drop, Create And Recreate DB Control In A10gDatabase ­

­

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: ­

Pliny
Pliny

创建、分享和重新组合AI应用程序

下载

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 both10gR1 and R2 run: ­

/sysman/admin/emdrep/bin/RepManager -action drop ­

Warning: this command puts the database in Quiesce Mode. ­

Please consult thehttps://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=375946.1&blackframe=1Running 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 ManuallyStep 1: Drop AQ related objects in the SYSMAN schema ­

Logon SQLPLUS as user SYSMAN ­

SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'MGMT_NOTIFY_QTABLE',force =>TRUE); ­

­

Step 2: 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 INc1 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; ­

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; ­

­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: ­

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

­

 

/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/[B]emca -deconfig dbcontrol db -repos drop

­

Warning: this command puts the database in Quiesce Mode. ­

Please consult thehttps://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=375946.1&blackframe=1Running 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 -r ­

For 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/emca ­

For 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 thehttps://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=375946.1&blackframe=1Running 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/[B]emca -config dbcontrol db -repos recreate

­

Warning: this command puts the database in Quiesce Mode. ­

Please consult thehttps://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=375946.1&blackframe=1Running 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 Manager10gAdvanced Configuration Guide or seehttps://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=330130.1&blackframe=1Overview Of The EMCA Commands Available for DB Control 10.2References ­

­

https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=375946.1&blackframe=1- Problem: Running EMCA Results in Database quiesce And No New Connections or Operations Can Be Performed During the DB Control Repository Creation ­

https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=395162.1&blackframe=1- How to manage DB Control 10.2 for RAC Database with emca ­

https://metalink2.oracle.com/metalink/plsql/showdoc?db=NOT&id=456437.1&blackframe=1- Ora-24005 Error Trying To Drop User Sysman Cascade ­

­

附: ­

Note that this command puts the database in Quiesce Mode.Please consult the Note 375946.1­

Applies to: Enterprise Manager Grid Control - Version: 10.2.0.1 to 11.1.0.7­

This problem can occur on any platform.­

SymptomsWhen running 'emca -config dbcontrol db -repos recreate' or 'emca -deconfig dbcontrol db -repos drop' to recreate or drop the Enterprise Manager Database Control configuration files and repository the operation hangs and at the same time users are not able to login to the database. CauseThe emca command, when recreating or dropping the repository, requires the database to be quiesced.  This means that, temporarily, no operations are possible on the database and new users cannot login.­

­

If there are active sessions on the database at the time the quiesce operation will hang pending their completion, during which time no new users will be able to connect.­

Therefore it is important to understand that running these commands may/will cause the database to be unavailable during the time that the repository is being dropped and should not be run on a production database unless you are fully aware of the possible impact to database availability and have planned for this eventuality­

SolutionTo implement the solution, please execute the following steps:­

­

1. Kill the emca command­

2. Connect to the database with SYS account through SQL*Plus­

     SQL > alter system unquiesce;­

­

Run the emca command at a time when there is low system usage.­

For additional information on emca, please consult:­

Enterprise Manager Advanced Configuration ­

Topic 1.2.6 Configuring Database Control During and After the Oracle Database 10g Installation­

Available on OTN at:­

­

linux

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
pixiv网页版官网登录与阅读指南_pixiv官网直达入口与在线访问方法
pixiv网页版官网登录与阅读指南_pixiv官网直达入口与在线访问方法

本专题系统整理pixiv网页版官网入口及登录访问方式,涵盖官网登录页面直达路径、在线阅读入口及快速进入方法说明,帮助用户高效找到pixiv官方网站,实现便捷、安全的网页端浏览与账号登录体验。

705

2026.02.13

微博网页版主页入口与登录指南_官方网页端快速访问方法
微博网页版主页入口与登录指南_官方网页端快速访问方法

本专题系统整理微博网页版官方入口及网页端登录方式,涵盖首页直达地址、账号登录流程与常见访问问题说明,帮助用户快速找到微博官网主页,实现便捷、安全的网页端登录与内容浏览体验。

233

2026.02.13

Flutter跨平台开发与状态管理实战
Flutter跨平台开发与状态管理实战

本专题围绕Flutter框架展开,系统讲解跨平台UI构建原理与状态管理方案。内容涵盖Widget生命周期、路由管理、Provider与Bloc状态管理模式、网络请求封装及性能优化技巧。通过实战项目演示,帮助开发者构建流畅、可维护的跨平台移动应用。

117

2026.02.13

TypeScript工程化开发与Vite构建优化实践
TypeScript工程化开发与Vite构建优化实践

本专题面向前端开发者,深入讲解 TypeScript 类型系统与大型项目结构设计方法,并结合 Vite 构建工具优化前端工程化流程。内容包括模块化设计、类型声明管理、代码分割、热更新原理以及构建性能调优。通过完整项目示例,帮助开发者提升代码可维护性与开发效率。

22

2026.02.13

Redis高可用架构与分布式缓存实战
Redis高可用架构与分布式缓存实战

本专题围绕 Redis 在高并发系统中的应用展开,系统讲解主从复制、哨兵机制、Cluster 集群模式及数据分片原理。内容涵盖缓存穿透与雪崩解决方案、分布式锁实现、热点数据优化及持久化策略。通过真实业务场景演示,帮助开发者构建高可用、可扩展的分布式缓存系统。

61

2026.02.13

c语言 数据类型
c语言 数据类型

本专题整合了c语言数据类型相关内容,阅读专题下面的文章了解更多详细内容。

30

2026.02.12

雨课堂网页版登录入口与使用指南_官方在线教学平台访问方法
雨课堂网页版登录入口与使用指南_官方在线教学平台访问方法

本专题系统整理雨课堂网页版官方入口及在线登录方式,涵盖账号登录流程、官方直连入口及平台访问方法说明,帮助师生用户快速进入雨课堂在线教学平台,实现便捷、高效的课程学习与教学管理体验。

15

2026.02.12

豆包AI网页版入口与智能创作指南_官方在线写作与图片生成使用方法
豆包AI网页版入口与智能创作指南_官方在线写作与图片生成使用方法

本专题汇总豆包AI官方网页版入口及在线使用方式,涵盖智能写作工具、图片生成体验入口和官网登录方法,帮助用户快速直达豆包AI平台,高效完成文本创作与AI生图任务,实现便捷智能创作体验。

669

2026.02.12

PostgreSQL性能优化与索引调优实战
PostgreSQL性能优化与索引调优实战

本专题面向后端开发与数据库工程师,深入讲解 PostgreSQL 查询优化原理与索引机制。内容包括执行计划分析、常见索引类型对比、慢查询优化策略、事务隔离级别以及高并发场景下的性能调优技巧。通过实战案例解析,帮助开发者提升数据库响应速度与系统稳定性。

58

2026.02.12

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
最新Python教程 从入门到精通
最新Python教程 从入门到精通

共4课时 | 22.4万人学习

Node.js 教程
Node.js 教程

共57课时 | 11.7万人学习

CSS3 教程
CSS3 教程

共18课时 | 5.8万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号