zoukankan      html  css  js  c++  java
  • 抽取进程stop,无法抽取ASM实例内的归档日志

    一、问题现象

    DB 11.2.0.4 Linux 6.9 2节点RAC,OGG 12.2

    集成模式没问题,经典模式启动一直提示无法获取有效的归档日志!

    二、问题分析

    2.1 问题排查

    进程参数,添加进程命令如下
    > edit param ext_a1 extract ext_a1 SETENV (ORACLE_SID = "wsgw2") userid OGG01 ,password OGG01 REPORTCOUNT EVERY 1 MINUTES, RATE DISCARDFILE ./dirrpt/ext_a1.dsc,APPEND,MEGABYTES 1024 WARNLONGTRANS 2h,CHECKINTERVAL 300 EXTTRAIL /u01/ogg122/dirdat/a1/a1 --table TABLE SCOTT.A1; ADD EXTRACT ext_a1, TRANLOG,THREADS 2,BEGIN NOW add exttrail /u01/ogg122/dirdat/a1/a1,extract ext_a1,megabytes 200 START ext_a1

    抽取进程,使用TRANLOG,THREADS 2,BEGIN NOW !!!但是每次都找不到合适的位置开始抽取!!!
    ERROR OGG-00446 No valid log files for current redo sequence 45, thread 1, error retrieving redo file name for sequence 45, archiv
    ed = 0, use_alternate = 0Not able to establish initial position for begin time 2021-06-06 15:19:15.000000.
    select max(sequence#) from v$archived_log where thread#=1;
    MAX(SEQUENCE#)
    --------------
    44

    我们可以发现Oracle读取的归档日志45根本不存在,手工alter修改观察一下
    alter extract ext_a1 thread 1,extseqno 44,extrba 0
    info ext_a1
    EXTRACT EXT_A1 Initialized 2021-06-06 15:24 Status RUNNING
    Checkpoint Lag 00:05:38 (updated 00:01:14 ago)
    Process ID 9458
    Log Read Checkpoint Oracle Redo Logs
    2021-06-06 15:19:15 Thread 1, Seqno 44, RBA 0
    SCN 0.0 (0)
    Log Read Checkpoint Oracle Redo Logs
    2021-06-06 15:19:15 Thread 2, Seqno 0, RBA 0
    SCN 0.0 (0)
    select max(sequence#) from v$archived_log where thread#=2;
    THREAD# MAX(SEQUENCE#)
    ---------- --------------
    1 44
    2 42

    发现OGG报错OGG-00446,但是后面的SQL不同了,可以发现SQL and name not like '+%' ???
    2021-06-06 15:34:22 ERROR OGG-00446 Could not find archived log for sequence 44 thread 1 under default destinations SQL <SELECT name FROM v$archiv
    ed_log WHERE sequence# = :ora_seq_no AND thread# = :ora_thread AND resetlogs_id = :ora_resetlog_id AND archived = 'YES' AND 
    deleted = 'NO' AND name not like '+%' AND standby_dest = 'NO' >, error retrieving redo file name for sequence 44, archived = 1, use_al
    ternate = 0Not able to establish initial position for sequence 44, rba 0.
    本次测试环境DB在ASM磁盘组内,肯定是+存储方式! 使用如下参数!
    TRANLOGOPTIONS DBLOGREADER

    解决问题!!!

    GGSCI (wsgw2) 261> info ext_a1
    EXTRACT EXT_A1 Last Started 2021-06-06 15:47 Status RUNNING
    Checkpoint Lag 00:00:01 (updated 00:00:04 ago)
    Process ID 13418
    Log Read Checkpoint Oracle Redo Logs
    2021-06-06 15:47:59 Thread 1, Seqno 45, RBA 1443328
    SCN 0.1717323 (1717323)
    Log Read Checkpoint Oracle Redo Logs
    2021-06-06 15:48:02 Thread 2, Seqno 43, RBA 16642560
    SCN 0.1717324 (1717324)

    
    

     GGSCI (wsgw2) 259> info ext_a2

    EXTRACT EXT_A2 Last Started 2021-06-06 15:11 Status RUNNING
    Checkpoint Lag 00:00:10 (updated 00:00:06 ago)
    Process ID 6706
    Log Read Checkpoint Oracle Integrated Redo Logs
    2021-06-06 15:47:43
    SCN 0.1717297 (1717297)

    2.2 TRANLOGOPTIONS DBLOGREADER参数说明

    官方文档

    DBLOGREADER
    Valid for Extract in classic capture mode for Oracle.
    Causes Extract to use a newer API that is available as of Oracle 11.2.0.2 and later 11g R2 versions. This API uses the database server to
    access the redo and archive logs. DBLOGREADER can be used to mine logs on regular disks and raw disks, and can be used instead of connecting
    directly to an Oracle ASM instance. The database system must contain the libraries that contain the API modules and must be running.
    To use this feature, the Extract database user must have SELECT ANY TRANSACTION privilege. When used, DBLOGREADER enables Extract to use a read size of up to 4 MB in size. This is controlled with the DBLOGREADERBUFSIZE option.
    The maximum read size when using the default OCI buffer is 28672 bytes. A larger buffer may improve the performance of Extract when
    redo rate is high. When using DBLOGREADER with ASM, do not use the ASMUSER or ASMUSERALIAS and ASMPASSWORD options of TRANLOGOPTIONS. The API uses the
    user and password specified with the USERID or USERIDALIAS parameter. For more information about using Oracle GoldenGate with ASM,
    see Mining ASM-stored Logs in Classic Capture Mode in Using Oracle GoldenGate for Oracle Database.

    Extract使用从Oracle 11.2.0.2及更高版本11g R2起提供的较新API。此API使用数据库服务器

    访问重做和归档日志。DBLOGREADER可以用来挖掘常规磁盘和原始磁盘上的日志,也可以用来代替连接直接到Oracle ASM实例。

    缓冲区默认大小可以看如下信息:

    https://docs.oracle.com/en/middleware/goldengate/core/19.1/reference/tranlogoptions.html#GUID-B6ADFEC9-10E6-456D-9477-088513E113AF
    High values increase capture speed but cause Extract to consume more memory. Low values reduce memory usage but increase I/O because Extract must store data that exceeds the cache size to disk.
    The following are the valid ranges and default sizes, in bytes:
    Oracle:
    Minimum: 8,192
    Maximum: 10,000,000
    The default buffer size is determined by the source of the redo data:
    For file-based redo, the default is 1000KB (1024000).
    For ASM redo, the default is 1000KB (1024000).
    For DBLOGREADER redo, the default is 2MB (2097152).
    For Extract in integrated capture mode, the default is 1000KB (1024000).

    此时再次阅读MOS,关于抽取日志的Oracle版本优化手段,更清晰一点

    案例MOS  OGG How to address Extract Performance Issue When Reading Archive Logs stored in Oracle ASM (Doc ID 1363266.1)    
    Oracle GoldenGate - Version 9.0.0.0 and later
    SYMPTOMS
    There is increasing lag on an extract and the archive logs are stored on ASM. 
    Using  TRACE/TRACE2 will display summary stats where Extract is spending the majority of time reading records from the redo. 
    SUMMARY STATISTICS
    04:11:13.008 (+0,0,0) Redo log statistics:
    04:11:13.008 (+0,0,0) 82.70% Reading record from redo log file
    04:11:13.008 (+0,0,0) 8.64% Extracting subrecord from redo record
    CAUSE
    There is a processing overhead reading archive log data from ASM using a TNS connection to the ASM instance, which is the case when you 
    specify TRANLOGOPTIONS ASMUSER and ASMPASSWORD  to provide access can cause throughput issues in a high volume transaction system. 使用TNS连接ASM实例读取归档日志会产生处理开销!指定TRANLOGOPTIONS ASMUSER and ASMPASSWORD提供访问权限时候,可能会导致延迟很高的问题! 如下是Oracle解决方案: 1.OGG11.2.x版本中集成模式将直接读取STREAMS Logminer的数据LCR,不需要读取redo,archive log; 2.OGG11.2 and 11.1.1.x版本经典模式下,可以配置DBLOGREADER 及使用新版本的API从ASM中捕获数据; 3.在ORACLE 10.2.0.4及更低的版本,建议升级OGG到11.1.1.1.0来读取ASM,提高抽取速度! 剩下的省略,可以直接看MOS文章。 -- TRANLOGOPTIONS ASMUSER sys@+ASM, ASMPASSWORD ******

    2.3 阅读一下其它相关的MOS文档

    抽取进程无法启动,由于是RAC迁移至单实例,线程数多了,通过禁用多余的线程,重启抽取进程!
    OGG Extracts Abends with OGG-00446 Error (Doc ID 1662433.1) CAUSE 2014-04-10 15:25:54 ERROR OGG-00446 Could not find archived log for sequence 1 thread 2 under default destinations SQL CHANGES The database was cloned from RAC to non-RAC Despite being a standalone node, v$log shows there are 2 threads: SQL> select distinct thread# from v$log; THREAD# ---------- 1 2 1- ALTER DATABASE DISABLE THREAD 2 2- restart extract
    如果是使用11.2.x版本的OGG软件抽取DB 12c无法抽取,版本限制! 12c DB请使用12.x版本OGG进行抽取!!!
    OGG-00446 ,ORA-01022: Database Operation Not Supported In This Configuration (Doc ID 2231132.1)

    当RAC多个节点,删除了节点后,经典模式抽取进程无法启动,因为抽取进程根据每个线程创建了一个检查点,启动OGG会检查线程,会根据线程数验证节点数量,线程数量>节点数报错OGG 00446
    建议:删除并根据现有的节点数量重新指定 The error was because of
    using OGG 11.2.x for an Oracle 12c database. Oracle 12c database is supported only from OGG version 12.x Extract fails OGG-00446 The Number Of Oracle Redo Threads (x) Is Not The Same As The (Doc ID 1642428.1) After removing a RAC node from your cluster and rebuilding the database to have one less RAC node causes your Classic extract to not restart ERROR OGG-00446 The number of Oracle redo threads (2) is not the same as the number of checkpoint threads (1). EXTRACT groups on RAC systems
    should be created with the THREADS parameter (e.g., ADD EXT <group name>, TRANLOG, THREAD The database was rebuild to remove a RAC node Classic extract has a checkpoint for each of the RAC nodes, when OGG starts it validates the number of nodes against the number of threads
    in checkpoint file. If there are too many it will cause the error OGG-00446 Delete and recreate the extract specify the NEW number of THREADS
    远程OGG服务器进行远程抽取捕获报错,无法找到归档日志,使用添加参数!!!进行处理。
    Remote Capture - OGG-00446 Could Not Find Archived Log (Doc ID 2342430.1) Oracle GoldenGate - Version 12.1.2.0.0 and later SYMPTOMS Remote capture is failing with the below error, OGG-00446 Oracle GoldenGate Capture for Oracle, ext1.prm: Could not find archived log Environment details separate server for SOURCE DATABASE, GOLDEN GATE APPLICATION and DESTINATION DATABASE. Database is running in Archive log mode. Oracle Client 11.2.0.1.0 is installed in the server where OGG is installed. CAUSE When using the Remote capture, we need to use TRANLOGOPTIONS DBLOGREADER parameter in the Extract parameter file. This parameter is

    not supported for the Oracle client 11.2.0.1.0. Here the Client version installed in 11.2.0.1.0 If one wants to be able to access archive logs from a different Oracle installation and using Classic Extract, then we need to use
    TRANLOGOPTOINS DBLOGREADER parameter. This does not imply or mean we are using ASM at the remote installation, it is just a means for OGG to read the remote archive logs. The client version 11.2.0.1.0 is unable to use TRANLOGOPTOINS DBLOGREADER which is what is needed. SOLUTION Install Oracle Client 11.2.0.4 and use the parameter TRANLOGOPTIONS DBLOGREADER in the Extract process parameter file. Restart the Extract process
  • 相关阅读:
    IE6IE9兼容性问题列表及解决办法总结
    正则表达式笔记:提取C#代码中的中文信息,双引号,尖括号间的信息
    IE6IE9兼容性问题列表及解决办法_补遗漏之一:button的type默认值改变为submit了。
    IE6IE9兼容性问题列表及解决办法_补充之三:Table的Col不再支持style及align,需要到th, td中去设置
    再谈IE的浏览器模式和文档模式
    WebRequest, WebResponse , HttpWebResponse, HttpWebResponse , WebClient笔记
    IE6IE9兼容性问题列表及解决办法_补遗漏之二:CSS区分大小写,Style中height需要加px
    VS2010的智能提示没有了的可能原因
    IE6IE9兼容性问题列表及解决办法_补充之四:HTC (Html Components) 功能逐渐被IE抛弃
    LINQ to XML 笔记,确实比DOM好用,方便。
  • 原文地址:https://www.cnblogs.com/lvcha001/p/14855685.html
Copyright © 2011-2022 走看看