
In the previous article Install OGG, we noticed that the installation of the software Oracle GoldenGate finished fine and could observe that the manager runs fine.
So, We need to start with the following steps to continue with the awaited moment, replication.
Also for easy administration and execution of the OGG command line, it recommends setting the environment variables.
Usually, I set the env variables to avoid issues.
export OGG_HOME=/ggate/OGG/11.2.0/<$ORACLE_SID> export ORACLE_HOME=/u01/app/dbhome/11.2.0.4 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$PATH:$OGG_HOME
You can set it, on the .bash_profile or (I preferred using a simple env variable script on the user home) an script.
The config used in the previous step, avoid some error that will appear, for example:
./ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file
Keep in mind this check:
- tnsnames
- Define TNS_ADMIN
- Create sub dirs [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!
Configuring Tnsnames.ora
It’s necessary to configure the entry of the names to ensure the connections between sites.
Below, you can see an example, please, replace 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 your env path:
export TNS_ADMIN= /u01/app/dbhome/11.2.0.4/network/admin
Create sub dirs 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 the previous output, we find that the folder exists, this could have happened because it was created at the installation moment.
Configure Parameters on Source and Target Databases
Now, we are ready to add some configurations to our database.
This parameter enables the possibility of starting the Extract process, which will be in the following 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 manage and integrate the database process with the ogg process and tasks.
Create User [Source] [Target]
The users are necessary to manage and register any event on the OGG tables, such as other 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 these 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
Remember to 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!