## -- Connections -- ## srccdb122 c##ggadmin@172.18.0.20:1521/ORCLCDB trgpdb193 pdbggadmin@172.18.0.10:1521/east ---- #### Set Credential Store, from Laptop #### ---- curl -s -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H 'cache-control: no-cache' \ -X GET https://localhost:415/services/v2/connections | jq '.response' | grep name #-- Delete and Recreate Source Credentials --# curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X DELETE https://localhost:415/services/v2/credentials/OracleGoldenGate/srccdb122 | jq '.messages' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X POST https://localhost:415/services/v2/credentials/OracleGoldenGate/srccdb122 \ -d '{"userid":"c##ggadmin@172.18.0.20:1521/ORCLCDB", "password":"vip1only"}' | jq '.messages' #-- Delete and Recreate Target Credentials --# curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X DELETE https://localhost:415/services/v2/credentials/OracleGoldenGate/trgpdb193 | jq '.messages' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X POST https://localhost:415/services/v2/credentials/OracleGoldenGate/trgpdb193 \ -d '{"userid":"pdbggadmin@172.18.0.10:1521/east", "password":"vip1only"}' | jq '.messages' #-- Delete and Create heartbeat table --# curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X DELETE https://localhost:415/services/v2/connections/OracleGoldenGate.trgpdb193/tables/heartbeat | jq '.messages' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X POST https://localhost:415/services/v2/connections/OracleGoldenGate.trgpdb193/tables/heartbeat \ -d '{"frequency":60}' | jq '.messages' #-- Create Check Point Table Target curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X DELETE https://localhost:415/services/v2/connections/OracleGoldenGate.trgpdb193/tables/checkpoint | jq '.messages' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X POST https://localhost:415/services/v2/connections/OracleGoldenGate.trgpdb193/tables/checkpoint \ -d '{"operation":"add","name":"pdbggadmin.checkpointtable"}' | jq '.messages' #-- Add Schematrandata to the source curl -k -u oggadmin:"WwelcomE##123" \ -H 'cache-control: no-cache' \ -d '{ "operation":"add", "schemaName":"west.hr", "allColumns": true }' \ -X POST https://localhost:415/services/v2/connections/OracleGoldenGate.srccdb122/trandata/schema | jq '.messages' #-- Purge Trail Files Manually --# curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X POST https://localhost:415/services/v2/commands/execute \ -d \ '{ "name": "purge", "purgeType": "trails", "trails": [ { "name": "z1" } ], "useCheckpoints": false, "keep": [ { "type": "min", "units": "files", "value": 0 } ] }' | jq '.messages' #-- Create Extract --## curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X POST https://localhost:415/services/v2/extracts/EDEMO2 \ -d '{ "description":"Create Extract Demo", "config":[ "EXTRACT EDEMO2", "EXTTRAIL z1", "USERIDALIAS srccdb122 DOMAIN OracleGoldenGate", "-- Integrated extract parameters", "TRANLOGOPTIONS INTEGRATEDPARAMS (max_sga_size 500, parallelism 24)", "LOGALLSUPCOLS", "UPDATERECORDFORMAT COMPACT", "GETTRUNCATES", "DDL INCLUDE MAPPED", "DDLOPTIONS GETREPLICATES, GETAPPLOPS", "TABLE WEST.HR.*;" ], "source":{ "tranlogs":"integrated" }, "credentials":{ "alias":"srccdb122" }, "registration":{ "containers": [ "WEST" ], "optimized":false }, "begin":"now", "targets":[ { "name":"z1", "sizeMB":50 } ], "status":"running" }' \ | jq '.messages' #-- Create and Delete the Replicat --# curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X POST https://localhost:415/services/v2/replicats/RDEMO2 \ -d '{ "description":"Create Replicat Demo", "config":[ "REPLICAT RDEMO2", "USERIDALIAS trgpdb193 DOMAIN OracleGoldenGate", "GETTRUNCATES", "DDL INCLUDE MAPPED", "MAP WEST.HR.*, TARGET HR.*;" ], "checkpoint": {"table": "pdbggadmin.checkpointtable"}, "credentials": {"alias": "trgpdb193"}, "mode": {"parallel": false,"type": "integrated"}, "registration": "none", "source": {"name": "z1"}, "status": "running" }' \ | jq '.messages' ## Status Checks ## -- List of Deployments curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X GET https://localhost:415/services/v2/deployments | jq '.response' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X GET https://localhost:415/services/v2/config/summary| jq '.response' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X GET https://localhost:415/services/v2/config/health | jq '.response' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X GET https://localhost:415/services/v2/extracts| jq '.response' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X GET https://localhost:415/services/v2/extracts/EDEMO2/info/checkpoints | jq '.response' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X GET https://localhost:415/services/v2/extracts/EDEMO2/info/status | jq '.response' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X GET https://localhost:415/services/v2/extracts/EDEMO2/info/reports | jq '.response' curl -k -u oggadmin:"WwelcomE##123" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X GET https://localhost:415/services/v2/extracts/EDEMO2/info/history | jq '.response' export OGG_CLIENT_TLS_CAPATH=/etc/nginx/cert/ogg.pem adminclient connect https://localhost deployment West as oggadmin password WwelcomE##123 !