Oracle® Enterprise Manager Administration 11g Release 1 (11.1.0.1) Part Number E16790-03 |
|
|
PDF · Mobi · ePub |
This chapter explains how to use the Enterprise Manager command line utility (emctl) to start and stop the Management Service, the Management Agent, the Grid Control Console, the Fusion Middleware Control Console, and Database Control.
This chapter also explains the various emctl commands, exit codes, and how to use log information to troubleshoot emctl.
Following are the sections in this chapter:
Guidelines for Starting Multiple Enterprise Manager Components on a Single Host
Starting and Stopping Oracle Enterprise Manager 11g Grid Control
The following sections describe how to use the Enterprise Manager command line utility (emctl
) to control the Oracle Management Agent:
To start, stop, or check the status of the Management Agent on UNIX systems:
Change directory to the AGENT_HOME
/bin
directory.
Use the appropriate command described in Table 7-1.
For example, to stop the Management Agent, enter the following commands:
$PROMPT> cd AGENT_HOME/bin
$PROMPT> ./emctl stop agent
Table 7-1 Starting, Stopping, and Checking the Status of the Management Agent
Command | Purpose |
---|---|
Starts the Management Agent |
|
Stops the Management 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 (). |
Example 7-1 Checking the Status of the Management Agent
$PROMPT> ./emctl status agent Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. --------------------------------------------------------------- Agent Version : 11.1.0.1.0 OMS Version : 11.1.0.1.0 Protocol Version : 11.1.0.0.0 Agent Home : /ade/example_username/oracle Agent binaries : /ade/example_username/oracle Agent Process ID : 10677 Parent Process ID : 10593 Agent URL : https://example.us.oracle.com:11865/emd/main/ Repository URL : https://example.us.oracle.com:13123/em/upload Started at : 2010-01-05 10:35:58 Started by user : example_username Last Reload : 2010-01-06 04:42:33 Last successful upload : 2010-01-06 04:42:35 Total Megabytes of XML files uploaded so far : 1041.04 Number of XML files pending upload : 0 Size of XML files pending upload(MB) : 0.00 Available disk space on upload filesystem : 71.53% Last successful heartbeat to OMS : 2010-01-06 04:42:44 --------------------------------------------------------------- Agent is Running and Ready $PROMPT>
On IBM AIX environment with a large memory configuration where the Management Agent is monitoring a large number of targets, the Agent may not start. To prevent this issue, prior to starting the Management Agent, set the following variables in the shell:
LDR_CNTRL="MAXDATA=0x80000000"@NOKRTL AIX_THREADSCOPE=S
The LDR_CNTRL variable sets the data segment size and disables loading of run time libraries in kernel space. The AIX_THREADSCOPE parameter changes AIX Threadscope context from the default Processwide 'P' to Systemwide 'S'. This causes less mutex contention.
When you install the Oracle Management Agent on a Windows system, the installation procedure creates three new services in the Services control panel.
The procedure for accessing the Services control panel varies, depending upon the version of Microsoft Windows you are using. For example, on Windows 2000, locate the Services Control panel by selecting Settings and then Administrative Tools from the Start menu.
Note:
Theemctl
utility described in Controlling the Management Service on UNIX is available in the bin
subdirectory of the Oracle home where you installed the Management Agent; however, Oracle recommends that you use the Services control panel to start and stop the Management Agent on Windows systems.Table 7-2 describes the Windows services that you use to control the Management Agent.
Table 7-2 Summary of Services Installed and Configured When You Install the Management Agent on Windows
Component | Service Name Format | Description |
---|---|---|
Oracle Management Agent |
Oracle<agent_home>Agent For example: OracleOraHome1Agent |
Use this to start and stop the Management Agent. |
Oracle<oracle_home>SNMPPeerEncapsulator For example: OracleOraHome1PeerEncapsulator |
Use this service only if you are using the advanced features of the Simple Network Management Protocol (SNMP). For more information, see the Oracle SNMP Support Reference Guide. |
|
Oracle<oracle_home>SNMPPeerMasterAgent For example: OracleOraHome1PeerMasterAgent |
Use this service only if you are using the advanced features of the Simple Network Management Protocol (SNMP). For more information, see the Oracle SNMP Support Reference Guide. |
Note:
If you are having trouble starting or stopping the Management Agent on a Windows NT system, try stopping the Management Agent using the following emctl command:$PROMPT> <AGENT_HOME>\bin\emctl istop agent
After stopping the Management Agent using the emctl istop agent command, start the Management Agent using the Services control panel.
This problem and solution applies only to the Windows NT platform, not to other Windows platforms, such as Windows 2000 or Windows XP systems.
To check the status of the Management Agent on Windows systems:
Change directory to the following location in the AGENT_HOME directory:
AGENT_HOME\bin
Enter the following emctl command to check status of the Management Agent:
$PROMPT> .\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 ().
The following sections describe how to control the Oracle Management Service:
To start and stop the Oracle Management Service on UNIX systems, use a set of emctl
commands.
To start, stop, or check the status of the Management Service with the Enterprise Manager command-line utility:
Change directory to the ORACLE_HOME/bin
directory in the Management Service home.
Use the appropriate command described in Table 7-3.
For example, to stop the Management Service, enter the following commands:
$PROMPT> cd bin $PROMPT> ./emctl stop oms
Table 7-3 Starting, Stopping, and Checking the Status of the Management Service
Command | Purpose |
---|---|
Starts the Fusion Middleware components required to run the Management Service J2EE application. Specifically, this command starts HTTP Server and the EMGC_OMS1 domain where the Management Service is deployed. Note: The |
|
Stops the Management Service. Note: The |
|
Displays a message indicating whether or not the Management Service is running. |
When you install the Oracle Management Service on a Windows system, the installation procedure creates three new services in the Services control panel.
The procedure for accessing the Services control panel varies, depending upon the version of Microsoft Windows you are using. For example, on Windows 2000, locate the Services control panel by selecting Settings and then Administrative Tools from the Start menu.
Note:
Theemctl
utility described in Controlling the Management Service on UNIX is available in the bin
subdirectory of the Oracle home where you installed the Management Service; however, Oracle recommends that you use the Services control panel to start and stop the Management Service on Windows systems.Table 7-4 describes the Windows services that you use to control the Oracle Management Service.
Table 7-4 Summary of Services Installed and Configured When Installing the Oracle Management Service on Windows
Component | Service Name Format | Description |
---|---|---|
OracleWeblogicNodeManager_EMGC_OMS1_1 |
Use this service to start and stop the node manager of the WebLogic Server that was installed and configured to deploy the Management Service J2EE application. |
|
OracleManagementServer_EMGC_OMS1_1 |
Use this service to start and stop all components that were installed and configured as part of the Management Service J2EE application. |
Fusion Middleware Control is a component of Oracle Fusion Middleware 11g that is installed as part of any WebLogic Server installation. For information about starting and stopping Fusion Middleware Control, see the chapter on Starting and Stopping Oracle Fusion Middleware in the Oracle® Fusion Middleware Administrator's Guide available on OTN.
To control the Database Control, you use the emctl
command-line utility that is available in the ORACLE_HOME/bin
directory after you install Oracle Database 11g.
To start the Database Control, as well the Management Agent and the Management Service associated with the Database Control:
To stop the Database Control, as well the Management Agent and the Management Service associated with the Database Control:
To start or stop the Database Control on Windows systems:
Open the Services control panel.
For example, on Windows NT, select Start, point to Settings, select Control Panel, and then double-click the Services icon.
On Windows 2000, select Start, point to Administrative Tools, and select Services.
Locate the Database Control in the list of services.
The name of the service is usually consists of "Oracle", followed by the name of the home directory you specified during the installation and the database system identifier (SID), followed by the word "DBControl." For example, if you specified DBd11g
as the Oracle Home, the Service name would be:
OracleDB11gDBControl
After you locate the service, you can use the Services control panel to start or stop the Database Control service.
By default, the Database Control service is configured to start automatically when the system starts.
Oracle Enterprise Manager 11g components are used to manage a variety of Oracle software products. In most cases, in a production environment, you will want to distribute your database and WebLogic Server instances among multiple hosts to improve performance and availability of your software resources. However, in cases where you must install multiple WebLogic Servers or databases on the same host, consider the following guidelines.
When you start Fusion Middleware Control, the Management Agent, or the Database Control, Enterprise Manager immediately begins gathering important monitoring data about the host and its managed targets. Keep this in mind when you develop a process for starting the components on the host.
Specifically, consider staggering the startup process so that each Enterprise Manager process has a chance to start before the next process begins its startup procedure. When you start up all the components (for example, after a restart of the system), use a process such as the following:
Use the emctl start
command to start all the OPMN-managed processes in the WebLogic Server home directory.
Wait 15 seconds.
Run the StartWebLogic.sh script to start HTTP services for WebLogic Server.
Wait 15 seconds.
Use the emctl start agent
command to start the Management Agent for the host.
Using a staggered startup procedure such as the preceding example will ensure that the processes are not in contention for resources during the CPU-intensive startup phase for each component.
As described in the previous sections, you use separate commands to control the Oracle Management Service, Oracle Management Agent, and the Oracle Fusion Middleware components on which the Grid Control depends.
The following sections describe how to stop and start all the Grid Control components that are installed by the Oracle Enterprise Manager 11g Grid Control Console installation procedure.
You can use this procedure to start all the framework components after a system reboot or to shutdown all the components before bringing the system down for system maintenance.
The following procedure summarizes the steps required to start all the components of the Grid Control. For example, use this procedure if you have restarted the host computer and all the components of the Grid Control have been installed on that host.
To start all the Grid Control components on a host, use the following procedure:
If your Oracle Management Repository resides on the host, change directory to the Oracle Home for the database where you installed the Management Repository and start the database and the Net Listener for the database:
Set the ORACLE_HOME environment variable to the Management Repository database home directory.
Set the ORACLE_SID environment variable to the Management Repository database SID (default is asdb).
Start the Net Listener:
$PROMPT> $ORACLE_HOME/bin/lsnrctl start
Start the Management Repository database instance:
ORACLE_HOME/bin/sqlplus /nolog
SQL> connect SYS as SYSDBA
SQL> startup
SQL> quit
See Also:
Oracle Database Administrator's Guide for information about starting and stopping an Oracle DatabaseStart the Oracle Management Service:
$PROMPT> ORACLE_HOME/bin/emctl start oms
Run the StartWebLogic.sh script to start HTTP services for WebLogic Server:
Change directory to the home directory for the Oracle Management Agent and start the Management Agent:
$PROMPT> AGENT_HOME/bin/emctl start agent
Note:
Be sure to run theemctl start agent
command in the Oracle Management Agent home directory and not in the Management Service home directory.The following procedure summarizes the steps required to stop all the components of the Grid Control. For example, use this procedure if you have installed all the components of the Grid Control on the same host you want to shut down or restart the host computer.
To stop all the Grid Control components on a host, use the following procedure:
Stop the Oracle Management Service:
$PROMPT> $ORACLE_HOME/bin/emctl stop oms
Run the StartWebLogic.sh script to start HTTP services for WebLogic Server.
Change directory to the home directory for the Oracle Management Agent and stop the Management Agent:
$PROMPT> AGENT_HOME/bin/emctl stop agent
Note:
Be sure to run theemctl stop agent
command in the Oracle Management Agent home directory and not in the Oracle WebLogic Server home directory.If your Oracle Management Repository resides on the same host, change directory to the Oracle Home for the database where you installed the Management Repository and stop the database and the Net Listener for the database:
Set the ORACLE_HOME environment variable to the Management Repository database home directory.
Set the ORACLE_SID environment variable to the Management Repository database SID (default is asdb).
Stop the database instance:
$PROMPT> ORACLE_HOME/bin/sqlplus /nolog SQL> connect SYS as SYSDBA SQL> shutdown SQL> quit
See Also:
Oracle Database Administrator's Guide for information about starting and stopping an Oracle DatabaseStop the Net Listener:
$PROMPT> $ORACLE_HOME/bin/lsnrctl stop
The following sections describe additional emctl
commands you can use to control the Management Agent:
Under normal circumstances, the Management Agent uploads information about your managed targets to the Management Service at regular intervals.
However, there are two Enterprise Manager commands that can help you force an immediate upload of data to the Management Service or a reload of the target definitions and attributes stored in the Management Agent home directory.
To use these commands, change directory to the AGENT_HOME/bin
directory (UNIX) or the AGENT_HOME\bin
directory (Windows) and enter the appropriate command as described in Table 7-5.
Table 7-5 Manually Reloading and Uploading Management Data
Command | Description |
---|---|
Use this command to force an immediate upload of the current management data from the managed host to the Management Service. Use this command instead of waiting until the next scheduled upload of the data. |
|
This command can be used to modify the Note: Oracle does not support manual editing of the |
To monitor the performance of your database targets, Enterprise Manager connects to your database using a database user name and password. This user name and password combination is referred to as the database monitoring credentials.
Note:
The instructions in this section are specific to the monitoring credentials for a database target, but you can use this procedure for any other target type that requires monitoring credentials. For example, you can use this procedure to specify new monitoring credentials for your Oracle Management Service and Management Repository.When you first add an Oracle9i Database target, or when it is added for you during the installation of the Management Agent, Enterprise Manager uses the DBSNMP database user account and the default password for the DBSNMP account as the monitoring credentials.
When you install Oracle Database 11g, you specify the DBSNMP monitoring password during the database installation procedure.
As a result, if the password for the DBSNMP database user account is changed, you must modify the properties of the database target so that Enterprise Manager can continue to connect to the database and gather configuration and performance data.
Similarly, immediately after you add a new Oracle Database 11g target to the Grid Control, you may need to configure the target so it recognizes the DBSNMP password that you defined during the database installation. Otherwise, the Database Home page may display no monitoring data and the status of the database may indicate that there is a metric collection error.
You can modify the Enterprise Manager monitoring credentials by using the Oracle Enterprise Manager 11g Grid Control Console or by using the Enterprise Manager command line utility (emctl
).
To modify the password for the DBSNMP account in the Oracle Enterprise Manager 11g Grid Control Console:
Click the Targets tab in the Grid Control Console.
Click the Database subtab to list the database targets you are monitoring.
Select the database and click Configure.
Enterprise Manager displays the Configure Database: Properties page.
Enter the new password for the DBSNMP account in the Monitor Password field.
Click Test Connection to confirm that the monitoring credentials are correct.
If the connection is successful, continue to the end of the Database Configuration wizard and click Submit.
To enter new monitoring credentials with the Enterprise Manager command-line utility:
Change directory to the AGENT_HOME/bin
directory (UNIX) or the AGENT_HOME\bin
directory (Windows).
Enter the following command to specify new monitoring credentials:
$PROMPT>./emctl config agent credentials [Target_name[:Target_Type]]
To determine the correct target name and target type, see "Listing the Targets on a Managed Host".
shows an example of the prompts and the output you receive from the command.
Example 7-2 Modifying the Database Monitoring Credentials
$PROMPT>./emctl config agent credentials example.com:oracle_database Oracle Enterprise Manager 11g Release 11.1.0.0.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. Name = example.us.oracle.com, Type = oracle_database Want to change for "UserName" (y/n):n Want to change for "password" (y/n):y Enter the value for "password" :******* EMD reload completed successfully
There are times when you need to provide the name and type of a particular target you are managing. For example, you must know the target name and type when you are setting the monitoring credentials for a target.
To list the name and type of each target currently being monitored by a particular Management Agent:
Change directory to the AGENT_HOME/bin
directory (UNIX) or the AGENT_HOME\bin
directory (Windows).
Enter the following command to specify new monitoring credentials:
$PROMPT>./emctl config agent listtargets
To list targets fully, use the following command:
$PROMPT>./emctl config agent listtargetsfully
shows the typical output of the commands.
Example 7-3 Listing the Targets on a Managed Host
ade:[ example_username_1208_qc_ag ] [example_username@example emagent]$ emctl config agent listtargetsOracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.[example.us.oracle.com:11852, oracle_emd][example.us.oracle.com, host][chronos_test, oracle_webcache][chronos_apache_test, oracle_apache][mytestBeacon, oracle_beacon][CSAcollector, oracle_csa_collector][database, oracle_database][database2, oracle_database][database3, oracle_database][listener, oracle_listener][listener2, oracle_listener][listener3, oracle_listener][Management Services and Repository, oracle_emrep]ade:[ example_username_1208_qc_ag ] [example_username@example emagent]$
Example 7-4 Listing the Targets Fully on a Managed Host
ade:[ example_username_1208_qc_ag ] [example_username@example emagent]$ emctl config agent listtargetsfully Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. <Targets> <Target TYPE="oracle_emd" NAME="example.us.oracle.com:11852"> </Target> <Target TYPE="host" NAME="example.us.oracle.com" DISPLAY_NAME="example.us.oracle.com"> </Target> <Target TYPE="oracle_webcache" NAME="chronos_test"> <Property NAME="HTTPProtocol" VALUE="http"/> <Property NAME="HTTPMachine" VALUE="localhost"/> <Property NAME="HTTPMachineForAdmin" VALUE="example.us.oracle.com"/> <Property NAME="OracleHome" VALUE="/ade/example_username_1208_qc/oracle/work/middleware/oms"/> <Property NAME="HTTPPath" VALUE="/"/> <Property NAME="MonitorPort" VALUE="4002"/> <Property NAME="AdminPort" VALUE="4000"/> <Property NAME="authpwd" VALUE="6a6aeca8b6028643" ENCRYPTED="TRUE"/> <Property NAME="authrealm" VALUE="sysman"/> <Property NAME="authuser" VALUE="sysman"/> <Property NAME="logFileDir" VALUE="/ade/example_username_1208_qc/oracle/work/middleware/oms/webcache/logs"/> <Property NAME="logFileName" VALUE="access_log"/> <Property NAME="version" VALUE="10.1.2.0.0"/> <AssocTargetInstance ASSOCIATION_NAME="ias" ASSOC_TARGET_NAME="/ade/example_username_1208_qc/oracle/work/middleware/oms.example.us.oracle.com" ASSOC_TARGET_TYPE="oracle_ias"/> </Target> <Target TYPE="oracle_apache" NAME="chronos_apache_test" DISPLAY_NAME="chronos_apache_test"> <Property NAME="HTTPMachine" VALUE="example.us.oracle.com"/> <Property NAME="HTTPPort" VALUE="18828"/> <Property NAME="useDefaultProxy" VALUE="false"/> <Property NAME="version" VALUE="stdApache10.1.2"/> <Property NAME="OracleHome" VALUE="/ade/example_username_1208_qc/oracle/work/middleware/oms"/> <Property NAME="logFileDir" VALUE="/ade/example_username_1208_qc/asg_apache/apache2/apache2/logs"/> <Property NAME="logFileName" VALUE="eum_log"/> </Target> <Target TYPE="oracle_beacon" NAME="mytestBeacon"> <Property NAME="proxyHost" VALUE="example.us.oracle.com"/> <Property NAME="proxyPort" VALUE="80"/> <Property NAME="dontProxyFor" VALUE="us.oracle.com"/> </Target> <Target TYPE="oracle_csa_collector" NAME="CSAcollector"> <Property NAME="recvFileDir" VALUE="/ade/example_username_1208_qc/oracle/work/user_projects/domains/EMGC_DOMAIN/em/EMGC_OMS1/sysman/oms_csa/results"/> </Target> <Target TYPE="oracle_database" NAME="database" VERSION="1.0"> <Property NAME="MachineName" VALUE="example.us.oracle.com"/> <Property NAME="OracleHome" VALUE="/ade/example_username_1208_qct/oracle"/> <Property NAME="UserName" VALUE="94d6d81ed42c38ae" ENCRYPTED="TRUE"/> <Property NAME="Port" VALUE="25059"/> <Property NAME="SID" VALUE="t1208qc"/> <Property NAME="Role" VALUE="NORMAL"/> <Property NAME="password" VALUE="94d6d81ed42c38ae" ENCRYPTED="TRUE"/> </Target> <Target TYPE="oracle_database" NAME="database2" VERSION="1.0"> <Property NAME="MachineName" VALUE="example.us.oracle.com"/> <Property NAME="OracleHome" VALUE="/ade/example_username_1208_qct/oracle"/> <Property NAME="UserName" VALUE="94d6d81ed42c38ae" ENCRYPTED="TRUE"/> <Property NAME="Port" VALUE="25059"/> <Property NAME="SID" VALUE="t1208qc"/> <Property NAME="Role" VALUE="NORMAL"/> <Property NAME="password" VALUE="94d6d81ed42c38ae" ENCRYPTED="TRUE"/> </Target> <Target TYPE="oracle_database" NAME="database3" VERSION="1.0"> <Property NAME="MachineName" VALUE="example.us.oracle.com"/> <Property NAME="OracleHome" VALUE="/ade/example_username_1208_qct/oracle"/> <Property NAME="UserName" VALUE="94d6d81ed42c38ae" ENCRYPTED="TRUE"/> <Property NAME="Port" VALUE="25059"/> <Property NAME="SID" VALUE="t1208qc"/> <Property NAME="Role" VALUE="NORMAL"/> <Property NAME="password" VALUE="94d6d81ed42c38ae" ENCRYPTED="TRUE"/> </Target> <Target TYPE="oracle_listener" NAME="listener"> <Property NAME="Machine" VALUE="example.us.oracle.com"/> <Property NAME="Port" VALUE="25059"/> <Property NAME="ListenerOraDir" VALUE="/ade/example_username_1208_qct/oracle/work"/> <Property NAME="LsnrName" VALUE="LISTENER"/> <Property NAME="OracleHome" VALUE="/ade/example_username_1208_qct/oracle"/> </Target> <Target TYPE="oracle_listener" NAME="listener2"> <Property NAME="Machine" VALUE="example.us.oracle.com"/> <Property NAME="Port" VALUE="25059"/> <Property NAME="ListenerOraDir" VALUE="/ade/example_username_1208_qct/oracle/work"/> <Property NAME="LsnrName" VALUE="LISTENER2"/> <Property NAME="OracleHome" VALUE="/ade/example_username_1208_qct/oracle"/> </Target> <Target TYPE="oracle_listener" NAME="listener3"> <Property NAME="Machine" VALUE="example.us.oracle.com"/> <Property NAME="Port" VALUE="25059"/> <Property NAME="ListenerOraDir" VALUE="/ade/example_username_1208_qct/oracle/work"/> <Property NAME="LsnrName" VALUE="LISTENER3"/> <Property NAME="OracleHome" VALUE="/ade/example_username_1208_qct/oracle"/> </Target> <Target TYPE="oracle_emrep" NAME="Management Services and Repository"> <Property NAME="ConnectDescriptor" VALUE="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=stbdg06)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=example.us.oracle.com)))"/> <Property NAME="UserName" VALUE="e34e191763acd13b" ENCRYPTED="TRUE"/> <Property NAME="password" VALUE="e34e191763acd13b" ENCRYPTED="TRUE"/> </Target> </Targets>
Blackouts allow Enterprise Manager users to suspend management data collection activity on one or more managed targets. For example, administrators use blackouts to prevent data collection during scheduled maintenance or emergency operations.
See Also:
The "Systems Monitoring" chapter in Oracle Enterprise Manager Concepts for more information about Enterprise Manager blackoutsYou can control blackouts from the Oracle Enterprise Manager 11g Grid Control Console or from the Enterprise Manager command line utility (emctl
). However, if you are controlling target blackouts from the command line, you should not attempt to control the same blackouts from the Grid Control Console. Similarly, if you are controlling target blackouts from the Grid Control Console, do not attempt to control those blackouts from the command line.
See Also:
"Creating, Editing, and Viewing Blackouts" in the Enterprise Manager online help for information about controlling blackouts from the Grid Control ConsoleFrom the command line, you can perform the following blackout functions:
Starting Immediate Blackouts
Stopping Immediate Blackouts
Checking the Status of Immediate Blackouts
Note:
When you start a blackout from the command line, any Enterprise Manager jobs scheduled to run against the blacked out targets will still run. If you use the Grid Control Console to control blackouts, you can optionally prevent jobs from running against blacked out targets.To use the Enterprise Manager command-line utility to control blackouts:
Change directory to the AGENT_HOME/bin
directory (UNIX) or the AGENT_HOME\bin
directory (Windows).
Enter the appropriate command as described in Table 7-6.
Note:
When you start a blackout, you must identify the target or targets affected by the blackout. To obtain the correct target name and target type for a target, see "Listing the Targets on a Managed Host".Table 7-6 Summary of Blackout Commands
Use the following examples to learn more about controlling blackouts from the Enterprise Manager command line:
To start a blackout called "bk1" for databases "db1" and "db2," and for Oracle Listener "ldb2," enter the following command:
$PROMPT> emctl start blackout bk1 db1 db2 ldb2:oracle_listener -d 5 02:30
The blackout starts immediately and will last for 5 days 2 hours and 30 minutes.
To check the status of all the blackouts on a managed host:
$PROMPT> emctl status blackout
To stop blackout "bk2" immediately:
$PROMPT> emctl stop blackout bk2
To start an immediate blackout called "bk3" for all targets on the host:
$PROMPT> emctl start blackout bk3 -nodeLevel
To start an immediate blackout called "bk3" for database "db1" for 30 minutes:
$PROMPT> emctl start blackout bk3 db1 -d 30
To start an immediate blackout called "bk3" for database "db2" for five hours:
$PROMPT> emctl start blackout bk db2 -d 5:00
The Management Agent may fail to start after the upgrade if it realizes that it is no longer in the same time zone that it was originally configured with.
You can reset the time zone used by the Management Agent using the following command:
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.
IMPORTANT:
Before you change the Management Agent time zone, first check to see if there are any blackouts that are currently running or scheduled to run on any target managed by that Management Agent.
To check for blackouts:
In the Grid Control Console, go to the All Targets page under the Targets tab, and locate the Management Agent in the list of targets. Click on the Management Agent's name. This brings you to the Management Agent's home page.
The list of targets monitored by the Management Agent are listed in the "Monitored Targets" section.
For each of target in the list:
Click the target name. This brings you to the target's home page.
In the Related Links section of the home page, click the Blackouts link. This allows you to check any currently running blackouts or blackouts that are scheduled in the future for this target.
If such blackouts exist, then:
From the Grid Control Console, stop all currently running blackouts on all targets monitored by that Management Agent.
From the Grid Control Console, stop all scheduled blackouts on all targets monitored by that Management Agent.
Once you have stopped all currently running and scheduled blackouts, you can run the emctl resetTZ agent
command to change the Management Agent's time zone.Once you have changed the Management Agent's time zone, create new blackouts on the targets as needed.
If you are running a Management Agent Release 10.2, then you can use the following command to perform an immediate reevaluation of a metric collection:
emctl control agent runCollection <targetName>:<targetType> <colletionItemName>
where <collectionItemName>
is the name of the Collection Item that collects the metric.
Performing this command causes the reevaluated value of the metric to be uploaded into the Management Repository, and possibly trigger alerts if the metric crosses its threshold.
Related metrics are typically collected together; collectively a set of metrics collected together is called a Metric Collection. Each Metric Collection has its own name. If you want to reevaluate a metric, you first need to determine the name of the Metric Collection to which it belongs, then the CollectionItem for that Metric Collection.
When you run the previous command to reevaluate the metric, all other metrics that are part of the same Metric Collection and Collection Item will also be reevaluated.
Perform the following steps to determine the Metric Collection name and Collection Item name for a metric:
Go to $ORACLE_HOME/sysman/admin/metadata directory, where $ORACLE_HOME is the Oracle Home of the Management Agent.
Locate the XML file for the target type. For example, if you are interested in the host metric 'Filesystem Space Available(%)' metric, look for the host.xml file.
In the xml file, look for the metric in which you are interested. The metric that you are familiar with is actually the display name of the metric. The metric name would be preceded by a tag that started with:
<Label NLSID=
For example, in the host.xml file, the metric 'Filesystem Space Available(%)" would have an entry that looks like this:
<Label NLSID="host_filesys_pctAvailable">Filesystem Space Available (%) </Label>
Once you have located the metric in the xml file, you will notice that its entry is part of a bigger entry that starts with:
<Metric NAME=
Take note of the value defined for "Metric NAME". This is the Metric Collection name. For example, for the 'Filesystem Space Available(%)' metric, the entry would look like this:
<Metric NAME="Filesystems"
So for the 'Filesystem Space Available(%)' metric, the Metric Collection name is 'Filesystems'.
The Collection Item name for this Metric Collection needs to be determined next. Go to the $ORACLE_HOME/sysman/admin/default_collection directory, where $ORACLE_HOME is the Oracle Home of the Management Agent.
In this directory, look for the collection file for the target type. In our example, this would be host.xml.
In cases where a Metric Collection is collected by itself, there would be a single Collection Item of the same name in the collection file. To determine if this is the case for your Metric Collection, look for an entry in the collection file that starts with:
<CollectionItem NAME=
where the value assigned to the CollectionItem NAME matches the Metric NAME in step (4).
For the 'Filesystem Space Available(%)' metric, the entry in the collection file would look like:
<CollectionItem NAME = "Filesystems"
If you find such an entry, then the value assigned to "CollectionItem NAME" is the collection item name that you can use in the emctl command.
Otherwise, this means the Metric Collection is collected with other Metric Collections under a single Collection Item. To find the Collection Item for your Metric Collection, first search for your Metric Collection. It should be preceded by the tag:
<MetricColl NAME=
Once you have located it, look in the file above it for: <CollectionItem NAME=
The value associated with the CollectionItem NAME is the name of the collection item that you should use in the emctl command.
For example if the you want to reevaluate the host metric "Open Ports", using the previous steps, you would do the following:
Go to the $ORACLE_HOME/sysman/admin/metadata directory where $ORACLE_HOME is the Oracle Home of the Management Agent. Look for the host.xml file and in that file locate: <Metric NAME="openPorts"
.
Then go to the $ORACLE_HOME/sysman/admin/default_collection directory. Look for the host.xml file and in that file look for <CollectionItem NAME="openPorts"
.
Failing this, look for <MetricColl NAME="openPorts"
.
Look above this entry in the file to find the <CollectionItem NAME=
string and find <CollectionItem NAME="oracle_security"
.
The CollectionItem NAME oracle_security is what you would use in the emctl command to reevaluate the Open Ports metric.
This section lists the emctl commands for the Enterprise Manager Agent and Management Service.
emctl Command | Description |
---|---|
emctl start | getversion oms |
Gets the version of the Management Service. |
emctl stop oms [-all] |
Stops the Management Service. |
emctl status oms |
Lists the status of the Management Service |
emctl status oms -details |
Lists the status of the Management Service in detail |
emctl config oms sso -host ssoHost -port ssoPort -sid ssoSid -pass ssoPassword -das dasURL -u user |
Configures the Management Service. |
emctl config oms loader -shared <yes|no> -dir <loader dir> |
Configures the Management Service. |
emctl config oms -list_repos_details |
Lists the Management Service repository details. |
emctl config oms -store_repos_details [-repos_host <host> -repos_port <port> -repos_sid <sid> | -repos_conndesc <connect descriptor> ] -repos_user <username> [-repos_pwd <pwd>] [-no_check_db] |
Configures the Management Service. |
emctl config oms -change_repos_pwd [-change_in_db] [-old_pwd <old_pwd>] [-new_pwd <new_pwd>] [-use_sys_pwd [-sys_pwd <sys_pwd>]] |
Configures the Management Service. |
emctl config oms -change_view_user_pwd [-sysman_pwd <sysman_pwd>] [-user_pwd <user_pwd>] [-auto_generate] |
Configures the Management Service. |
emctl start | stop agent |
Starts or stops agent. |
emctl start | stop | status subagent |
Starts or stops subagent. |
emctl status agent |
Lists the status of agent. |
emctl status agent -secure [-omsurl <http://<oms-hostname>:<oms-unsecure-port>/em/*>] |
Lists the secure status of the agent and the port on which the agent is running in secure mode and also the OMS security status of the agent it points to. This command also gives the OMS secure port. Below is an example output: bash-3.00$ emctl status agent -secure Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. Checking the security status of the Agent at location set in /ade/example_username_cpap4_ag/oracle/sysman/config/emd.properties... Done. Agent is secure at HTTPS Port 1838. Checking the security status of the OMS at http://example.us.oracle.com:7654/em/upload/... Done. OMS is secure on HTTPS Port 4473 bash-3.00$ |
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. The following is an example output: bash-3.00$ emctl status agent jobs Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. ------------------------------------------------- step id typ pid stat command line ------- --- --- ---- ------------ ------------------------------------------------- Agent is Running and Ready |
emctl status agent target <target name>,<target type>,<metric> |
Lists the detailed status of the specified targets in the order of target name, target type. The following is an example of an oracle_database target. You can also provide a particular metric name in the emctl command to get the status of a particular metric of a target. bash-3.00$ emctl status agent target database,oracle_database Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. ------------------------------------------------- Target Name : database Target Type : oracle_database Current severity state ---------------------- Metric Column name Key State Timestamp ------------------------------------------------- DeferredTrans errortrans_count n/a CLEAR 2009-07-09 02:38:07 DeferredTrans deftrans_count n/a CLEAR 2009-07-09 02:38:07 ha_recovery missing_media_files n/a CLEAR 2009-07-09 02:28:57 ha_recovery corrupt_data_blocks n/a CLEAR 2009-07-09 02:28:57 ha_recovery datafiles_need_recovery n/a CLEAR 2009-07-09 02:28:57 Response Status n/a CLEAR 2009-07-09 02:38:04 Response userLogon n/a CLEAR 2009-07-09 02:38:04 Response State n/a CLEAR 2009-07-09 02:38:04 OCMInstrumentation NeedToInstrument n/a CLEAR 2009-07-09 02:31:55 health_check Status n/a CLEAR 2009-07-09 02:40:00 health_check Unmounted n/a CLEAR 2009-07-09 02:40:00 health_check Mounted n/a CLEAR 2009-07-09 02:40:00 health_check Unavailable n/a CLEAR 2009-07-09 02:40:00 health_check Maintenance n/a CLEAR 2009-07-09 02:40:00 sql_response time n/a CLEAR 2009-07-09 02:38:50 sga_pool_wastage java_free_pct n/a CLEAR 2009-07-09 02:28: 58 UserAudit username DBSNMP_example CLEAR 2009-07-09 02:32:48 ------------------------------------------------------- Agent is Running and Ready |
emctl status agent mcache <target name>,<target type>,<metric> |
Lists the names of the metrics for which the values are present in the metric cache. See the following example for a simple host target: bash-3.00$ emctl status agent mcache example.us.oracle.com,host Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. ------------------------------------------------------- Metric cache contains value for following metrics at 2009-07-09 02:54:47 CPUUsage DiskActivity FileMonitoring LPAR Performance on AIX Load Network PagingActivity ------------------------------------------------------- Agent is Running and Ready The metrics listed above are the ones whose values are present in the metric cache. |
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.Following is the sample output of emctl status agent cpu: bash-3.00$ emctl status agent cpu Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. ------------------------------------------------------- Agent Thread CPU Snapshot available in file: /ade/example_username_cpap4_ag/oracle/sysman/emd/cputrack/emagent_1654792_2009-07-09_02-58-54_cpudiag.trc ------------------------------------------------------- Agent is Running and Ready |
emctl status agent mutex |
Gives the detailed status of the agent mutex contention for each thread. It gives the acquired, release, and wait time of mutexes for each thread.Following is a sample output: bash-3.00$ emctl status agent mutex Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. ------------------------------------------------------- Mutex status at 2009-07-09 03:03:46 (prev : 2009-07-09 03:03:13) Addr Name : TotAcq TotRel TotWT LSAcq LSRel LSWT MxWt OwnerTid 2346a578 CollState : 14 14 18 0 0 0 1 NULL-thread 232e7628 CollState : 0 0 0 0 0 0 0 NULL-thread 23386638 CollState : 0 0 0 0 0 0 0 NULL-thread 2329fd28 CollState : 0 0 0 0 0 0 0 NULL-thread 239521c8 CollItem : 0 0 0 0 0 0 0 NULL-thread 2328cd98 CollState : 0 0 0 0 0 0 0 NULL-thread 23a54948 CollItem : 0 0 0 0 0 0 0 NULL-thread 232d8b68 CollItem : 1 1 1 0 0 0 1 NULL-thread 2358ce38 MetricCacheItem : 2 2 2 0 0 0 1 NULL-thread |
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 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. To enable memory tracing, you need to set enableMemoryTracing=true in emd.properties of the agent and then reload the agent.The following is a sample output: bash-3.00$ emctl status agent memclean Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. ------------------------------------------------------- Memory hashtable cleared. ------------------------------------------------------ Agent is Running and Ready |
emctl reload [agent] |
Reloads the agent by reading the emd.properties and targets.xml files again. If you have changed any property in emd.properties file, for example, if you have changed the tracing level of collector in the emd.properties by changing tracelevel.collector=DEBUG (default will be WARN) then you need to reload the agent to make the agent takes this change into account. Note that the agent should be up and running for the reload to happen successfully. |
emctl reload agent dynamicproperties [<Target_name>:<Target_Type>]... |
Recomputes the dynamic properties of a target and generates the dynamic properties for the target.Sample output for oracle_database is as follows: bash-3.00$ emctl reload agent dynamicproperties database:oracle_database Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. ------------------------------------------------------- EMD recompute dynprops completed successfully |
emctl upload |
Uploads xml files that are pending to upload to the OMS under the upload directory. |
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 config agent <options> |
Configures agent based on the options provided. |
emctl config agent updateTZ |
Updates the current timezone of the agent in emd.properties file. |
emctl config agent getTZ |
Prints the current timezone of the agent. |
emctl config agent credentials [<Target_name>[:<Target_Type>]] |
Provides the option to change the credentials for a particular target. Through this, you can change the user name and password of the target. It will ask you when you run this command whether you want to change the user name or password. If you select yes, then you have to provide the new user name and password for the target which you want to configure. Then it will reload the agent.Sample output for oracle_database is as follows: bash-3.00$ emctl config agent credentials database Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. Name = database, Type = oracle_database Want to change for "UserName" (y/n): Want to change for "password" (y/n): EMD reload completed successfully |
emctl config agent getSupportedTZ |
Prints the supported timezones for the agent. |
emctl config console <fileloc> [<EM loc>] |
Allows you to configure the console based on the configuration entries that you have mentioned in the file <fileloc>. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] addtarget [-f|-force] <fileloc> [<EM loc>] |
Allows you to configure agent. <fileloc> contains a definition of target to add and where -f or -force allows to overwrite an existing target.If -f or -force is not specified, existing targets cannot be overwritten. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] addtargets [-f|-force] <fileloc> [<EM loc>] |
Allows you to configure agent. <fileloc> contains a definition of targets to add and -f or -force allows to overwrite existing targets.If -f or -force is not specified, existing targets cannot be overwritten. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] modifytarget <fileloc> [<EM loc>] [<EM State>] [-mergeProps] |
Allows you to configure agent. <fileloc> contains a definition of target to modify and -mergeProps is used when only target properties are to be updated. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] deletetarget <type> <name> [<EM loc>] |
Allows you to delete target. <type>,<name> specify target type and name to delete. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] listtargets [<EM loc>] |
Lists all targets present in targets.xml. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config agent listtargetsfully [<EM loc1>] [<EM loc2>] ... |
Lists all targets present in targets.xml of the given Enterprise Manager location. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] listcentralagents [<EM loc>] |
Lists the central agents this home is associated with. The centralagent command does not apply in an agent-only home. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] addcentralagent <centralAgentHomePath> [<EM loc>] |
Associates this home with a new central agent. The centralagent command does not apply in an agent-only home. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] removecentralagent <centralAgentHomePath> [<EM loc>] |
Removes the association of this home with a central agent. The centralagent command does not apply in an agent-only home. <EM loc> is optional and can be used to operate on a different Oracle Home. |
emctl config [agent] upgradecentralagent <centralAgentHomePathOld> [<centralAgentHomePathNew>] |
Upgrades all product homes being monitored by this central agent. The centralagent command does not apply in an agent-only home. |
emctl config [agent] setcentralagents <centralAgent1> [<centralAgent2> ...] |
Sets the list of central agents this home is associated with. The centralagent command does not apply in an agent-only home. |
emctl config agent addTargetsToRepository <uploadFile> <update_on_dup (true | false)> |
Adds targets to repository. uploadFile contains definition for targetsupdate_on_dup decides whether updating duplicate targetsThis function is for central agent. |
emctl config agent addAssociationsToRepository <uploadFile> |
Adds associations to repository. uploadFile contains definition(s) for association(s)This function is for central agent. |
emctl config agent getLocalHost |
Prints the local host where the agent is running. |
emctl control agent runCollection <target_name>:<target_type> <metric_name> |
Allows to manually run the collections for a particular metric of a target. Sample output is as follows: bash-3.00$ emctl control agent runCollection example.us.oracle.com:host CPUUsage Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. ------------------------------------------------------- EMD runCollection completed successfully |
emctl getcurdir agent |
Prints the current working directory you are in (pwd). |
emctl resetTZ agent |
Resets the timezone of the agent. Stop the agent first and then run this command to change the current timezone to a different timezone. Then start the agent. |
emctl resettzhost <hostname> <override_timezone> |
Resets the timezone settings of the host where the agent is running. |
emctl getversion |
Prints the version of the agent. Sample output is as follows: bash-3.00$ emctll getversion bash: emctll: command not found bash-3.00$ emctl getversion Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. --- Standalone agent Enterprise Manager 10g Agent Version 10.2.0.5.0 |
emctl dumpstate agent <component> . . . |
Generates the dumps for the agent. This command allow you to analyze the memory/cpu issues of the agent. Sample output is as follows: bash-3.00$ emctl dumpstate agent Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. dump file generated: /ade/example_username_cpap4_ag/oracle/sysman/dump/emagent_1654792_20090709042448.diagtrc bash-3.00$ |
emctl gensudoprops |
Generates the sudo properties of the agent. |
emctl clearsudoprops |
Clears the sudo properties. |
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. The state files are the files which are ready for the agent to convert them into corresponding xml files. |
emctl getemhome |
Prints the agent home directory. The sample output is as follows: bash-3.00$ emctl getemhome Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. EMHOME=/ade/example_username_cpap4_ag/oracle |
emctl start blackout <Blackoutname> [-nodeLevel] [<Target_name>[:<Target_Type>]].... [-d <Duration>] |
Starts blackout on a target. <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 stop blackout <Blackoutname> |
Stops the blackout that was started on a particular target. Only those blackouts that are started by the emctl tool can be stopped using emctl. This command cannot stop the blackouts that are started using the Console or emcli. |
emctl status blackout [<Target_name>[:<Target_Type>]].... |
Provides the status of the blackout of the target. The status includes the type of blackout, whether one time, repeating, or a scheduled blackout. This command also specifies whether the blackout has started or stopped. |
emctl secure agent <registration password> [-passwd_file <abs file loc>] |
Secures the agent against an OMS. The registration password must be provided. |
emctl unsecure agent |
Unsecures the agent. This will make the agent unsecure and the agent's port will be changed to http port. |
emctl verifykey |
Verifies the communication between the OMS and agent by sending pingOMS. |
emctl deploy agent [-s <install-password>] [-o <omshostname:consoleSrvPort>] [-S] <deploy-dir> <deploy-hostname>:<port> <source-hostname> |
'agent' creates and deploys only the agent. [-s <password>]: Install password for securing agent. [-S ]: Password will be provided in STDIN. [-o <omshostname:consoleSrvPort>]: The OMS Hostname and console servlet port. Choose the unsecured port. <deploy-dir> : Directory to create the shared (state-only) installation port. <deploy-hostname:port> : Host name and port of the shared (state-only) installation. Choose unused port. <source-hostname>: The host name of the source install. Typically the machine where EM is installed. This is searched and replaced in targets.xml by the host name provided in argument <deploy-hostname:port>. <sid>: The instance of the remote database. Only specified when deploying "dbconsole". |
emctl deploy dbconsole [-s <install-password>] <deploy-dir> <deploy-hostname>:<port> <source-hostname> <sid> |
'dbconsole' creates and deploys both the agent and the dbconsole. [-s <password>]: Install password for securing agent. <deploy-dir> : Directory to create the shared (state-only) installation port. <deploy-hostname:port> : Host name and port of the shared(state-only) installation. Choose unused port. <source-hostname>: The host name of the source install. Typically the machine where EM is installed. This is searched and replaced in targets.xml by the host name provided in argument <deploy-hostname:port>. <sid>: The instance of the remote database. Only specified when deploying "dbconsole". |
emctl ilint |
Allows ilint support of agent. |
emctl annotateconfigfiles agent [<template files dir> <config files dir>] |
For annotating configuration files |
emctl register oms targettype [-o <SQL Output filename>] <XML filename> [<rep user> <rep passwd> <rep host> <rep port> <rep sid>] OR emctl register oms targettype [-o <SQL Output filename>] <XML filename> [<rep user> <rep passwd> <rep connect descriptor>] |
For registering target type |
emctl switchOMS <reposUrl> |
For switching OMS |
emctl relocate_target agent <targetname> <targettype> [<name1>=<value1>]* [-force] |
Used to relocate target. |
This release introduces APIs that can be run instead of emctl commands for agent configuration. Table 7-8 lists the APIs.
Table 7-8 APIs for Agent Configuration
API | Description |
---|---|
oracle.sysman.emd:addAssociationsToRepository |
Adds definition(s) for association(s). This function is for central agent. Usage is emctl config agent oracle.sysman.emd:addAssociationsToRepository <uploadFile> |
oracle.sysman.emd:upgradeCentralAgentHome |
Modifies cagentPathOld (if it does not already exist) to curOraHome/sysman/emd/centralagents.lst if curOraHome is not null, otherwise to ORACLE_HOME/sysman/emd/centralagents.lst where ORACLE_HOME is the java property. Each member of centralAgentPaths has to be unique. Usage is emctl config agent oracle.sysman.emd:upgradeCentralAgentHome <cagentPathOld> [cagentPathNew] |
oracle.sysman.emd:printLocalHost |
Prints the hostname on standard output. Usage is emctl config agent oracle.sysman.emd:printLocalHost |
oracle.sysman.emd:printTargets |
Prints targets of type tType present in the targets.xml file. If tType is null,all targets are printed. Usage is emctl config agent oracle.sysman.emd:printTargets [tType] |
oracle.sysman.emd:printRepositoryURL |
Prints the REPOSITORY_URL value from emd.properties file. Usage is emctl config agent oracle.sysman.emd:printRepositoryURL |
oracle.sysman.emd:reloadTargets |
Causes the agent to reload the targets.xml file. If agent is not running then this call does nothing. Usage is emctl config agent oracle.sysman.emd:reloadTargets |
oracle.sysman.emd:updateAgentTimeZone |
Updates the agent time zone with the value of the property agentTZRegion from emd.properties file. Usage is emctl config agent oracle.sysman.emd:updateAgentTimeZone |
oracle.sysman.emd:setCentralAgentHomes |
Adds all the centralAgentPaths to curOraHome/sysman/emd/centralagents.lst if curOraHome is not null, otherwise to ORACLE_HOME/sysman/emd/centralagents.lst where ORACLE_HOME is the java property. Adding is done as follows:
Note - Each member of centralAgentPaths must be unique. |
oracle.sysman.emd:deleteSingleTargetFromCentralHome |
Deletes the specific target instance from homeToRemove's targets.xml. The name and type are case-sensitive. Usage is emctl config agent oracle.sysman.emd:deleteSingleTargetFromCentralHome <centralHome> <parentHome> <targetType> <targetName> |
oracle.sysman.emd:modifyTarget |
Modifies a specified target. The composite members of this target are not affected by this operation. Usage is emctl config agent modifyTarget <target> |
oracle.sysman.emd:printProxyHostPort |
Prints the REPOSITORY_URL value from emd.properties file. Usage is emctl config agent oracle.sysman.emd:printRepositoryURL |
oracle.sysman.emd:modifyTargetFromFile |
Modifies a target as specified in a file. The file must contain an XML fragment describing the target to be modified. The composite members of this target are not affected by this operation. Usage is emctl config agent oracle.sysman.emd:modifyTargetFromFile <fileLoc> |
oracle.sysman.emd:getProxyHostPort |
Gets the REPOSITORY_URL value from emd.properties file. Usage is emctl config agent oracle.sysman.emd:getRepositoryURL |
oracle.sysman.emd:registerWith904ForCentralMonitoring |
Registers with the central agent for monitoring. Usage is emctl config agent oracle.sysman.emd:registerWith904ForCentralMonitoring <centralHome> <productOH> |
oracle.sysman.emd:getRepositoryURL |
Gets the REPOSITORY_URL value from emd.properties file. Usage is emctl config agent oracle.sysman.emd:getRepositoryURL |
oracle.sysman.emd:removeCentralAgentHome |
Removes the <cagentPath> (if it exists) from curOraHome/sysman/emd/centralagents.lst if curOraHome is not null, otherwise to ORACLE_HOME/sysman/emd/centralagents.lst where ORACLE_HOME is the java property. Usage is emctl config agent oracle.sysman.emd:removeCentralAgentHome <cagentPath> |
oracle.sysman.emd:printTimeZone |
Prints the time zone on standard output. Usage is emctl config agent oracle.sysman.emd:printTimeZone |
oracle.sysman.emd:addCentralAgentHome |
Adds the cagentPath (if it does not already exist) to curOraHome/sysman/emd/centralagents.lst if curOraHome is not null, otherwise to ORACLE_HOME/sysman/emd/centralagents.lst where ORACLE_HOME is the java property. NOTE - Requires each member of centralAgentPaths to be unique. Usage is emctl config agent oracle.sysman.emd:addCentralAgentHome <cagentPath> |
oracle.sysman.emd:printSupportedTimeZone |
Prints the time zone on standard output. Usage is emctl config agent oracle.sysman.emd:printTimeZone |
oracle.sysman.emd:listTargetsFully |
Reads all targets in the specified source ORACLE_HOME - source_oracle_home(if null - in the current, local to TargetInstaller, ORACLE_HOME) and writes them to stdout in the format suitable for the agent in the destination ORACLE_HOME - destination_oracle_home. It will also show the encrypted data. Usage is emctl config agent listTargetsFully [<destination_oracle_home> | <source_oracle_home destination_oracle_home>] |
oracle.sysman.emd:getCentralAgentHomes |
Gets the list of central agents monitoring curOraHome. Usage is emctl config agent oracle.sysman.emd:getCentralAgentHomes |
oracle.sysman.emd:getEmLoc |
Gets the location of the active agent given, the Enterprise Manager ORACLE_HOME. Usage is emctl config agent oracle.sysman.emd:getEmLoc |
oracle.sysman.emd:relocateTargetAgent |
Relocates target to the caller agent |
oracle.sysman.emd:addTargetFromFile |
Adds a target to the list of targets monitored by the agent. Usage is emctl config agent oracle.sysman.emd:addTargetFromFile [forceOpt ((true | force | -f) | false)] <fileLoc> |
oracle.sysman.emd:addFileToTargetsXml |
Adds targets from a given file to the list of targets monitored by the agent. Usage is emctl config agent oracle.sysman.emd:addFileToTargetsXml [forceOpt ((true | force | -f) | false)] <xmlFileToAdd> |
oracle.sysman.emd:addTargetsToRepository |
Adds targets to the list of targets in the repository monitored by the agent. This function is for central agent. Usage is emctl config agent addTargetsToRepository <uploadFile> <update_on_dup (true | false)> |
oracle.sysman.emd:registerForCentralMonitoring |
Registers with the central agent for monitoring. Usage is emctl config agent oracle.sysman.emd:registerForCentralMonitoring <centralHome> <productOH> <stateHome> |
oracle.sysman.emd:listCentralAgentHomes |
Lists the centralAgentPaths (if it exists) from curOraHome/sysman/emd/centralagents.lst if curOraHome is not null, otherwise to ORACLE_HOME/sysman/emd/centralagents.lst where ORACLE_HOME is the java property. Usage is emctl config agent oracle.sysman.emd:listCentralAgentHomes |
oracle.sysman.emd:addTarget |
Adds a target to the list of targets monitored by the agent. Usage is emctl config agent addTarget [force (true | false)] <target> |
oracle.sysman.emd:getLocalHost |
Returns the hostname. Usage is emctl config agent getLocalHost |
oracle.sysman.emd:deleteTarget |
Deletes the specific target instance. The name and type are case-sensitive. Usage is emctl config agent oracle.sysman.emd:deleteTarget <targetType> <targetName> |
oracle.sysman.emd:unregisterForCentralMonitoring |
Unregisters with the central agent. Usage is emctl config agent oracle.sysman.emd:unregisterForCentralMonitoring <productOH> <stateHome> |
oracle.sysman.emd:listTargets |
Enumerates targets of type tType present in the targets.xml file. If tType is null, all targets are returned. Usage is emctl config agent listTargets [tType] [decryptLevel | hideEncryptedData] |
oracle.sysman.emd:listTargets |
Adds new entry to the configuration file sysman/config/classpath.lst that lists the full path of jar files used by the JavaWrapperFetchlet (classpath.lst). Ignores entry that already exists in the file. Does not check validity of path name supplied. Usage is emctl config agent oracle.sysman.emd:addToClasspathLst <jarName> |
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 example, run the following command from the Oracle home directory of the Management Agent to check its status:
<Oracle_Home>emctl status agent
After running the command, navigate to the log directory to view the following information in the emctl.log
file:
1114306 :: Wed Jun 10 02:29:36 2009::AgentLifeCycle.pm: Processing status agent 1114306 :: Wed Jun 10 02:29:36 2009::AgentStatus.pm:Processing status agent 1114306 :: Wed Jun 10 02:29:37 2009::AgentStatus.pm:emdctl status returned 3
Here, the first column, that is, 1114306, is the thread that was used to check the status. The second column shows the date and time when the command was run. The third column mentions the Perl script that was run for the command. The last column describes the result of the command, where it shows the progress made by the command and the exit code returned for the command. In this case, the exit code is 3, which means that the Management Agent is up and running.
Another example, run the following command from the Oracle home directory of the Management Agent to upload data:
<Oracle_Home>emctl upload agent
After running the command, navigate to the log directory to view the following information in the emctl.log
file:
1286220 :: Tue Jun 9 07:13:09 2009::AgentStatus.pm:Processing upload 1286220 :: Tue Jun 9 07:13:10 2009::AgentStatus.pm:emdctl status agent returned 3 1286220 :: Tue Jun 9 07:13:41 2009::AgentStatus.pm: emdctl upload returned with exit code 6
Here, the entries are similar to the entries in the first example, but the exit code returned is 6, which means the upload operation is failing for some reason.
Table 7-9 describes the different exit codes of an emctl command:
Exit Code | Description |
---|---|
0 |
Operation was successful. No action required from user. |
1 |
Failed to connect to the Management Agent. Maybe the Management Agent is not running. Restart the Management Agent, and then try the emctl command again. |
2 |
Timed out while connecting to the Management Agent. Maybe the Management Agent is hanging. Restart the Management Agent, and then try the emctl command again. |
3 |
Management Agent is up and running. No action required from user. |
4 |
Management Agent is up but not ready. Wait for some more time, and then try the emctl command again. |
5 |
Input/output error while sending Management Agent-related request or receiving Management Agent-related response. |
6 |
Unable to upload. Check the status of the Management Agent, and then try the emctl command again. |
7 |
Management Agent is in an abnormal state. Check the status of the Management Agent, and then try the emctl command again. |
8 |
Operation was incomplete. The command might have timed out. Try again. |
9 |
Usage error. Check the command you are running and try again with the correct command. |
10 |
SSL handshake error while communicating with the Management Agent. Secure the Management Agent, and then try the emctl command again. |
11 |
Key mismatch while communicating with the Management Agent. Secure the Management Agent, and then try the emctl command again. |
255 |
Unable to open the temporary file. Try the emctl command again. |