Database Reference
In-Depth Information
The following are advantages of using an argfile:
The EM CLI utility is invoked outside the argfile, so verbs are processed serially without
restarting EM CLI.
An argfile is a text file, and your choice of suffix has no bearing at all on execution. The
example has an lst suffix but you could just as easily use cli or cmd .
You must fully qualify the path to the argfile.
This example does not include file cleanup, but I'm sure your script will.
As you might suspect, this method is quite efficient, and argfile executions typically run very fast since there is a
single call to the OMS through the CLI utility.
Populating an Argfile from a Text File
Creating and editing an argfile by hand isn't out of the question, but sometimes (always?) a scripted solution is easier
and less error prone. For instance, what if you received a request to provide OEM access to several members of an
application group with the following CSV file attached?
Note
Backslashes are included for clarity in this illustration. put each complete string on one line.
cat manage_request.txt
login,name,department,email e123450,"Jerry",A100,jerry@samplecorp.com
e123451,"Bobby",A100,bobby@samplecorp.dom
e123452,"Phil",A100,phil@samplecorp.dom
e123449,"Robert",A100,roberth@samplecorp.dom
e123499,"Ron",A100,ronpig@samplecorp.dom
e123460,"Bill",A110,bill@samplecorp.dom
e123461,"Mickey",A110,mickey@samplecorp.dom
e123491,"Keith",A120,keith@samplecorp.dom
e123492,"Donna",A120,donnaj@samplecorp.dom
e123460,"Brent",A120,brent@samplecorp.dom
We'll redirect output from a loop statement to create the argfile, like this:
touch /tmp/user_builder_argfile.lst
for thisENTRY in `cat manage_request.txt`; do
LOGIN=`echo ${thisENTRY} | cut -d, -f1`
NAME=`echo ${thisENTRY} | cut -d, -f2`
DEPT=`echo ${thisENTRY} | cut -d, -f3`
EMAIL=`echo ${thisENTRY} | cut -d, -f4`
echo "delete_user -name=${NAME} \n >>/tmp/user_builder_argfile.lst
echo "create_user -name=${NAME} \
\t -password=oracle -expired=true \
\t -desc=${NAME} \
\t -department=${DEPT} \
\t -email=${EMAIL} \
\t -roles="EM_USER \n"
 
 
Search WWH ::




Custom Search