Database Reference
In-Depth Information
>>/tmp/user_builder_argfile.lst
done
echo "\n\nArgfile has been created\n"
cat /tmp/user_builder_argfile.lst
We end up with an argfile that looks like this:
delete_user -name=e123450
create_user -name=e123450 -password=oracle -expired=true \
-desc=Jerry -department=A100 -email=jerry@samplecorp.com-roles=EM_USER
delete_user -name=e123451
create_user -name=e123451 -password=oracle -expired=true \
-desc=Bobby -department=A100 -email=bobby@samplecorp.com-roles=EM_USER
. . .
At run-time we'll see this:
>emcli argfile /tmp/user_builder_argfile.lst
>User "e123450"deleted successfully
>User "e123450"created successfully
>User "e123451"deleted successfully
>User "e123451"created successfully
...
It's fast and efficient because all of the commands are issued to the OMS in one CLI session, reducing the
overhead of sending each command to the OMS for processing as a separate transaction.
Cloning OEM Roles and Users Between OMS Instances
Sandbox OEM servers are part of a well-designed OEM environment, but copying EM security data from one
repository to another can be difficult without EM CLI. This example combines SQL*Plus and EM CLI to gather data
from the existing environment and then reproduce it in the sandbox quickly and completely.
First, we'll create three spool files from queries against the SYSMAN schema in the existing OEM repository
database. Those spool files will become the EM CLI argfiles we'll use to build the roles, users, and grants.
The SYSMAN schema in the repository database contains all the information gathered or set by OEM. When
the EM agents upload their latest metrics to the management server, the values are posted to tables in the SYSMAN
schema. Whenever you request a page in the console it is populated from data in SYSMAN.
#!/bin/bash# =====================================================
# File: clone_em_users.sh
# Purpose: Copy OEM roles and user account between instances
# Parameters : None
# =====================================================
ARGFILE01=/tmp/argfile_create_roles.txt
ARGFILE02=/tmp/argfile_create_users.txt
ARGFILE03=/tmp/argfile_grant_roles.txt
 
Search WWH ::




Custom Search