WHENEVER SQLERROR EXIT FAILURE
SET SERVEROUTPUT ON
SET TIMING ON
SET ECHO ON
SET HEADING OFF
SET FEEDBACK ON
SET VERIFY OFF

-- Simple filename without PDB reference
var filename VARCHAR2(100)
BEGIN
	SELECT 'ROLLBACK_MARS_1011_' || TO_CHAR(SYSDATE,'YYYYMMDD_HH24MISS')||'.log' INTO :filename from DUAL;
END;
/
column filename new_value _filename
select :filename filename from dual;
spool &_filename 

prompt ##### started at time #####
select systimestamp from dual;
prompt ##### database name #####
SELECT SYS_CONTEXT('USERENV', 'DB_NAME') AS DATABASE_NAME FROM DUAL;

prompt ========================================
prompt MARS-1011: Rolling back WORKFLOW_MANAGER changes
prompt Description: Rollback to previous version 1.7.0
prompt ========================================

@@91_MARS_1011_rollback_CT_MRDS_WORKFLOW_MANAGER_SPEC.sql
@@91_MARS_1011_rollback_CT_MRDS_WORKFLOW_MANAGER_BODY.sql
@@92_MARS_1011_track_rollback_version.sql

SET ECHO OFF

prompt ##### completed at time #####
select systimestamp from dual;

SPOOL OFF
EXIT