0

我使用的设置是https://oracle-base.com/articles/19c/minimum-viable-oracle-database-19c-installation-on-ol8#download-software这样做的:

sqlplus / as sysdba <<EOF
alter session set container=ORCLPDB1;

create user testuser1 identified by testuser1 quota unlimited on users;
grant connect, resource to testuser1;

exit;
EOF

登录数据库成功:

sqlplus testuser1/testuser1@//localhost:1521/ORCLPDB1

但是ora2pg.conf这样设置了一个文件:

ORACLE_DSN      dbi:Oracle:host=localhost;service_name=ORCLCDB;port=1521
ORACLE_USER     testuser1
ORACLE_PWD      testuser1

...我无法登录。我努力了

  1. 更改 DSN 并正确地说它根本找不到数据库;好的
  2. 更改 service_name 并显示不存在此类服务;好的
  3. 尝试service_name=ORCLCDB(如出现在 中) tnsnames.oraservice_name=ORCLCDB1. 稍等片刻然后失败;快速失败:ORACLE_DSNORCLCDBORCLCDB1
FATAL: 12514 ... ORA-12514: TNS:listener does not currently know of service requested in connect descriptor (DBD ERROR: OCIServerAttach)

ora2pg.conf是 dist 版本的副本,仅更改了 DNS、USER 和 PWD。

有任何想法吗?

4

1 回答 1

1

您的可插拔数据库的服务名称是ORCLPDB1,因此请使用它而不是 CDB 服务名称(ORCLCDB):

ORACLE_DSN      dbi:Oracle:host=localhost;service_name=ORCLPDB1;port=1521
ORACLE_USER     testuser1
ORACLE_PWD      testuser1
于 2021-10-06T23:03:19.253 回答