1、lsnrctl status 确保PDB容器监听正常
2、确保PDB容器读写正常
sqlplus / as sysdba
show pdbs;
3、修改 tnsname.ora文件
cd /opt/oracle/product/19c/dbhome_1/network/admin
vi tnsnames.ora (追加,保持原有内容不变,在后面追加下面内容)
ORA19CPDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = IP)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORA19CPDB) ) ) ORA19CPDB_SID = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = IP)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = ORA19CPDB) ) )
4、修改 listener.ora ,在后面追加
USE_SID_AS_SERVICE_LISTENER = ON
5、重启监听
lsnrctl stop
lsnrctl start
6、重新装载数据库
sqlplus / as sysdba
shutdown immediate
startup
7、测试连接
tnsping ora19cpdb_sid
8、sqlplus 使用sid连接,问题不大
标签:lsnrctl,sqlplus,SID,Oracle,ORA19CPDB,PDB,ora From: https://www.cnblogs.com/wag1027/p/17664316.html