In the previous article Install OGG, we noticed that the installation of software Oracle GoldenGate finished fine and could observer that the manager runs fine.
So, We need start with the following steps to continue with the awaited moment, replication.
Also for easy administration and execution of OGG command line, its recommend set the environment variables.
Usually, I set the env variables for avoid issues.
export OGG_HOME=/ggate/OGG/11.2.0/<$ORACLE_SID> export ORACLE_HOME=/u01/app/dbhome/220.127.116.11 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$PATH:$OGG_HOME
You can set it, on the .bash_profile or (I preferred use an simple env variable script on the user home) an script.
The config used on the prevously step, avoid some error that will be appear, for example:
./ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file
Keep in mind this check:
- Define TNS_ADMIN
- Create subdirs [OGG_CONSOLE]
- Prepare the Source Database
- Configure Parameters on Source and Target Databases for Golden Gate.
- Configure Users on Source and Target Databases.
Let’s start !
Its necessary configure the names entry to ensure the connections between sites.
Below, you can see an example, please, replace for the true values (names)
ANIMAL = (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=vrobinson01)(PORT=1728)) (CONNECT_DATA=(SERVICE_NAME = AFRICA))) DATALAKE = (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=guilligan09)(PORT=1728)) (CONNECT_DATA=(SERVICE_NAME = WORLD)))
Defining TNS_ADMIN variable
You must configure with you env path:
export TNS_ADMIN= /u01/app/dbhome/18.104.22.168/network/admin
Create subdirs on OGG [OGG Console]
login on OGG console, with ggsci and execute:
GGSCI (exa2adbadm01.xxxxx.com.ar) 2> create subdirs Creating subdirectories under current directory /ggate/OGG/11.2.0/DATALAKE Parameter files /ggate/OGG/11.2.0/DATALAKE/dirprm: already exists Report files /ggate/OGG/11.2.0/DATALAKE/dirrpt: already exists Checkpoint files /ggate/OGG/11.2.0/DATALAKE/dirchk: already exists Process status files /ggate/OGG/11.2.0/DATALAKE/dirpcs: already exists SQL script files /ggate/OGG/11.2.0/DATALAKE/dirsql: already exists Database definitions files /ggate/OGG/11.2.0/DATALAKE/dirdef: already exists Extract data files /ggate/OGG/11.2.0/DATALAKE/dirdat: already exists Temporary files /ggate/OGG/11.2.0/DATALAKE/dirtmp: already exists Credential store files /ggate/OGG/11.2.0/DATALAKE/dircrd: already exists Masterkey wallet files /ggate/OGG/11.2.0/DATALAKE/dirwlt: already exists Dump files /ggate/OGG/11.2.0/DATALAKE/dirdmp: already exists
On previous output, we find that the folder exists, this could be happened because was created on the installation moment.
Configure Parameters on Source and Target Databases
Now, we are ready to add some configurations on our database.
This parameter enable the possibilty of start the Extract process, that will be on the next article.
Pay attention and scheduled some window time to restart the database to apply some changes.
alter database archivelog; alter database flashback on; alter database open; alter database add supplemental log data; alter database force logging; alter database add supplemental log data; alter system set enable_goldengate_replication=true scope=both;
Configure the Users on Source and Target Databases
The users will be manage and integrate the process of database with the ogg process and tasks.
Create User [Source] [Target]
The users are necessary to managed and register any event on the OGG tables, such as another admin tasks.
create user ogg_user identified by ",9sD%100010212aa.Q" tablespace ogg_data temporary tablespace temp; grant connect,resource,create session, alter session to ogg_user; grant select any dictionary, select any table,create table to ogg_user; grant alter any table to ogg_user; grant execute on utl_file to ogg_user; grant flashback any table to ogg_user; grant execute on dbms_flashback to ogg_user; grant EXECUTE on dbms_logmnr_d to ogg_user; grant SELECT on sys.logmnr_buildlog to ogg_user; grant EXECUTE ON UTL_FILE TO ogg_user; grant EXEMPT ACCESS POLICY to ogg_user;
Configuring the Database for OGG [Source]
To finish with the OGG setup, we must run this scripts.
@marker_setup.sql @ddl_setup.sql @role_setup.sql @marker_setup.sql @sequence.sql EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE(‘ogg_user’); grant ggs_ggsuser_role to ogg_user; @ddl_enable
Remeber create the credential store for a major level of security.
We are ready to go to the last step, configuring the REPLICA.
See You coming soon !