Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the initial load and OGG

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to understand the initial load of OGG and, the content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Initial load

It can be divided into several categories:

Except for the first method, all the others need initial-load extract or initial-load replicat; to synchronize the change during initial-load. Replicat needs to add the handlercollisions parameter and remove it after the synchronization is completed.

Loading data with a database utility

Create a target db using db copy utility, wait for copy to finish enabling change; generated during change-sync replicat synchronization, and start normal data synchronization after this process is complete.

Because initial-load extract/replicat is not required, and there is no need to equip it with parameter files

Loading data from file to replicat

Using initial-load extract to write source table to a remote extract file (canonical format), and initial-load replicat to load it line by line into the database, so it is inefficient

Rough steps

1 start the manager process of source: start manager

2 Edit initial-load extract parameter file: edit params

SOURCEISTABLE-Mark extract as initial load and obtain data directly from source table

SOURCEDB mydb, USERID ogg, PASSWORD

AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

AES128, ENCRYPTKEY securekey1

RMTHOST ny4387, MGRPORT 7888, ENCRYPT AES 192 KEYNAME mykey-specify target host and manager port

ENCRYPTTRAIL AES192, KEYNAME mykey1

RMTFILE / ggs/dirdat/initld, MEGABYTES 2, PURGE-specify remote extract file, no need to maintain checkpoing

TABLE hr.*

TABLE sales.*

3 Edit the parameter file of target initial-load repicat: edit params

SPECIALRUN-set replicat to run at once and does not require checkpoint

END RUNTIME-terminates the replicat when the load is completed

TARGETDB mydb, USERID ogg, PASSWORD

AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

AES128, ENCRYPTKEY securekey1

DECRYPTTRAIL AES192, KEYNAME mykey1

EXTFILE / ggs/dirdat/initld-declares the rmtfile specified by extract

SOURCEDEFS / ggs/dirdef/source_defs-when the source/target table structure is not used at the same time, the def file is generated by defgen; if the table structure is consistent, use assumetargetdefs

MAP hr.*, TARGET hr.*

MAP sales.*, TARGET hr.*

4 start the change extract process: start extract

5 start the initial-load extract process: $/ .prm reportfile-- start with the initial-load extract parameter file name and monitor the status until the extraction is completed

6 start the initial-load replicat process: $/ .prm reportfile-- start through the initial-load replicat parameter file and monitor until complete

7 start the change replicat process: start replicat

8 Monitoring change replicat status: info replicat-until all change generated by initial load has been applied, if initial-load extract ends at 12:05, make sure replicat is applied at this point in time

9 remove the handlecollisions parameters of change replicat: send replicat, nohandlecollisions, and then update the repliat parameter file

Load data from file to database utility

Use initial-load extract to write source table to a remote ASCII file, and loading it into target db,initial-load replicat via db utility generates run and control files. Auxiliary db utility; data conversion must be performed by initial-load extract.

Rough steps

1 start the manager process of source: start manager

2 Edit initial-load extract parameter file: edit params

SOURCEISTABLE-declares extract to be initial-load

SOURCEDB mydb, USERID ogg, PASSWORD

AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

AES128, ENCRYPTKEY securekey1

RMTHOST ny4387, MGRPORT 7888, ENCRYPT AES 192 KEYNAME mykey-specify target host and manager port

ENCRYPTTRAIL AES192, KEYNAME mykey1

RMTFILE / ggs/dirdat/initld, MEGABYTES 2, PURGE-specify the remote extract file

FORMATASCII, SQLLOADER-formats the output as ASCII text, replacing the default canonical format, with options including BCP and SQLLOADER

TABLE hr.*

TABLE sales.*

3 Edit the parameter file of target initial-load repicat: edit params

GENLOADFILES sqlldr.tpl-generate run and control files to assist db utility to load data. The dynamic generation of this file cannot be intervened manually.

USERID ogg, PASSWORD

AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

AES128, ENCRYPTKEY securekey1

DECRYPTTRAIL AES192, KEYNAME mykey1

EXTFILE / ggs/dirdat/initld

SOURCEDEFS / ggs/dirdef/source_defs

MAP hr.*, TARGET hr.*

MAP sales.*, TARGET hr.*

4 start the change extract process: start extract

5 start the initial-load extract process: $/ .prm reportfile-- start with the initial-load extract parameter file name and monitor the status until the extraction is completed

6 start the initial-load replicat process: $/ .prm reportfile-- start through the initial-load replicat parameter file and monitor until complete

7 load target db: through the ASCII text file and run and control files generated in step 6, load it into target db using db utility, and monitor until it is complete

7 start the change replicat process: start replicat

8 Monitoring change replicat status: info replicat-until all change generated by initial load has been applied, if initial-load extract ends at 12:05, make sure replicat is applied at this point in time

9 remove the handlecollisions parameters of change replicat: send replicat, nohandlecollisions, and then update the repliat parameter file

Load data with OGG direct load

Use initial-load extract to send source table directly to initial-load replicat task (dynamically generated by manager and does not require a collector process), which is loaded into target; through large block and does not support data fields with log/long/UDT/ greater than 4K

The Target side uses dynamicportlist to assign port to replicat to speed up the query and binding process

Rough steps

1 start the manager process of source: start manager

2 add and edit initial-load extract parameter file: add extract

< initial-load extract name>

, sourceistable/edit params

EXTRACT initext-- specify the initial-load extract process name

SOURCEDB mydb, USERID ogg, PASSWORD

AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

AES128, ENCRYPTKEY securekey1

RMTHOST ny4387, MGRPORT 7888, ENCRYPT AES 192 KEYNAME mykey

RMTTASK REPLICAT, GROUP initrep-instructs the manager of target to start disposable initial-load replicat dynamically

TABLE hr.*

TABLE sales.*

3 add and edit the parameter files of target initial-load repicat: add replicat initrep, specialran/edit params initrep

REPLICAT initrep-specifies the initial-load replicat task name

TARGETDB mydb, USERID ogg, PASSWORD

AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

AES128, ENCRYPTKEY securekey1

SOURCEDEFS / ggs/dirdef/source_defs

MAP hr.*, TARGET hr.*

MAP sales.*, TARGET hr.*

4 start the change extract process: start extract

5 start the initial-load extract process: start extract, which will start initial-load replicat automatically

6 monitor the initial-load process and execute the view report in target until it is completed

7 start the change replicat process: start replicat

8 Monitoring change replicat status: info replicat-until all change generated by initial load has been applied, if initial-load extract ends at 12:05, make sure replicat is applied at this point in time

9 remove the handlecollisions parameters of change replicat: send replicat, nohandlecollisions, and then update the repliat parameter file

Load data with a direct bulk load to SQL*Loader

Use initial-load extract to send source table to initial-load replicat, which performs direct path loading in conjunction with SQL*Loader

This method is only used for SQL*Loader of Oracle and is not suitable for other databases; lob/long type is not supported

1 start the manager process of source: start manager

2 Edit initial-load extract parameter file: edit params

EXTRACT initext-specifies the initial-load extract process name

SOURCEDB mydb, USERID ogg, PASSWORD

AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

AES128, ENCRYPTKEY securekey1

RMTHOST ny4387, MGRPORT 7888, ENCRYPT AES 192 KEYNAME mykey

RMTTASK REPLICAT, GROUP initrep-instructs the manager of target to start initial-load replicat dynamically, which is an one-time task

TABLE hr.*

TABLE sales.*

3 add / edit parameter files for target initial-load repicat: add replicat m, specialrun/edit params

REPLICAT initrep

USERID ogg, PASSWORD

AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC &

AES128, ENCRYPTKEY securekey1

BULKLOAD-instructs replicat to work with the oracle sql*loader interface

SOURCEDEFS / ggs/dirdef/source_defs

MAP hr.*, TARGET hr.*

MAP sales.*, TARGET hr.*

4 start the change extract process: start extract

5 start the initial-load extract process: start extract, which will start initial-load replicat automatically

6 monitor the initial-load process and execute the view report in target until it is completed

7 start the change replicat process: start replicat

8 Monitoring change replicat status: info replicat-until all change generated by initial load has been applied, if initial-load extract ends at 12:05, make sure replicat is applied at this point in time

9 remove the handlecollisions parameters of change replicat: send replicat, nohandlecollisions, and then update the repliat parameter file

Online change sync

Roughly divided into

Create a checkpoint table

Create an extract group

Create an extract parameter file

Create trail

Create a replicat group

Create a replicat parameter file

Each manager supports up to 5000 concurrent extract and replicat groups. Extract can be allocated separately for different tables according to the activity level, and each extract corresponds to a data pumps and replicat group.

Checkpoint table

Can be shared by multiple OGG instance or create multiple tables, one for each replicat group

Creation method:

one

Declare in the GLOBALS file

Each new replicat group created through add replicat can be used automatically

Edit the GLOBALS file Edit params. / GLOBALS

Add the parameter checkpointtabl.

Log in to the database dblogin sourcedb, userid, password through GGSCI

Execute add checkpointtabl.

two

Declare when you create a replicat

Add replicat checkpointtable to overwrite the GLOBALS file; if nodbcheckpoint is specified, checkpoint file is used

Create online extract group

ADD EXTRACT

{,}-specify data source; tranlog- transaction log, integrated tranlog- accepts LCR in integrated mode, only for oracle,VAM- for teradata,vamtrailsource-- specify VAM trail,exttrailsource-- specify local trail

{, BEGIN} | {}-optional value: now- starts from add extract time point, and it is best not to use data pump;-- specify time point

[, PASSIVE]-used with alias extract when initiating a connection from target

[, THREADS]-- used only under RAC. Specify the number of Redo threads.

[, PARAMS]-if its parameter file is not stored in the dirpm subdirectory, the declaration needs to be displayed

[, REPORT]-if the process report is stored in a non-dirrpt subdirectory, a declaration needs to be displayed

[, DESC ""]

Create alias extract

ADD EXTRACT

, RMTHOST {|}

, {MGRPORT} | {PORT

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report