05.14. Preparing Oracle Database (Reports) for Replication

                                                    <<< Back   Next >>>

!!! Certainly, please provide the scripts or steps you would like me to execute on the Oracle database for reports. !!!

Oracle (reports)
***************************
- db-ora01.oracak.com:1521/dbrep1

1. Enable the parameter on the receiving side in Oracle
sqplus>
alter system set enable_goldengate_replication=true;

2. Creating user ggadmin
sqplus>
DROP USER ggadmin CASCADE;
CREATE USER ggadmin
IDENTIFIED by <***>
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
ACCOUNT UNLOCK;
-- 5 Roles for ggadmin
GRANT CONNECT TO ggadmin;
GRANT DBA TO ggadmin;
GRANT RESOURCE TO ggadmin;
GRANT SELECT_CATALOG_ROLE TO ggadmin;
ALTER USER ggadmin DEFAULT ROLE ALL;
-- 2 Tablespace Quotas for ggadmin
ALTER USER ggadmin QUOTA UNLIMITED ON tbs_quik;
ALTER USER ggadmin QUOTA UNLIMITED ON USERS;

3. Creating table HB
sqplus>
DROP TABLE ggadmin.HB CASCADE CONSTRAINTS;
CREATE TABLE ggadmin.HB (ID NUMBER NOT NULL, INSTANCE_NAME VARCHAR2(50 BYTE) NOT NULL, SRC_TIMESTAMP TIMESTAMP(6) NOT NULL, SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS) TABLESPACE USERS;
CREATE UNIQUE INDEX ggadmin.HB_PK ON ggadmin.HB (ID) TABLESPACE USERS;
ALTER TABLE ggadmin.HB ADD (CONSTRAINT HB_PK PRIMARY KEY (ID) USING INDEX ggadmin.HB_PK ENABLE VALIDATE);

4. Creating table HB_TARGET
sqplus>
DROP TABLE ggadmin.HB_TARGET CASCADE CONSTRAINTS;
CREATE TABLE ggadmin.HB_TARGET (ID NUMBER NOT NULL, INSTANCE_NAME VARCHAR2(50 BYTE) NOT NULL, SRC_TIMESTAMP TIMESTAMP(6) NOT NULL, DEST_TIMESTAMP TIMESTAMP(6) DEFAULT systimestamp)TABLESPACE USERS;
CREATE UNIQUE INDEX ggadmin.HBT_PK ON ggadmin.HB_TARGET (ID, INSTANCE_NAME) TABLESPACE USERS;
ALTER TABLE ggadmin.HB_TARGET ADD (CONSTRAINT HBT_PK PRIMARY KEY (ID, INSTANCE_NAME) USING INDEX ggadmin.HBT_PK ENABLE VALIDATE);

5. Truncating application tables
[oracle] sqlplus>
truncate table stock.bonds;
truncate table stock.bonds_arch;
truncate table stock.bonds_setting;
truncate table stock.bonds_setting_arch;
truncate table stock.bonds_zajvka;
truncate table stock.bonds_zajvka_arch;
truncate table stock.client_account;
truncate table stock.client_account_arch;
truncate table stock.dividents;
truncate table stock.job_logs;
truncate table stock.portfolio;
truncate table stock.portfolio_arch;
truncate table stock.quotes;
truncate table stock.quotes_analyst_15m;
truncate table stock.quotes_analyst_1d;
truncate table stock.quotes_analyst_1h;
truncate table stock.quotes_arch;
truncate table stock.quotes_volume;
truncate table stock.quotes_volume_arch;
truncate table stock.report_benefit;
truncate table stock.report_benefit_comparator;
truncate table stock.report_edu;
truncate table stock.report_edu_comparator;
truncate table stock.sdelka;
truncate table stock.sdelka_arch;
truncate table stock.signal;
truncate table stock.signal_arch;
truncate table stock.trading_edu;
truncate table stock.trading_prod;
truncate table stock.trading_prod_arch;
                                                     <<< Back   Next >>>