ORACLE EM重建

前端之家收集整理的这篇文章主要介绍了ORACLE EM重建前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

推荐通过emca的帮助文档指导您的操作

1、移除已有配置

emca -deconfig dbcontrol db [-repos drop] [-cluster] [-silent] [parameters]: de-configure Database Control

输入以下信息:
数据库 SID: 输入您的数据sid,例如orcl

是否继续? [是(Y)/否(N)]: y

2、删除仓库repository

emca -repos drop: drop the current Database Control repository

提示您输入以下信息:
数据库 SID: @H_301_20@输入您的数据sid,例如orcl
监听程序端口号: 输入数据库的监听器端口,例如1521,如果您变更过数据库的监听器端口,这里必须修改
SYS 用户的口令:@H_301_20@口令必须正确,可以使用“alter user 用户名 identified by 密码”分别为每个账户设置统一的密码
SYSMAN 用户的口令:@H_301_20@口令必须正确,可以使用“alter user 用户名 identified by 密码”分别为每个账户设置统一的密码

是否继续? [是(Y)/否(N)]: y

3、创建仓库

emca -repos create: create a new Database Control repository

@H_301_20@提示您输入以下信息:
数据库 SID: @H_301_20@输入您的数据sid,例如orcl
监听程序端口号: @H_301_20@输入数据库的监听器端口,如果您变更过数据库的监听器端口,这里必须修改
SYS 用户的口令:
SYSMAN 用户的口令:@H_301_20@口令必须正确,可以使用“alter user 用户名 identified by 密码”分别为每个账户设置统一的密码
是否继续? [是(Y)/否(N)]: y

4、重新创建数据库em配置信息

emca -config dbcontrol db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure Database Control for a database

@H_301_20@提示您输入以下信息:
数据库 SID:@H_301_20@输入您的数据sid,例如orcl
监听程序端口号:@H_301_20@输入数据库的监听器端口,如果您变更过数据库的监听器端口,这里必须修改
监听程序 ORACLE_HOME [ /opt/oracle/or11g2\product\11.2.0\dbhome_1 ]:确认可以直接回车
SYS 用户的口令:口令必须正确,可以使用“alter user 用户名 identified by 密码”分别为每个账户设置统一的密码
DBSNMP 用户的口令:@H_301_20@口令必须正确,可以使用“alter user 用户名 identified by 密码”分别为每个账户设置统一的密码
通知的电子邮件地址 (可选):
通知的发件 (SMTP) 服务器 (可选):


以上第4步完成后,会自动启动em console

5、查看em状态

emctl status dbconsole

输出如下:

Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996,2009 Oracle Corporation. All rights reserved.
https://主机名:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /opt/oracle/11gr2/test/sysman/log

6、使用emctl管理em console

启动和停止操作:

emctl start | stop dbconsole

其它操作:

emctl status | secure | setpasswd dbconsole
emctl config dbconsole -heap_size <size_value> -max_perm_size <size_value>
emctl status agent
emctl status agent -secure [-omsurl <http://<oms-hostname>:<oms-unsecure-port>/em/*>]
emctl getversion
emctl reload | upload | clearstate | getversion agent
emctl reload agent dynamicproperties [<Target_name>:<Target_Type>]....
emctl config agent <options>
emctl config agent updateTZ
emctl config agent getTZ
emctl resetTZ agent
emctl config agent credentials [<Target_name>[:<Target_Type>]]
emctl gensudoprops
emctl clearsudoprops
Blackout Usage :
emctl start blackout <Blackoutname> [-nodeLevel] [<Target_name>[:<Target_Type>]].... [-d <Duration>]
emctl stop blackout <Blackoutname>
emctl status blackout [<Target_name>[:<Target_Type>]]....


The following are valid options for blackouts
<Target_name:Target_type> defaults to local node target if not specified.
If -nodeLevel is specified after <Blackoutname>,the blackout will be applied to all targets and any target list that follows will be ignored.
Duration is specified in [days] hh:mm


emctl getemhome
emctl ilint
Em Key Commands Usage :
emctl config emkey -emkeyfile <emkey.ora path> [-force] [-sysman_pwd <sysman password>]
emctl config emkey -emkey [-emkeyfile <emkey.ora path>] [-force] [-sysman_pwd <sysman password>]
emctl config emkey -repos [-emkeyfile <emkey.ora path>] [-force] [-sysman_pwd <sysman password>]
emctl config emkey -remove_from_repos [-sysman_pwd <sysman password>]
emctl config emkey -copy_to_repos [-sysman_pwd <sysman password>]
emctl status emkey [-sysman_pwd <sysman password>]


Secure DBConsole Usage :
emctl secure dbconsole -sysman_pwd <sysman password> [-passwd_file <abs file loc>]
[-host <slb hostname>] [-sid <service name>] [-reset] [-secure_port <secure_port>]
[-root_dc <root_dc>] [-root_country <root_country>] [-root_state <root_state>] [-root_loc <root_loc>]
[-root_org <root_org>] [-root_unit <root_unit>] [-root_email <root_email>]
[-wallet <wallet loc>] [-wallet_pwd <wallet pwd>] [-trust_certs_loc <certs loc>]
emctl secure status dbconsole
Register Targettype Usage :
emctl register oms targettype [-o <Output filename>] <XML filename> <rep user> <rep passwd> <rep host> <rep port> <rep sid> OR
emctl register oms targettype [-o <Output filename>] <XML filename> <rep user> <rep passwd> <rep connect descriptor>


7、修改em的默认端口为其它端口(安全需要)

emca -reconfig ports -DBCONTROL_HTTP_PORT 1190


以上1190为新的端口号,修改成功后可以使用emctl status dbconsole再次查看状态


8、其它:

根据需要采用静默模式删除一个已经存在的数据库(危险操作,请勿模仿)。

8.1、删除切记做到数据备份

8.2、执行命令

dbca -silent -deleteDatabase -sourceDB 数据库名 -sid 数据库实例名 -sysDBAUserName DBA用户名 -sysDBAPassword DBA用户密码

来看看dbca -help的说明:

Delete a database by specifying the following parameters:
-deleteDatabase
-sourceDB <source database sid>
[-sysDBAUserName <user name with SYSDBA privileges>
-sysDBAPassword <password for sysDBAUserName user name>]


最后附上:上述危险动作请勿模仿。

猜你在找的Oracle相关文章