首页 > 其他分享 >使用emca命令行配置EM并通过浏览器访问EM示例

使用emca命令行配置EM并通过浏览器访问EM示例

时间:2023-07-24 21:05:53浏览次数:33  
标签:EM 14 示例 emca oracle Nov bys3 2013


EM是Oracle Enterprise Manager简称,本文涉及操作及命令:
配置EM-创建删除重建:    emca -config dbcontrol db -repos recreate|drop|create
启动、关闭、查看EM状态     emctl start|stop|status dbconsole
环境:OEL5.7,ORACLE 11.2.0.4,VBOX虚拟机
配置EM前检查事项:1.确定监听已经启动并正常运行,2.检查主机名 3.检查主机名与IP对应已经写入/etc/hosts,4.密码文件进行确认无误,5.检查EM需要用到的三个用户:SYS DBSNMP,SYSMAN的密码以及是否能登陆,6.可以提前将 $ORACLE_HOSTNAME变量(与主机名一致即可)写入.bash_profile.这个参数不写有时也可以,保险起见还是写上吧。7.可使用SYS用户通过服务名登陆数据库测试一下。

1.环境检查步骤-检查结果类似以下即可:

[oracle@bys3 admin]$
 lsnrctl status   
 监听状态正常
 LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-NOV-2013 22:34:50

 Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bys3.bys.com)(PORT=1521)))

 STATUS of the LISTENER

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

 Alias                     LISTENER

 Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

 Start Date                15-NOV-2013 12:26:43

 Uptime                    1 days 10 hr. 8 min. 6 sec

 Trace Level               off

 Security                  ON: Local OS Authentication

 SNMP                      OFF

 Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

 Listener Log File         /u01/diag/tnslsnr/bys3/listener/alert/log.xml

 Listening Endpoints Summary...

   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bys3.bys.com)(PORT=1521)))

   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

 Services Summary...

Service "bys3" has 1 instance(s).

  
 Instance "bys3", status READY, has 1 handler(s) for this service...

 The command completed successfully

 [oracle@bys3 admin]$ 
cat /etc/hosts  
 IP与主机名对应无误
 # Do not remove the following line, or various programs

 # that require network functionality will fail.

127.0.0.1               bys3.bys.com bys3

 ::1             localhost6.localdomain6 localhost6

192.168.1.211   bys3.bys.com

查看已经注册的信息:select comp_name from dba_registry;
 [oracle@bys3 dbhome_1]$ cd network/admin/

 [oracle@bys3 admin]
$ ls

listener.ora  samples  shrept.lst  tnsnames.ora

 [oracle@bys3 admin]$ 
pwd

/u01/app/oracle/product/11.2.0/dbhome_1/network/admin

 [oracle@bys3 admin]$ 
cat tnsnames.ora   

 bys3 =

   (DESCRIPTION =

     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.211)(PORT = 1521))

     (CONNECT_DATA =

       (SERVER = DEDICATED)

       (SERVICE_NAME = bys3)

     )

   )

 [oracle@bys3 dbs]$ 
pwd

/u01/app/oracle/product/11.2.0/dbhome_1/dbs

 [oracle@bys3 dbs]$ ls ora*   
密码文件格式正常
orapwbys3

 [oracle@bys3 admin]$ 
sqlplus sys/oraclesys@bys3 as sysdba  
使用服务名可以正常登陆--可验证密码是否正确、监听、TNSNAMES.ORA是否正常
 SQL*Plus: Release 11.2.0.4.0 Production on Sat Nov 16 22:38:17 2013

 Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 Connected to:

 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production

 With the Partitioning, OLAP, Data Mining and Real Application Testing options

 SYS@ bys3>
conn bys/bys@bys3

 Connected.

 BYS@ bys3>exit

 [oracle@bys3 ~]$ 
cat .bash_profile   --增加ORACLE_HOSTNAME环境变量,只截取两条

 ORACLE_HOSTNAME=bys3.bys.com

 export ORACLE_HOSTNAME

 [oracle@bys3 ~]$ hostname

 bys3.bys.com

 [oracle@bys3 ~]$ 
echo $ORACLE_HOSTNAME

bys3.bys.com

 BYS@ bys3>select username,account_status from dba_users;

 USERNAME                       ACCOUNT_STATUS

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

 BYS                            OPEN

 MGMT_VIEW                      OPEN

 SYS                            OPEN

 SYSTEM                         OPEN

 DBSNMP                         OPEN

 SYSMAN                         OPEN

 OUTLN                          EXPIRED & LOCKED

 DIP                            EXPIRED & LOCKED

 ORACLE_OCM                     EXPIRED & LOCKED

 APPQOSSYS                      EXPIRED & LOCKED

 10 rows selected.

 BYS@ bys3>
conn dbsnmp/oraclesys    --测试下用户的密码是否正确用户是否已经解锁。

 Connected.

 DBSNMP@ bys3>conn system/oraclesys

 Connected.

 SYSTEM@ bys3>
conn sysman/oraclesys     --测试下用户的密码是否正确用户是否已经解锁。

 Connected.

 ##########################################################################

2.通过emca来配置EM的相关参数
开始执行重建EM操作:
 [oracle@bys3 ~]$ emca -config dbcontrol db -repos recreate    recreate 关键字。 STARTED EMCA at Nov 14, 2013 4:25:58 PM

 EM Configuration Assistant, Version 11.2.0.3.0 Production

 Copyright (c) 2003, 2011, Oracle.  All rights reserved.

 Enter the following information:

 Database SID: 
bys3        -
--实例名

 Listener port number: 
1521     ---监听运行的端口

 Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/dbhome_1 ]:       -
--这里是ORACLE_HOME的值,确认不误直接回车就行

 Password for SYS user:                                         
 ---SYS用户的密码

 Password for DBSNMP user:  

 Password for SYSMAN user:  

 Email address for notifications (optional):                  
  --EMAIL可以不填写,应该是用来发送报警信息的。

 Outgoing Mail (SMTP) server for notifications (optional): 

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

 You have specified the following settings

 Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1

 Local hostname ................ bys3.bys.com

 Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1

 Listener port number ................ 1521

 Database SID ................ bys3

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

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

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

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

 WARNING : While repository is dropped the database will be put in quiesce mode.

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

Do you wish to continue? [yes(Y)/no(N)]: y                          ---这里确认上面汇总信息无误后输入:Y,就开始配置了,需要几分钟时间。

 Nov 14, 2013 4:27:04 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /u01/cfgtoollogs/emca/bys3/emca_2013_11_14_16_25_58.log.  
EM创建时的日志位置
 Nov 14, 2013 4:27:06 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Dropping the EM repository (this may take a while) ...       删除EM
 Nov 14, 2013 4:27:09 PM oracle.sysman.emcp.EMReposConfig invoke

 INFO: Repository successfully dropped

 Nov 14, 2013 4:27:09 PM oracle.sysman.emcp.EMReposConfig createRepository

INFO: Creating the EM repository (this may take a while) ...   创建EM用时3分钟
 Nov 14, 2013 4:31:17 PM oracle.sysman.emcp.EMReposConfig invoke

 INFO: Repository successfully created

 Nov 14, 2013 4:31:24 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository

INFO: Uploading configuration data to EM repository (this may take a while) ...     更新注册信息吧,用时两分钟
 Nov 14, 2013 4:33:09 PM oracle.sysman.emcp.EMReposConfig invoke

 INFO: Uploaded configuration data successfully

 Nov 14, 2013 4:33:15 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

 INFO: Securing Database Control (this may take a while) ...

 Nov 14, 2013 4:33:56 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

 INFO: Database Control secured successfully.

 Nov 14, 2013 4:33:56 PM oracle.sysman.emcp.util.DBControlUtil startOMS

 INFO: Starting Database Control (this may take a while) ...

 Nov 14, 2013 4:35:19 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

 INFO: Database Control started successfully

 Nov 14, 2013 4:35:20 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

 INFO: >>>>>>>>>>> The Database Control URL is https://bys3.bys.com:1158/em <<<<<<<<<<<

 Nov 14, 2013 4:35:43 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/dbhome_1/bys3.bys.com_bys3/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost. 

 ***********************************************************

Enterprise Manager configuration completed successfully                  --可以看到这条语句,表明EM配置成功
 FINISHED EMCA at Nov 14, 2013 4:35:43 PM

 ##########################################################################

3.查看EM状态
 [oracle@bys3 ~]$ 
emctl status dbconsole

 Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 

 Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

 https://bys3.bys.com:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is not running.  

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

 Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/bys3.bys.com_bys3/sysman/log

4.启动EM
 启动EM成功后一般还需要以下两条设置就可以通过浏览器访问:
--通过浏览器访问EM截图见最后的图。

1.需要关闭相应防火墙,如通过域名访问则需要配置相应的条目。
 2.启动监听并确认实例已经注册进监听,因为EM是通过监听连接到实例的。--监听就不演示了,详细参考:

 [oracle@bys3 ~]$
 emctl status dbconsole

 Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 

 Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

 https://bys3.bys.com:1158/em/console/aboutApplication

 Oracle Enterprise Manager 11g is not running. 

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

 Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/bys3.bys.com_bys3/sysman/log

 [oracle@bys3 ~]$ emctl start dbconsole

 Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 

 Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

 https://bys3.bys.com:1158/em/console/aboutApplication

 Starting Oracle Enterprise Manager 11g Database Control ......... started. 

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

 Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/bys3.bys.com_bys3/sysman/log

5.停止EM
 [oracle@bys3 ~]$ 
emctl stop dbconsole

 Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 

 Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

 https://bys3.bys.com:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 11g Database Control ... ...  Stopped.

  

6.使用浏览器访问监听截图



标签:EM,14,示例,emca,oracle,Nov,bys3,2013
From: https://blog.51cto.com/u_1652968/6839172

相关文章

  • Creating a Unix Service for ActiveMQ
    BelowarestepstomakeActiveMQaLinuxDaemononRedHat4ES.It'sbasedonthisarticle.Alternatively,youcouldalsousetheJavaServiceWrapperimplementation,refertotheJavaServiceWrapperPageformoredetails.SettingsJAVA_HOME=/opt/j......
  • memcached完全剖析
    翻译一篇技术评论社的文章,是讲memcached的连载。fcicq同学说这个东西很有用,希望大家喜欢。发表日:2008/7/2作者:长野雅广(MasahiroNagano)原文链接:http://gihyo.jp/dev/feature/01/memcached/0001我是mixi株式会社开发部系统运营组的长野。日常负责程序的运营。从今天开始,将分几次......
  • 15个实用的Linux find命令示例
    译文出处:oschina-青崖白鹿。欢迎加入技术翻译小组。<!--divid="ad1"><scripttype="text/javascript">google_ad_client="ca-pub-7056282119617872";google_ad_slot="6645040531";google_ad_width=300;google_ad_height=250......
  • HAOI2011 Problem b
    Problemblink做法:莫比乌斯反演。思路:对于给出的\(n\)个询问,每次求有多少个数对\((x,y)\),满足\(a\lex\leb\),\(c\ley\led\),且\(\gcd(x,y)=k\),\(\gcd(x,y)\)函数为\(x\)和\(y\)的最大公约数。我们设\[\operatorname{f}(n)=\sum\limits_{i=1}^x\sum\limit......
  • React函数式组件渲染顺序探究(Demo)
    参考资料:React渲染顺序及useEffect执行顺序探究(含并发模式)codeimport{useEffect,useState}from"react";import{Button}from"antd";functionComponent({name,children}){const[state,setState]=useState(()=>{console.log(`C......
  • element-ui 周、月、季、年的日期时间选择器
    日常做项目中经常会遇到根据周、月、季度、年的日期时间选择器,切换不同的时间时选择器也做出相对应的变化,并且获取相对的开始时间和结束时间。效果如下:  1.先创建子组件--季度的日期选择器 1<template>2<divclass="time_quarter">3<markstyle="posi......
  • element table列表项展示省市区
    使用的省市区插件npminstallelement-china-area-data-S引用import{provinceAndCityData,regionData,provinceAndCityDataPlus,regionDataPlus,CodeToText,TextToCode}from'element-china-area-data'绑定formatter的方法<el-table-columnalign="center&qu......
  • 快速检测HTTP代理IP是否有效的方法及python代码示例
     1.使用在线代理检测工具:有许多免费的在线代理检测工具可用,如ProxyChecker、ProxyScrape等。只需将待检测的代理IP和端口输入工具中,点击开始检测,即可迅速获得代理的可用性和匿名性等信息。 2.使用命令行工具进行检测:在命令行中使用curl命令来测试代理的可用性。例如,输入命令"......
  • 封装RedisTemplate工具类
    packagecom.juxi.common.redis.service;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.data.redis.core.*;importorg.springframework.stereotype.Component;importjava.time.Duration;importjava.util.*;importja......
  • 通过docker安装的jira提示We've detected a potential problem with JIRA's Dashboard
    正常通过docker安装jira后,访问是不会出问题的但是如果使用nginx代理后,就是在nginx里配置了proxy_passhttp://localhost:2800再访问后,就会报错We'vedetectedapotentialproblemwithJIRA'sDashboardconfigurationthatyouradministratorcancorrect.Clickhereto......