Create WHO_IS_USING.plb

This article contains a script that checks to see whether a package is currenly in use.

The procedure  can be used to check whether any user is using the package. If the procedure shows ANY row, then the package cannot be compiled at this time. Substitute the parameter '%' with the actual package name that you are trying to compile.

Package compilation will hang waiting on 'Library Cache Lock' and 'Library Cache Pin' if some users are executing any Procedure/Function defined in the same package.

In order to compile/Parse a Package/Procedure/Function/View, a user needs to obtain 'Library Cache Lock' and 'Library Cache Pin' latches for the . The latches ensure that
no one is using the object during compilation/parsing. If we did not do this then the pacakge could be replace while it is being executed with unpredicatable results.
This commit is contained in:
FranzAndreas 2016-08-09 11:21:20 +02:00 committed by GitHub
parent c02a9f5911
commit c280d1a1df

227
WHO_IS_USING.plb Normal file
View File

@ -0,0 +1,227 @@
create or replace procedure who_is_using wrapped
0
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
3
7
9200000
1
4
0
20
2 :e:
1WHO_IS_USING:
1OBJ_NAME:
1VARCHAR2:
1DBMS_OUTPUT:
1ENABLE:
11000000:
1I:
1B:
1INST_ID:
1USERNAME:
1SID:
1SYS:
1X$KGLPN:
1A:
1GV$SESSION:
1X$KGLOB:
1C:
1KGLPNUSE:
1=:
1SADDR:
1UPPER:
1KGLNAOBJ:
1LIKE:
1KGLPNHDL:
1KGLHDADR:
1LOOP:
1PUT_LINE:
1(:
1||:
1TO_CHAR:
1-:
1) - :
0
0
0
84
2
0 9a 8f a0 b0 3d b4 55
6a :2 a0 6b 51 a5 57 91 :2 a0
6b :2 a0 6b :2 a0 6b ac :2 a0 6b
a0 b9 :2 a0 b9 :2 a0 6b a0 b9
b2 ee :2 a0 6b a0 7e a0 6b
b4 2e :3 a0 6b a5 b 7e :2 a0
a5 b b4 2e a 10 :2 a0 6b
a0 7e a0 6b b4 2e a 10
ac d0 e5 e9 37 :3 a0 6b 6e
7e :3 a0 6b a5 b b4 2e 7e
6e b4 2e 7e :3 a0 6b a5 b
b4 2e 7e 6e b4 2e 7e :2 a0
6b b4 2e a5 57 b7 a0 47
b7 a4 b1 11 68 4f 1d 17
b5
84
2
0 3 1f 1b 1a 27 17 2c
30 34 38 3c 3f 42 43 48
4c 50 54 57 5b 5f 62 66
6a 6d 6e 72 76 79 7d 7f
83 87 89 8d 91 94 98 9a
9b a2 a6 aa ad b1 b4 b8
bb bc c1 c5 c9 cd d0 d1
d3 d6 da de df e1 e2 1
e7 ec f0 f4 f7 fb fe 102
105 106 1 10b 110 111 115 11b
120 122 126 12a 12e 131 136 139
13d 141 145 148 149 14b 14c 151
154 159 15a 15f 162 166 16a 16e
171 172 174 175 17a 17d 182 183
188 18b 18f 193 196 197 19c 19d
1a2 1a4 1a8 1af 1b1 1b5 1b7 1c3
1c7 1c9 1ca 1d3
84
2
0 b 18 21 :2 18 17 :2 1 2
:2 e 15 :2 2 6 1c :2 1e 26 :2 28
31 :2 33 1c 11 15 11 1d 11
1f 2a 1f 2c 30 2c 38 2c
c 11 12 :2 14 1f 1d :2 21 :2 1d
12 18 :2 1a :3 12 2a 30 :2 2a :5 12
:2 14 1f 1d :2 21 :2 1d :2 12 :4 c 2
2b 2 :2 e 17 1a 1c 24 :2 26
:2 1c :2 17 2e 30 :2 17 33 35 3d
:2 3f :2 35 :2 17 43 45 :2 17 4b 4d
:2 4f :2 17 :2 2 2b 6 2 :9 1
84
4
0 :8 1 :6 3 :b 4
:f 5 :9 6 :d 7 :2 6
:9 8 :2 6 5 :4 4
8 :26 9 8 a
4 :2 2 :7 1
1d5
4
:3 0 1 :a 0 7f
1 :7 0 5 :2 0
:2 3 :3 0 2 :7 0
4 3 :3 0 6
:2 0 7f 1 7
:2 0 4 :3 0 5
:3 0 9 a 0
6 :2 0 7 b
d :2 0 7b 7
:3 0 8 :3 0 9
:3 0 10 11 0
8 :3 0 a :3 0
13 14 0 8
:3 0 b :3 0 16
17 0 9 c
:3 0 d :2 0 4
1a 1b 0 e
:3 0 1c 1d f
:3 0 8 :3 0 1f
20 c :3 0 10
:2 0 4 22 23
0 11 :3 0 24
25 d 27 4b
0 4c :3 0 e
:3 0 12 :3 0 29
2a 0 8 :3 0
13 :2 0 14 :3 0
2c 2e 0 13
2d 30 :3 0 15
:3 0 11 :3 0 16
:3 0 33 34 0
16 32 36 17
:2 0 15 :3 0 2
:3 0 18 39 3b
1a 38 3d :3 0
31 3f 3e :2 0
e :3 0 18 :3 0
41 42 0 11
:3 0 13 :2 0 19
:3 0 44 46 0
1f 45 48 :3 0
40 4a 49 :3 0
2 19 28 0
4d :6 0 4e :2 0
50 f 4f 1a
:3 0 4 :3 0 1b
:3 0 52 53 0
1c :4 0 1d :2 0
1e :3 0 7 :3 0
9 :3 0 58 59
0 22 57 5b
24 56 5d :3 0
1d :2 0 1f :4 0
27 5f 61 :3 0
1d :2 0 1e :3 0
7 :3 0 b :3 0
65 66 0 2a
64 68 2c 63
6a :3 0 1d :2 0
20 :4 0 2f 6c
6e :3 0 1d :2 0
7 :3 0 a :3 0
71 72 0 32
70 74 :3 0 35
54 76 :2 0 78
37 7a 1a :3 0
50 78 :4 0 7b
39 7e :3 0 7e
0 7e 7d 7b
7c :6 0 7f :2 0
1 7 7e 82
:3 0 81 7f 83
:8 0
3c
4
:3 0 1 2 1
5 1 c 3
12 15 18 3
1e 21 26 1
2f 2 2b 2f
1 35 1 3a
2 37 3c 1
47 2 43 47
1 5a 2 55
5c 2 5e 60
1 67 2 62
69 2 6b 6d
2 6f 73 1
75 1 77 2
e 7a
1
4
0
82
0
1
14
2
3
0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0
1 0 1
2 1 0
f 2 0
0
/