zoukankan      html  css  js  c++  java
  • linux 小问题和 NBU 恢复问题一则

    ###linux 小问题一则

    ps -ef|grep pmon 显示用户名后面有一个+ 号,比如用户名是 ddivmsc+

    实际上查看/etc/passwd 是 ddivmsctl, 因为超过了8位,就没办法使用ps -ef显示全,有办法显示全不,有办法显示不


    解释1:(建用户最好不重要超过8位)
    最多8个字节,posix规范
    如果是告警,建议用id,然后自动获取用户名

    解释2:(使用以下命令可以突破8位限制)
    默认是不行的,试下自定义输出,

    比如: ps ax o user:16,pid,pcpu,pmem,vsz,rss,stat,start_time,time,cmd

    user:16 16这可以调整大小

    ####nbu 恢复问题一则

    在升级了oracle 软件到19C 后,nbu 备份软件连接catalog 执行命令报错,报错如下:

    环境如下:nbu catalog 为11.2.0.4.0 , 备份的db 版本19.7.0.0 , 

    db02 ~]$ rman target / catalog rman11g/rman11g@cat11g

    Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jul 30 10:09:48 2020
    Version 19.7.0.0.0

    Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.

    connected to target database: CIVMSCTL (DBID=3946457152)
    connected to recovery catalog database
    PL/SQL package RMAN11G.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old

    RMAN> register database;

    PL/SQL package RMAN11G.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old
    PL/SQL package RMAN11G.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of register command at 07/30/2020 10:09:59
    RMAN-06429: RCVCAT database is not compatible with this version of RMAN

    问题

    因为11g 到19C ,中间跨了了一个版本,当时没想这么对 所以 直接套用了文档2022782.1 ,直接在生产同步catalog 库,结果悲剧了,报错ORA-02296: cannot enable (RMAN11G.) - null values found ,也就是catalog recovery catalog is partially upgraded to 19.07.00.00 (部分19C 的情况)

    有因为catalog 是个集中存放,所有的归档日志备份都要连接这个库, 所以所有的归档备份都失败了。

    RMAN-06429: RCVCAT database is not compatible with this version of RMAN (Doc ID 2022782.1)

    connect to the catalog schema and issue:

    SQL>select * from rcver;
     

    $ rman target / catalog <catalog schema>/<password>@<catalog database service>
    Recovery Manager: Release 12.1.0.1.0 - Production on Mon Jun 22 09:34:59 2015

    Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

    connected to target database: <DB_NAME> (DBID=1868993881)
    connected to recovery catalog database
    PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is too old

    RMAN> register database;

    PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is too old
    PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is too old
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of register command at 06/22/2015 09:35:19
    RMAN-06429: RCVCAT database is not compatible with this version of RMAN

    RMAN> upgrade catalog;

    recovery catalog owner is RMAN
    enter UPGRADE CATALOG command again to confirm catalog upgrade

    RMAN> upgrade catalog;

    recovery catalog upgraded to version 12.01.00.01
    DBMS_RCVMAN package upgraded to version 12.01.00.01
    DBMS_RCVCAT package upgraded to version 12.01.00.01

    结果悲剧了


    RMAN> upgrade catalog;

    recovery catalog owner is RMAN11G
    enter UPGRADE CATALOG command again to confirm catalog upgrade

    RMAN> register database;

    PL/SQL package RMAN11G.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old
    PL/SQL package RMAN11G.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of register command at 07/30/2020 10:10:10
    RMAN-06429: RCVCAT database is not compatible with this version of RMAN

    RMAN> upgrade catalog;


    error creating modify_grsp_pdb_key_not_null
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-06004: Oracle error from recovery catalog database: ORA-02296: cannot enable (RMAN11G.) - null values found

    经过检查应该是出发了bug  Bug 20861957  ORA-2296 during RMAN upgrade catalog to 12c

    该bug 解决方法,是升级db 版本到 11.2.0.4.180717 

    ORA-2296 DURING UPGRADE CATALOG TO 12.1,0.1 IN AN 11.2 DATABASE (Patch)11.2.0.4.180717

    这个bug 在11.2.0.4.180717 有补丁提供下载,所以可以考虑升级版本,在打补丁

    但是现实时间紧迫,生产的备份都有问题,无奈只能使用数据库的Nbu 昨天的备份恢复,还好有备份文件存在,谢谢

    step 1:

    备份原来的数据库文件

    step 2:

    恢复控制文件

    --替换以下$CLIENT_NAME为目标库的值,输入需要列举备份片的开始、结束时间后执行:

    ./bplist -C oracle -S pnbu -l -t 4 -s 07/29/2020 06:00:00 -e 07/30/2020 16:00:00 -R /

    step 3:

    --====恢复控制文件

    -- startup  nomount;

    run {

    allocate channel c1 type 'sbt_tape';

    send 'NB_ORA_SERV=pnbu,NB_ORA_CLIENT=oracle';

    restore controlfile from '/cntrl_18387_1_1047067687'; 

    release channel c1;

    }

    step 3: 恢复数据文件

    run {

    allocate channel c1 type 'sbt_tape';

    allocate channel c2 type 'sbt_tape';

    allocate channel c3 type 'sbt_tape';

    allocate channel c4 type 'sbt_tape';

    send 'NB_ORA_SERV=pnbu,NB_ORA_CLIENT=oracle';

    restore database;

    release channel c1;

    release channel c2;

    release channel c3;

    release channel c4;

    }

    step 4. 基于时间点的恢复,恢复升级catalog 之前的时间点,

    sql "alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''";

    recover database  until time '2020-07-29 23:00:00';

    Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.
     
     
    Click to add to Favorites To BottomTo Bottom


    Bug 20861957  ORA-2296 during RMAN upgrade catalog to 12c

     This note gives a brief overview of bug 20861957.
     The content was last updated on: 01-AUG-2019
     Click here for details of each of the sections below.

    Affects:

    Product (Component) Oracle Server (Rdbms)
    Range of versions believed to be affected Versions BELOW 12.2
    Versions confirmed as being affected
    Platforms affected Generic (all / most platforms affected)

    Fixed:

    The fix for 20861957 is first included in

    Interim patches may be available for earlier versions - click here to check.

    Symptoms:

    Related To:

    Description

    RMAN UPGRADE CATALOG is failing with ORA-2296 error. 
     
    RMAN> upgrade catalog;
     
    error creating modify_bcf_pdb_key_not_null
     
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-06004: ORACLE error from recovery catalog database: ORA-02296: cannot enable (&OWNER.) - null values found
     
    RMAN trace shows :
     
     DBGSQL:        RCVCAT>	alter table bcf modify(pdb_key NOT NULL)
     DBGSQL:
     DBGSQL: 	  sqlcode = 2296
     DBGSQL:        error: ORA-02296: cannot enable (&OWNER.) - null values found (krmkosqlerr)
     DBGSQL: 	(krmkosqlerr)
     DBGSQL:       EXITED krmkosqlerr
     RMAN-06444: error creating modify_bcf_pdb_key_not_null
     DBGMISC:      krmksqlerror called from file krmk4.c, line 4046
     
    There are orphaned entries in BCF which do not have a matching entry en DBINC, this is causing that the procedure which sets the PDB_KEY value to miss these rows.
     
    Example :
     
    SELECT BCF_KEY, DBINC_KEY, PDB_KEY FROM bcf WHERE PDB_KEY not in (SELECT DBINC_KEY FROM dbinc);
     
       BCF_KEY  DBINC_KEY    PDB_KEY
    ---------- ---------- ----------
    52563595   52552197
    52560087   52552197
  • 相关阅读:
    关于WP7的Loaded事件[转]
    皮皮书屋的变态验证码
    近期学习内容for mobile
    一个js问题引发的同时吐槽
    powerdesigner 概念模型转物理模型时的丢表问题
    偶的处女文近期学习计划
    web布局实现圆角,兼容所有的浏览器
    最近面试asp.net碰到的一些题
    网站推广心得
    兼容ie6的png格式图片的背景透明问题
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/13405430.html
Copyright © 2011-2022 走看看