0

我有两个容器数据库。

  1. SID my10,服务名称为 M10CDB
  2. SID my10c 与服务名称 MY10CL (它是第一个的克隆)

这两个容器都有两个可插拔数据库,my10pdb 和 pdbseed。

如果我想直接连接到它们,我如何区分这两个可插入的,即 my10pdb,属于不同的容器?

lsnrctl status

LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 17-JUL-2020 14:45:26

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MYUPG05.myworld.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 19.0.0.0.0 - Production
Start Date                16-JUN-2020 02:22:27
Uptime                    31 days 12 hr. 22 min. 59 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   C:\app\oracle\product\19.3.0\dbhome_1\network\admin\listener.ora
Listener Log File         C:\app\oracle\diag\tnslsnr\MYUPG05\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MYUPG05.myworld.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
Services Summary...
Service "3541dad180144e9fb63afda77b213f89" has 2 instance(s).
  Instance "my10", status READY, has 1 handler(s) for this service...
  Instance "my10c", status READY, has 1 handler(s) for this service...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "MY10CDB" has 1 instance(s).
  Instance "my10", status READY, has 1 handler(s) for this service...
Service "MY10CL" has 1 instance(s).
  Instance "my10c", status READY, has 1 handler(s) for this service...
Service "MY10XDB" has 2 instance(s).
  Instance "my10", status READY, has 1 handler(s) for this service...
  Instance "my10c", status READY, has 1 handler(s) for this service...
Service "my10pdb" has 2 instance(s).
  Instance "my10", status READY, has 1 handler(s) for this service...
  Instance "my10c", status READY, has 1 handler(s) for this service...
The command completed successfully
4

1 回答 1

1

它们必须具有唯一的服务名称。如果它们共享相同的服务名称,那么侦听器会将它们视为 RAC 数据库,并将您随机连接到其中一个。

查看这些文章,其中详细描述了您的问题:

使用 DBMS_SERVICE 在新 PDB 中创建新服务并删除旧服务。

CONN / AS SYSDBA
ALTER SESSION SET CONTAINER=pdb1;

BEGIN
  DBMS_SERVICE.create_service(
    service_name => 'my_new_service',
    network_name => 'my_new_service'
  );
END;
/

BEGIN
  DBMS_SERVICE.start_service(
    service_name => 'my_new_service'
  );
END;
/

BEGIN
  DBMS_SERVICE.stop_service(
    service_name => 'my_old_service'
  );
END;
/

BEGIN
  DBMS_SERVICE.delete_service(
    service_name => 'my_old_service'
  );
END;
/
于 2020-07-17T14:43:25.863 回答