博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
逻辑备库之ORA-01403解决方法
阅读量:7164 次
发布时间:2019-06-29

本文共 2695 字,大约阅读时间需要 8 分钟。

Oracle 的Data Guard环境中, 逻辑备库应用进程停止,日志显示错误为ORA-01403 not data found 。

它具体信息如下:

Mon May 21 10:39:31 2012

LOGSTDBY status: ORA-01403: no data found

LOGSTDBY Apply process P004 pid=143 OS id=13936 stopped

Mon May 21 10:39:32 2012

Errors in file /u01/app/oracle/admin/db/bdump/rdb_lsp0_13922.trc:

ORA-12801: error signaled in parallel query server P004

ORA-01403: no data found

LOGSTDBY Analyzer process P003 pid=38 OS id=13932 stopped

 

这种错误在logical standby 环境中很常见。

通过dba_logstdby_events 视图查询失败的事务信息。

查询SQL 如下所示:

select event_time,

       xidusn,

       xidslt,

       xidsqn,

       status,

       status_code,

       event,

       'exec dbms_logstdby.skip_transaction(' || xidusn || ',' || xidslt || ',' ||

       xidsqn || ');' as exec_sql,

       a.*

  from dba_logstdby_events a

 where event_time = (select max(event_time) from dba_logstdby_events);

 

  从event 列中我们查询出失败的具体信息,是更新一张表失败。

 

解决方法

 

这类问题的解决方法有两种:

第一种,可以使用skip_transaction 方法忽略掉该事务。

 exec dbms_logstdby.skip_transaction(487,12,951001);

但这个方法有后遗症,接下来的同步过程中会有不断的麻烦,数据没找到的问题会层出不穷。

 

第二种,使用skip 方法忽略掉该表的所有的操作。

alter database stop logical standby apply;

execute dbms_logstdby.skip('DML','username','T_ZHUSHOU_ORDER');

execute dbms_logstdby.skip('SCHEMA_DDL','username','T_ZHUSHOU_ORDER');

alter database start logical standby apply immediate;

忽略掉出问题的表的DML 操作和SCHEMA_DDL 操作。

 

 

数据复制停止的问题是解决了,但这里造成了一张表事实上不能同步了。

 

新问题:如何将已skip 的表再加入logical standby 中?

 

解决这个新问题主要是靠DBMS_LOGSTDBY.INSTANTIATE_TABLE 方法。

 

官方对它的使用说明:

This procedure creates and populates a table in the standby database from a corresponding table in the primary database. The table requires the name of the database link (dblink) as an input parameter. If the table already exists in the logical standby database, it will be dropped and re-created based on the table definition at the primary database. This procedure only brings over the data associated with the table, and not the associated indexes and constraints.

 

操作步骤如下:

1 、在逻辑备库创建指向主库的数据库链路

2 、在逻辑备库上unskip 掉该表。

unskip 之前需停止逻辑备库应用日志

alter database stop logical standby apply;

execute dbms_logstdby.unskip('DML','username','T_ZHUSHOU_ORDER');

execute dbms_logstdby.unskip('SCHEMA_DDL','username','T_ZHUSHOU_ORDER');

3 、使用INSTANTIATE_TABLE 重新实例化一张表。

EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE('username', 'T_ZHUSHOU_ORDER', 'DB_RAC');

注意,源库上的用户必须有  SELECT_CATALOG_ROLE 权限,否则会报错ORA-16276

SQL> EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE('username', 'T_ZHUSHOU_ORDER', 'DB_RAC');

 

begin DBMS_LOGSTDBY.INSTANTIATE_TABLE('username', 'T_ZHUSHOU_ORDER', 'DB_RAC'); end;

 

ORA-16276: specified database link does not correspond to primary database

ORA-06512: at "SYS.DBMS_INTERNAL_LOGSTDBY", line 5361

ORA-02019: connection description for remote database not found

ORA-06512: at "SYS.DBMS_LOGSTDBY", line 636

ORA-06512: at line 2

转载地址:http://vkmwm.baihongyu.com/

你可能感兴趣的文章
Manacher算法笔记 C++
查看>>
不同的国家/地区与语言缩写代码
查看>>
NS2网络模拟(6)-homework02.tcl
查看>>
内核基本的体系结构
查看>>
面向对象
查看>>
工作流
查看>>
PHP算法学习(8) 环形链表 解决约瑟夫问题
查看>>
winform dategridview 自动完成。
查看>>
com.domain.bean
查看>>
Python 实现整数线性规划:分枝定界法(Branch and Bound)
查看>>
ajax,cookie和localStoragede 的基础知识
查看>>
python 进程间通信
查看>>
Vulkan:初始化 前篇
查看>>
SharePoint2007站点中用户信息与AD用户信息的“不一致”问题
查看>>
仅仅测试Word2016发布博客
查看>>
***四种参数传递的形式——URL,超链接,js,form表单
查看>>
LINUX下PHP编译添加相应的动态扩展模块so(不需要重新编译PHP,以openssl.so为例)...
查看>>
11.21团队总结
查看>>
Application Metrics With Spring Boot Actuator
查看>>
ML科普系列(三)监督学习和无监督学习
查看>>