Skip to content

dxh_runsql

Edward de los Santos edited this page Mar 3, 2018 · 8 revisions

Synopsis

dxh_runsql.sh -o config-clone|pre-refresh|post-refresh|pre-snapshot|post-snapshot|pre-rewind|post-rewind|pre-start|post-stop [-s {SERVICE_NAME|ORACLE_SID}] -u {USERNAME} -p {PASSWORD} -t {SQL_SCRIPT}

Arguments

  • -o hook operation type (config-clone|pre-refresh|post-refresh|pre-snapshot|post-snapshot|pre-rewind|post-rewind|pre-start|post-stop)
  • -s SERVICE_NAME or ORACLE_SID
  • -u Username
  • -p Password
  • -t SQL Script file on /<operation_operation>/sql

Description

Wrapper script to call Oracle expdp utility tool.

Example

Connect using os authentication

dxh_runsql.sh -o post-refresh -t dxh_create_user.sql

Connect using SERVICE_NAME or ORACLE_SID, providing username and password

dxh_runsql.sh -s DEVDB -u system -p manager -o post-refresh -t dxh_create_user.sql

Sample sql script file - dxh_create_user.sql

PROMPT *** create testuser account ***
create user testuser identified by testtuser default tablespace users;
grant resource to testuser;

Output

2018-03-03 01:03:32 [INFO]  dxh_runsql.sh execution started
2018-03-03 01:03:32 [DEBUG] entering :::check_dir_exists():::
2018-03-03 01:03:32 [INFO]  executing post-refresh dxh_create_user.sql
2018-03-03 01:03:32 [DEBUG] entering :::exec_sqlplus_script:::
2018-03-03 01:03:32 [DEBUG] executing ./DEVDB/post-refresh/sql/dxh_create_user.sql
2018-03-03 01:03:32 [DEBUG] *** create testuser account ***
User created.
Grant succeeded.
2018-03-03 01:03:32 [INFO]  dxh_runsql.sh execution completed

Example

dxh_runsql.sh -o post-refresh -t dxh_create_user.sql

Clone this wiki locally