Create Named Credentials by Using emcli

In order to create a named credential, you need to know:

  • Target name (unless you create a global credential)
  • Target type
  •  Credential type associated with the target type

Now we start to create a named credential for cluster database ( RACTEST ) user ( JAMES).

1) To get TARGET_TYPE from TARGET_NAME. Normally we know a couple of target_type from daily emcli practice.

$ emcli get_targets -targets="RACTEST:%"

Status ID Status Target Type  Target Name
1         Up     rac_database  RACTETS

2) To get the credential types (and their attributes) associated with “rac_database”.

$ emcli show_credential_type_info -target_type=rac_database
Target Type  Cred Type Name      Cred Type Column Name Key Column
rac_database DBCreds             DBPassword            No
                                 DBRole                No
                                 DBUserName            Yes
             DBHostCreds         HostPassword          No
                                 HostUserName          Yes
             DBKerberosCreds     DBKerberosPassword    No
                                 DBKerberosUserName    Yes
             DBPkiCreds          DBPkiUserWallet       Yes
                                 DBPkiUserWalletPassword No
                                 DBPkiUserWalletType   No
             HostSSHCreds        SSH_PUB_KEY           No
                                 SSH_PVT_KEY           No
                                 USERNAME              Yes

We can see target type rac_database has four credential types. we will use credential type  DBCreds in the following steps.

3) Create named credential for JAMES user of the RAC database.

$emcli create_named_credential -auth_target_type=rac_database \
 -cred_scope=Instance -target_type=rac_database \
-target_name=RACTEST -cred_type=DBCreds -cred_name=NC_RACTEST_JAMES \
-attributes="DBUserName:JAMES;DBPassword:yourpasswd" -test

Credential NC_RACTEST_JAMES created.

Here “-test” to test the credential before saving.

If you want to create a global named credential, just remove “cred_scope, target_type, target_name” parameters.

Clear Problems in OEM by Using EMCLI

There are many old problems and their incidents in OEM repository for many years.  Here is an example of  how to clear those problems by using emcli. Otherwise you might need log on to OEM console by clearing them from one target to another. Imagine your OEM repository might manage thousands of different kinds of targets.

Subscribe to get access

Read more of this content when you subscribe today.

Clears Stateless Alerts in OEM by Using EMCLI

The Enterprise Manager Agent does not automatically clear those stateless alerts.

This post explains how to clean up stateless alerts, also provides shell scripts to generate commands to automatically clean all stateless alerts if possible.

Subscribe to get access

Read more of this content when you subscribe today.

OEM Shows Scan Listeners Down While All Scan Listeners Are UP

After RAC servers rebooted, or GI cluster restarted,  scan listeners show offline on OEM. Now we explore how to resolve this issue here.

Subscribe to get access

Read more of this content when you subscribe today.

OEM 13c Agent Creates Many OraInstall_Timestamp Directories in /tmp

For Oracle Enterprise Manager 13c agent, it creates many directories and files under /tmp of Linux server:

...
..
.
drwxr-----. 2 oracle oinstall 46 Sep 18 10:05 OraInstall2019-09-18_10-05-53AM
drwxr-----. 2 oracle oinstall 46 Sep 18 10:05 OraInstall2019-09-18_10-05-57AM
drwxr-----. 2 oracle oinstall 46 Sep 18 10:06 OraInstall2019-09-18_10-06-02AM
drwxr-----. 2 oracle oinstall 46 Sep 19 10:05 OraInstall2019-09-19_10-05-49AM
drwxr-----. 2 oracle oinstall 46 Sep 19 10:05 OraInstall2019-09-19_10-05-53AM
drwxr-----. 2 oracle oinstall 46 Sep 19 10:05 OraInstall2019-09-19_10-05-57AM
drwxr-----. 2 oracle oinstall 46 Sep 19 10:06 OraInstall2019-09-19_10-06-01AM
$ cd OraInstall2019-09-19_10-06-01AM

$ ls -ltr
total 4
-rw-r-----. 1 oracle oinstall 129 Sep 19 10:06 nextgen2019-09-19_10-06-01AM.log

$cat nextgen2019-09-19_10-06-01AM.log
2019-09-19 10:06:01,829 INFO [1] oracle.sysman.oii.oiio.oiiol.OiiolTextLogger - OiicStandardInventorySession(OPatch,13.8.0.0.0)

CAUSES

It is a bug for OEM 13c agent which tries to collect ORACLE_HOME configurations, etc.

SOLUTION

  1.  This issue is a bug which is fixed in EM Cloud Control Ver 13.4. Upgrade the OMS/Agents to Ver 13.4 to fix the issue permanently.
  2. Manually or using a cronjob to delete those files.