/* Pre-requisites: Step 3 on Application associated pdb creation is completed */
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 Configuration
SPOOL "&SPOOL_PATH"
/* Inputs are received */
accept P_APPROOT_USER Prompt 'Enter Approot Schema Username: '
accept P_APPROOT_PWD Prompt  'Enter Approot Schema Password: '
accept P_APPROOT_HOST Prompt 'Enter Approot Schema Host: '
accept P_APPROOT_PORT Prompt 'Enter Approot Schema Port: '
accept P_APPROOT_NAME Prompt 'Enter Application Root Name: '

accept P_APPLICATION_NAME Prompt   'Enter application name to be upgraded for object conversion: '

/*Connecting to Application seed*/
conn &P_APPROOT_USER/&P_APPROOT_PWD@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=&P_APPROOT_HOST)(PORT=&P_APPROOT_PORT)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=&P_APPROOT_NAME$SEED)));

/*Synching object conversion to application seed */
alter pluggable database application &P_APPLICATION_NAME sync;

SET ERRORLOGGING OFF
SPOOL OFF