login
Logs into Enterprise Manager with the given credentials and sets up a session with the OMS.
Note:
To avoid an uncommon occurrence in which multiple emcli sessions are created on the OMS, Oracle recommends that you enter the login command before running a script containing EM CLI commands.
Standard Mode
emcli login -username=<EM_Console_Username> [-password=<EM_Console_Password>] [-force] [ ] indicates that the parameter is optional
Interactive or Script Mode
login (username="<EM_Console_Username>" [,password="<EM_Console_Password>"] [,force=True|False]) [ ] indicates that the parameter is optional
Options
-
username
Enterprise Manager user name to be used by all subsequent EM CLI commands when contacting the OMS.
-
password
Enterprise Manager user password. If you do not specify this , you are prompted for the password interactively.
Note:
Providing a password on the command line is insecure and should be avoided.
-
force
Force a login even if there is an existing session. The value must be set to either True or False for Interactive or Script Mode.
Examples
These examples show a login as a different user using newly specified credentials, then a subsequent login using the previous credentials.
Example 1 - Command-Line
emcli logout
emcli login -user=new_user -pass=new_user_pass
emcli <verb-name>
emcli logout
emcli login -user=old_user -pass=old_user_pass
Example 2 - Scripting and Interactive
logout()
login(username="new_user", password="new_user_pass")
<verb-name>
logout()
login(username="old_user", password="old_user_pass")
See Also