[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版本开始支持物理复制,也称为流复制,通过从实例级复制出一个与主库一模一样的备库.流复制同步方式有同步,异步两种,如果主节点和备节点不是很忙,通常异步模式下备 ...
随机推荐
- Python 离线工作环境搭建
准备 在断网的和联网的机器安装pip,下载地址https://pypi.python.org/pypi/pip 在联网的开发机器上安装好需要的包 例如: pip3 install paramiko p ...
- Python函数学习——作用域与嵌套函数
全局与局部变量 在函数中定义的变量称为局部变量,在程序的一开始定义的变量称为全局变量. 全局变量作用域是整个程序,局部变量作用域是定义该变量的函数. 当全局变量与局部变量同名时,在定义局部变量的函数内 ...
- MySQL笔记(7)---事务
1.前言 前面具体讲了MySQL中的锁实现的方式,解释了是如何保证数据在并发情况下的可靠性,并提到了事务REPETABLE READ和READ COMMITTED,解释了一下这两种事务的不同.本章讲具 ...
- python 多环境共存 基础
正在学习python 使用的是3.3 但是由于种种原因吧 还得使用python2.7 所以记录一下 如何安装2个版本 假设 在windows 下面安装的python 版本 和路径 如下 python ...
- MariaDB 数据库
1. MariaDB 介绍 MariaDB数据库管理系统是 MySQL 的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成 ...
- leetcode — two-sum-ii-input-array-is-sorted
import java.util.ArrayList; import java.util.List; /** * Source : https://oj.leetcode.com/problems/m ...
- ajaxFileUpload带参数提交(亲测可用)
使用ajaxFileUpload上传文件时,有时需要带参数提交,网上有很多资料说使用data,但其实要使用data带参数是需要修改的,否则后台是获取不到的. 分析原因: ajaxFileUpload为 ...
- [TensorFlow] Introduction to TensorFlow Datasets and Estimators
Datasets and Estimators are two key TensorFlow features you should use: Datasets: The best practice ...
- webpack4打包报错:WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults fo
运行命令webpack ./src/main.js ./dist/murenziwei.js后,目录上神马动静都没有,你以为在dist文件夹上会有murenziwei.js吗?毛都没有 警告和错误倒是 ...
- spring boot整合JMS(ActiveMQ实现)
pom依赖如下: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="ht ...