Skip to content

Instantly share code, notes, and snippets.

View shadabshaukat's full-sized avatar
🕶️

Shadab Mohammad shadabshaukat

🕶️
View GitHub Profile
-- 01_load_source.sql
-- Appends generated fixture data to the SYD source database only.
-- Prerequisite: run 00_create_schema.sql once on a fresh database.
-- Usage: psql -X "$SOURCE_DSN" -v ON_ERROR_STOP=1 -v rows=100000 -f 01_load_source.sql
\set ON_ERROR_STOP on
-- Validate the psql variable before it is cast or used in SQL. :'rows'
-- quotes the value as a SQL literal and avoids raw variable substitution.
\if :{?rows}
\else
-- 00_create_schema.sql
-- Creates the complete DVD rental schema and source-only generator procedure.
-- Fresh database only. Run on SYD, MEL, and SGP; this file loads no rows.
-- Usage: psql -X "$DB_DSN" -v ON_ERROR_STOP=1 -f 00_create_schema.sql
\set ON_ERROR_STOP on
-- Fresh database only. Deliberately fails if dvdrental already exists.
-- Original lab implementation of the 15-table DVD rental model, not the
-- canonical sample dump. All surrogate keys use bigint; temporal columns use timestamptz.
BEGIN;
@shadabshaukat
shadabshaukat / Service_Health_Summary.sh
Created May 24, 2022 16:54
Service_Health_Summary
curl -u <user>:"<password>"
-H "Content-Type: application/json"
-H "Accept: application/json"
-X GET https://pxxxxxxxq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/v2/config/health/check
curl -X "POST" "https://pxxxxxxxq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/v2/credentials/{domain}/{alias} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u 'user:password' \
-d $'{
"userid": "oggadmin@//localhost:1521/ORCL",
"password": "oggadmin"
}'
@shadabshaukat
shadabshaukat / Critical_Events_Replication_Process.sh
Created May 24, 2022 16:35
Critical_Events_Replication_Process
curl -u <user>:"<password>"
-H "Content-Type: application/json"
-H "Accept: application/json"
-X GET https://pxxxxxq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/v2/logs/events
@shadabshaukat
shadabshaukat / View_Discard_File_Replicat.sh
Created May 24, 2022 16:21
View_Discard_File_Replicat
curl -u <user>:"<password>"
-H "Content-Type: application/json"
-H "Accept: application/json"
-X GET https://pxxxxxxq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/v2/replicats/<replicat name>/info/reports/<replicat name>.dsc
@shadabshaukat
shadabshaukat / View_Discard_File_Extract.sh
Created May 24, 2022 16:19
View_Discard_File_Extract.sh
curl -u <user>:"<password>"
-H "Content-Type: application/json"
-H "Accept: application/json"
-X GET https://pxxxxxxxq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/v2/extracts/<extract name>/info/reports/<extract name>.dsc
curl -X "POST" "https://pxxxxxxq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/v2/replicats/<replicat name>/command" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u 'user:password' \
-d $'{
"command": "GETLAG"
}'
curl -X "POST" "https://pxxxxxxq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/v2/extracts/<extract name>/command" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-u 'user:password' \
-d $'{
"command": "GETLAG"
}'
@shadabshaukat
shadabshaukat / Add_Tran_Data_Source_Schema.sh
Created May 22, 2022 16:05
Add_Tran_Data_Source_Schema
curl -u <user>:"<password>" -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://<deployment URL>:<port>/services/v2/connections/<domain>.<credential>/trandata/schema -d '{ "operation":"add", "schemaName":"<schema>" }'
curl -u <user>:"<password>"
-H "Content-Type: application/json"
-H "Accept: application/json"
-X POST https://pxxxxxq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/v2/connections/OracleGoldenGate.ggashburn/trandata/schema -d '{ "operation":"add", "schemaName":"admin" }'