import_workloads
Imports the captures and (optionally) the replays contained in a directory. An XML input file is required that describes the path of the directory containing capture (and replay) data files; the database target to be used to load captures (and replays); and, optionally, capture (and replay) names to import only specific captures (and replays) into the Enterprise Manager repository.
Sample XML File:
<?xml version="1.0" encoding="UTF-8"?> <cliImportData xmlns="http://xmlns.oracle.com/sysman/db/dbreplay"> <targetName>database</targetName> <targetType>oracle_database</targetType> <dbHostName>host.example.com</dbHostName> <dbCredRef> <credName>testDB121</credName> <credOwner>sysman</credOwner> </dbCredRef> <dbHostCredRef> <credName>testDBHost121</credName> <credOwner>sysman</credOwner> </dbHostCredRef> <directoryPath>/storage/dbr/myConsTask</directoryPath> <consolidatedDirectory>true</consolidatedDirectory> <replays> <taskName>myTask</taskName> <replay> <nameInEm>myNewConsTrial_1</nameInEm> <nameInTarget>myNewConsTrial_1</nameInTarget> </replay> </replays> </cliImportData> <?xml version="1.0" encoding="UTF-8"?> <cliImportData xmlns="http://xmlns.oracle.com/sysman/db/dbreplay"> <targetName>database</targetName> <targetType>oracle_database</targetType> <dbHostName>host.example.com</dbHostName> <dbCredRef> <credName>testDB121</credName> <credOwner>sysman</credOwner> </dbCredRef> <dbHostCredRef> <credName>testDBHost121</credName> <credOwner>sysman</credOwner> </dbHostCredRef> <directoryPath>/storage/dbr/copyDir_task4Caps</directoryPath> <consolidatedDirectory>true</consolidatedDirectory> <captures> <capture> <nameInEm>capture01</nameInEm> <nameInTarget>capture01</nameInTarget> </capture> <capture> <nameInEm>capture10</nameInEm> <nameInTarget>capture10</nameInTarget> </capture> </captures> </cliImportData>
Format - Standard Mode
emcli import_workloads [-input_file="template:<input file path>"] [-include_replays] [-all] [-format="[name:<pretty|script|csv>];[column_separator:"column_sep_string"];[row_separator:"row_sep_string"]"]
[ ] indicates that the parameter is optional.
Format - Interactive or Script Mode
import_workloads( [input_file="template:<input file path>"] [,include_replays=True/False] [,all=True/False] [,format="[name:<pretty|script|csv>];[column_separator:"column_sep_string"];[row_separator:"row_sep_string"]"] )
[ ] indicates that the parameter is optional.
Options
-
input_file
Fully qualified path to an XML file containing parameters for the verb.
-
include_replays
Imports replays into the Enterprise Manager repository along with the associated captures that are imported.
-
all
Imports all captures (and replays) into the Enterprise Manager repository. No names need to be specified in the XML input file unless there is a naming conflict with a preexisting Enterprise Manager capture (or replay).
-
format
Specifies how the output is formatted. The default value is "name:pretty". You can use the parameter in the following ways:
-
-format="name:pretty" Prints the output table in a readable format not intended to be parsed by scripts.
-
-format="name:script" Sets the default column separator to a tab and the default row separator to a newline in the output. You can override the column and row separator strings with your own values.
-
-format="name:script;column_separator:<column_sep_string>" Causes the verb output to be column-separated by <column_sep_string>. Rows are separated by the newline character.
-
-format="name:script;row_separator:<row_sep_string>" Causes the verb output to be row-separated by <row_sep_string>. Columns are separated by the tab character.
-
-format="name:script;column_separator:<column_sep_string>;row_separator:<row_sep_string>" Causes the verb output to be column-separated by <column_sep_string> and row-separated by <row_sep_string>.
-
-format="name:csv" Sets the default column separator to a comma and the default row separator to a newline in the output.
-
Exit Codes
0 if successful. A non-zero value indicates that verb processing was unsuccessful.
Output
Output Columns: EM Entity Name, Entity Name, Database Name, Start Time, Import Status
Examples
Example 1 - Standard Mode
The following example imports all captures from a directory into the Enterprise Manager repository.
emcli import_workloads -all -input_file=template:/storage/xml/importReplay_capture121_5Mins.xml
Example 2 - Interactive or Script Mode
The following example imports all captures from a directory into the Enterprise Manager repository.
import_workloads(all=True, input_file="template:/storage/xml/importReplay_capture121_5Mins.xml" )
Example 3 - Standard Mode
The following example imports captures from a directory into the Enterprise Manager repository. Only those captures specifically named in the XML input file are imported.
emcli import_workloads -input_file=template:/storage/xml/importReplay_capture121_5Mins.xml
Example 4 - Interactive or Script Mode
The following example imports captures from a directory into the Enterprise Manager repository. Only those captures specifically named in the XML input file are imported.
import_workloads(input_file="template:/storage/xml/importReplay_capture121_5Mins.xml" )
import_workloads(include_replays=True, input_file="template:/storage/xml/importReplay_capture121_5Mins.xml" )
See Also