Comandos de Amostra para Configurar Streams de Dados GoldenGate para Views do JSON Relational Duality

Esta seção fornece uma amostra de workflow usando comandos cURL, para configurar Streams de Dados GoldenGate para Views de Dualidade Relacional JSON.

#--- ----------------------------------------------------------------------------------------------------
# --
# -- Create USERIDALIAS to connection from GoldenGate to the Databases
# --
# -------------------------------------------------------------------------------------------------------

curl -s -k -X POST https://north:9001/services/v2/credentials/OracleGoldenGate/ggnorth                  \
     -H "Content-Type: application/json"                                                                \
     -H "Accept: application/json"                                                                      \
     -H 'Authorization: Basic ********************'                                                     \
     -d '{"userid":"ggadmin@dbnorth","password":"***"}' | jq '.messages'

# -------------------------------------------------------------------------------------------------------
# --
# -- Add Schematranda/Trandata
# -- Note that the JSON DV and JCT are explictly called for trandata
# --
# -------------------------------------------------------------------------------------------------------

curl -s -k -X POST https://north:9001/services/v2/connections/OracleGoldenGate.ggnorth/trandata/schema  \
     -H "Content-Type: application/json"                                                                \
     -H "Accept: application/json"                                                                      \
     -H 'Authorization: Basic ********************'                                                     \
     -d '{"operation":"add","schemaName":"hr"}' | jq '.messages'

curl -s -k -X POST https://north:9001/services/v2/connections/OracleGoldenGate.ggnorth/trandata/table   \
     -H "Content-Type: application/json"                                                                \
     -H "Accept: application/json"                                                                      \
     -H 'Authorization: Basic ********************'                                                     \
     -d '{"operation":"add", "tableName":"hr.students_dv"}' | jq '.response'

curl -s -k -X POST https://north:9001/services/v2/connections/OracleGoldenGate.ggnorth/trandata/table   \
     -H "Content-Type: application/json"                                                                \
     -H "Accept: application/json"                                                                      \
     -H 'Authorization: Basic ********************'                                                     \
     -d '{"operation":"add", "tableName":"hr.demo_jct"}' | jq '.response'

# -------------------------------------------------------------------------------------------------------
# --
# -- Add Extracts on source database GGNORTH
# -- Note that the wildcard within the TABLE parameter captures
# --
# -------------------------------------------------------------------------------------------------------

curl -s -k -X POST https://north:9001/services/v2/extracts/EXTN                                         \
     -H 'Content-Type: application/json'                                                                \
     -H 'Authorization: Basic ********************'                                                     \
     -d '{"description":"Extract - Region North"
         ,"config":["EXTRACT EXTN"
                   ,"USERIDALIAS ggnorth"
                   ,"EXTTRAIL north/ea"
                   ,"DDL INCLUDE MAPPED"
                   ,"DDLOPTIONS REPORT"
                   ,"REPORTCOUNT EVERY 10 MINUTES, RATE"
                   ,"WARNLONGTRANS 15MINUTES, CHECKINTERVAL 5MINUTES"
                   ,"TABLE hr.*;"
                   ]
	     ,"source": "tranlogs"
	     ,"credentials":{"alias":"ggnorth"}
	     ,"registration": {"optimized": false}
	     ,"begin":"now"
	     ,"targets":[{"name":"ea", "path":"north/"}]
         ,"status":"running"
	     }' | jq '.messages'

# -------------------------------------------------------------------------------------------------------
# --
# -- Add User for DataStream
# --
# -------------------------------------------------------------------------------------------------------

curl -s -k -X POST https://north:9001/services/v2/authorizations/Operator/dsadmin                       \
     -H 'Content-Type: application/json'                                                                \
     -H "Accept: application/json"                                                                      \
     -H 'Authorization: Basic ********************'                                                     \
     -d '{"credential":"***", "info":"Dedicated DataStream user"}' | jq '.response'

# -------------------------------------------------------------------------------------------------------
# --
# -- Add DataStream
# --
# -------------------------------------------------------------------------------------------------------

curl -s -k -X POST https://north:9002/services/v2/stream/DS01                                           \
     -H 'Content-Type: application/json'                                                                \
     -H "Accept: application/json"                                                                      \
     -H 'Authorization: Basic ********************'                                                     \
     -d '{"source":{"trail":"ea"
                   ,"path":"north"
                   }
         ,"cloudEventsFormat":false
         ,"encoding":"json"
         ,"bufferSize":1048576
         ,"qualityOfService":"exactlyOnce"
         ,"description":"Data Stream Test #01"
         }' | jq '.response'

# -------------------------------------------------------------------------------------------------------