This document discusses using the Enterprise Manager Command Line Interface (EM CLI) to manage and automate tasks in Oracle Enterprise Manager 12c. It provides an overview of the EM CLI's history and capabilities. It then discusses important EM CLI commands and concepts like logging in, checking the connection mode, and submitting procedure jobs. The document aims to help determine what content should be included in a book about using the EM CLI in EM 12c.
Report
Share
Report
Share
1 of 42
Download to read offline
More Related Content
The enterprise manager command line interface2
2. Kellyn Pot’Vin,
Westminster, Colorado
Oracle ACE, Sr. Technical Specialist at Enkitec
Finishing up EM12c book and starting EM CLI
book
Specialize in performance and management
of large enterprise environments.
Board of directors for RMOUG, Director of
Training Days 2013, KSCOPE DB Track Lead
2013
Blog: DBAKevlar.com
Twitter: @DBAKevlar
3. What to Include?
What to Exclude?
What are the most important areas of
the EM CLI?
What commands are best covered to
create the best educational introduction
to the topic?
4. Enterprise Manager Command Line
Interface History
How EM12c has changed level of
knowledge requirements for the
administrator
The Command Line Interface Basics
Enterprise Manager commands
EM CLI Procedure Scripting
5. Introduced in Oracle 9i with very limited
use.
Access to EM functionality from text
based consoles.
Ability to incorporate scripts, including
SQL*Plus, Perl, Shell, Python, etc.
Fully integrated as part of the EM
environment, including same security.
Ability to simplify multi-target tasks
through command line interface.
6. Create Jobs, schedule jobs, delete jobs
Administer groups, members, targets
Administer users and credentials.
Upload patches, delete patches-create
patch plans.
Execute host and SQL commands.
Get information about all targets,
monitoring.
Over 30 verb “groups” and 250 commands
that I have documented “so far”.
7. EM CLI Login- Online or Offline?
“Verbs” grant the administrator initial
commands for the interface.
May Require one or more arguments.
Can utilize a argument file, aka
properties file.
Syntax often changes with version of
Enterprise Manager.
emcli help <verb>
8. The Command Line must be logged into
for the first time before commands will
be accepted, (login dependent upon
EM security time out feature or
connection mode.)
emcli login –username=<username>
Syncronize the EMCLI with the OMS:
emcli sync
9. Check connection mode, if complete,
then offline the EM CLI
emcli get_connection_mode
emcli set_connection_mode -mode="offline“
emcli get_jobs
Set back to online mode if wanting to proceed.
11. Redirection example of output, (similar to
Unix):
emcli get_procedure_xml –
procedure=“PROC_GUID” >
test_proc.xml
12. get_resolution_states - Incident
Information
stop/start_agent - Manage Agents
create/stop_blackout - Manage Blackouts
clone_database_home - Clone home
execute_sql - Execute SQL
get_jobs - Get a list of jobs
clear_stateless_alerts - Clears stateless
alerts
Argfile: File of verbs to execute from the
emcli.
13. EM CLI for EM12c support
› Checking Incidents
› Retrieve Targets Monitored
› Retrieve Agent Properties
› Agent Deployment
› Platform support
› Creating/Stopping Blackouts
› Executing Host Commands
20. Save off Templates
Inventory Existing Jobs
Create secure credentials for targets
Create administrator groups to ease
administration.
Reuse templates, post creating first one,
easy updates!
21. emcli create_blackout -name="Linux
Patch 120612" -reason="Needs to be
Done" -
add_targets="emrep12:oracle_databa
se" -schedule="duration::60“
How fast could you blackout entire
environment for maintenance window with
this scripted?
22. Simply state the name of the blackout and
the agent will issue a stop to the OMS:
emcli stop_blackout
-name="Linux Patch 120612“
How quickly could you end a blackout of
environment post maintenance?
25. Simplify management of large number of
targets with simple script vs. multiple
steps through EM12c console.
This simplicity includes creating,
managing, editing and purging of jobs
and patching job tasks.
Retain EM12c security and single console
monitoring if required.
26. Need to verify job information
emcli get_jobs
28. Assumption is that patches are
downloaded via EM12c.
Process:
› Verify Patch Available.
› Create Patch Plan
› Schedule Patches in Patch Plan
› Deploy Patch Plan
29. list_aru_languages -- List ARU Language
information.
list_aru_platforms -- List ARU platform
information.
list_aru_products -- List ARU Product
information.
list_aru_releases -- List ARU Release
information.
list_patch_plans -- List existing Patch Plans.
search_patches -- Search patches from
ARU site or Software
31. Multi-step, multi-tasked or chained
scripting through the EM CLI.
Ability to execute SQL, Perl, OS
Commands from one procedure.
Ability to use properties file to simplify
work and reuse with other procedures.
EM Console access through Job Activity
Interface.
34. Create a template to use for your new
properties file, sourced from a procedure
definition.
Fill in all pertinent information for the
target lists.
Submit the procedure, using the
properties file as part or whole of the
entry at the command line.
Verify all was successful.
36. Using the GUID, (or the procedure
<NAME>, we can then generate a
properties file template:
emcli describe_procedure_input –
procedure=
BFC71D3485629B93E04014AC08001B7D >
dbreplay_tst.properties
$> Verifying parameters…
$>
37. Edit the new template properties file and
add the new values for the following:
$ vi dbreplay_tst.properties
Source and Reference Host Data
Agent Info
Oracle Home
Credentials