发布网友 发布时间:2022-04-22 17:44
共1个回答
热心网友 时间:2022-04-10 13:27
这个不是命令配置的,是改文件
如果是服务端:
$ORACLE_HOME/network/ADMIN目录,修改LISTENER.ORA
到$ORACLE_HOME/bin下,通过lnsrctl start启动监听 lnsrctl stop | lnsrctl status 分别是停止监听和查看监听状态
如果是客户端:
$ORACLE_HOME/network/ADMIN目录,修改tnsnames.ora
==========================================================
配置LISTENER.ORA的demo:
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
#BEQUEATH CONFIG
(GLOBAL_DBNAME=salesdb.mycompany)
(SID_NAME=sid1)
(ORACLE_HOME=/private/app/oracle/proct/8.0.3)
#PRESPAWN CONFIG
(PRESPAWN_MAX=20)
(PRESPAWN_LIST=
(PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
)
)
)
配置tnsnames.ora的demo:
ora_xxx =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora11g) <-----这个地方填SID_NAME也行
)
)