gpt4 book ai didi

oracle - 如何使用新创建的 LISTENER 注册可插拔数据库 (PDB)

转载 作者:行者123 更新时间:2023-12-04 00:16:30 28 4
gpt4 key购买 nike

我正在与 Oracle 19c 一起工作在 centos 7 .安装 Oracle 后,我创建了新的 容器数据库(CDB) 可插拔数据库(PDB) 使用 DBCA。
我正在与 port number=1522 一起工作

[oracle@ol8-19 ~]$ lsnrctl start LISTENER_TST

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 17-AUG-2020 16:02:02

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

Starting /opt/Oracle19c/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/Oracle19c/network/admin/listener.ora
Log messages written to /opt/oraclebase19c/diag/tnslsnr/ol8-19/listener_tst/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol8-19.localdomain)(PORT=1522)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol8-19.localdomain)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER_TST
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 17-AUG-2020 16:02:02
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/Oracle19c/network/admin/listener.ora
Listener Log File /opt/oraclebase19c/diag/tnslsnr/ol8-19/listener_tst/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol8-19.localdomain)(PORT=1522)))
The listener supports no services
The command completed successfully
这是我的 Listener.ora 文件。
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

LISTENER_TST =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1522))
)
)
这是我的 tnsnames.ora 文件。
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1521))


LISTENER_ABC =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1522))

ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

ABC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol8-19.localdomain)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ABC)
)
)
我的可插拔数据库名称是 PDB。如何使用端口 1522 向我的监听器注册 PDB?

最佳答案

连接空闲实例并启动实例

[oracle@ol8-19 ~]$ sqlplus / as sysdba

SQL> startup;
将容器更改为该可插拔数据库
SQL> alter session set container=pdb;
Session altered.
并打开它
SQL> alter pluggable database pdb open;
现在,您设置 local_listener
SQL> alter system set local_listener='(address=(protocol=tcp)(host=ol8-19.localdomain)
(port=1522))' scope=spfile;

System altered.
并发出以下命令以立即注册服务
SQL> alter system register;

System altered.
并重新启动可插拔数据库
SQL> alter pluggable database pdb close immediate;

SQL> alter pluggable database pdb open;

SQL> exit;
然后启动监听器
[oracle@ol8-19 ~]$ lsnrctl start
并重新检查监听器的当前状态
[oracle@ol8-19 ~]$ lsnrctl status
这应该在半分钟内开始。

关于oracle - 如何使用新创建的 LISTENER 注册可插拔数据库 (PDB),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63458885/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com