[20170824]11G备库启用DRCP连接.txt
[20170824]11G备库启用DRCP连接.txt
--//参考链接:
http://blog.itpub.net/267265/viewspace-2099397/
blogs.oracle.com/database4cn/adg%e5%a4%87%e5%ba%93%e7%9a%84drcp%e8%bf%9e%e6%8e%a5%e6%8a%a5%e9%94%99oci-21500%e8%a7%a3%e5%86%b3%e4%b8%80%e4%be%8b
1.测试环境:
SYS@bookdg> startup
ORACLE instance started.
Total System Global Area 634732544 bytes
Fixed Size 2255792 bytes
Variable Size 197133392 bytes
Database Buffers 427819008 bytes
Redo Buffers 7524352 bytes
Database mounted.
Database opened.
SYS@bookdg> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@bookdg> alter database recover managed standby database using current logfile disconnect ;
Database altered.
SYS@bookdg> exec dbms_connection_pool.start_pool();
BEGIN dbms_connection_pool.start_pool(); END;
*
ERROR at line 1:
ORA-56501: DRCP: Pool startup failed
ORA-56501: DRCP: Pool startup failed
ORA-06512: at "SYS.DBMS_CONNECTION_POOL", line 4
ORA-06512: at line 1
--//奇怪我启动就报错!!先在主库执行启动,然后备库执行启动.
SYS@book> exec dbms_connection_pool.start_pool()
PL/SQL procedure successfully completed.
SYS@bookdg> exec dbms_connection_pool.start_pool();
PL/SQL procedure successfully completed.
--//这样ok了.
2.测试备库是否能连接使用POOL.
$ sqlplus scott/book@192.168.100.40:1521/bookdg:POOLED
SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 24 09:22:44 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-56600: DRCP: Illegal call [First call inconsistency]
Errors in file :
OCI-21500: internal error code, arguments: [kpplcSyncState:Error in sync], [56600], [], [], [], [], [], []
Errors in file :
OCI-21500: internal error code, arguments: [kgepop: no error frame to pop to], [], [], [], [], [], [], []
OCI-21500: internal error code, arguments: [kpplcSyncState:Error in sync], [56600], [], [], [], [], [], []
Errors in file :
OCI-21500: internal error code, arguments: [kgepop: no error frame to pop to], [], [], [], [], [], [], []
OCI-21500: internal error code, arguments: [kpplcSyncState:Error in sync], [56600], [], [], [], [], [], []
b?縝?縝?縝??
--//可以发现连接报错.OCI-21500.
$ oerr ora 56600
56600, 0000, "DRCP: Illegal call [%s]"
// *Cause: An illegal OCI function call was issued.
// *Action: Check the documentation for Database Resident Connection Pool (DRCP) usage.
$ oerr oci 21500
21500, 00000, "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
// *Cause: This is the generic error number for the OCI
// environment (client-side) internal errors. This indicates
// that the OCI environment has encountered an exceptional
// condition.
// *Action: Report as a bug - the first argument is the internal error number.
--//作者采用跟踪包,发现执行dml语句,因为备库是只读打开,应用日志.
SCOTT@bookdg> select * from emp for update;
select * from emp for update
*
ERROR at line 1:
ORA-16000: database open for read-only access
--//作者通过跟踪16000事件,确定问题语句.
SYS@bookdg> alter system set events='16000 trace name errorstack forever,level 12';
System altered.
--//再次执行:
$ sqlplus scott/book@192.168.100.40:1521/bookdg:POOLED
SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 24 09:31:54 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-56600: DRCP: Illegal call [First call inconsistency]
--//alert显示如下:
Errors in file /u01/app/oracle/diag/rdbms/bookdg/bookdg/trace/bookdg_l002_22744.trc:
ORA-16000: database open for read-only access
Dumping diagnostic data in directory=[cdmp_20170824093412], requested by (instance=1, osid=22744 (L002)), summary=[abnormal process termination].
Dumping diagnostic data in directory=[cdmp_20170824093413], requested by (instance=1, osid=22744 (L002)), summary=[abnormal process termination].
*** 2017-08-24 09:32:00.997
dbkedDefDump(): Starting a non-incident diagnostic dump (flags=0x0, level=3, mask=0x0)
----- Error Stack Dump -----
ORA-16000: database open for read-only access
----- Current SQL Statement for this session (sql_id=4m7m0t6fjcs5x) -----
update seq$ set increment$=:2,minvalue=:3,maxvalue=:4,cycle#=:5,order$=:6,cache=:7,highwater=:8,audit$=:9,flags=:10 where obj#=:1
--//不知道作者如何猜出audit$=:9,与审计有关...
$ ps -ef | grep l002
oracle 22744 1 1 09:19 ? 00:00:14 ora_l002_bookdg
$ ps -ef | grep -e ora_l0 -e ora_n0 | grep -v grep
oracle 22738 1 0 09:19 ? 00:00:00 ora_n000_bookdg
oracle 22740 1 0 09:19 ? 00:00:00 ora_l000_bookdg
oracle 22742 1 0 09:19 ? 00:00:00 ora_l001_bookdg
oracle 22744 1 0 09:19 ? 00:00:14 ora_l002_bookdg
oracle 22746 1 0 09:19 ? 00:00:00 ora_l003_bookdg
ora_n000_XXX => Connection Broker Process
ora_l000_XXX => Pooled Server Process(Handles client requests in Database Resident Connection Pooling)
3.如果真是审计引起的,关闭就ok了.
--//实际上对于备库及时审计打开的,备库也会设置为OS.备库设置read only时,alert提示如下:
Thu Aug 24 10:02:39 2017
ALTER DATABASE OPEN
AUDIT_TRAIL initialization parameter is changed to OS, as DB,EXTENDED is NOT compatible for database opened with read-only access
SYS@bookdg> show parameter audit_trail
NAME TYPE VALUE
----------- ------ -------
audit_trail string OS
SYS@bookdg> show spparameter audit_trail
SID NAME TYPE VALUE
-------- ------------ ------- ---------
* audit_trail string DB
* audit_trail string EXTENDED
--//修改为none看看.先备份
$ cp spfilebookdg.ora spfilebookdg.ora_20170824
SYS@bookdg> alter system set audit_trail=none scope=spfile ;
System altered.
--//重启看看.
SYS@bookdg> alter database recover managed standby database cancel ;
Database altered.
SYS@bookdg> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@bookdg> startup
ORACLE instance started.
Total System Global Area 634732544 bytes
Fixed Size 2255792 bytes
Variable Size 197133392 bytes
Database Buffers 427819008 bytes
Redo Buffers 7524352 bytes
Database mounted.
Database opened.
SYS@bookdg> alter database recover managed standby database using current logfile disconnect ;
Database altered.
SYS@bookdg> exec dbms_connection_pool.start_pool();
PL/SQL procedure successfully completed.
$ sqlplus scott/book@192.168.100.40:1521/bookdg:POOLED
SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 24 09:59:16 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SCOTT@192.168.100.40:1521/bookdg:POOLED> select * from dept ;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SCOTT@192.168.100.40:1521/bookdg:POOLED> select * from dept for update ;
select * from dept for update
*
ERROR at line 1:
ORA-16000: database open for read-only access
--//OK,现在能使用DRCP在备库连接数据库了.
[20170824]11G备库启用DRCP连接.txt的更多相关文章
- [20170825]11G备库启用DRCP连接3.txt
[20170825]11G备库启用DRCP连接3.txt --//昨天测试了11G备库启用DRCP连接,要设置alter system set audit_trail=none scope=spfil ...
- Oracle备库TNS连接失败的分析
今天在测试12c的temp_undo的时候,准备在备库上测试一下,突然发现备库使用TNS连接竟然失败. 抛出的错误如下: $ sqlplus sys/oracle@testdb as sysdba S ...
- Oracle 11g DRCP连接方式——基本原理
学习Oracle是一个复杂.繁琐的过程.在浩如烟海的Oracle官方资料.新特性.MOS资料和各种Internal知识面前,我们总是觉得力不从心.不知所措.但是,这往往也就是我们不断坚持.积累和追寻的 ...
- 使用DUPLICATE 方式创建ORACLE 11G DG备库环境
我的最佳实践 ① 手动创建好初始化参数文件: *.audit_file_dest='E:\APP\XJXU\ADMIN\ORASTAND\ADUMP'*.control_files='E:\APP\X ...
- ORACLE 11g 用Duplicate恢复Data Guard 备库详细过程
1.先查找备库控制文件路径 先在备库上找出控制文件的路径,通过和主库一样,不过为了以防万一,还是check为好. SQL> select name from v$controlfile; NA ...
- Oracle DG强制激活 备库
在实际运营环境中,我们经常碰到类似这样的需求,譬如想不影响现网业务评估DB补丁在现网环境中运行的时间,或者是想在做DB切换前想连接Standby DB做实际业务运行的测试,如果在9i版本的时候,想做到 ...
- oracle data guard备库备份恢复
客户有套data guard环境,主库在阿里云上,备库在本地机房,现在想定期做备份,但是因为一些原因,备份阿里云上的主库实现会有些问题,所以只能备份本地的备库.目前需求就是测试备库的备份文件是否可以进 ...
- OGG 从Oracle备库同步数据至kafka
OGG 从Oracle备库同步数据至kafka Table of Contents 1. 目的 2. 环境及规划 3. 安装配置JDK 3.1. 安装jdk 3.2. 配置环境变量 4. 安装Data ...
- pgsql物理复制(pgsql 备库的搭建以及角色互换,提升)
结构图如下: Postgresql早在9.0版本开始支持物理复制,也称为流复制,通过从实例级复制出一个与主库一模一样的备库.流复制同步方式有同步,异步两种,如果主节点和备节点不是很忙,通常异步模式下备 ...
随机推荐
- 09-部署配置kubedns插件
安装和配置 kubedns 插件 官方的yaml文件在:kubernetes/cluster/addons/dns. 该插件直接使用kubernetes部署,官方的配置文件中包含以下镜像: gcr.i ...
- 【xsy2332】Randomized Binary Search Tree DP+FFT
题目大意:给你一个$[0,1]$之间等概率随机序列,你需要把这个序列插入到一棵$treap$中,问这棵$treap$的期望深度,请对于$[1,n]$中的每个深度分别输出它的概率(实数,保留五位小数). ...
- 在向一个ArrayList中添加大量元素前,可以使用ensureCapacity方法来增加ArrayList的容量
参考http://www.jianshu.com/p/f174d49b391c ensureCapacity(),该方法就是 ArrayList 的扩容方法.在前面就提过 ArrayList 每次新增 ...
- DDD实战进阶第一波(四):开发一般业务的大健康行业直销系统(搭建支持DDD的轻量级框架三)
上一篇文章我们讲了经典DDD架构对比传统三层架构的优势,以及经典DDD架构每一层的职责后,本篇文章将介绍基础结构层中支持DDD的轻量级框架的主要代码. 这里需要说明的是,DDD轻量级框架能够体现DDD ...
- RC1015 cannot open include file 'atlres.h'
fatal error RC1015: cannot open include file 'atlres.h' 问题:此问题是由于rc文件没有找到 atlres.h导致的 (原因不详) 解决:工程 ...
- SpringMVC redirect中文乱码问题
在使用"redirect:xxx.do?param=中文"时会出现乱码问题,解决方案如下: 使用model.addAttribute来替代直接拼接参数.如下: @RequestMa ...
- 信号为E时,如何让语音识别脱“网”而出?
欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由腾讯教育云发表于云+社区专栏 一般没有网络时,语音识别是这样的 ▽ 而同等环境下,嵌入式语音识别,是这样的 ▽ 不仅可以帮您边说边识. ...
- JS实现图片懒加载插件
一.前言 我在前几篇博客的记录中,有说自己在做一个图片懒加载的功能,然后巴拉巴拉的遇到哪些问题,结果做完了也没对懒加载这个功能做一些记录,所以这篇文章主要针对我所实现的思路,以及代码做个记录,实现不佳 ...
- docker常用命令记录
Docker官方镜像中心:https://hub.docker.com/explore/ 参考:慕课网docker视频教程 https://www.imooc.com/video/14625 1.启动 ...
- 鸟哥的Linux私房菜:基础学习篇 —— 第五章笔记
1.Linux一般将文件可存取的身份分为三个类 别,分别是 owner/group/others,且三种身份各有 read/write/execute 等权限.其中 root 的权限最高. 2.在我们 ...