-
Notifications
You must be signed in to change notification settings - Fork 17
/
run.sql
91 lines (61 loc) · 1.73 KB
/
run.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
connect / as sysdba
declare
procedure drop_user_if_exists is
cnt number;
begin
select count(*) into cnt from dba_users where username = 'TQ84_PLSCOPE_TEST';
if cnt > 0 then
execute immediate 'drop user tq84_plscope_test cascade';
end if;
end drop_user_if_exists;
begin
drop_user_if_exists;
end;
/
create user tq84_plscope_test
identified by tq84_plscope_test
default tablespace data
temporary tablespace temp
quota unlimited on data;
grant
create procedure,
create session,
create synonym,
create table,
create trigger,
create view
to tq84_plscope_test;
grant all on sys.all_identifiers to tq84_plscope_test;
-- Grants needed for tq84_all_identifiers (see ../tq84_plscope_test.sql)
grant all on sys."_CURRENT_EDITION_OBJ" to tq84_plscope_test;
grant all on sys.plscope_identifier$ to tq84_plscope_test;
grant all on sys.plscope_action$ to tq84_plscope_test;
grant all on sys.user$ to tq84_plscope_test;
connect tq84_plscope_test/tq84_plscope_test;
@tab_01.sql
@pck_a.pks
@pck_b.pks
@pck_c.pks
@pck_a.pkb
@pck_b.pkb
@pck_c.pkb
@trg_01.plsql
-- Install PL-Scope:
@@../tables.sql
@@../spec.plsql
@@../body.plsql
-- Run PL-Scope
connect tq84_plscope_test/tq84_plscope_test
exec plscope.gather_identifiers
@@../tq84_all_identifiers
commit;
-- Prevent ORA-04068: existing state of packages has been discarded
connect tq84_plscope_test/tq84_plscope_test
exec plscope.fill_call(user, true);
-- Vim Tests
@@../vim/unused_constants.sql
@@../vim/unused_functions.sql
@@../vim/unused_variables.sql
$fc unused_constants.ef unused_constants.expected
$fc unused_functions.ef unused_functions.expected
$fc unused_variables.ef unused_variables.expected