逻辑备库之ORA-01403解决方法
Oracle 的Data Guard环境中, 逻辑备库应用进程停止,日志显示错误为ORA-01403 not data found 。
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
更多Oracle相关信息见Oracle 专题页面 ?tid=12

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

Data Integration Simplification: AmazonRDSMySQL and Redshift's zero ETL integration Efficient data integration is at the heart of a data-driven organization. Traditional ETL (extract, convert, load) processes are complex and time-consuming, especially when integrating databases (such as AmazonRDSMySQL) with data warehouses (such as Redshift). However, AWS provides zero ETL integration solutions that have completely changed this situation, providing a simplified, near-real-time solution for data migration from RDSMySQL to Redshift. This article will dive into RDSMySQL zero ETL integration with Redshift, explaining how it works and the advantages it brings to data engineers and developers.

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

LaravelEloquent Model Retrieval: Easily obtaining database data EloquentORM provides a concise and easy-to-understand way to operate the database. This article will introduce various Eloquent model search techniques in detail to help you obtain data from the database efficiently. 1. Get all records. Use the all() method to get all records in the database table: useApp\Models\Post;$posts=Post::all(); This will return a collection. You can access data using foreach loop or other collection methods: foreach($postsas$post){echo$post->

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.
