Database Reference
In-Depth Information
sqlplus -S ${SYSMAN_CONNECT} <<EOF 1>/dev/null
SET ECHO OFF
SET FEEDBACK OFF HEADING OFF LINES 250 PAGES 999
SPOOL ${ARGFILE01}
SELECT 'create_role -name="' || role_name || '" -description="' || description || '"'
FROM sysman.gc_roles
WHERE role_type= '1';
SPOOL OFF
SPOOL ${ARGFILE02}
SELECT 'create_user -name="' || user_name || '" -description="' || user_description ||
'" -password='||oracle||
" -expired="||true||'"'
FROM sysman.gc_users
WHERE user_name NOT IN ('SYSMAN')
ORDER BY user_name;
SPOOL OFF
SPOOL ${ARGFILE03}
SELECT 'grant_roles -name="' || user_name || '" -roles="' || role_name || '"'
FROM sysman.gc_user_roles;
SPOOL OFF
exit
EOF
emcli login -user=sysman -pass=${CONSOLE_PWD}
emcli -argfile ${ARGFILE01}
emcli -argfile ${ARGFILE02}
emcli -argfile ${ARGFILE03}
Changing EM Administrator References
As we mentioned in the previous section, all of the information you create through OEM is stored in the repository
database. User data for OEM accounts is stored in the sysman.mgmt_created_users table. You should never directly
change data in the repository, of course, but you may use it as reference data.
Updating an individual administrator is simple and straightforward through the EM console. However, what if the
name of department changed or a group of administrators changed locations?
You could create a short script to change the references when everyone in department 200 gets assigned to
department 500 by gathering a list of employees in department 200 into a spool file and then rolling through each
line in the spool file to create modify_user statements for each one. The script consists of a combination of SQL and
EM CLI commands. Right now there are no CLI verbs to gather this information directly, so we'll pull it from the
repository.
 
Search WWH ::




Custom Search