GoldenGate 指定时间点重新抽取事务变化
今天的实验是演示goldengate指定时间点重新抽取事务。
今天的实验是演示goldengate指定时间点重新抽取事务。
实验步骤:
1,制定一个重新抽取的SCN
2,,根据SCN在v$archived_log视图找到起始时间
3,停止抽取进程
4,重置抽取进程的开始时间
5,启动抽取进程重新捕获事务(从归档日志中获取)
1,查看源端当前的SCN,记录该值作为重新抽取的时间点
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
1507066
2,查看当前抽取进程ex1的状态
GGSCI (node3) 2> info ex1 detail
EXTRACT EX1 Last Started 2014-11-02 18:19 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:06 ago)
Log Read Checkpoint Oracle Redo Logs
2014-11-02 19:09:40 Thread 1, Seqno 12, RBA 10750464
SCN 0.1507682 (1507682)
Log Read Checkpoint Oracle Redo Logs
2014-11-02 19:09:39 Thread 2, Seqno 12, RBA 9300480
SCN 0.1507682 (1507682)
Target Extract Trails:
Remote Trail Name Seqno RBA Max MB
/goldengate/dirdat/ex 2 205729 5
Extract Source Begin End
+DATA/prod/onlinelog/group_4.302.859509357 2014-11-02 18:02 2014-11-02 19:09
Not Available * Initialized * 2014-11-02 18:02
Current directory /goldengate
Report file /goldengate/dirrpt/EX1.rpt
Parameter file /goldengate/dirprm/ex1.prm
Checkpoint file /goldengate/dirchk/EX1.cpe
Process file /goldengate/dirpcs/EX1.pce
Stdout file /goldengate/dirout/EX1.out
Error log /goldengate/ggserr.log
3,查看当前系统时间以及目前存在的local trail文件
[oracle@single goldengate]$ ls -l dirdat
total 424
-rw-rw-rw- 1 oracle oinstall 205826 Nov 1 16:02 rt000000
-rw-rw-rw- 1 oracle oinstall 1192 Nov 1 16:57 rt000001
-rw-rw-rw- 1 oracle oinstall 1161 Nov 1 17:20 rt000002
4,在源端节点2登录测试用户snow,向测试表插入100万条记录
SYS@PROD2 > conn snow/snow
SNOW@PROD2 > begin for i in 1001..1000000 loop
2 insert into t1 values(i,'Fin');
3 end loop;
4 commit;
5 end;
6 /
目标端snow.t1成功复制100万条记录
SQL> conn snow/snow
Connected.
SQL> select count(*) from t1;
COUNT(*)
----------
1000000
插入100条数据使得源端生成了22个local trail文件,从ex000003-ex000024
[oracle@node3 dirdat]$ ll
total 104128
-rw-rw-rw- 1 oracle oinstall 205795 Nov 2 17:24 ex000000
-rw-rw-rw- 1 oracle oinstall 1076 Nov 2 18:19 ex000001
-rw-rw-rw- 1 oracle oinstall 4999907 Nov 3 10:02 ex000003
-rw-rw-rw- 1 oracle oinstall 4999952 Nov 3 10:02 ex000004
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000005
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000006
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000007
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000008
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000009
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000010
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000011
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000012
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000013
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000014
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000015
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000016
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000017
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000018
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000019
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000020
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000021
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000022
-rw-rw-rw- 1 oracle oinstall 4999951 Nov 3 10:02 ex000023
-rw-rw-rw- 1 oracle oinstall 1122278 Nov 3 10:02 ex000024
5, 根据SCN1507066,查找相对应时间。
所在归档日志为红色表示记录。该日志生成的时间为2014-11-02 17:41:26,接下来采用该时间作为重新生成local trail的参数。

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.

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->

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.

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.
