The enterprise manager command line interface2


Published on

RMOUG 2013

Published in: Technology
1 Comment
  • Incredibly insightful presentation on the EMCLI. As is typical with all the Oracle EM focused content I've seen from Kellyn Pot'vin, the information is top notch.
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

The enterprise manager command line interface2

  1. 1.  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: Twitter: @DBAKevlar
  2. 2.  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?
  3. 3.  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
  4. 4.  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.
  5. 5.  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”.
  6. 6.  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>
  7. 7.  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
  8. 8.  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.
  9. 9. emcli<verb>1st_argument[-name, -procedure, -instance, -guid, -argfile, -input_file, -type, -targets, -action…] = <value>2nd_argument [-xml, -tailLength, -info, -analyze, -grants, -scheduler, -notification] =<value>
  10. 10.  Redirection example of output, (similar toUnix):emcli get_procedure_xml –procedure=“PROC_GUID” >test_proc.xml
  11. 11.  get_resolution_states - IncidentInformation 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 statelessalerts Argfile: File of verbs to execute from theemcli.
  12. 12.  EM CLI for EM12c support› Checking Incidents› Retrieve Targets Monitored› Retrieve Agent Properties› Agent Deployment› Platform support› Creating/Stopping Blackouts› Executing Host Commands
  13. 13. emcli get_resolution_states
  14. 14.  What database targets are beingmonitored, both single instance and RAC?emcli get_targets -targets="%database%"
  15. 15. emcli get_supported_platforms
  16. 16. emcli get_agentimage -destination=/home/oracle -platform="Microsoft Windows x64(64-bit)" –version=""
  17. 17. emcli get_targetsemcli delete_target –name="<trg_nm>“emcli import_update –file="file_nm" –omslocalemcli deploy_plugin_on_server -plugin=oracle.sysman.db –sys_password=<passwd>emcli deploy_plugin_on_agent –plugin="oracle.sysman.db" –agent_name="<dbname>:<port>"
  18. 18. emcli set_credential -target_type=oracle_database -target_name="<preferred_nm>"-credential_set=DBCredsMonitoring -user=sysman-column="Role:SYSDBA;UserName:sys;password:<passwd>"-monitoring
  19. 19.  Save off Templates Inventory Existing Jobs Create secure credentials for targets Create administrator groups to easeadministration. Reuse templates, post creating first one,easy updates!
  20. 20. 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?
  21. 21. 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?
  22. 22. emcli execute_hostcmd –cmd=“ls -ltr/home/oracle”-credential_set_name=“HostCredsPriv”-targets=“<host>.com:host”
  23. 23.  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.
  24. 24.  Need to verify job informationemcli get_jobs
  25. 25. emcli get_job_execution_detail -execution=C07388B855B44C38B5953B8C3C7C6A5E -xml
  26. 26.  Assumption is that patches aredownloaded via EM12c. Process:› Verify Patch Available.› Create Patch Plan› Schedule Patches in Patch Plan› Deploy Patch Plan
  27. 27.  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
  28. 28. emcli search_patches-patch_name="patch number"-platform="platform id“emcli search_patches–patch_name=“5875660” (BIPublisher)–platform=“233” (Windows 64 bit)
  29. 29.  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.
  30. 30. emcli submit_procedure-name=<Procedure Name>-input_file="<data:path to file>"-instance_name="<ProcedureInstance>"-schedule=start_time:yyyy/mm/ddHH:mm;
  31. 31. emcli submit_procedure -input_file=data:data.xml -procedure=3D7F4D139E70453CB56D7621BB56D390-schedule="start_time:2012/12/0321:00; tz:America/Central" -grants="KPOTVIN:VIEW_JOB;SYSMAN:FULL_JOB" -notification="action required,failed"
  32. 32.  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.
  33. 33. emcli get_procedures –type=DBPROVExample Output:$>BFC71D3485629B93E04014AC08001B7D, DBPROV, DBREPLAYCLIENTDP_NG,Provision Oracle Database Client,6.2, ORACLEBFC71D3485599B93E04014AC08001B7D,DBPROV, SIHA_SIDB_PROC, ProvisionOracle Database, 1.1, ORACLE
  34. 34. Using the GUID, (or the procedure<NAME>, we can then generate aproperties file template:emcli describe_procedure_input –procedure=BFC71D3485629B93E04014AC08001B7D >$> Verifying parameters…$>
  35. 35. Edit the new template properties file andadd the new values for the following:$ vi Source and Reference Host Data Agent Info Oracle Home Credentials
  36. 36. emcli submit_procedure –name=test_dbrpl_job-owner=sys_jobs-procedure= C23E10B1F427B4EEE040578CD74442G4-input_file=/u01/emjobs/emcli/"action required, failed"-grants=“KPOTVIN:VIEW_JOB; SYSMAN:FULL_JOB"-schedule= "start_time:2012/12/06 01:00:00;tz:America/Denver"
  37. 37. emcli get_instance_status -instance=C23E10B1F427B4EEE040578CD74442G4-details -showJobOutputOutput:C23E10B1F427B4EEE040578CD74442G4, test_job, test_job, SUCCESSFUL
  38. 38. Rob Zoeteweij, Patching with EM12c Leturgez, Useful EMCLI Commands Schneider, The EM CLI
  39. 39. http://enkitec.com