L Correcting the Database Domain Name to Avoid or Resolve Database Link Error

If your database domain name has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), then the Run Presync step of the switchover operation might fail, and you will see the following error in the emoms.trc trace file. For example, a database domain name with a hyphen (-) can result in this issue.

ORA-20000: Found exception Error Message :ORA-02083: database name has illegal character '-' Error Number ;-2083

This appendix describes how you can circumvent this error if you have not already started your upgrade, and how you can work around this error if you have already started the upgrade and if you are seeing an error on the Create Upgraded Oracle Management Repository Link page.

In particular, this section covers the following:

L.1 Avoiding the Database Link Error Before Starting the Upgrade Process

To circumvent the database link issue, as a prerequisite, follow these steps:

  1. Run the following SQL commands as SYS user on the old as well as the new Management Repository:

    1. Verify the domain name:

      show parameters db_domain;

    2. If the domain name has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), for example, a '-' (hyphen), then change the domain name.

      alter system set db_domain='<domain_name_with_illegal_char_replaced_with_legal_char>' scope=spfile sid='*';

    3. Verify the service name:

      show parameters service_names;

    4. If the service name has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), for example, a '-' (hyphen), then change the service name.

      alter system set service_names='service_name_with_illegal_char_replaced_with_legal_char' scope=both sid='*';

    5. Verify the global name:

      select * from global_name;

    6. If the global name has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), for example, a '-' (hyphen), then change global name.

      alter database rename GLOBAL_NAME to "global_name_with_illegal_char_replaced_with_legal_char";

  2. Update the SERVICE_NAME value with the changed or corrected service name in the following files:

    $<DB_HOME>/network/admin/listener.ora

    $<DB_HOME>/network/admin/tnsnames.ora

  3. Perform these steps on the old as well as the new OMS:

    1. Verify the connect descriptor for OMS:

      $<OMS_HOME>/bin/emctl config oms -list_repos_details

    2. If the service name in the connect descriptor has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), for example, a '-' (hyphen), then change the connect descriptor.

      $<OMS_HOME>/bin/emctl config oms -store_repos_details -repos_conndesc '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = example.com)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = service_name_with_illegal_char_replaced_with_legal_char)))' -repos_user sysman

    3. Restart the OMS.

      $<OMS_HOME>/bin/emctl stop oms -all

      $<OMS_HOME>/bin/emctl start oms

  4. Restart the database:

    SQL>shutdown immediate;

    SQL>start the database

L.2 Resolving the Database Link Error That Appears While the Upgrade Process Is in Progress

To resolve the database link issue if you see an error on the Create Link to Upgraded Repository page of the Preupgrade Console, run the following commands as SYS user:

  1. Drop the database link:

    • If the database link is already created in the old repository, run the following command:

      drop public database link PREUPGTO_NG_LINK;

    • If the database link is already created in the new repository, run the following command:

      drop public database link PREUPG_EMREPO_LINK;

  2. Run the following SQL commands as SYS user on the old as well as the new Management Repository:

    1. Verify the domain name:

      show parameters db_domain;

    2. If the domain name has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), for example, a '-' (hyphen), then change the domain name.

      alter system set db_domain='domain_name_with_illegal_char_replaced_with_legal_char' scope=spfile sid='*';

    3. Verify the service name:

      show parameters service_names;

    4. If the service name has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), for example, a '-' (hyphen), then change the service name.

      alter system set service_names='service_name_with_illegal_char_replaced_with_legal_char' scope=both sid='*';

    5. Verify the global name:

      select * from global_name;

    6. If the global name has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), for example, a '-' (hyphen), then change global name.

      alter database rename GLOBAL_NAME to "global_name_with_illegal_char_replaced_with_legal_char";

  3. Update the SERVICE_NAME value with the changed/corrected service name in the following files:

    $<DB_HOME>/network/admin/listener.ora

    $<DB_HOME>/network/admin/tnsnames.ora

  4. Perform these steps on the old as well as the new OMS:

    1. Verify the connect descriptor for OMS:

      For 11g and 12c OMS, run the following command:

      $<OMS_HOME>/bin/emctl config oms -list_repos_details

      For 10g OMS, open the emoms.properties file.

    2. If the service name in the connect descriptor has any characters other than A-Z (letters), 0-9 (numerals), _ (underscore), # (hash), $ (dollar),. (period), or @ (at the rate), for example, a '-' (hyphen), then change the connect descriptor.

      For 11g and 12c OMS, run the following command:

      $<OMS_HOME>/bin/emctl config oms -store_repos_details -repos_conndesc '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = example.com)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = service_name_with_illegal_char_replaced_with_legal_char)))' -repos_user sysman

      For 10g OMS, edit the connect descriptor directly in the emoms.properties file, and save the file.

    3. Restart the OMS:

      $<OMS_HOME>/bin/emctl stop oms -all

      $<OMS_HOME>/bin/emctl start oms

  5. Restart the database:

    SQL>shutdown immediate;

    SQL>start the database

  6. Create or re-create the database link from the Create Link to Upgraded Repository page of the Preupgrade Console. For instructions, see Section 13.2.

  7. Create the database link in the new Management Repository.

    1. Verify the global names parameter:

      show parameters global_names;

      If global_names is set to FALSE, then use the database link name PREUPG_EMREPO_LINK.If it is set to TRUE, then use the database link name <value_of_"select * from global_name"_from_the_old_Management_Repository>.

      Run the following command to use the database link:

      CREATE PUBLIC DATABASE LINK <db_link_name> CONNECT TO SYSMAN IDENTIFIED BY welcome1 using '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=example.com)(PORT=1521)))(CONNECT_DATA=(SID=orcl)))';

    2. Update the database link name in the new Management Repository:

      UPDATE sysman.MGMT_UPGRADEUTIL_PROPS SET property_value='<db_link_name>' WHERE property_name = 'PREUPG_EMREPO_DBLINK_NAME'

  8. Verify the database link in the old as well as the new Management Repository:

    • Run the following SQL commands on the old Management Repository:

      DECLARE

      l_count number;

      begin

      select count(*) into l_count from mgmt_targets@PREUPGTO_NG_LINK;

      end;

      /

    • Run the following SQL commands on the new Management Repository:

      DECLARE

      l_count number;

      begin

      select count(*) into l_count from mgmt_targets@<db_link_name>;

      end;

      /