Download Read the note on How to Configure a Downstream

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts

Commitment ordering wikipedia, lookup

DBase wikipedia, lookup

Registry of World Record Size Shells wikipedia, lookup

Entity–attribute–value model wikipedia, lookup

Serializability wikipedia, lookup

Microsoft Access wikipedia, lookup

IMDb wikipedia, lookup

Extensible Storage Engine wikipedia, lookup

Btrieve wikipedia, lookup

Functional Database Model wikipedia, lookup

SQL wikipedia, lookup

Ingres (database) wikipedia, lookup

Microsoft SQL Server wikipedia, lookup

Open Database Connectivity wikipedia, lookup

Database wikipedia, lookup

Concurrency control wikipedia, lookup

Microsoft Jet Database Engine wikipedia, lookup

Relational model wikipedia, lookup

PL/SQL wikipedia, lookup

Oracle Database wikipedia, lookup

Database model wikipedia, lookup

Clusterpoint wikipedia, lookup

ContactPoint wikipedia, lookup

Transcript
Configuring an Oracle GoldenGate Downstream Integrated Extract/Replicat
This note describes the steps involved in configuring an Oracle GoldenGate replication environment using a Downstream Capture database.
Environment



Source database: SOURCEDB (Oracle 12.1.0.2 two-node RAC database)
Downstream Capture database: OGGDB (Oracle 12.1.0.2 single instance database)
Target database: PRODDB (Oracle 12.1.0.2 single instance database)
In this example we will be deploying Integrated Extract in a downstream mining database using real-time mining.
For this we need to create standby redo logs so that the source database can use Oracle Data Guard redo transport to send redo to the
downstream mining database as it is written to the online redo log at the source.

SQL>
On the source database obtain the size and number of online redo log files
select group#,thread#,bytes/1048576 from v$log;
GROUP#
THREAD# BYTES/1048576
---------- ---------- ------------11
1
1000
12
1
1000
13
1
1000
14
1
1000
15
1
1000
16
1
1000
17
1
1000
18
1
1000
21
2
1000
How to configure a Downstream Capture database for Oracle GoldenGate
Page 1
22
23
24
25
26
27
28
2
2
2
2
2
2
2
1000
1000
1000
1000
1000
1000
1000
16 rows selected.
On the Downstream Capture database, we will create standby redo log file groups. The size of the standby redo log file groups should be same as
the online redo log file and the number of standby redo log file groups needs to be one more in number than the number of online redo log file
groups.
So in this case we will create the Redo log files also of size 1000 MB and create 2 groups of Standby Redo log files with 9 members in each group
(8+1) and of size 1000 MB.

On the source database enable supplemental logging as well as force logging if not already enabled.
SQL> SELECT supplemental_log_data_min, force_logging FROM v$database;
SUPPLEME FORCE_LOGGING
-------- --------------------------------------NO
YES
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
Database altered.

Create the Downstream Capture database via DBCA
Important – Redo log file size should be the same as the size of the Standby Redo Log file size
How to configure a Downstream Capture database for Oracle GoldenGate
Page 2
Set the following parameters:
SGA_TARGET and SGA_MAX_SIZE – 8192M
Processes - 800
Streams_pool_size – 2048M

Create the GoldenGate user in both the source as well as Downstream database
create user oggsuser identified by Oggsuser1
default tablespace users
temporary tablespace temp;
grant dba to oggsuser;
SQL> exec dbms_goldengate_auth.grant_admin_privilege ('OGGSUSER');
PL/SQL procedure successfully completed.

On both the Source as well as Downstream Capture database add the following parameters
SQL> alter system set enable_goldengate_replication=TRUE scope=both;
System altered.
SQL>
ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(SOURCEDB,oggdb)' scope=both;
System altered.
Note - This should be the value of the parameter DB_UNIQUE_NAME
How to configure a Downstream Capture database for Oracle GoldenGate
Page 3

On the Source database set the LOG_ARCHIVE_DEST_2 parameter
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=oggdb ASYNC NOREGISTER
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=oggdb' scope=both;
System altered.
SQL>
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=enable
scope=both;
System altered.

Create the Standby Redo Log Files on the Downstream Capture database
Note since the Source database is a two node RAC cluster, we need to create two threads of Standby Log files
SQL>
alter
group
group
group
group
group
group
group
group
group
database add standby logfile thread 1
29 size 1000m,
30 size 1000m,
31 size 1000m,
32 size 1000m,
33 size 1000m,
34 size 1000m,
35 size 1000m,
36 size 1000m,
37 size 1000m;
Database altered.
SQL> alter database add standby logfile thread 2
group 38 size 1000m,
group 39 size 1000m,
group 40 size 1000m,
group 41 size 1000m,
How to configure a Downstream Capture database for Oracle GoldenGate
Page 4
group
group
group
group
group
42
43
44
45
46
size
size
size
size
size
1000m,
1000m,
1000m,
1000m,
1000m;
Database altered.

Copy the password file from Source database $ORACLE_HOME/dbs to the $ORACLE_HOME/dbs directory on the server hosting the
OGGDB Downstream Capture database

Create a separate directory which will hold the archive log files received from the Source database. The Downstream Capture database
will also generate some archive log files which are stored in the location specified by the parameter DB_RECOVERY_FILE_DEST
SQL> show parameter db_reco
NAME
-----------------------------------db_recovery_file_dest
db_recovery_file_dest_size
TYPE
----------string
big integer
VALUE
-----------------------------+BSCS_AUX_FRA
20G
ASMCMD> pwd
+BSCS_AUX_FRA/OGGDB/ARCHIVELOG
ASMCMD> ls
2015_12_08/
ASMCMD> mkdir REMOTE
ASMCMD> cd REMOTE
ASMCMD> pwd
+BSCS_AUX_FRA/OGGDB/ARCHIVELOG/REMOTE
How to configure a Downstream Capture database for Oracle GoldenGate
Page 5

On the Downstream Capture database set the parameters LOG_ARCHIVE_DEST_n
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=USE_RECOVERY_FILE_DEST
VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE)' scope=both;
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='LOCATION=+BSCS_AUX_FRA/OGGDB/ARCHIVELOG/REMOTE
VALID_FOR=(STANDBY_LOGFILE,PRIMARY_ROLE)' scope=both;
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_state_2=enable scope=both;
System altered.

On the server hosting the Source database, $ORACLE_HOME/network/admin add the entries to the tnsnames.ora
SOURCEDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host01-scan)(PORT = 1524))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SOURCEDB)
)
)
OGGDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host02-scan)(PORT = 20070))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oggdb)
)
How to configure a Downstream Capture database for Oracle GoldenGate
Page 6
)

On the server hosting the Downstream database, $ORACLE_HOME/network/admin add the entries to the tnsnames.ora
OGGDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host02-scan)(PORT = 20070))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oggdb)
)
)
PRODDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host02-scan)(PORT = 20070))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = srv_PRODDB)
)
)
SOURCEDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host01-scan)(PORT = 1524))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SOURCEDB)
)
)

Ensure that we are able to connect as the user OGGSUSER to both the source database as well as the Downstream Capture database on
server host01 and as user OGGSUSER to the Downstream Capture database, Target PRODDB database as well as the source SOURCEDB
database on server host02.
How to configure a Downstream Capture database for Oracle GoldenGate
Page 7

Query the V$ARCHIVE_DEST_STATUS view to check the status
SQL> select destination,status,error from v$archive_dest_status where rownum < 3;
DESTINATION
-------------------------------------------------------------------------------STATUS
ERROR
--------- ----------------------------------------------------------------VALID
oggdb
VALID

Configure the Oracle GoldenGate Credential Store
GGSCI (host02) 1> info credentialstore
Reading from ./dircrd/:
Default domain: OracleGoldenGate
Alias: oggsuser_PRODDB
Userid: [email protected]
GGSCI (host02) 2> alter credentialstore add user [email protected] alias oggsuser_sourcedb
Password:
Credential store in ./dircrd/ altered.
GGSCI (host02) 3> alter credentialstore add user [email protected] alias oggsuser_oggdb
Password:
Credential store in ./dircrd/ altered.
How to configure a Downstream Capture database for Oracle GoldenGate
Page 8

Add schema level supplemental logging at the GoldenGate level
GGSCI (host02) 4> dblogin useridalias oggsuser_sourcedb
Successfully logged into database.
GGSCI (host02 as [email protected]) 6> add schematrandata SAPCD3
2015-12-08 04:33:54
INFO
OGG-01788
SCHEMATRANDATA has been added on schema SAPCD3.
2015-12-08 04:35:45
SAPCD3.
INFO
OGG-01976
SCHEMATRANDATA for scheduling columns has been added on schema

Create the Extract, Pump and Replicat
GGSCI (host02) 1> dblogin useridalias oggsuser_sourcedb
Successfully logged into database.
GGSCI (host02 as [email protected]) 2> miningdblogin useridalias oggsuser_oggdb
Successfully logged into mining database.
GGSCI (host02 as [email protected]) 3> add extract eSOURCEDB integrated tranlog begin now
EXTRACT added.
GGSCI (host02 as [email protected]) 4> add exttrail ./dirdat/SOURCEDB/lt extract eSOURCEDB
EXTTRAIL added.
GGSCI (host02 as [email protected]) 5> add extract pSOURCEDB exttrailsource ./dirdat/SOURCEDB/lt
EXTRACT added.
GGSCI (host02 as [email protected]) 6> add rmttrail ./dirdat/SOURCEDB/rt extract pSOURCEDB
RMTTRAIL added.
How to configure a Downstream Capture database for Oracle GoldenGate
Page 9
GGSCI (host02 as [email protected]) 7> register extract eSOURCEDB database
Extract ESOURCEDB successfully registered with database at SCN 261106958.
GGSCI (host02 as [email protected]) 12> add replicat rSOURCEDB integrated exttrail ./dirdat/SOURCEDB/rt
REPLICAT (Integrated) added.
Parameter files
EXTRACT eSOURCEDB
USERIDALIAS oggsuser_sourcedb
TRANLOGOPTIONS MININGUSERALIAS oggsuser_oggdb
TRANLOGOPTIONS INTEGRATEDPARAMS (downstream_real_time_mine Y)
EXTTRAIL ./dirdat/SOURCEDB/lt
TABLE SAPCD3.*;
EXTRACT pSOURCEDB
USERIDALIAS oggsuser_sourcedb
RMTHOST host02, MGRPORT 7809 TCPBUFSIZE 200000000, TCPFLUSHBYTES 200000000
RMTTRAIL ./dirdat/SOURCEDB/rt
PASSTHRU
TABLE SAPCD3.*;
REPLICAT rSOURCEDB
ASSUMETARGETDEFS
How to configure a Downstream Capture database for Oracle GoldenGate
Page 10
USERIDALIAS oggsuser_PRODDB
MAP SAPCD3.*, TARGET SAPCD3.*;

Check that the Capture process has been created in the Downstream database and not the Source database
SQL> conn oggsuser/[email protected]
Connected.
SQL> select capture_name from dba_capture;
no rows selected
SQL> conn oggsuser/[email protected]
Connected.
SQL>
select capture_name from dba_capture;
CAPTURE_NAME
-------------------------------------------------------------------------------OGG$CAP_ESOURCEDB

Start the Extract and Pump
GGSCI (host02 as [email protected]) 7> start extract eSOURCEDB
Sending START request to MANAGER ...
EXTRACT ESOURCEDB starting
GGSCI (host02 as [email protected]) 8> info eSOURCEDB
EXTRACT
ESOURCEDB
Last Started 2016-01-14 05:39
Checkpoint Lag
00:01:27 (updated 00:00:06 ago)
How to configure a Downstream Capture database for Oracle GoldenGate
Status RUNNING
Page 11
Process ID
Log Read Checkpoint
13840
Oracle Integrated Redo Logs
2016-01-14 05:38:34
SCN 0.315303022 (315303022)
GGSCI (host02 as [email protected]) 9> start pSOURCEDB
Sending START request to MANAGER ...
EXTRACT PSOURCEDB starting
GGSCI (host02 as [email protected]) 14> info pSOURCEDB
EXTRACT
PSOURCEDB
Last Started 2016-01-14 05:41
Checkpoint Lag
00:00:00 (updated 00:38:50 ago)
Process ID
16068
Log Read Checkpoint File ./dirdat/SOURCEDB/lt000000000
First Record RBA 0

Status RUNNING
Take the Export from Source and Import into the Target database. Obtain the CURRENT_SCN from V$DATABASE.
[[email protected] ~]$ expdp directory=DATA_PUMP_DIR dumpfile=sapcd3.%U.dmp schemas=sapcd3 exclude=statistics
logfile=DATA_PUMP_DIR:exp_sapcd3.log flashback_scn=315304843 parallel=8
impdp directory=data_pump_dir dumpfile=sapcd3.%U.dmp parallel=8 full=y logfile=data_pump_dir:imp_sapcd3.log
remap_tablespace=PSAPSR3USR:PSAPSR3 remap_tablespace=PSAPSR3740:PSAPSR3
remap_tablespace=PSAPSR3740X:PSAPSR3

After the Import is completed, start the Replicat process
GGSCI (host02 as [email protected]) 14> start rSOURCEDB aftercsn 315304843
Sending START request to MANAGER ...
How to configure a Downstream Capture database for Oracle GoldenGate
Page 12
REPLICAT RSOURCEDB starting
GGSCI (host02 as [email protected]) 15> info rSOURCEDB
REPLICAT
RSOURCEDB
Last Started 2015-12-08 05:13
INTEGRATED
Checkpoint Lag
00:00:00 (updated 00:00:06 ago)
Process ID
37127
Log Read Checkpoint File ./dirdat/SOURCEDB/rt000000
First Record RBA 0
How to configure a Downstream Capture database for Oracle GoldenGate
Status RUNNING
Page 13