Skip to content

Commit d1452db

Browse files
committed
Updated install script - adding spool to log file
Updated uninstall script - adding parameter check/validation. Added uninstall.sh to the travis to validate that the uninstall is working correctly.
1 parent f978b8e commit d1452db

File tree

5 files changed

+67
-6
lines changed

5 files changed

+67
-6
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ install:
5555
- .travis/setup_account.sh
5656
# Install project sources and tests
5757
- source/install.sh
58+
- source/uninstall.sh
59+
- source/install.sh
5860
- test/install.sh
5961

6062
script:

source/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -ev
44

55
cd "$(dirname "$(readlink -f "$0")")"
66

7-
sqlplus -L -S / as sysdba @install.sql utp ut3
7+
sqlplus -L -S / as sysdba @uninstall.sql utp ut3

source/install.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ from dual;
3333

3434
spool off
3535

36+
spool install.log
37+
3638
set termout on
3739
@params.sql.tmp
3840

@@ -98,6 +100,7 @@ prompt &&sep
98100

99101
set termout off
100102

103+
spool off
101104
/*
102105
* cleanup temporary sql files
103106
*/

source/uninstall.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -ev
4+
5+
cd "$(dirname "$(readlink -f "$0")")"
6+
7+
sqlplus -L -S / as sysdba @install.sql utp ut3

source/uninstall.sql

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,56 @@
1-
drop package utassert;
2-
drop package utassert2;
3-
drop package ut_v2_migration;
4-
drop public synonym ut_v2_migration;
1+
prompt Removing utplsql v2-v3 migration utility
2+
3+
set timing off
4+
set feedback off
5+
set verify off
6+
set heading off
7+
set linesize 1000
8+
set pagesize 0
9+
set echo off
10+
set termout off
11+
set serveroutput on size unlimited format truncated
12+
13+
column 1 new_value 1 noprint
14+
column 2 new_value 2 noprint
15+
select null as "1", null as "2" from dual where 1=0;
16+
column sep new_value sep noprint
17+
select '--------------------------------------------------------------' as sep from dual;
18+
19+
spool params.sql.tmp
20+
21+
select
22+
case
23+
when '&&1' is null then q'[ACCEPT utplsql_v2_owner CHAR DEFAULT 'UTP' PROMPT 'Provide schema owning the utPLSQL v2 (UTP)']'
24+
else 'define utplsql_v2_owner=&&1'
25+
end
26+
from dual;
27+
select
28+
case
29+
when '&&2' is null then q'[ACCEPT utplsql_v3_owner CHAR DEFAULT 'UT3' PROMPT 'Provide schema owning the utPLSQL v3 (UT3)']'
30+
else 'define utplsql_v3_owner=&&2'
31+
end
32+
from dual;
33+
34+
spool off
35+
set termout on
36+
@params.sql.tmp
37+
38+
spool uninstall.log
39+
40+
drop package &&utplsql_v3_owner..ut_v2_migration;
41+
drop public synonym &&utplsql_v3_owner..ut_v2_migration;
42+
drop package &&utplsql_v3_owner..utassert;
43+
drop package &&utplsql_v3_owner..utassert2;
544
create or replace public synonym utassert for &&utplsql_v2_owner..utassert;
645
create or replace public synonym utassert2 for &&utplsql_v2_owner..utassert2;
7-
drop package ut_v2_migration;
46+
47+
spool off
48+
/*
49+
* cleanup temporary sql files
50+
*/
51+
--try running on windows
52+
$ del *.sql.tmp
53+
--try running on linux/unix
54+
! rm *.sql.tmp
55+
56+
exit success

0 commit comments

Comments
 (0)