EMCLI : Installing Enteprise Manager Command Line Interface for Cloud Control 12c and 13c
Learn how to install EMCLI for Enterprise Manager Cloud Control 12c and 13c on Windows and Linux.
oracle miscconfigurationintermediate
by OracleDba
13 views
Learn how to install EMCLI for Enterprise Manager Cloud Control 12c and 13c on Windows and Linux.
12345678
mkdir /home/oracle/emcli
export JAVA_HOME=/usr/java/jdk1.8.0_211
export PATH=$JAVA_HOME/bin:$PATH
java -jar emcliadvancedkit.jar client -install_dir=/home/oracle/emcli
cd /home/oracle/emcli
export EMCLI_STATE_DIR=/home/oracle/emcli
emcli setup -url=https://ol7-em13cr3.localdomain:7802/em -username=sysman -trustall -autologin -dir=/home/oracle/emcli
emcli sync12345678
mkdir c:\emcli
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
set PATH=%JAVA_HOME%\bin;%PATH%
java -jar emcliadvancedkit.jar client -install_dir=c:\emcli
cd c:\emcli
set EMCLI_STATE_DIR=C:\emcli
emcli setup -url=https://ol7-em13cr3.localdomain:7802/em -username=sysman -trustall -autologin -dir=C:\emcli
emcli sync1234567891011121314151617181920212223242526272829303132333435
# Linux
export JAVA_HOME=/usr/java/jdk1.8.0_211
export PATH=$JAVA_HOME/bin:$PATH
cd /home/oracle/emcli
export EMCLI_STATE_DIR=/home/oracle/emcli
emcli sync
emcli
Rem Windows
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
set PATH=%JAVA_HOME%\bin;%PATH%
java -jar emcliadvancedkit.jar client -install_dir=c:\emcli
cd c:\emcli
set EMCLI_STATE_DIR=C:\emcli
emcli sync
emcli
# Linux
export JAVA_HOME=/usr/java/jdk1.8.0_211
export PATH=$JAVA_HOME/bin:$PATH
cd /home/oracle/emcli
export EMCLI_STATE_DIR=/home/oracle/emcli
emcli sync
emcli help
Rem Windows
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
set PATH=%JAVA_HOME%\bin;%PATH%
java -jar emcliadvancedkit.jar client -install_dir=c:\emcli
cd c:\emcli
set EMCLI_STATE_DIR=C:\emcli
emcli sync
emcli help
emcli sync1234567891011
emcli># Interactive
emcli>help()
$ # Standard Invocation
$ emcli help
emcli># Interactive
emcli>help("create_job")
$ # Standard Invocation
$ emcli help create_job123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
$ emcli help
.
.
.
Job Verbs
add_chef_cookbook -- Create chef cookbook entities
create_job -- Create a job
create_job_from_library -- Create a job using a library job as a template
create_library_job -- Create a library job
delete_chef_cookbook -- Delete chef cookbook entities
delete_job -- Delete the specified job
delete_library_job -- Delete a library job
describe_job -- Describe a job
describe_job_type -- Describe a job type
describe_library_job -- Describe a library job
export_jobs -- Export job details in to an xml file
get_job_execution_detail -- Display details of job execution
get_job_types -- Lists all job types supported by EMCLI
get_jobs -- Get a list of existing jobs
import_jobs -- Import job definitions from an xml file
job_input_file -- Supply details for a job verb in a property file
job_target_criteria
resume_job -- Resume a job or set of jobs
retry_job -- Restart a previously failed job execution
stop_job -- Stop the specified job
submit_job -- Submit a job (Deprecated - use create_job)
suspend_job -- Suspend a job or set of jobs
.
.
.
$ emcli help create_job
emcli create_job
-name=<job_name>
-type=<job_type>
-input_file="property_file:<filename>"
Description:
Create and schedule a job.
Options:
-name: Optional parameter. The name may be specified in the input file instead.
-type: Optional parameter. The type may be specified in the input file instead.
-input_file : Required parameter. <filename> must be provided to load the properties for creating and scheduling the job.
A template property file for the job_type can be obtained using EMCLI verb "describe_job_type".
Another job of the same job type could also be used to generate the property file using EMCLI verb "describe_job".
Please make sure that the property file is accessible to the EMCLI client for reading.
Sample:
Create and schedule a job with name MYJOB1 and of job type MyJobType1 with property file present at location /tmp/myjob1_prop.txt
emcli create_job -name=MYJOB1 -job_type=MyJobType1 -input_file="property_file:/tmp/myjob1_prop.txt"
$
$ emcli describe_job_type -type=RMANScript
# Description: (Optional) The user specified name of the job
name=
# Description: (Optional) The job type for this job
type=RMANScript
# Description: (Optional) The user specified description of the job
description=
# Description: The job owner. The job owner is the user who creates the job.
# Default: the logged in user
# The job owner information displayed here is for documentation only and user is not expected to change it.
owner=
# Description: (Optional) The kind of job
# Legal Values: active, library
kind=
# Fill in the target list before submitting.
# For Example:
# target_list=MyTarget:oracle_database
target_list=<target_name>:<target_type>
# Credential Usage: defaultDBCred
# Description:
cred.defaultDBCred.<target_name>:<target_type>=
# Credential Usage: defaultHostCred
# Description:
cred.defaultHostCred.<target_name>:<target_type>=
# Description: (Required) Enter RMAN commands or a fully qualified script name on the remote hosts, for example, "@script.rcv"
variable.rman_perl_script=
# Description: (Optional) Notify the job owner when a selected state occurs
# Allowed Values: SCHEDULED, RUNNING, ACTION_REQUIRED, SUSPENDED, SUCCEEDED, PROBLEMS
notification=
$
# Description: (Optional) The user specified name of the job
name=test_emcli_job_1
# Description: (Optional) The job type for this job
type=RMANScript
# Description: (Optional) The user specified description of the job
description=A test job created using EMCLI
# Description: The job owner. The job owner is the user who creates the job.
# Default: the logged in user
# The job owner information displayed here is for documentation only and user is not expected to change it.
owner=sysman
# Description: (Optional) The kind of job
# Legal Values: active, library
kind=active
# Fill in the target list before submitting.
# For Example:
# target_list=MyTarget:oracle_database
target_list=db12c:oracle_database
# Credential Usage: defaultDBCred
# Description:
#cred.defaultDBCred.<target_name>:<target_type>=
# Credential Usage: defaultHostCred
# Description:
#cred.defaultHostCred.<target_name>:<target_type>=
# Description: (Required) Enter RMAN commands or a fully qualified script name on the remote hosts, for example, "@script.rcv"
variable.rman_perl_script=<<MULTILINEVALUE
run {
recover copy of database with tag 'MYDB_INCR_BACKUP' until time 'SYSDATE-7';
backup incremental level 1 for recover of copy with tag 'MYDB_INCR_BACKUP' database;
backup device type disk tag 'MYDB_INCR_BACKUP' archivelog all not backed up delete all input;
delete noprompt obsolete device type disk;
}
MULTILINEVALUE
# Description: (Optional) Notify the job owner when a selected state occurs
# Allowed Values: SCHEDULED, RUNNING, ACTION_REQUIRED, SUSPENDED, SUCCEEDED, PROBLEMS
notification=SUCCEEDED,PROBLEMS
$ emcli create_job -input_file="property_file:/tmp/property_file.txt"
Creation of job "TEST_EMCLI_JOB_1" was successful.
$
$ emcli delete_job -name=test_emcli_job_1
Job "TEST_EMCLI_JOB_1" deleted successfully
$
schedule.frequency=
schedule.startTime=
schedule.endTime=
schedule.gracePeriod=
schedule.months=
schedule.days=
schedule.interval=
schedule.timezone.type=
schedule.timezone.targetIndex=
schedule.timezone.zoneOffset=
schedule.timezone.region=
schedule.frequency=REPEAT_BY_DAYS
schedule.startTime=2013-08-31 20:00:00
schedule.interval=1
schedule.timezone.type=TIMEZONE_REGION_SPECIFIED
schedule.timezone.targetIndex=1
schedule.timezone.region=Europe/London
$ emcli stop_job -name=test_emcli_job_1
Job "TEST_EMCLI_JOB_1" stopped successfully
$ emcli delete_job -name=test_emcli_job_1
Job "TEST_EMCLI_JOB_1" deleted successfully
$Please to add comments
No comments yet. Be the first to comment!