当前位置:网站首页>重启Oracle监听器会中断已有连接吗
重启Oracle监听器会中断已有连接吗
2022-04-23 05:59:00 【Sebastien23】
问题背景
Oracle RAC架构中,重启两个数据库节点的监听器,是否会影响已经建立的客户端连接?
实验测试
现有两个数据库节点DB01、DB02,对应的SCAN-vip为x.x.x.34,以及一个装有Oracle client的应用服务器AP01。假设数据库名为FLEXCOM,用户账号及密码为flex/xlef_101。
建立一个从应用服务器到数据库的连接。登录AP01执行:
su - oracle
sqlplus flex/[email protected]:1521/FLEXCOM
登录成功。
依次停止两个数据库节点的监听器:
ssh $DB01_IP
su - grid
lsnrctl stop
ssh $DB02_IP
su - grid
lsnrctl stop
测试已有的连接是否断开。回到AP01起先建立的会话,尝试执行SQL语句:
show parameter session;
select grantee,privilege from dba_sys_privs where grantee='XXX';
SQL语句执行成功,可见停止监听器对已经建立的会话没有影响。
测试是否可以建立新的连接:
su - oracle
sqlplus flex/[email protected]:1521/FLEXCOM
ERROR: ORA-12516: TNS:listener could not find available handler with matching protocol stack
Enter user-name:
Enter password:
ERROR: ORA-12162: TNS:net service name is incorrectly specified
可见,停止监听器后,无法再建立新的客户端连接。
启动两个数据库节点的监听器:
ssh $DB01_IP
su - grid
lsnrctl start
ssh $DB02_IP
su - grid
lsnrctl start
检查监听器状态:
lsnrctl status
综上可知,当客户端成功连接到Oracle数据库后,重启监听器并不会中断已有的连接;只是无法建立新的连接。因此,在数据库升级、重启等过程中,需要先停掉监听器,然后杀掉已有的会话连接。
报错分析
在停止监听器后,尝试连接数据库时,我们收到了两个报错信息:ORA-12516和ORA-12162。
ORA-12516: TNS:listener could not find available handler with matching protocol stack
Cause: None of the known and available service handlers for the given SERVICE_NAME support the client’s protocol stack: transport, session, and presentation protocols.
Action: Check to make sure that the service handlers (e.g. dispatchers) for the given SERVICE_NAME are registered with the listener, are accepting connections, and that they are properly configured to support the desired protocols.
ORA-12516是由于我们停止了数据库的监听器造成的。
ORA-12162: TNS:net service name is incorrectly specified
Cause: The connect descriptor corresponding to the net service name in TNSNAMES.ORA or in the directory server (Oracle Internet Directory) is incorrectly specified.
Action: If using local naming make sure there are no syntax errors in the corresponding connect descriptor in the TNSNAMES.ORA file. If using directory naming check the information provided through the administration used for directory naming. If using ORACLE_SID, please check if ORACLE_SID is// set.
ORA-12612是因为我们没有在Oracle client服务器配置tnsnames.ora导致的。
References
【1】Database error maessages
版权声明
本文为[Sebastien23]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Sebastien23/article/details/124316302
边栏推荐
- 浏览器工作原理与实践
- 2021-09-18
- 多线程
- Installing redis using a small leather panel in the window environment
- 百度地图案例-修改地图样式
- Method of MySQL password expiration
- New type of dark energy could solve Universe expansion mystery
- js中entries(),keys(),values() , some(), Object.assign()遍历数组用法
- useCenterHook
- 【代码解析(2)】Communication-Efficient Learning of Deep Networks from Decentralized Data
猜你喜欢
随机推荐
TP5中的getField()方法变化,tp5获取单个字段值
阅读笔记:Meta Matrix Factorization for Federated Rating Predictions
浏览器工作原理与实践
JS正则匹配先行断言和后行断言
el-date-picker限制选择范围,从当前时间到两个月前
LeetCode刷题|368最大整除子集(动态规划)
offset和client获取dom元素位置信息
SQL学习|集合运算
关于注解1
JS手写兼容性事件绑定
页面缓存问题解决方法(慎用)
ubuntu下搭建mysql环境 & 初识SQL
浏览器中堆栈内存的底层处理
Promise(一)
PHP unlimited classification and tree
2021-09-18
The arithmetic square root of X in leetcode
【代码解析(2)】Communication-Efficient Learning of Deep Networks from Decentralized Data
PHP background parsing after JQ serialization
file_get_contents 访问 ssl 错误的两种解决方法









