November 25, 2014 Leave a comment
In our last post we have seen “GoldenGate 12c: Installation for Oracle DB” on Linux platform. Now we will do initial configuration before configuring extract and replicat on source and target databases respectively. Here are the steps:
Create tablespace for GGS operations (on both Source & Target DB)
SQL> create tablespace GGS_DATA;
Create User for extract on source database (on both Source & Target DB)
SQL> create user GGSUSER identified by GGSUSER default tablespace GGS_DATA temporary tablespace TEMP;
Grant required permissions (on both Source & Target DB)
SQL> grant connect, resource to ggsuser; SQL> grant select any dictionary, select any table to ggsuser; SQL> grant create table to ggsuser; SQL> grant flashback any table to ggsuser; SQL> grant execute on dbms_flashback to ggsuser; SQL> grant execute on utl_file to ggsuser; SQL> grant create any table to ggsuser; SQL> grant insert any table to ggsuser; SQL> grant update any table to ggsuser; SQL> grant delete any table to ggsuser; SQL> grant drop any table to ggsuser; SQL> grant ALTER ANY TABLE to ggsuser; SQL> grant ALTER SYSTEM to ggsuser; SQL> grant LOCK ANY TABLE to ggsuser; /*Only for initial load.*/ SQL> grant SELECT ANY TRANSACTION to ggsuser; /*To extract changes from redo stored on ASM for classic extract.*/
Authenticate ggsuser via DBMS_GOLDENGATE_AUTH package.
SQL> EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE('ggsuser');
Other changes on Source DB & Target DBs,
SQL> alter system set enable_goldengate_replication=TRUE;
Enable supplemental logging (only on source, not required on target)
i. Make sure DB is archive log mode, if not convert it into archivelog mode. SQL> select LOG_MODE from v$database; O/p should be ARCHIVELOG ii. Enable force logging mode. SQL> ALTER DATABASE FORCE LOGGING; iii. Add supplemental logging for all columns ( if you need to replicate majority of non default schemas) SQL> alter database add supplemental log data (ALL) columns; iv. Verify the suplimental logging. SQL> select SUPPLEMENTAL_LOG_DATA_ALL,SUPPLEMENTAL_LOG_DATA_MIN, FORCE_LOGGING from v$database; SUP SUPPLEME FOR --- -------- --- YES IMPLICIT YES
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; and GGSCI> ADD Trandata .*
Edit Manager parameters on source
go to ggs home
./GGSCI GGSCI> edit param mgr ================ PORT 7809 PurgeOldExtracts /ggs/dirdat/* UseCheckPoints, MinKeepHours 48 ================ GGSCI> stop mgr GGSCI> start mgr GGSCI> info mgr detail
Edit Manager parameters on Target Server
GGSCI> info mgr GGSCI> edit param mgr =================== PORT 7810 ===================
We are using 7810 port, you can use default 7809 or any port of your choice based on availability and firewall policy in your organization.
GGSCI> stop mgr GGSCI> start mgr GGSCI> info mgr detail
Storing Credentials in Wallet (on both Source & Target Servers)
GGSCI> create wallet Created wallet at location 'dirwlt'. Opened wallet at location 'dirwlt'. GGSCI> Add CredentialStore Credential store created in ./dircrd/. GGSCI> alter CredentialStore Add User ggsuser@MASKGGS Password ggsuser Alias ggsuser /*On Source Server.*/ Credential store in ./dircrd/ altered. GGSCI> alter CredentialStore Add User ggsuser@MASKGGT Password ggsuser Alias ggsuser /*On Target Server.*/ Credential store in ./dircrd/ altered.
Note: maskggs is tns connection string.
GGSCI> info CredentialStore Reading from ./dircrd/: Default domain: OracleGoldenGate Alias: oggs_user Userid: ggsuser@maskggs
GGSCI> DBLogin UserIDAlias ggsuser
At this stage our environment is ready for classic/integrated extract and replicat. We will cover initial load in our next post.
The views expressed on this blog are my own and do not necessarily reflect the views of either the companies I have worked for or Oracle Corporation and its affiliates. The comments, views and opinions expressed by visitors on this blog are theirs alone and may not reflect mine. Whatever scenarios suggested under this blog were simulated only on demo environment, so it’s advisable to test those in test systems before pushing to your production environment.