16.3.12 ORA-12521

Indicates that the listener cannot identify the instance requested in the connect descriptor.

Message

ORA-12521: Cannot connect to database.
Instance string for service string
  is not registered with the listener at string.
(CONNECTION_ID=string)
For example:
ORA-12521: Cannot connect to database.
Instance sales_instance for service sales_service.example.com
  is not registered with the listener at host 10.9.7.5 port 1522.
(CONNECTION_ID=1ABcDEabCd1aB+AbCdE1aB==)

Cause

A listener process initially handles all connections to Oracle Database. In addition to the service name, the connection request received by the listener specified an instance name for an instance (usually a database instance) that either has not been dynamically registered with the listener or has not been statically configured in the listener's listener.ora configuration file. This error may be a temporary condition that occurs after the listener has started but before the database instance registers with the listener.

Action

  1. Check for mistakes in the specified connection string.

  2. Ensure that the INSTANCE_NAME parameter in the connection string or that the tnsnames.ora file connect descriptor specifies an instance known by the listener.

  3. If using an Easy Connect connection string, then check that the specified instance name is known by the listener.

  4. Wait a moment, and then try to connect again. The database instance registration may not be complete yet.

  5. Use the CONNECTION_ID value to track this connection attempt in trace files for further diagnosis.

  6. Check which instances are currently known by the listener by performing one of these tasks:
    • Ask your database administrator.

    • Review the connection string in the cloud service console.

    • If you have access to the machine where the listener is running, then run one of the following:
      • lsnrctl services

      • If a listener is named in the listener.ora file, then run:
        lsnrctl services listener_name
      • If an Oracle Connection Manager (Oracle CMAN) proxy listener is named in the cman.ora file, then run:
        cmctl show services -c cman_name
      • If an Oracle Global Service Manager (Oracle GSM) listener is named in the gsm.ora file, then run:
        gdsctl services -raw -gsm gsm_name