• 转 11g Grid Control: Overview of the EMCTL Options Available for Managing the Agent


    1.概念:

    The Enterprise Manager DBConsole consists of the following components:

    - A Standalone OC4J Management Service (DBConsole OMS)      (server side )
    - A local Management Agent (EM agent)                                            (agent side )
    - A local Management Repository (also referred as DBConsole Repository)   (server side)

    作为分布式架构OEM,也就是一 server对多client 的架构, 

    server 端执行:

    emctl status oms

    agent 端执行:

    emctl status agent 

    做为一对一的架构,dbconsole 

    server/client 端执行:

    emctl status dbconsole 

    2.

    Please set the ORACLE_HOME to your Agent Home location using

    For Unix:
    export ORACLE_HOME=/oracle/product/agent11g

    For Windows:

    set ORACLE_HOME=C:oracleproductagent11g

    The emctlutility can be executed from the <AGENT_HOME>/bin directory.

    emctl.log file

    The emctl.log file is a file that captures the results of all emctl commands you run. The log file resides in the $ORACLE_HOME/sysman/log directory of the Management Agent, and is updated every time you run an emctl command. If your emctl command fails for some reason, access this log file to diagnose the issue.

    For more information On how to debug emctl.log file Please refer to Oracle Enterprise Manager Administration 11g Release 1 (11.1.0.1), Chapter 7 - Starting and Stopping Enterprise Manager Components, Topic: Using emctl.log File.

    Description of EMCTL Commands:

    CommandDescription
    emctl start agent Starts the Management Agent
    emctl stop agent Stops the Management Agent
    emctl status agent If the Management Agent is running, this command displays
    status information about the Management Agent, including the
    Agent Home, the process ID, and the time and date of the last successful upload to the Management Repository
    emctl upload (agent) Use this command to force an immediate upload of the current management data from the managed host to the Management Service.
    emctl clearstate Clears the state directory contents. The files that are located under $ORACLE_HOME/sysman/emd/state will be deleted if this command is run.
    emctl getemhome Prints the Agent home directory
    emctl config agent getLocalHost Prints the hostname where the Agent is running
    emctl pingOMS [agent] Pings the OMS to check if the agent is able to connect to the
    OMS. Agent will wait for the reverse ping from the OMS so that Agent can say the pingOMS is successful.
    emctl verifykey Verifies the communication between the OMS and agent by
    sending pingOMS.
    emctl reload agent Reloads the agent by reading the emd.properties and targets.xml files again.
    emctl status agent scheduler Lists all Running, Ready, and Scheduled Collection threads
    emctl status agent jobs Lists the status of the jobs that are running at present on the
    agent.
    emctl status agent target Lists the detailed status of the specified targets in the order of
    target name, target type

    Agent Secure Commands

    emctl status agent -secure Check if the Agent is secured in https mode.
    emctl secure agent agent_registration_pwd Configures the Agent to communication with the OMS in the HTTPS mode.
    emctl unsecure agent Unsecures the agent. This will make the agent unsecure and the Agent's port will be changed to http port.
    emctl secure setpwd [-sysman_pwd] [new registration pwd] To add a new Agent Registration Password

    Blackouts

     
    emctl start blackout <Blackoutname> [<Target_name>[:<Target_Type>]].... [-d <Duration>] [-nowait] Set an immediate blackout on a particular target or on list of targets.
    emctl stop blackout <Blackoutname> [-nowait] Stops an immediate blackout
    emctl start blackout [-nodeLevel] [-d ] Set an immediate blackout for all targets on a host
    emctl status blackout [<Target_name>[:<Target_Type>]] Check the status of a blackout

    Timezone commands

     
    emctl config agent getTZ Prints the current timezone of the agent.
    emctl resetTZ agent

    This command will correct the Management Agent side time zone and specify an additional command to be run against the Management Repository to correct the value there.
    emctl config agent updateTZ Updates the current timezone of the agent in emd.properties file.
    emctl config agent getSupportedTZ Prints the supported timezones for the agent.

    Memory And CPU commands

     
    emctl status agent memory Used for debugging agent memory. You will need to set
    enableMemoryTracing=TRUE in emd.properties for memory profiling agent.
    emctl status agent cpu Dumps the agent Thread CPU usage into a .trc file. This file contains the list of all the threads that are running at present and their CPU usage
    emctl dumpstate agent Generates the dumps for the agent. This command allow you to analyze the memory/cpu issues of the agent.
    emctl status agent memclean Clears the memory hash table. Note that by default, the memory tracing will not be enabled by the agent. So, if the memory tracing is not enabled, then emctl status agent memclean will not clear the hashtable.

    Target Configuration

     
    emctl config agent listtargets Lists the target names and target types on specified host
    emctl config agent listtargetsfully lists the targets fully
    emctl config agent credentials [<Target_name>[:<Target_Type>]] Provides the option to change the credentials for a particular
    target.target name and target type can be obtained from output of command: emctl config agent listtargets
    emctl config [agent] addtarget [-f-force] [] Allows you to configure agent.
    contains a definition of target to add and where -f or
    -force allows to overwrite an existing target.
    emctl config [agent] modifytarget [][][-mergeProps] Allows you to configure agent.
    contains a definition of target to modify and -mergeProps is used when only target properties are to be updated.
    emctl config [agent] deletetarget [] Allows you to delete target.
    Specify target type and name to delete.

    Miscellaneous

     
    emctl gensudoprops Generates the sudo properties of the agent.
    emctl clearsudoprops Clears the sudo properties
    emctl secure add_trust_cert -trust_certs_loc file> Adds the trusted new certificate on all agents to communicate with the OMS
    emctl relocate_target agent [=]* [-force] Used to relocate target
    emctl getversion

    Prints the version of the agent. Sample output:

    $ emctl getversion 
    Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. 
    Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.

     Kindly review the following :

    1. Make sure the hostname is resolvable.

    2. /etc/hosts should have a recommended format:
    <IPAddress>      <Fully Qualified Hostname>        <Short Name>

    3. Start the agent

    ./emctl start agent

    Now the agent starts without any issues.
     
    References :
    12.1.0.2 agent fails to start with error "HTTP Listener failed at Startup" after new installation. [ID 1519682.1]
     
    Or 
     
    1. Stop the agent:
         <AGENT_INST_HOME>/bin>./emctl stop agent

    2. Ensure that none of the agent process is running:
              $ ps -ef | grep -i TMMain

    3. Kill the agent process that are still running

    4.Start the agent
         <AGENT_INST_HOME>/bin>./emctl start agent
     
    References :
    12.1.0.2 Agent Startup Fails With Error "Possible port conflict on port" [ID 1509575.1]
     
    Please mark the thread as Helpful or Correct to help other users to find questions that were answered. 
     
         
    emctl status oms
     
    ###
    sample :
     

    1.检查

    ps -ef|grep em12c

    ps -ef|grep em12c
    opdb 13500606 17235986 0 Oct 26 - 208:20 /em12cr2/core/12.1.0.2.0/jdk/bin/java -Xmx172M -server -Djava.security.egd=file:///dev/./urandom -Dsun.lang.ClassLoader.allowArraySyntax=true -Xgcpolicy:gencon -Dwatchdog.pid=17235986 -cp /em12cr2/core/12.1.0.2.0/jdbc/lib/ojdbc5.jar:/em12cr2/core/12.1.0.2.0/ucp/lib/ucp.jar:/em12cr2/core/12.1.0.2.0/modules/oracle.http_client_11.1.1.jar:/em12cr2/core/12.1.0.2.0/lib/xmlparserv2.jar:/em12cr2/core/12.1.0.2.0/lib/jsch.jar:/em12cr2/core/12.1.0.2.0/lib/optic.jar:/em12cr2/core/12.1.0.2.0/modules/oracle.dms_11.1.1/dms.jar:/em12cr2/core/12.1.0.2.0/modules/oracle.odl_11.1.1/ojdl.jar:/em12cr2/core/12.1.0.2.0/modules/oracle.odl_11.1.1/ojdl2.jar:/em12cr2/core/12.1.0.2.0/sysman/jlib/log4j-core.jar:/em12cr2/core/12.1.0.2.0/jlib/gcagent_core.jar:/em12cr2/core/12.1.0.2.0/sysman/jlib/emagentSDK-intg.jar:/em12cr2/core/12.1.0.2.0/sysman/jlib/emagentSDK.jar oracle.sysman.gcagent.tmmain.TMMain
    opdb 17235986 1 0 Sep 09 - 23:23 /em12cr2/core/12.1.0.2.0/perl/bin/perl /em12cr2/core/12.1.0.2.0/bin/emwd.pl agent /em12cr2/agent_inst/sysman/log/emagent.nohup

    2.log
    location is in /em12cr2/agent_inst/sysman/log/

    solution:

    step 1: (su - oracle用户)

    su - oracle

    step 2:

    1). check the agent status:
    /em12cr2/core/12.1.0.2.0/bin/emctl status agent


    2). Stop the agent:
    /em12cr2/core/12.1.0.2.0/bin/emctl stop agent

    3). Ensure that none of the agent process is running:
    $ ps -ef | grep -i TMMain

    4). Kill the agent process that are still running

    4.Start the agent
    /em12cr2/core/12.1.0.2.0/bin/emctl start agent

  • 相关阅读:
    SQL Server数据库查询区分大小写、全半角——排序规则的应用
    C#中查询字符串中是否包含指定字符/字符串,使用IndexOf还是Contains?
    【WM6.5】三星I8000按键码及窗体消息发送的方法备忘
    UoBlog 支持 MetaWeblog Api,可以使用 Windows Live Writer 离线发表日志
    C#中如何获取一个字符串的实际字符数
    使用HttpWebRequest发送HTTP请求,同时支持GET/POST方式提交。
    c#.NET中开发可用于Web网页的ActiveX控件
    CorePlex开发手记:一、Winform窗体皮肤及简单换肤机制
    .NET中简易实现线程安全
    在C#中截取指定长度的中文字符串(效率提高2500倍)
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/7993274.html
Copyright © 2020-2023  润新知