SET VERIFY ON
SET HEAD ON
SET FEEDBACK 1
SET ARRAY 1
SET LINESIZE 10000
SET PAGESIZE 50000
SET LONG 10000
SET ECHO ON
SET TRIMSPOOL ON
SET COLSEP ';'
SET SERVEROUT OFF
clear screen
SPOOL ON
SET SQLBLANKLINES ON
SET SERVEROUTPUT ON
SET ERRORLOGGING ON
SET ECHO ON
prompt Welcome to Application PDB Sync
SPOOL "&SPOOL_PATH"
/* Inputs are received */
accept P_PDB_USER Prompt 'Enter PDB Schema Username: '
accept P_PDB_PWD Prompt 'Enter PDB Schema Password: '
accept P_PDB_HOST Prompt 'Enter PDB Schema Host: '
accept P_PDB_PORT Prompt 'Enter PDB Schema Port: '

accept P_PDB_NAME Prompt 'Enter the PDB name to be synched: '
accept P_APPLICATION_NAME Prompt 'Enter the application name: '

/*Connecting to pdb */
conn &P_PDB_USER/&P_PDB_PWD@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=&P_PDB_HOST)(PORT=&P_PDB_PORT)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=&P_PDB_NAME)));

/*Synching the application with pdbs */
alter pluggable database application &P_APPLICATION_NAME sync;

SET ERRORLOGGING OFF
SPOOL OFF