一直使用sqlplus来管理数据库,最近尝试了一下EM,感觉还是比较好用的。
----卸载
oracle@primary ebank]$ emca -deconfig dbcontrol db
STARTED EMCA at Jul 1, 2010 7:24:42 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: ebank
Do you wish to continue? [yes(Y)/no(N)]: y
Jul 1, 2010 7:24:45 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /home/db/oracle/product/10.2.0/cfgtoollogs/emca/ebank/emca_2010-07-01_07-24-42-AM.log.
Jul 1, 2010 7:24:46 AM 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 Jul 1, 2010 7:24:46 AM
----重建
[oracle@primary ebank]$ emca -config dbcontrol db -repos recreate
STARTED EMCA at Jul 1, 2010 7:24:54 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: ebank
Listener port number: 1521
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 ................ /home/db/oracle/product/10.2.0
Database hostname ................ primary
Listener port number ................ 1521
Database SID ................ ebank
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jul 1, 2010 7:25:13 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /home/db/oracle/product/10.2.0/cfgtoollogs/emca/ebank/emca_2010-07-01_07-24-54-AM.log.
Jul 1, 2010 7:25:15 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Jul 1, 2010 7:25:17 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Jul 1, 2010 7:25:17 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jul 1, 2010 7:28:02 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jul 1, 2010 7:28:17 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jul 1, 2010 7:29:51 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jul 1, 2010 7:29:51 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jul 1, 2010 7:31:34 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jul 1, 2010 7:31:34 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://primary:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
----查看状态
[oracle@primary bdump]$ emctl status agent
TZ set to US/Eastern
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 10.1.0.6.0
OMS Version : 10.1.0.6.0
Protocol Version : 10.1.0.2.0
Agent Home : /home/db/oracle/product/10.2.0/primary_ebank
Agent binaries : /home/db/oracle/product/10.2.0
Agent Process ID : 8766
Parent Process ID : 7325
Agent URL : https://primary:3938/emd/main
Started at : 2010-07-01 07:31:32
Started by user : oracle
Last Reload : 2010-07-01 07:31:32
Last successful upload : 2010-07-01 07:34:24
Total Megabytes of XML files uploaded so far : 4.20
Number of XML files pending upload : 0
Size of XML files pending upload(MB) : 0.00
Available disk space on upload filesystem : 10.52%
---------------------------------------------------------------
Agent is Running and Ready
----查看使用了哪个端口
[oracle@primary ~]$ cat $ORACLE_HOME/install/portlist.ini
Enterprise Manager Console HTTP Port (ebank) = 1158
Enterprise Manager Agent Port (ebank) = 3938
----启动服务
[oracle@primary ~]$ emctl start dbconsole
TZ set to US/Eastern
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
https://primary:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ................... started.
------------------------------------------------------------------
Logs are generated in directory /home/db/oracle/product/10.2.0/primary_ebank/sysman/log
----停止服务
[oracle@primary ~]$ emctl stop dbconsole
TZ set to US/Eastern
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
https://primary:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10972173/viewspace-666907/ ,如需转载,请注明出处,否则将追究法律责任。