11prompt Installing utplsql v2- v3 migration utility
22
3- set serveroutput on size unlimited
43set timing off
54set feedback off
65set verify off
6+ set heading off
7+ set linesize 1000
8+ set pagesize 0
9+ set feedback off
10+ set echo off
11+ set termout off
12+ set serveroutput on size unlimited format truncated
13+
14+ column 1 new_value 1 noprint
15+ column 2 new_value 2 noprint
16+ select null as " 1" , null as " 2" from dual where 1 = 0 ;
17+ column sep new_value sep noprint
18+ select ' --------------------------------------------------------------' as sep from dual;
19+
20+ spool params .sql .tmp
21+
22+ select
23+ case
24+ when ' &&1' is null then q' [ACCEPT utplsql_v2_owner CHAR DEFAULT ' UTP' PROMPT ' Provide schema owning the utPLSQL v2 (UTP)' ]'
25+ else ' define utplsql_v2_owner=&&1'
26+ end
27+ from dual;
28+ select
29+ case
30+ when ' &&2' is null then q' [ACCEPT utplsql_v3_owner CHAR DEFAULT ' UT3' PROMPT ' Provide schema owning the utPLSQL v3 (UT3)' ]'
31+ else ' define utplsql_v3_owner=&&2'
32+ end
33+ from dual;
34+
35+ spool off
36+
37+ set termout on
38+ @params .sql .tmp
739
840whenever sqlerror exit failure rollback
941whenever oserror exit failure rollback
1042
11- define utplsql_v2_owner= &1
12- define utplsql_v3_owner= &2
43+ prompt &&sep
44+ begin
45+ execute immediate q' [begin dbms_output.put_line(' User &&utplsql_v2_owner owns utPLSQL - version ' ||&&utplsql_v2_owner..utplsql.version()); end;]' ;
46+ exception
47+ when others then
48+ raise_application_error(- 20000 , ' User &&utplsql_v2_owner does not own utPLSQL v2 or current user(' || user|| ' ) does not have privileges to access it.' );
49+ end;
50+ /
51+
52+ prompt &&sep
53+ begin
54+ execute immediate q' [begin dbms_output.put_line(' User &&utplsql_v3_owner owns ' ||&&utplsql_v3_owner..ut.version()); end;]' ;
55+ exception
56+ when others then
57+ raise_application_error(- 20000 , ' User &&utplsql_v3_owner does not own utPLSQL v3 or current user(' || user|| ' ) does not have privileges to access it.' );
58+ end;
59+ /
60+
61+ prompt &&sep
62+ prompt Using schema (&&utplsql_v2_owner) as owner of utPLSQL v2
63+ prompt Using schema (&&utplsql_v3_owner) as owner of utPLSQL v3
1364
1465alter session set current_schema = &&utplsql_v3_owner;
1566
67+ prompt &&sep
68+ PROMPT Installing into schema &&utplsql_v3_owner
69+ prompt &&sep
70+ set feedback on
71+ set echo on
1672grant execute on sys .utl_file to &&utplsql_v3_owner;
1773
1874drop public synonym utassert2;
1975drop public synonym utassert;
2076
21- @@migration/ utassert2 .pks
22- @@migration/ utassert .pks
23- @@migration/ utassert2 .pkb
24- @@migration/ utassert .pkb
25- @@migration/ ut_v2_migration .pks
26- @@migration/ ut_v2_migration .pkb
77+ set echo off
78+ @@install_component .sql ' migration/utassert2.pks'
79+ @@install_component .sql ' migration/utassert.pks'
80+ @@install_component .sql ' migration/ut_v2_migration.pks'
81+
82+ @@install_component .sql ' migration/utassert2.pkb'
83+ @@install_component .sql ' migration/utassert.pkb'
84+ @@install_component .sql ' migration/ut_v2_migration.pkb'
2785
86+ set echo on
2887create or replace public synonym utassert for &&utplsql_v2_owner..utassert;
2988create or replace public synonym utassert2 for &&utplsql_v2_owner..utassert2;
3089create or replace public synonym ut_v2_migration for ut_v2_migration;
@@ -33,4 +92,19 @@ grant execute on utassert to public;
3392grant execute on utassert2 to public;
3493grant execute on ut_v2_migration to public;
3594
95+ set echo off
96+ prompt &&sep
97+ PROMPT Installation completed successfully
98+ prompt &&sep
99+
100+ set termout off
101+
102+ /*
103+ * cleanup temporary sql files
104+ */
105+ -- try running on windows
106+ $ del * .sql .tmp
107+ -- try running on linux/unix
108+ ! rm * .sql .tmp
109+
36110exit success
0 commit comments