所以我和甲骨文斗争了将近两天,我放弃了。我相信我检查了谷歌叔叔提供的所有解决方案。
总结一下我的问题:
但是当我尝试登录pdb时
-Sqlplus(本地主机)-甲骨文/产品/19/dbhome/bin/sqlplus系统/密码@pdb
-Impdp (本地主机)
-Sqldeveloper (远程)

我收到一个错误:
ERROR:ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 4376
Additional information: -1774770425
Process ID: 0
Session ID: 0 Serial number: 0我的环境看起来是:
show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
2 PDB$SEED READ ONLY NO
3 ORCLPDB MOUNTED
4 PDB READ WRITE NO
$ echo $ORACLE_HOME
/oracle/product/19/dbhome
$ echo $ORACLE_SID
orcl听众:
cat /oracle/product/19/dbhome/network/admin/listener.ora
# listener.ora Network Configuration File: /oracle/product/19/dbhome/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /oracle/product/19/dbhome)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = orclpdb)
(ORACLE_HOME = /oracle/product/19/dbhome)
(SID_NAME = orclpdb)
)
(SID_DESC =
(GLOBAL_DBNAME = pdb)
(ORACLE_HOME = /oracle/product/19/dbhome)
(SID_NAME = pdb)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.103.19.240)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)姓名:
cat /oracle/product/19/dbhome/network/admin/tnsnames.ora
ORCL=
(description=
(address_list=
(address = (protocol = TCP)(host = 10.103.19.240)(port = 1521))
)
(connect_data =
(service_name=orcl)
)
)
PDB=
(description=
(address_list=
(address = (protocol = TCP)(host = 10.103.19.240)(port = 1521))
)
(connect_data =
(service_name=pdb)
)
)基于
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4听众状态:
$ /oracle/product/19/dbhome/bin/lsnrctl start
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 15-SEP-2020 12:11:13
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /oracle/product/19/dbhome/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /oracle/product/19/dbhome/network/admin/listener.ora
Log messages written to /oracle/diag/tnslsnr/ies-phipdb-r77/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.103.19.240)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.103.19.240)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 15-SEP-2020 12:11:13
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/19/dbhome/network/admin/listener.ora
Listener Log File /oracle/diag/tnslsnr/ies-phipdb-r77/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.103.19.240)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Service "orclpdb" has 1 instance(s).
Instance "orclpdb", status UNKNOWN, has 1 handler(s) for this service...
Service "pdb" has 1 instance(s).
Instance "pdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully,你知道为什么它不起作用吗?以及如何使它工作?
问候皮奥特
发布于 2020-09-15 12:46:59
这是SID_LIST_LISTENER在listener.ora中的配置
将可插入的列表作为"SID“,意味着监听器提供这些名称,就像它们是实例一样。这就是您获得“共享领域等”的原因,因为这些实例不存在(因此启动)。
一个典型的listener.ora可能看起来像
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1519))
)
)
SID_LIST_LISTENER19 =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oracle\product\19)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\oracle\product\19\bin\oraclr19.dll")
)
)在您可以看到条目的地方,只需要支持主机/端口和外部程序。每个可插拔程序都会很高兴地向监听器注册,然后监听器会将可插入性作为服务提供出去。
发布于 2020-09-16 09:31:04
在我的Vagrant/Virtualbox环境中:
重命名listener.ora (使用默认设置)
[oracle@localhost ~]$ mv /u01/app/oracle/product/19.0.0/grid/network/admin/listener.ora /u01/app/oracle/product/19.0.0/grid/network/admin/listener.ora.1重新启动监听器
[oracle@localhost ~]$ lsnrctl stop; lsnrctl start; lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 16-SEP-2020 11:10:41
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 16-SEP-2020 11:10:41
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 16-SEP-2020 11:10:41
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
The listener supports no services
The command completed successfully
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 16-SEP-2020 11:10:41
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 16-SEP-2020 11:10:41
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
The listener supports no services
The command completed successfully还没有通过侦听器公开的服务!
# A database background process is responsible for registration every 30 sec,
# but we can force service registration
[oracle@localhost ~]$ echo 'alter system register;' | sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 16 11:11:41 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
System altered.
SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0哦,是的!有服务
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 16-SEP-2020 11:12:12
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 16-SEP-2020 11:10:41
Uptime 0 days 0 hr. 1 min. 30 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "86b637b62fdf7a65e053f706e80a27ca.oradb3.private" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "af547de90c477ffee055000000000001.oradb3.private" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl.oradb3.private" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.oradb3.private" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "pdb1.oradb3.private" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully我的CDB名为: orcl.oradb3.private
# now, let's connect!
[oracle@localhost ~]$ sqlplus system/Welcome1@localhost:1521/orcl.oradb3.private
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 16 11:21:05 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Last Successful login time: Wed Sep 16 2020 11:20:48 +02:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> col name for a30
SQL> r
1* select con_id, name from v$pdbs
CON_ID NAME
---------- ------------------------------
2 PDB$SEED
3 PDB1我的PDB名为: pdb1.oradb3.private
# now, let's connect!
[oracle@localhost ~]$ sqlplus system/Welcome1@localhost:1521/pdb1.oradb3.private
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 16 11:24:46 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Last Successful login time: Wed Sep 16 2020 11:21:05 +02:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> sho con_id
CON_ID
------------------------------
3
SQL>确保可以使用EZConnect进行连接,然后修改tnsnames.ora以反映公开的服务。
祝你好运!
发布于 2020-09-16 18:57:08
谢谢你的重播和你花在它上的时间。
解决了在Listener.ora和tnsnames.ora中将FQDN后缀添加到PDB名称中的问题。
此外,为了远程连接,我也需要添加这个后缀。
https://stackoverflow.com/questions/63900684
复制相似问题