[20170824]11G備庫啟用DRCP連接.txt

来源:http://www.cnblogs.com/lfree/archive/2017/08/24/7421644.html
-Advertisement-
Play Games

[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% ...


[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/[email protected]: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/[email protected]: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/[email protected]: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

[email protected]:1521/bookdg:POOLED> select * from dept ;
    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

[email protected]: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在備庫連接資料庫了.


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 由於防火牆問題,TCP keep alive 問題,以及 MySQL 自身的參數問題這三個在使用中比較常見,所以今天就分享下自己找到的排查方法。 今天先聊一聊防火牆問題 大多數人在第一次創建 MySQL database on Azure 實例之後便開始嘗試連接。但是往往遇到的結果不是連接成功而是如 ...
  • 用 insert 添加用戶時,可能會報錯: ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value my-default.ini中有一條語句: sql_mode=NO_ENGINE_SUBSTITUTION,STRICT ...
  • 一、搭建Mongodb 副本集 副本集中有三個角色: 主節點:所有副節點的數據均來自於主節點,並且只能對主節點進行讀寫操作。副節點:數據來自於主節點,可以進行讀取操作,但是不能進行寫操作。仲裁者:不含數據也不與客戶端交流,只在選舉主節點的時候進行投票。 Mongodb最多支持50個副本集成員以及最多 ...
  • 業務場景: 某天truncate大量表時遇到錯誤ORA-O2266:表中的唯一/主鍵被啟用的外鍵引用,不想看ER圖來禁用大量複雜約束,所以研發了三種套路... 一. 最偷懶套路 如果要一次性導出很多表, 懶得看ER圖, 可以用巧辦法: PLSQL developer: Tools Export ta ...
  • select * from 表名 as of timestamp to_timestamp('2016-02-23 23:59:59','yyyy-mm-dd hh24:mi:ss') ; 該語句表示查詢某一個時間點時該表的數據,通過修改時間,你可以查詢刪除之前時的數據。篩選出來重新插入即可。 ...
  • 在MySQL中如何給普通用戶授予查看所有用戶線程/連接的許可權,當然,預設情況下show processlist是可以查看當前用戶的線程/連接的。 mysql> grant process on MyDB.* to test; ERROR 1221 (HY000): Incorrect usage o... ...
  • 具體報錯如下: Table '.\mysql\proc' is marked as crashed and should be repaired 我的解決辦法: 找到mysql的安裝目錄的bin/myisamchk工具,右擊【以管理員身份運行】修複下即可。 網上解決辦法: 找到mysql的安裝目錄的 ...
  • ALTER PROCEDURE [dbo].[sp_GetClassCountData] @BatchId NVARCHAR(50), @ExamId VARCHAR(100), @ClassId VARCHAR(100), @SubjectId NVARCHAR(50)ASBEGIN DECLAR ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...