Kellyn Pot’Vin, Westminster, Colorado Oracle ACE, Sr. Technical Specialist at Enkitec Finishing up EM12c book and starting EM CLIbook Specialize in performance and managementof large enterprise environments. Board of directors for RMOUG, Director ofTraining Days 2013, KSCOPE DB Track Lead2013 Blog: DBAKevlar.com Twitter: @DBAKevlar
What to Include? What to Exclude? What are the most important areas ofthe EM CLI? What commands are best covered tocreate the best educational introductionto the topic?
Enterprise Manager Command LineInterface History How EM12c has changed level ofknowledge requirements for theadministrator The Command Line Interface Basics Enterprise Manager commands EM CLI Procedure Scripting
Introduced in Oracle 9i with very limiteduse. Access to EM functionality from textbased consoles. Ability to incorporate scripts, includingSQL*Plus, Perl, Shell, Python, etc. Fully integrated as part of the EMenvironment, including same security. Ability to simplify multi-target tasksthrough command line interface.
Create Jobs, schedule jobs, delete jobs Administer groups, members, targets Administer users and credentials. Upload patches, delete patches-createpatch plans. Execute host and SQL commands. Get information about all targets,monitoring. Over 30 verb “groups” and 250 commandsthat I have documented “so far”.
EM CLI Login- Online or Offline? “Verbs” grant the administrator initialcommands for the interface. May Require one or more arguments. Can utilize a argument file, akaproperties file. Syntax often changes with version ofEnterprise Manager.emcli help <verb>
The Command Line must be logged intofor the first time before commands willbe accepted, (login dependent uponEM security time out feature orconnection mode.)emcli login –username=<username> Syncronize the EMCLI with the OMS:emcli sync
Check connection mode, if complete,then offline the EM CLIemcli get_connection_modeemcli set_connection_mode -mode="offline“emcli get_jobsSet back to online mode if wanting to proceed.
Save off Templates Inventory Existing Jobs Create secure credentials for targets Create administrator groups to easeadministration. Reuse templates, post creating first one,easy updates!
emcli create_blackout -name="LinuxPatch 120612" -reason="Needs to beDone" -add_targets="emrep12:oracle_database" -schedule="duration::60“How fast could you blackout entireenvironment for maintenance window withthis scripted?
Simply state the name of the blackout andthe agent will issue a stop to the OMS:emcli stop_blackout-name="Linux Patch 120612“How quickly could you end a blackout ofenvironment post maintenance?
Simplify management of large number oftargets with simple script vs. multiplesteps through EM12c console. This simplicity includes creating,managing, editing and purging of jobsand patching job tasks. Retain EM12c security and single consolemonitoring if required.
Need to verify job informationemcli get_jobs
Assumption is that patches aredownloaded via EM12c. Process:› Verify Patch Available.› Create Patch Plan› Schedule Patches in Patch Plan› Deploy Patch Plan
list_aru_languages -- List ARU Languageinformation. list_aru_platforms -- List ARU platforminformation. list_aru_products -- List ARU Productinformation. list_aru_releases -- List ARU Releaseinformation. list_patch_plans -- List existing Patch Plans. search_patches -- Search patches fromARU site or Software
Multi-step, multi-tasked or chainedscripting through the EM CLI. Ability to execute SQL, Perl, OSCommands from one procedure. Ability to use properties file to simplifywork and reuse with other procedures. EM Console access through Job ActivityInterface.
emcli submit_procedure-name=<Procedure Name>-input_file="<data:path to file>"-instance_name="<ProcedureInstance>"-schedule=start_time:yyyy/mm/ddHH:mm;
Create a template to use for your newproperties file, sourced from a proceduredefinition. Fill in all pertinent information for thetarget lists. Submit the procedure, using theproperties file as part or whole of theentry at the command line. Verify all was successful.
Using the GUID, (or the procedure<NAME>, we can then generate aproperties file template:emcli describe_procedure_input –procedure=BFC71D3485629B93E04014AC08001B7D >dbreplay_tst.properties$> Verifying parameters…$>
Edit the new template properties file andadd the new values for the following:$ vi dbreplay_tst.properties Source and Reference Host Data Agent Info Oracle Home Credentials
Rob Zoeteweij, Patching with EM12chttp://oemgc.wordpress.com/tag/oem-gc-12c/Laurent Leturgez, Useful EMCLI Commandshttp://laurentleturgez.wordpress.com/2012/06/11/useful-emcli-commands-in-em-cloud-control-12c/Laurent Schneider, The EM CLIhttp://laurentschneider.com/wordpress/2011/11/enterprise-manager-command-line-interface.html