On Oracle Community forum, I’ve seen a good question about using EMCLI to add targets. The forum user says that they decided to name the database targets with combining db_name and hostname. As you may know, when you add a database target, EM also creates a database system for the new target (or assign it with an existing one). The new database system’s name is generated by adding “_sys” to the database target name. Let’s we add a database target named TEST, EM will create a database system as TEST_sys. If we name our database target as “TEST_test.gokhanatil.com”, EM will create a database system named “TEST_test.gokhanatil.com_sys”.

In my personal opinion, Enterprise Manager provides enough flexibility to report these information so I wouldn’t use this kind of naming system but that’s not the point. As you see, it works well for stand alone databases but when you add a standby database to this system, it becomes confusing. For example, your TESTSTBY_stby.gokhanatil.com will be part of TEST_test.gokhanatil.com_sys. So the forum user asks if we can give a specific name to the database system instead of default naming. For example, our database system will be named as TEST_sys although its members are TEST_test.gokhanatil.com and TESTSTBY_stby.gokhanatil.com.

If you use the web console, it’s possible to set a name for the database system, but as I see, there’s no option or parameter for it on emcli. So my solution is using a “hidden gem” in emcli verbs: rename_target.

Let’s say we add a target databases like this:

Wait for a while and check if the database system is created:

Now let’s rename the new database system and check the result:

When we add the standby database of TEST_test.gokhanatil.com, Enterprise Manager will assign it to TEST_sys system. I hope this method solves the problem. We couldn’t give a specific name to the database system when adding the database target because there’s no (documented) parameter for it. So as a workaround, we renamed it after it’s created.

Leave a Reply

Your email address will not be published. Required fields are marked *