ORA-29548: Java system class reported: release of Java system classes in the database ( being determined) does not match that of the oracle executable (11.2.0.4.221018)
执行 java 报错
create or replace and compile java source named preg_replace as
package com.tydic.oracle.udf;
public class PregReplace{
static public String pregReplace(String srcString,String regex,String replaceString){
if(srcString==null || srcString.trim().length()<=0 ||
regex==null || regex.trim().length()<=0 ||
replaceString==null || replaceString.trim().length()<=0){
return srcString;
}
return srcString.replaceAll(regex,replaceString);
}
20:29:00 12 };
20:29:01 13 /
create or replace and compile java source named preg_replace as
*
ERROR at line 1:
ORA-29548: Java system class reported: release of Java system classes in the database ( being determined) does not match that of the oracle executable (11.2.0.4.221018)
Elapsed: 00:00:00.01
20:29:02 SYS@cndb> select dbms_java.get_jdk_version() from dual;
select dbms_java.get_jdk_version() from dual
*
ERROR at line 1:
ORA-00980: synonym translation is no longer valid
Elapsed: 00:00:00.01
20:30:25 SYS@cndb> @?/javavm/install/update_javavm_db.sql
SP2-0310: unable to open file "/u01/app/oracle/product/11.2.0/dbhome_1/javavm/install/update_javavm_db.sql"
20:30:42 SYS@cndb> alter session set "_ORACLE_SCRIPT"=true;
alter session set "_ORACLE_SCRIPT"=true
*
ERROR at line 1:
ORA-02248: invalid option for ALTER SESSION
Elapsed: 00:00:00.00
--检查数据库中的JDK版本
20:30:51 SYS@cndb> select dbms_java.get_jdk_version() from dual;
select dbms_java.get_jdk_version() from dual
*
ERROR at line 1:
ORA-00980: synonym translation is no longer valid
网上百度说要执行一个 sql
20:25:18 SYS@cndb> @?/javavm/install/update_javavm_db.sql
没有解决问题
检查OPATCH版本
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/OPatch]$./opatch lsinv
Oracle Interim Patch Installer version 11.2.0.3.39
Copyright (c) 2024, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.39
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2024-03-25_20-33-37PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2024-03-25_20-33-37PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: qian04a
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.
Interim patches (2) :
Patch 34412266 : applied on Fri Sep 29 15:05:36 CST 2023
Unique Patch ID: 24946751
Patch description: "OJVM PATCH SET UPDATE 11.2.0.4.221018"
Created on 23 Sep 2022, 14:08:32 hrs UTC
Bugs fixed:
32523233, 23727132, 19554117, 19006757, 14774730, 18933818, 18458318
18166577, 19231857, 19153980, 19058059, 19007266, 17285560, 17201047
17056813, 19223010, 19852360, 19909862, 19895326, 19374518, 20408829
21047766, 21566944, 19176885, 17804361, 17528315, 21811517, 22253904
19187988, 21911849, 22118835, 22670385, 23265914, 22675136, 24448240
25067795, 24534298, 25076732, 25494379, 26023002, 19699946, 26637592
27000663, 25649873, 27461842, 27952577, 27642235, 28502128, 28915933
29254615, 29774367, 29992392, 29448234, 30160639, 30534664, 30855121
31306274, 30772207, 31476032, 30561292, 28394726, 26716835, 24817447
23082876, 31668867, 32892894, 32720458, 33223294, 33131742, 33563123
33805168, 34149259, 33239083, 28492769, 34473555
Patch 34386237 : applied on Fri Sep 29 14:38:14 CST 2023
Unique Patch ID: 24946740
Patch description: "Database Patch Set Update : 11.2.0.4.221018 (34386237)"
Created on 23 Sep 2022, 01:50:11 hrs UTC
Sub-patch 34057724; "Database Patch Set Update : 11.2.0.4.220719 (34057724)"
Sub-patch 33711103; "Database Patch Set Update : 11.2.0.4.220419 (33711103)"
Sub-patch 33477185; "Database Patch Set Update : 11.2.0.4.220118 (33477185)"
Sub-patch 33128584; "Database Patch Set Update : 11.2.0.4.211019 (33128584)"
Sub-patch 32758711; "Database Patch Set Update : 11.2.0.4.210720 (32758711)"
Sub-patch 32328626; "Database Patch Set Update : 11.2.0.4.210420 (32328626)"
Sub-patch 31983472; "Database Patch Set Update : 11.2.0.4.210119 (31983472)"
Sub-patch 31537677; "Database Patch Set Update : 11.2.0.4.201020 (31537677)"
Sub-patch 31103343; "Database Patch Set Update : 11.2.0.4.200714 (31103343)"
Sub-patch 30670774; "Database Patch Set Update : 11.2.0.4.200414 (30670774)"
Sub-patch 30298532; "Database Patch Set Update : 11.2.0.4.200114 (30298532)"
Sub-patch 29913194; "Database Patch Set Update : 11.2.0.4.191015 (29913194)"
Sub-patch 29497421; "Database Patch Set Update : 11.2.0.4.190716 (29497421)"
Sub-patch 29141056; "Database Patch Set Update : 11.2.0.4.190416 (29141056)"
Sub-patch 28729262; "Database Patch Set Update : 11.2.0.4.190115 (28729262)"
Sub-patch 28204707; "Database Patch Set Update : 11.2.0.4.181016 (28204707)"
Sub-patch 27734982; "Database Patch Set Update : 11.2.0.4.180717 (27734982)"
Sub-patch 27338049; "Database Patch Set Update : 11.2.0.4.180417 (27338049)"
Sub-patch 26925576; "Database Patch Set Update : 11.2.0.4.180116 (26925576)"
Sub-patch 26392168; "Database Patch Set Update : 11.2.0.4.171017 (26392168)"
Sub-patch 26609445; "Database Patch Set Update : 11.2.0.4.170814 (26609445)"
Sub-patch 25869727; "Database Patch Set Update : 11.2.0.4.170718 (25869727)"
Sub-patch 24732075; "Database Patch Set Update : 11.2.0.4.170418 (24732075)"
Sub-patch 24006111; "Database Patch Set Update : 11.2.0.4.161018 (24006111)"
Sub-patch 23054359; "Database Patch Set Update : 11.2.0.4.160719 (23054359)"
Sub-patch 22502456; "Database Patch Set Update : 11.2.0.4.160419 (22502456)"
Sub-patch 21948347; "Database Patch Set Update : 11.2.0.4.160119 (21948347)"
Sub-patch 21352635; "Database Patch Set Update : 11.2.0.4.8 (21352635)"
Sub-patch 20760982; "Database Patch Set Update : 11.2.0.4.7 (20760982)"
Sub-patch 20299013; "Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch 19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch 19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch 18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch 18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch 17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
Bugs fixed:
18619917, 19309466, 28876684, 28855981, 18189036, 19781326, 13609098
16285691, 16756406, 18430495, 17323222, 13854364, 29483723, 19915271
22468255, 19516448, 14458214, 23713236, 23140259, 29434301, 22502493
19540573, 18272672, 16410570, 16494615, 19174430, 21352646, 16901385
16596890, 22243719, 32741584, 18996843, 21387964, 20334344, 17174582
22250006, 17798953, 24307571, 14015842, 18031668, 15955387, 30758943
17391136, 21534893, 16832076, 16065166, 16579084, 25427662, 21179898
24589081, 11786053, 15990359, 17982832, 18685892, 20142975, 24835538
16315398, 20861693, 30018017, 17037130, 17284817, 17643573, 18832544
17891946, 17279227, 17588480, 17291347, 16731148, 21097043, 24528741
22321741, 17165204, 26245237, 17891943, 25205368, 32776891, 17359610
17265217, 17465741, 29621961, 22551446, 31492176, 18191164, 16721594
18614015, 27825893, 18440095, 19769489, 20596234, 25115178, 18482502
16043574, 20936905, 17360606, 22321756, 19211724, 17392698, 19463893
31492164, 29033139, 17477958, 17040764, 18362222, 19463897, 24624166
17853456, 14521849, 17816865, 32190132, 19692824, 21868720, 17951233
25505407, 17040527, 31022191, 24975421, 19888853, 18009564, 20882568
20803583, 23026585, 18604692, 17622427, 34100909, 16903536, 29483771
17865671, 17883081, 16228604, 17325413, 17082359, 30517516, 12747740
22168163, 16091637, 20569094, 31492144, 17468141, 30365745, 29962939
19469538, 29633753, 20598042, 32775512, 16042673, 23302839, 17437634
24473736, 28734355, 19049453, 33027553, 16941434, 20387265, 16833527
21343775, 17297939, 16069901, 34339279, 14285317, 22380919, 18436647
23065323, 31885190, 21983325, 31927930, 17853498, 24790914, 23571055
16542886, 21286665, 17365043, 17752995, 25914276, 17296856, 18783224
22353199, 22083366, 28305362, 21419850, 16180763, 23294548, 26679352
13960236, 33441073, 25328093, 25423453, 18339044, 17282229, 28384353
25600421, 18856999, 31031715, 18259031, 28806384, 21354456, 23725036
31885162, 18471685, 30237239, 17258090, 16344544, 17903598, 17011832
18135678, 18704244, 17786518, 19718981, 25655390, 17242746, 20250147
19197175, 17390431, 17835627, 17672719, 31125948, 17393915, 21566639
18765602, 21425496, 26544823, 22228324, 29962927, 18682983, 30179644
25165496, 12816846, 31885179, 18774543, 31885173, 18747196, 17824637
21834568, 19429927, 21429602, 16524926, 17343514, 19271443, 17019345
18681862, 17186905, 23330119, 17811438, 26474853, 17215560, 16875449
21380789, 17184721, 18508861, 19466309, 33065437, 23330124, 17811429
17019356, 25654936, 17754782, 17752121, 22809871, 17201159, 34100044
18308268, 19777862, 16198143, 29027694, 18828868, 17586955, 28076295
19445860, 26654363, 30200680, 22977256, 16692232, 27374796, 21142837
20869721, 17649265, 24555417, 17847764, 25879656, 21756699, 19697993
28364007, 17787259, 30578221, 23628685, 30252098, 23007241, 27351628
18094246, 18460587, 20031873, 17375354, 21698350, 26513067, 32153619
21538567, 18232865, 22683212, 16450169, 17478145, 17311728, 17648596
17308789, 22836801, 21756677, 33040335, 18674047, 14084247, 19788303
22683225, 27534509, 16833845, 18948177, 32368789, 17205719, 21756661
20004021, 17922254, 13837378, 32368792, 18084625, 17912217, 11883252
24842886, 12982566, 26203182, 14176370, 14764829, 21847223, 16875230
28079127, 22568797, 34088194, 17237521, 29511611, 25635149, 16934803
17848897, 20441797, 20175161, 19831647, 16613964, 17532245, 18334586
17288409, 17341326, 31338362, 17449815, 15913355, 16399083, 27404573
18740837, 20294666, 14565184, 21517440, 17614134, 32222473, 33873839
19854503, 14245531, 16194160, 18325460, 15979965, 30562923, 20671094
29965888, 27870645, 25093656, 18247991, 16912439, 30562936, 17047404
24433711, 19930276, 22092979, 20506715, 31884535, 23003979, 20506706
13871092, 33933784, 19272701, 17397545, 16785708, 19461270, 21051862
13829543, 16220077, 17008068, 18061914, 20448824, 30275359, 18674024
29343156, 19689979, 24411921, 23184013, 30275351, 17596908, 17036973
22175564, 22499356, 17612828, 20725343, 31001455, 28199085, 23194294
17630484, 21051858, 20017509, 21051852, 17767676, 17232014, 22893153
12611721, 25555252, 18356166, 17071721, 19315668, 25764020, 16863422
21051840, 17820741, 17267114, 33106822, 18043064, 21538558, 26243698
20324049, 21612959, 30305880, 16392068, 18744139, 24348685, 26746894
17806696, 18628388, 27302681, 27072923, 14010183, 16595641, 31711889
17080436, 17332800, 20777150, 21453153, 20299015, 18413820, 18264060
16819962, 22465352, 21351877, 21051833, 18673342, 30393318, 30562907
30562909, 29200700, 27441326, 16571443, 18328509, 27567477, 18674465
16422541, 18306996, 19359219, 21424824, 17443671, 17478514, 23054054
21067387, 16268425, 32846272, 17381384, 18723434, 17235750, 23328639
22195448, 24570598, 21172913, 17655240, 18384391, 16992075, 22195441
17025461, 30562891, 16472716, 19289642, 31987278, 21502702, 22195457
20475845, 22148226, 26030218, 18331850, 17945983, 13498382, 24652769
31885230, 18673304, 17610798, 19891090, 25369547, 18456514, 8322815
22657942, 17313525, 17050888, 18317531, 19835133, 17495022, 11733603
18798250, 19285025, 18260550, 17390160, 18316692, 19458377, 14368995
17551063, 21343838, 12905058, 14735792, 28612674, 16855292, 23315889
24480567, 13364795, 33096609, 18235390, 18293054, 32190284, 18673325
30215130, 19393542, 14657740, 17532729, 17393683, 17389192, 17783588
17852463, 19358317, 17441661, 14034426, 28254374, 20631274, 19207117
26569225, 17518652, 24662775, 19475971, 31885201, 18282562, 33232606
30421204, 19896336, 17348614, 19827973, 31883489, 17346671, 31022281
19791273, 32359044, 24476274, 22296366, 13853126, 18273830, 17570606
13558557, 20425790, 26007010, 16685417, 31885223, 18180390, 14692762
18159793, 17027426, 24476265, 23177648, 17851160, 16870214, 18202441
32984679, 17227073, 20657411, 19006849, 22606521, 20506699, 28000269
23536835, 17761775, 20382309, 16306373, 31885213, 17801017, 19680952
16850630, 17694209, 26667015, 17877323, 18230522, 25288078, 24563422
17446237, 17889549, 17551674, 16233738, 22730454, 17571039, 26667023
19972570, 18849970, 21532755, 20860659, 22905130, 21168487, 17016369
21263635, 17231779, 17717883, 21343897, 27710072, 18522509, 23209741
17484731, 21972320, 19972569, 19972568, 17716305, 21059919, 19972566
19972564, 26667032, 17394950, 26318200, 20657441, 17551699, 17006570
18051556, 12364061, 18029658, 17546973, 18262334, 19699191, 30387666
17227277, 32676350, 18018515, 16943711, 18388363, 17982555, 20828947
18098207, 18436307, 19584068, 16898135, 13936038, 19601762, 31010960
14054676, 25505394, 18228645, 29782211, 19013183, 25042823, 17721717
17239687, 25248384, 25634317, 20134113, 20273319, 28501075, 31945038
30624864, 21063322, 31834759, 17344412, 22507210, 32097882, 16354467
21795111, 25505371, 16777840, 25879984, 17811456, 19730508, 17385178
18166013, 17484762, 10136473, 6599380, 20717359, 20296213, 27097854
13955826, 18193833, 17545847, 16837842, 18964939, 19871910, 25505382
14786201, 17811447, 18554763, 21132297, 25957038, 20004087, 17889583
19544839, 26631046, 22507234, 24719736, 18868646, 17042658, 20627866
10088587, 14106803, 13951456, 18139690, 18277454, 13680635, 22750215
25823754, 18554871, 18515268, 20169408, 24908321, 17274537, 17602269
26575788, 31951628, 19032867, 17762296, 14829250, 16929165, 14602788
28849751, 21794615, 18899974, 29944660, 18441944, 14521218, 17811789
34421053, 20074391, 14852021, 17705023, 13645875, 24316947, 16668584
17786278, 25947799, 20879889, 19578350, 28022101, 22594718, 16384983
26439748, 17957017, 19121551, 17570240, 19788842, 18382302, 27086138
21330264, 21197626, 14338435, 13944971, 21656630, 22826067, 18886413
28289945, 17156148, 17936109, 20509482, 27255377, 24717859, 18762750
21526048, 24560906, 18096714, 17238511, 26078387, 27053456, 20144308
25364628, 18244962, 19433930, 20476175, 19297917, 19330795, 31506720
21174504, 18280813, 28819280, 17614227, 28357401, 32335769, 21911701
25809524, 17006183, 18092127, 19727057, 17695685, 26039623, 22820579
20856766, 15861775, 17258582, 21668627, 19487147, 20925795, 28100487
22760679, 26482376, 19554106, 21629064, 18199537, 18091059, 17299889
26999139, 21538485, 17546761, 26336977, 25775213, 18155762, 30803210
31683205, 31194264, 16956380, 19207156, 14705949, 31836113, 23105538
26198926, 19258504, 16314254, 17890099, 17246576, 17655634, 16989630
20067212, 19721304, 25077278, 19490948, 18203835, 18203838, 18973907
18203837, 29483672, 19615136, 17587063, 18000422, 18641451, 18090142
21641760, 17019086, 30559616, 19373893, 18373438, 21820934, 18641461
17346091, 21422580, 22351572, 18604493, 23008056, 22901797, 18610915
22666802, 17892268, 31668061, 17501491, 20907061, 14354737, 17835048
21787056, 22195485, 22782647, 17082983, 23266217, 28362607, 18641419
16618694, 14133975, 22195492, 18331812, 18093615, 24385983, 25897615
20513399, 21281607, 13866822, 18841764, 17600719, 17842825, 20558005
17088068, 9756271, 22195465, 18440047, 32834168, 19211433, 20078186
21515534, 20331945, 22686674, 18384537, 18607546, 34381414, 17254374
18315328, 31172207, 23115139, 28790634, 21394225, 16360112, 22195477
17726838, 18510194, 17571306, 24766121, 17302277, 21842740, 33090781
17551709, 28566241, 26910644, 17634921, 25489607, 16538760
--------------------------------------------------------------------------------
OPatch succeeded.
查看psu
set line 200
col COMMENTS for a30
col ACTION_TIME for a40
col ACTION for a10
col NAMESPACE for a10
col VERSION for a30
col BUNDLE_SERIES for a10
20:46:07 SYS@cndb> select * from dba_registry_history;
ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SER COMMENTS
---------------------------------------- ---------- ---------- ------------------------------ ---------- ---------- ------------------------------
24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
25-SEP-23 02.36.05.785046 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
29-SEP-23 02.45.08.922813 PM APPLY SERVER 11.2.0.4 221018 PSU PSU 11.2.0.4.221018
29-SEP-23 03.07.20.243489 PM APPLY SERVER 11.2.0.4.221018OJVMPSU 0 OJVM PSU post-install
29-SEP-23 03.07.20.245345 PM APPLY 34412266 Patch 34412266 applied
对比上次打补丁,好像是有有个 ojvm 修复sql没有执行
修复过程,从新执行 @postinstall.sql 问题解决
cd $ORACLE_HOME/sqlpatch/34412266
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> startup upgrade
SQL> @postinstall.sql
SQL> shutdown
SQL> startup
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> SELECT * FROM dba_objects WHERE status = 'INVALID';
SQL> @utlrp.sql
附日志:
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/OPatch]$cd $ORACLE_HOME/sqlpatch/34412266
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/sqlpatch/34412266]$ll
total 16
-rwxrwxr-x 1 oracle oinstall 5013 Sep 23 2022 postdeinstall.sql
-rwxrwxr-x 1 oracle oinstall 5004 Sep 23 2022 postinstall.sql
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/sqlpatch/34412266]$sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 25 20:48:41 2024
Copyright (c) 1982, 2013, Oracle. All rights reserved.
20:48:41 @> CONNECT / AS SYSDBA
Connected.
20:48:45 SYS@cndb> startup upgrade
ORA-01081: cannot start already-running ORACLE - shut it down first
20:48:51 SYS@cndb> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
20:49:32 SYS@cndb> startup upgrade
ORACLE instance started.
Total System Global Area 4.0353E+10 bytes
Fixed Size 2261928 bytes
Variable Size 5771365464 bytes
Database Buffers 3.4494E+10 bytes
Redo Buffers 85204992 bytes
Database mounted.
Database opened.
20:49:46 SYS@cndb> @postinstall.sql
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.02
Function created.
Elapsed: 00:00:00.00
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.03
Elapsed: 00:00:00.00
Elapsed: 00:00:00.00
Elapsed: 00:00:00.01
Check /u01/app/oracle/cfgtoollogs/postinstall/postinstall_CNDB2024Mar25_20_50_15.log for errors
Session altered.
Elapsed: 00:00:00.00
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
Calling javavm/install/jvmpsupi.sql on 25-MAR-24 08.50.15.742273 PM +08:00
1 row selected.
Elapsed: 00:00:00.00
20:50:15 SYS@cndb> SET FEEDBACK 1
20:50:15 SYS@cndb> SET NUMWIDTH 10
20:50:15 SYS@cndb> SET LINESIZE 80
20:50:15 SYS@cndb> SET TRIMSPOOL ON
20:50:15 SYS@cndb> SET TAB OFF
20:50:15 SYS@cndb> SET PAGESIZE 100
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> variable jvmscript varchar2(50);
20:50:15 SYS@cndb> column :jvmscript new_value jvm_script noprint;
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> declare
20:50:15 2 stat varchar2(30);
20:50:15 3 begin
20:50:15 4 :jvmscript := '?/javavm/install/jvmempty.sql';
20:50:15 5 select status into stat from dba_registry where comp_id = 'JAVAVM';
20:50:15 6 if stat != 'REMOVED' then
20:50:15 7 :jvmscript := '?/javavm/install/jvmpsupii.sql';
20:50:15 8 end if;
20:50:15 9 exception when no_data_found then null;
20:50:15 10 end;
20:50:15 11 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> select :jvmscript from dual;
1 row selected.
Elapsed: 00:00:00.00
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> @@&jvm_script
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb> Rem $Header: javavm/install/jvmpsupii.sql /st_javavm_11.2.0.4.0dbpsu/35 2022/09/01 09:08:53 sbusa Exp $
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb> Rem jvmpsupii.sql
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb> Rem Copyright (c) 2014, 2022, Oracle and/or its affiliates.
20:50:15 SYS@cndb> Rem All rights reserved.
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb> Rem NAME
20:50:15 SYS@cndb> Rem jvmpsupii.sql - OJVM PSU post-install internal
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb> Rem DESCRIPTION
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb> Rem NOTES
20:50:15 SYS@cndb> Rem This script is run by jvmpsupi.sql if JAVAVM is installed in the
20:50:15 SYS@cndb> Rem database. It needs to contain all the post-install actions for
20:50:15 SYS@cndb> Rem the OJVM PSU.
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb> Rem BEGIN SQL_FILE_METADATA
20:50:15 SYS@cndb> Rem SQL_SOURCE_FILE: javavm/install/jvmpsupii.sql
20:50:15 SYS@cndb> Rem SQL_SHIPPED_FILE:
20:50:15 SYS@cndb> Rem SQL_PHASE:
20:50:15 SYS@cndb> Rem SQL_STARTUP_MODE: NORMAL
20:50:15 SYS@cndb> Rem SQL_IGNORABLE_ERRORS: NONE
20:50:15 SYS@cndb> Rem SQL_CALLING_FILE:
20:50:15 SYS@cndb> Rem END SQL_FILE_METADATA
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb> Rem MODIFIED (MM/DD/YY)
20:50:15 SYS@cndb> Rem sbusa 08/30/22 - CI# 34473571 of sbusa_oct22_11.2.0.4_l_jdk7_2
20:50:15 SYS@cndb> Rem sbusa 08/30/22 - from st_javavm_11.2.0.4.0dbpsu.
20:50:15 SYS@cndb> Rem sbusa 08/30/22 - CI# 34473571
20:50:15 SYS@cndb> Rem sbusa 08/30/22 - sbusa_ci_backport_34473555_11.2.0.4.221018ojvmpsu
20:50:15 SYS@cndb> Rem sbusa 05/25/22 - Backport sbusa_july22_11.2.0.4_jdk7 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 02/22/22 - Backport sbusa_l_apr22_11.2.0.4_jdk7 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 11/29/21 - Backport sbusa_jan22_11.2.0.3_jdk7 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 09/03/21 - Backport sbusa_oct21_11.2.0.4_jdk7_2 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 05/27/21 - Backport sbusa_july21_11.2.0.4_jdk7 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 03/25/21 - Backport sbusa_jan21_apr21_11.2.0.4_jdk7 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 08/18/20 - Backport sbusa_oct20_11.2.0.4_jdk7 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 05/22/20 - Backport sbusa_july20_11.2.0.4_jdk7_2 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 02/13/20 - Backport sbusa_apr20_11.2.0.4_jdk7 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 11/26/19 - Backport sbusa_jan20_psu_11.2.0.4_jdk7 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem mohshanm 08/31/19 - Backport mohshanm_octmpsu from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem mohshanm 05/30/19 - Backport mohshanm_psujly from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem mohshanm 03/25/19 - Backport mohshanm_pilpsu from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 08/28/17 - Backport sbusa_oct_17_11.2.0.4_jdk6 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 05/29/17 - Backport sbusa_l_july17_11.2.0.4_jdk6 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 02/18/17 - Backport sbusa_apr17_11.2.0.4_jdk6 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 11/17/16 - Backport sbusa_j17_l_11.2.0.4_jdk6 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 09/01/16 - Backport sbusa_o_l_11.2.0.4_jdk6_2 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 05/31/16 - Backport sbusa_j5_l_11.2.0.4_jdk6 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem sbusa 02/23/16 - Backport sbusa_javavm_11.2.0.4_java6_april16 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem mohshanm 11/11/15 - Backport mohshanm_psujan_11204 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem mohshanm 09/11/15 - Backport mohshanm_bug-21811517 from
20:50:15 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:15 SYS@cndb> Rem nneeluru 12/03/14 - Add commit after insert
20:50:15 SYS@cndb> Rem nneeluru 10/29/14 - OJVM PSU post-install internal
20:50:15 SYS@cndb> Rem nneeluru 10/29/14 - Created
20:50:15 SYS@cndb> Rem
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> SET ECHO ON
20:50:15 SYS@cndb> SET FEEDBACK 1
20:50:15 SYS@cndb> SET NUMWIDTH 10
20:50:15 SYS@cndb> SET LINESIZE 80
20:50:15 SYS@cndb> SET TRIMSPOOL ON
20:50:15 SYS@cndb> SET TAB OFF
20:50:15 SYS@cndb> SET PAGESIZE 100
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> variable jvmaction varchar2(10)
20:50:15 SYS@cndb> execute :jvmaction := 'APPLY';
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> begin
20:50:15 2 execute immediate 'revoke execute on sys.dbms_java_misc from public';
20:50:15 3 exception when others
20:50:15 4 then null;
20:50:15 5 end;
20:50:15 6 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> begin
20:50:15 2 initjvmaux.drp('drop user ojvmsys cascade');
20:50:15 3 exception when others then
20:50:15 4 if sqlcode not in (-1435, -1918) then raise; end if;
20:50:15 5 end;
20:50:15 6 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> @@?/javavm/install/initsqlj.sql
20:50:15 SYS@cndb> --
20:50:15 SYS@cndb> -- CREATE SQLJUTL PACKAGE
20:50:15 SYS@cndb> --
20:50:15 SYS@cndb> create or replace package sqljutl as
20:50:15 2
20:50:15 3 -- The following is required at translate-time for SQLJ
20:50:15 4 function has_default(oid number,
20:50:15 5 proc char,
20:50:15 6 seq number,
20:50:15 7 ovr number) return number;
20:50:15 8
20:50:15 9 -- The following is required at translate-time for JPublisher
20:50:15 10 procedure get_typecode(tid raw, code OUT number,
20:50:15 11 class OUT varchar2, typ OUT number);
20:50:15 12
20:50:15 13 -- The following might be used at runtime for converting
20:50:15 14 -- between SQL and PL/SQL types
20:50:15 15 function bool2int(b boolean) return integer;
20:50:15 16 function int2bool(i integer) return boolean;
20:50:15 17 function ids2char(iv DSINTERVAL_UNCONSTRAINED) return CHAR;
20:50:15 18 function char2ids(ch CHAR) return DSINTERVAL_UNCONSTRAINED;
20:50:15 19 function iym2char(iv YMINTERVAL_UNCONSTRAINED) return CHAR;
20:50:15 20 function char2iym(ch CHAR) return YMINTERVAL_UNCONSTRAINED;
20:50:15 21 function uri2vchar(uri SYS.URITYPE) return VARCHAR2;
20:50:15 22 end sqljutl;
20:50:15 23 /
Package created.
Elapsed: 00:00:00.00
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> create or replace package body sqljutl is
20:50:15 2
20:50:15 3 function has_default(oid number,
20:50:15 4 proc char,
20:50:15 5 seq number,
20:50:15 6 ovr number) return number is
20:50:15 7 def number;
20:50:15 8 begin
20:50:15 9 if proc IS NULL
20:50:15 10 then
20:50:15 11 select DEFAULT# INTO def FROM ARGUMENT$
20:50:15 12 WHERE PROCEDURE$ IS NULL AND OBJ# = oid
20:50:15 13 AND SEQUENCE# = seq AND OVERLOAD# = ovr;
20:50:15 14 else
20:50:15 15 select DEFAULT# INTO def FROM ARGUMENT$
20:50:15 16 WHERE PROCEDURE$ = proc AND OBJ# = oid
20:50:15 17 AND SEQUENCE# = seq AND OVERLOAD# = ovr;
20:50:15 18 end if;
20:50:15 19
20:50:15 20 if def IS NULL
20:50:15 21 then return 0;
20:50:15 22 else return 1;
20:50:15 23 end if;
20:50:15 24 end has_default;
20:50:15 25
20:50:15 26
20:50:15 27 procedure get_typecode
20:50:15 28 (tid raw, code OUT number,
20:50:15 29 class OUT varchar2, typ OUT number) is
20:50:15 30 m NUMBER;
20:50:15 31 begin
20:50:15 32 SELECT typecode, externname, externtype INTO code, class, typ
20:50:15 33 FROM TYPE$ WHERE toid = tid;
20:50:15 34 exception
20:50:15 35 WHEN TOO_MANY_ROWS
20:50:15 36 THEN
20:50:15 37 begin
20:50:15 38 SELECT max(version#) INTO m FROM TYPE$ WHERE toid = tid;
20:50:15 39 SELECT typecode, externname, externtype INTO code, class, typ
20:50:15 40 FROM TYPE$ WHERE toid = tid AND version# = m;
20:50:15 41 end;
20:50:15 42 end get_typecode;
20:50:15 43
20:50:15 44 function bool2int(b BOOLEAN) return INTEGER is
20:50:15 45 begin if b is null then return null;
20:50:15 46 elsif b then return 1;
20:50:15 47 else return 0; end if;
20:50:15 48 end bool2int;
20:50:15 49
20:50:15 50 function int2bool(i INTEGER) return BOOLEAN is
20:50:15 51 begin if i is null then return null;
20:50:15 52 else return i<>0;
20:50:15 53 end if;
20:50:15 54 end int2bool;
20:50:15 55
20:50:15 56 function ids2char(iv DSINTERVAL_UNCONSTRAINED) return CHAR is
20:50:15 57 res CHAR(19);
20:50:15 58 begin
20:50:15 59 res := iv;
20:50:15 60 return res;
20:50:15 61 end ids2char;
20:50:15 62
20:50:15 63 function char2ids(ch CHAR) return DSINTERVAL_UNCONSTRAINED is
20:50:15 64 iv DSINTERVAL_UNCONSTRAINED;
20:50:15 65 begin
20:50:15 66 iv := ch;
20:50:15 67 return iv;
20:50:15 68 end char2ids;
20:50:15 69
20:50:15 70 function iym2char(iv YMINTERVAL_UNCONSTRAINED) return CHAR is
20:50:15 71 res CHAR(9);
20:50:15 72 begin
20:50:15 73 res := iv;
20:50:15 74 return res;
20:50:15 75 end iym2char;
20:50:15 76
20:50:15 77 function char2iym(ch CHAR) return YMINTERVAL_UNCONSTRAINED is
20:50:15 78 iv YMINTERVAL_UNCONSTRAINED;
20:50:15 79 begin
20:50:15 80 iv := ch;
20:50:15 81 return iv;
20:50:15 82 end char2iym;
20:50:15 83
20:50:15 84 -- SYS.URITYPE and VARCHAR2
20:50:15 85 function uri2vchar(uri SYS.URITYPE) return VARCHAR2 is
20:50:15 86 begin
20:50:15 87 return uri.geturl;
20:50:15 88 end uri2vchar;
20:50:15 89
20:50:15 90 end sqljutl;
20:50:15 91 /
Package body created.
Elapsed: 00:00:00.00
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> grant execute on sqljutl to public ;
Grant succeeded.
Elapsed: 00:00:00.01
20:50:15 SYS@cndb> -- Taking care of removed sqljutl2. This has the virtue of handling the patch
20:50:15 SYS@cndb> -- apply/rollback, upgrade/downgrade and base bug fix cases in one place.
20:50:15 SYS@cndb> begin
20:50:15 2 execute immediate 'drop package SYS.sqljutl2';
20:50:15 3 exception when others
20:50:15 4 then null;
20:50:15 5 end;
20:50:15 6 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> @@?/javavm/install/initdbj.sql
20:50:15 SYS@cndb> variable jvmrmaction varchar2(30)
20:50:15 SYS@cndb> execute :jvmrmaction := 'FULL_REMOVAL';
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
20:50:15 SYS@cndb> @@jvmrmdbj
20:50:15 SYS@cndb> -- Remove some portion of the dictionary objects created by initdbj.sql
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> -- This script must be run as a subscript of a script which sets the
20:50:15 SYS@cndb> -- variable jvmrmaction.
20:50:15 SYS@cndb> -- Possible values are
20:50:15 SYS@cndb> -- FULL_REMOVAL: remove all java related objects
20:50:15 SYS@cndb> -- GRADE_REMOVAL: remove java related objects for general up/downgrade
20:50:15 SYS@cndb> -- DOWNGRADE_x.y.z_TO_a.b.c: remove or massage system objects as appropriate
20:50:15 SYS@cndb> -- when downgrading to release a.b.c
20:50:15 SYS@cndb> -- NONE: do nothing
20:50:15 SYS@cndb>
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> print jvmrmaction
JVMRMACTION
--------------------------------------------------------------------------------
FULL_REMOVAL
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> begin if :jvmrmaction = 'FULL_REMOVAL' or
20:50:15 2 (:jvmrmaction = 'GRADE_REMOVAL' and
20:50:15 3 initjvmaux.startstep('JVMRMDBJ')) then
20:50:15 4
20:50:15 5 initjvmaux.drp('drop package dbms_java');
20:50:15 6 initjvmaux.drp('drop PUBLIC SYNONYM dbms_java');
20:50:15 7 initjvmaux.drp('drop FUNCTION dbj_long_name');
20:50:15 8 initjvmaux.drp('drop function "NameFromLastDDL"');
20:50:15 9 initjvmaux.drp('drop PUBLIC SYNONYM "NameFromLastDDL"');
20:50:15 10 initjvmaux.drp('drop FUNCTION dbj_short_name');
20:50:15 11 initjvmaux.drp('drop PUBLIC SYNONYM dbj_short_name');
20:50:15 12
20:50:15 13 if :jvmrmaction = 'GRADE_REMOVAL' then initjvmaux.endstep; end if;
20:50:15 14
20:50:15 15 end if;end;
20:50:15 16 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.02
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> create or replace package dbms_java authid current_user as
20:50:15 2
20:50:15 3 type compiler_option_type is record(option_line varchar2(128));
20:50:15 4
20:50:15 5 type compiler_option_type_table is table of compiler_option_type;
20:50:15 6
20:50:15 7 PROCEDURE start_btl;
20:50:15 8
20:50:15 9 PROCEDURE stop_btl;
20:50:15 10
20:50:15 11 PROCEDURE terminate_btl;
20:50:15 12
20:50:15 13 -- compile all methods defined by the class identified by
20:50:15 14 -- classname in the current schema.
20:50:15 15 -- return the number of methods successfully compiled
20:50:15 16 --
20:50:15 17 -- If the class does not exist an ORA-29532 (Uncaught Java
20:50:15 18 -- exception) will occur.
20:50:15 19 FUNCTION compile_class(classname VARCHAR2) return NUMBER;
20:50:15 20
20:50:15 21
20:50:15 22 -- compile the method specified by name and Java type signature
20:50:15 23 -- defined by the class identified by classname in the current
20:50:15 24 -- schema.
20:50:15 25 -- return the number of methods successfully compiled
20:50:15 26 --
20:50:15 27 -- If the class does not exist, an ORA-29532 (Uncaught Java
20:50:15 28 -- exception) will occur.
20:50:15 29 FUNCTION compile_method(classname VARCHAR2,
20:50:15 30 methodname VARCHAR2,
20:50:15 31 methodsig VARCHAR2) return NUMBER;
20:50:15 32
20:50:15 33
20:50:15 34 -- uncompile all methods defined by the class identified by
20:50:15 35 -- classname in the current schema.
20:50:15 36 --
20:50:15 37 -- return the number of methods successfully uncompiled.
20:50:15 38 --
20:50:15 39 -- If permanentp, then mark these methods as permanently dynamicaly
20:50:15 40 -- un-compilable, otherwise, they are eligible for future dynamic
20:50:15 41 -- recompilation.
20:50:15 42 --
20:50:15 43 -- If the class does not exist an ORA-29532 (Uncaught Java
20:50:15 44 -- exception) will occur.
20:50:15 45 FUNCTION uncompile_class(classname VARCHAR2,
20:50:15 46 permanentp NUMBER default 0) return NUMBER;
20:50:15 47
20:50:15 48
20:50:15 49 -- uncompile the method specified by the name and Java type
20:50:15 50 -- signature defined by the class identified by classname in the
20:50:15 51 -- current schema.
20:50:15 52 --
20:50:15 53 -- return the number of methods successfully uncompiled.
20:50:15 54 --
20:50:15 55 -- If permanentp, then mark the method as permanently dynamicaly
20:50:15 56 -- un-compilable, otherwise, it is eligible for future dynamic
20:50:15 57 -- recompilation.
20:50:15 58 --
20:50:15 59 -- If the class does not exist an ORA-29532 (Uncaught Java
20:50:15 60 -- exception) will occur.
20:50:15 61 FUNCTION uncompile_method(classname VARCHAR2,
20:50:15 62 methodname VARCHAR2,
20:50:15 63 methodsig VARCHAR2,
20:50:15 64 permanentp NUMBER default 0) return NUMBER;
20:50:15 65
20:50:15 66 --
20:50:15 67 -- Dump the native code (if available) for the specified method to trace.
20:50:15 68 --
20:50:15 69 PROCEDURE dump_native_machine_code(classname VARCHAR2,
20:50:15 70 methodname VARCHAR2,
20:50:15 71 methodsig VARCHAR2);
20:50:15 72
20:50:15 73 FUNCTION native_compiler_options return compiler_option_type_table pipelined;
20:50:15 74
20:50:15 75 -- sets a native-compiler option to the specified value for the
20:50:15 76 -- current schema
20:50:15 77 PROCEDURE set_native_compiler_option(optionName VARCHAR2,
20:50:15 78 value VARCHAR2);
20:50:15 79
20:50:15 80 -- decode, into a user-readable format, a persisted native-compiler
20:50:15 81 -- option. This function is not intended to be used by users
20:50:15 82 -- directly
20:50:15 83 FUNCTION decode_native_compiler_option(optionName VARCHAR2,
20:50:15 84 value VARCHAR2) RETURN VARCHAR2;
20:50:15 85
20:50:15 86 -- unsets a native-compiler option given by the tuple
20:50:15 87 -- [optionName, value].
20:50:15 88 --
20:50:15 89 -- if the option given by optionName is not allowed to have
20:50:15 90 -- duplicate values, then the value is ignored.
20:50:15 91 PROCEDURE unset_native_compiler_option(optionName VARCHAR2,
20:50:15 92 value VARCHAR2);
20:50:15 93
20:50:15 94 FUNCTION init_btl(files_prefix VARCHAR2, type NUMBER,
20:50:15 95 sample_limit NUMBER, exclude_java NUMBER) return NUMBER;
20:50:15 96 pragma restrict_references(init_btl, wnds, wnps);
20:50:15 97
20:50:15 98 FUNCTION longname (shortname VARCHAR2) return VARCHAR2;
20:50:15 99 pragma restrict_references(longname, wnds, wnps);
20:50:15 100
20:50:15 101 FUNCTION shortname (longname VARCHAR2) RETURN VARCHAR2;
20:50:15 102 pragma restrict_references(shortname, wnds, wnps);
20:50:15 103
20:50:15 104 -- functions and procedures to manipulate the compiler option table
20:50:15 105 -- what refers to a source name, package or class depending
20:50:15 106
20:50:15 107 -- determine the option value for option optionName applied to
20:50:15 108 -- what
20:50:15 109 FUNCTION get_compiler_option(what VARCHAR2, optionName VARCHAR2)
20:50:15 110 return varchar2 ;
20:50:15 111 pragma restrict_references (get_compiler_option, wnds, wnps);
20:50:15 112
20:50:15 113 -- set the option value to value for option optionName applied to
20:50:15 114 -- what. And depending upon the characteristics of optionName
20:50:15 115 -- it may apply to "descendants" of what as well.
20:50:15 116 PROCEDURE set_compiler_option(what VARCHAR2, optionName VARCHAR2, value VARCHAR2);
20:50:15 117
20:50:15 118 -- reset the option value. That is, undo an action performed by
20:50:15 119 -- set_compiler_option
20:50:15 120 PROCEDURE reset_compiler_option(what VARCHAR2, optionName VARCHAR2);
20:50:15 121
20:50:15 122
20:50:15 123 FUNCTION initGetSourceChunks (name VARCHAR2, owner VARCHAR2, type VARCHAR2)
20:50:15 124 RETURN NUMBER;
20:50:15 125 pragma restrict_references(initGetSourceChunks, wnds);
20:50:15 126
20:50:15 127 FUNCTION getSourceChunk RETURN VARCHAR2;
20:50:15 128 pragma restrict_references(getSourceChunk, wnds);
20:50:15 129
20:50:15 130 FUNCTION resolver (name VARCHAR2, owner VARCHAR2, type VARCHAR2)
20:50:15 131 RETURN VARCHAR2;
20:50:15 132 pragma restrict_references(resolver, wnds);
20:50:15 133
20:50:15 134 FUNCTION derivedFrom (name VARCHAR2, owner VARCHAR2, type VARCHAR2)
20:50:15 135 RETURN VARCHAR2;
20:50:15 136 pragma restrict_references(derivedFrom, wnds);
20:50:15 137
20:50:15 138 FUNCTION fixed_in_instance (name VARCHAR2, owner VARCHAR2, type VARCHAR2)
20:50:15 139 RETURN NUMBER;
20:50:15 140 pragma restrict_references(fixed_in_instance, wnds);
20:50:15 141
20:50:15 142 PROCEDURE set_fixed_in_instance (name VARCHAR2, owner VARCHAR2,
20:50:15 143 type VARCHAR2, value NUMBER);
20:50:15 144
20:50:15 145 FUNCTION sharedPrivateClassName (name VARCHAR2)
20:50:15 146 RETURN VARCHAR2;
20:50:15 147 pragma restrict_references(sharedPrivateClassName, wnds);
20:50:15 148
20:50:15 149 -- RUNJAVA interface. RUNJAVA is a facility for running
20:50:15 150 -- java in the OJVM server resident VM using a command line
20:50:15 151 -- interface that emulates the JDK java shell command. In
20:50:15 152 -- particular, this interface allows the use of -classpath
20:50:15 153 -- to run classes loaded directly from the file system without
20:50:15 154 -- the intervening step of loading these classes into the database
20:50:15 155 -- via loadjava or the equivalent. It also supports use of -D
20:50:15 156 -- arguments to set System property values. There is an
20:50:15 157 -- auxiliary facility for establishing System property values
20:50:15 158 -- used by default (without requiring -D, in a manner intended
20:50:15 159 -- to be analogous to the use of environment variable by the
20:50:15 160 -- JDK in setting certain System properties).
20:50:15 161
20:50:15 162 -- runjava: This function takes a java command line as its
20:50:15 163 -- only argument and executes that command in the OJVM. The
20:50:15 164 -- return value is null on successful completion, otherwise
20:50:15 165 -- an error message. The format of the command line is the
20:50:15 166 -- same as that taken by the JDK java shell command, ie
20:50:15 167 -- [option switches] name_of_class_to_execute [arg1 arg2 ... argn]
20:50:15 168 -- The option switches -classpath and -D are supported. Others
20:50:15 169 -- may be supported if they make sense in the OJVM environment.
20:50:15 170 -- This function differs from runjava_in_current_session in
20:50:15 171 -- that it clears any java state remaining from previous use of
20:50:15 172 -- java in the session prior to running the current command.
20:50:15 173 -- This is necessary in particular to guarantee that static
20:50:15 174 -- variable values derived at class initialization time from
20:50:15 175 -- -classpath and -D arguments are reflect the values of those
20:50:15 176 -- switches in the current command line.
20:50:15 177 FUNCTION runjava(cmdline VARCHAR2) RETURN VARCHAR2;
20:50:15 178
20:50:15 179 -- runjava_in_current_session: This function is the same as the
20:50:15 180 -- runjava function except that it does not clear java state
20:50:15 181 -- remaining from previous use of java in the session prior to
20:50:15 182 -- executing the current command line. See the description
20:50:15 183 -- of runjava for other details.
20:50:15 184 FUNCTION runjava_in_current_session(cmdline VARCHAR2) RETURN VARCHAR2;
20:50:15 185
20:50:15 186 -- endsession: This function clears any java session state remaining
20:50:15 187 -- from previous execution of java in the current RDBMS session.
20:50:15 188 -- The return value is a message indicating the action taken.
20:50:15 189 FUNCTION endsession RETURN VARCHAR2;
20:50:15 190
20:50:15 191 -- endsession_and_related_state: This function clears any java
20:50:15 192 -- session state remaining from previous execution of java in the
20:50:15 193 -- current RDBMS session and all supporting data related to running
20:50:15 194 -- java, such as property settings and output specifications.
20:50:15 195 -- The return value is a message indicating the action taken.
20:50:15 196 FUNCTION endsession_and_related_state RETURN VARCHAR2;
20:50:15 197
20:50:15 198 -- set_property: This function provides for establishing
20:50:15 199 -- a value for a System property which will be used thereafter for the
20:50:15 200 -- duration of the current RDBMS session whenever a java session is
20:50:15 201 -- initialized. The first argument is the name of the property
20:50:15 202 -- and the second is the value to be established for it. The return value
20:50:15 203 -- from set_property is null unless some error occurred, such as an
20:50:15 204 -- attempt to set a value for a prescribed property, in which case
20:50:15 205 -- an error message is returned.
20:50:15 206 FUNCTION set_property(name VARCHAR2, value VARCHAR2) RETURN VARCHAR2;
20:50:15 207
20:50:15 208 -- get_property: This function returns any value previously established
20:50:15 209 -- by set_property, or null if there is no such value.
20:50:15 210 FUNCTION get_property(name VARCHAR2) RETURN VARCHAR2;
20:50:15 211
20:50:15 212 -- remove_property: This function removes any value previously established
20:50:15 213 -- by set_property. The return value is null unless an error occurred,
20:50:15 214 -- in which case an error message is returned.
20:50:15 215 FUNCTION remove_property(name VARCHAR2) RETURN VARCHAR2;
20:50:15 216
20:50:15 217 -- show_property. This function prints a message of the form
20:50:15 218 -- name = value for the input name, or for all established property
20:50:15 219 -- bindings if name is null. The return value is null on successful
20:50:15 220 -- completion, otherwise it is an error message. The output is
20:50:15 221 -- printed to wherever java output is current directed.
20:50:15 222 FUNCTION show_property(name VARCHAR2) RETURN VARCHAR2;
20:50:15 223
20:50:15 224 -- Methods for controlling destination of java output
20:50:15 225 PROCEDURE set_output (buffersize NUMBER);
20:50:15 226
20:50:15 227 -- set_output_to_sql defines a named output specification which
20:50:15 228 -- constitutes a prescription for executing a sql statement whenever
20:50:15 229 -- output to the default System.out and System.err streams occurs.
20:50:15 230 -- The specification is defined for the duration of the current
20:50:15 231 -- session, or until remove_output_to_sql is called with its id.
20:50:15 232 -- The sql actions the specification prescribes will occur whenever
20:50:15 233 -- there is java output unless disable_output_to_sql has been called,
20:50:15 234 -- in which case the actions will not occur again until
20:50:15 235 -- enable_output_to_sql is called.
20:50:15 236 --
20:50:15 237 -- Arguments are
20:50:15 238 -- id The name of the specification. Multiple specifications
20:50:15 239 -- may exist in the same session, but each must have a distinct
20:50:15 240 -- id. The id is used to identify the specification in the
20:50:15 241 -- functions remove, enable, disable and query_output_to_sql.
20:50:15 242 -- stmt The default sql statement to execute when java output occurs.
20:50:15 243 -- bindings A string containing tokens from the set
20:50:15 244 -- ID, TEXT, LENGTH, LINENO, SEGNO, NL and ERROUT. This string
20:50:15 245 -- defines how the sql statement stmt will be bound. The
20:50:15 246 -- position in the bindings string of a token corresponds to
20:50:15 247 -- the bind position in the sql statement. The meanings of the
20:50:15 248 -- tokens are
20:50:15 249 -- ID the id of the specification, bound as a VARCHAR2
20:50:15 250 -- TEXT the text being output, bound as a VARCHAR2
20:50:15 251 -- LENGTH the length of the text, bound as a NUMBER
20:50:15 252 -- LINENO the line number (since the beginning of session output),
20:50:15 253 -- bound as a NUMBER
20:50:15 254 -- SEGNO the segment number within a line that is being output
20:50:15 255 -- in more than one piece, bound as a NUMBER
20:50:15 256 -- NL a boolean indicating whether the text is to be regarded
20:50:15 257 -- as newline terminated, bound as a NUMBER. The newline
20:50:15 258 -- may or may not actually be included in the text, depending
20:50:15 259 -- on the value of the include_newlines argument discussed
20:50:15 260 -- below.
20:50:15 261 -- ERROUT a boolean indicating whether the output came from
20:50:15 262 -- System.out or System.err, bound as a NUMBER. The value
20:50:15 263 -- is 0 iff the output came from System.out.
20:50:15 264 -- no_newline_stmt An optional alternate sql statement to execute
20:50:15 265 -- when the output is not newline terminated.
20:50:15 266 -- no_newline_bindings A string with the same syntax as for the bindings
20:50:15 267 -- argument discussed above, describing how the
20:50:15 268 -- no_newline_stmt is bound.
20:50:15 269 -- newline_only_stmt An optional alternate sql statement to execute
20:50:15 270 -- when the output is a single newline.
20:50:15 271 -- newline_only_bindings A string with the same syntax as for the bindings
20:50:15 272 -- argument discussed above, describing how the
20:50:15 273 -- newline_only_stmt is bound.
20:50:15 274 -- maximum_line_segment_length The maximum number of characters that
20:50:15 275 -- will be bound in a given execution of
20:50:15 276 -- the sql statement. Longer output
20:50:15 277 -- sequences will be broken up into
20:50:15 278 -- separate calls with distinct SEGNO
20:50:15 279 -- values. A value of 0 means no maximum.
20:50:15 280 -- allow_replace Controls behavior when a previously defined specification
20:50:15 281 -- with the same id exists. A value of 1 means replace the
20:50:15 282 -- old specification. 0 means return an error message
20:50:15 283 -- without modifying the old specification.
20:50:15 284 -- from_stdout Controls whether output from System.out causes execution
20:50:15 285 -- of the sql statement prescribed by the specification. A
20:50:15 286 -- value of 0 means that if the output came from System.out
20:50:15 287 -- the statement is not executed even if the specification is
20:50:15 288 -- otherwise enabled.
20:50:15 289 -- from_stderr Controls whether output from System.err causes execution
20:50:15 290 -- of the sql statement prescribed by the specification. A
20:50:15 291 -- value of 0 means that if the output came from System.err
20:50:15 292 -- the statement is not executed even if the specification is
20:50:15 293 -- otherwise enabled.
20:50:15 294 -- include_newlines Controls whether newline characters are left in the
20:50:15 295 -- output when it is bound to text. A value of 0 means
20:50:15 296 -- newlines are not included (but the presence of the
20:50:15 297 -- newline is still indicated by the NL binding and
20:50:15 298 -- by whether the no_newline_stmt is used).
20:50:15 299 -- eager Controls whether output not terminated by a newline causes
20:50:15 300 -- execution of the sql statement every time it is received vs
20:50:15 301 -- accumulating such output until a newline is received. A value
20:50:15 302 -- of 0 means that unterminated output is accumulated.
20:50:15 303 --
20:50:15 304 -- Return value is null on success otherwise an error message.
20:50:15 305 FUNCTION set_output_to_sql (id VARCHAR2,
20:50:15 306 stmt VARCHAR2,
20:50:15 307 bindings VARCHAR2,
20:50:15 308 no_newline_stmt VARCHAR2 default null,
20:50:15 309 no_newline_bindings VARCHAR2 default null,
20:50:15 310 newline_only_stmt VARCHAR2 default null,
20:50:15 311 newline_only_bindings VARCHAR2 default null,
20:50:15 312 maximum_line_segment_length NUMBER default 0,
20:50:15 313 allow_replace NUMBER default 1,
20:50:15 314 from_stdout NUMBER default 1,
20:50:15 315 from_stderr NUMBER default 1,
20:50:15 316 include_newlines NUMBER default 0,
20:50:15 317 eager NUMBER default 0) return VARCHAR2;
20:50:15 318
20:50:15 319 -- remove_output_to_sql deletes a specification created by
20:50:15 320 -- set_output_to_sql. If no such specification exists, an error message
20:50:15 321 -- is returned
20:50:15 322 FUNCTION remove_output_to_sql (id VARCHAR2) return VARCHAR2;
20:50:15 323
20:50:15 324 -- enable_output_to_sql (re)enables a specification created by
20:50:15 325 -- set_output_to_sql and subsequently disabled by disable_output_to_sql.
20:50:15 326 -- If no such specification exists, an error message is returned. If
20:50:15 327 -- the specification is not currently disabled, there is no change.
20:50:15 328 FUNCTION enable_output_to_sql (id VARCHAR2) return VARCHAR2;
20:50:15 329
20:50:15 330 -- disable_output_to_sql disables a specification created by
20:50:15 331 -- set_output_to_sql. The specification may be re-enabled by
20:50:15 332 -- enable_output_to_sql. While disabled, the sql statement prescribed
20:50:15 333 -- by the specification is not executed.
20:50:15 334 -- If no such specification exists, an error message is returned. If
20:50:15 335 -- the specification is already disabled, there is no change.
20:50:15 336 FUNCTION disable_output_to_sql (id VARCHAR2) return VARCHAR2;
20:50:15 337
20:50:15 338 -- query_output_to_sql returns a message describing a specification
20:50:15 339 -- created by set_output_to_sql.
20:50:15 340 -- If no such specification exists, an error message is returned.
20:50:15 341 FUNCTION query_output_to_sql (id VARCHAR2) return VARCHAR2;
20:50:15 342
20:50:15 343 -- set_output_to_java defines a named output specification which
20:50:15 344 -- constitutes a prescription for executing a java method whenever
20:50:15 345 -- output to the default System.out and System.err streams occurs.
20:50:15 346 -- See the comments for set_output_to_sql for discussion of the
20:50:15 347 -- common arguments and the duration of the specifications. The
20:50:15 348 -- java method prescribed by the specification is executed in a
20:50:15 349 -- separate VM context with separate java session state from the
20:50:15 350 -- rest of the session.
20:50:15 351 -- Arguments specific to this type of specification are
20:50:15 352 -- class_name The name of the class defining the method(s)
20:50:15 353 -- class_schema The schema in which the class is defined. A null
20:50:15 354 -- value means the class is defined in the current schema,
20:50:15 355 -- or PUBLIC.
20:50:15 356 -- method The name of the method.
20:50:15 357 -- bindings A string that defines how arguments to the method are bound.
20:50:15 358 -- This is a string of tokens with the same syntax as discussed
20:50:15 359 -- under set_output_to_sql above. The position of a token in
20:50:15 360 -- the string determines the position of the argument it
20:50:15 361 -- describes. All arguments must be of type int, except for
20:50:15 362 -- those corresponding to the tokens ID or TEXT, which must be
20:50:15 363 -- of type java.lang.String.
20:50:15 364 -- no_newline_method An optional alternate method to execute
20:50:15 365 -- when the output is not newline terminated.
20:50:15 366 -- newline_only_method An optional alternate method to execute
20:50:15 367 -- when the output is a single newline.
20:50:15 368 -- initialization_statement An optional sql statement that is executed
20:50:15 369 -- once per java session prior to the first
20:50:15 370 -- time the methods that receive output are
20:50:15 371 -- executed. This statement is executed in
20:50:15 372 -- same java VM context as the output methods
20:50:15 373 -- will be. Typically such a statement is
20:50:15 374 -- used to run a java stored procedure that
20:50:15 375 -- initializes conditions in the separate VM
20:50:15 376 -- context so that the methods that receive
20:50:15 377 -- output can function as intended. For
20:50:15 378 -- example such a procedure might open a
20:50:15 379 -- stream which the output methods write to.
20:50:15 380 -- finalization_statement An optional sql statement that is executed
20:50:15 381 -- once when the output specification is
20:50:15 382 -- about to be removed or the session is ending.
20:50:15 383 -- Like the initialization_statement this runs
20:50:15 384 -- in the same java VM context as the methods
20:50:15 385 -- that receive output. It runs only if the
20:50:15 386 -- initialization method has run, or if there is
20:50:15 387 -- no initialization method.
20:50:15 388 FUNCTION set_output_to_java (id VARCHAR2,
20:50:15 389 class_name VARCHAR2,
20:50:15 390 class_schema VARCHAR2,
20:50:15 391 method VARCHAR2,
20:50:15 392 bindings VARCHAR2,
20:50:15 393 no_newline_method VARCHAR2 default null,
20:50:15 394 no_newline_bindings VARCHAR2 default null,
20:50:15 395 newline_only_method VARCHAR2 default null,
20:50:15 396 newline_only_bindings VARCHAR2 default null,
20:50:15 397 maximum_line_segment_length NUMBER default 0,
20:50:15 398 allow_replace NUMBER default 1,
20:50:15 399 from_stdout NUMBER default 1,
20:50:15 400 from_stderr NUMBER default 1,
20:50:15 401 include_newlines NUMBER default 0,
20:50:15 402 eager NUMBER default 0,
20:50:15 403 initialization_statement VARCHAR2 default null,
20:50:15 404 finalization_statement VARCHAR2 default null)
20:50:15 405 return VARCHAR2;
20:50:15 406
20:50:15 407 -- remove_output_to_java deletes a specification created by
20:50:15 408 -- set_output_to_java. If no such specification exists, an error message
20:50:15 409 -- is returned
20:50:15 410 FUNCTION remove_output_to_java (id VARCHAR2) return VARCHAR2;
20:50:15 411
20:50:15 412 -- enable_output_to_java (re)enables a specification created by
20:50:15 413 -- set_output_to_java and subsequently disabled by disable_output_to_java.
20:50:15 414 -- If no such specification exists, an error message is returned. If
20:50:15 415 -- the specification is not currently disabled, there is no change.
20:50:15 416 FUNCTION enable_output_to_java (id VARCHAR2) return VARCHAR2;
20:50:15 417
20:50:15 418 -- disable_output_to_java disables a specification created by
20:50:15 419 -- set_output_to_java. The specification may be re-enabled by
20:50:15 420 -- enable_output_to_java. While disabled, the sql statement prescribed
20:50:15 421 -- by the specification is not executed.
20:50:15 422 -- If no such specification exists, an error message is returned. If
20:50:15 423 -- the specification is already disabled, there is no change.
20:50:15 424 FUNCTION disable_output_to_java (id VARCHAR2) return VARCHAR2;
20:50:15 425
20:50:15 426 -- query_output_to_java returns a message describing a specification
20:50:15 427 -- created by set_output_to_java.
20:50:15 428 -- If no such specification exists, an error message is returned.
20:50:15 429 FUNCTION query_output_to_java (id VARCHAR2) return VARCHAR2;
20:50:15 430
20:50:15 431 -- set_output_to_file defines a named output specification which
20:50:15 432 -- constitutes a prescription to capture any output sent to the
20:50:15 433 -- default System.out and System.err streams and append it to
20:50:15 434 -- a specified file. This is implemented using a special case
20:50:15 435 -- of set_output_to_java. Arguments are
20:50:15 436 -- file_path The path to the file to which to append the output
20:50:15 437 -- allow_replace, from_stdout and from_stderr all analogous to
20:50:15 438 -- those of the same name in set_output_to_java
20:50:15 439 FUNCTION set_output_to_file (id VARCHAR2,
20:50:15 440 file_path VARCHAR2,
20:50:15 441 allow_replace NUMBER default 1,
20:50:15 442 from_stdout NUMBER default 1,
20:50:15 443 from_stderr NUMBER default 1)
20:50:15 444 return VARCHAR2;
20:50:15 445
20:50:15 446 -- The following four functions are analogous to their output_to_java
20:50:15 447 -- counterparts
20:50:15 448 FUNCTION remove_output_to_file (id VARCHAR2) return VARCHAR2;
20:50:15 449
20:50:15 450 FUNCTION enable_output_to_file (id VARCHAR2) return VARCHAR2;
20:50:15 451
20:50:15 452 FUNCTION disable_output_to_file (id VARCHAR2) return VARCHAR2;
20:50:15 453
20:50:15 454 FUNCTION query_output_to_file (id VARCHAR2) return VARCHAR2;
20:50:15 455
20:50:15 456 -- The following two procedures are for internal use in the
20:50:15 457 -- implementation of set_output_to_file
20:50:15 458 PROCEDURE initialize_output_to_file (id VARCHAR2, path VARCHAR2);
20:50:15 459
20:50:15 460 PROCEDURE finalize_output_to_file (id VARCHAR2);
20:50:15 461
20:50:15 462 -- The following two procedures and one function control
20:50:15 463 -- whether java output is sent to the .trc file (this is the
20:50:15 464 -- case by default)
20:50:15 465 PROCEDURE enable_output_to_trc;
20:50:15 466
20:50:15 467 PROCEDURE disable_output_to_trc;
20:50:15 468
20:50:15 469 FUNCTION query_output_to_trc return VARCHAR2;
20:50:15 470
20:50:15 471 -- support for calling runjava from ojvmjava
20:50:15 472
20:50:15 473 -- rjbc_init: setup back channel, return id that identifies it. Called
20:50:15 474 -- prior to runjava in the same session as runjava will run in.
20:50:15 475 -- flags non zero means dont use back channel for file content
20:50:15 476 -- this corresponds to the ojvmjava runjava mode server_file_system
20:50:15 477 function rjbc_init(flags NUMBER) return VARCHAR2;
20:50:15 478
20:50:15 479 -- rjbc_request: called from runjava to ask for contents or directoriness
20:50:15 480 -- of file identified by pathname on the client filesystem. Puts pathname
20:50:15 481 -- in the java$jvm$rjbc row then waits for client response. rtype 0 means
20:50:15 482 -- get content, 1 means ask if directory
20:50:15 483 -- status returned is 0 if content returned or is directory, !0 otherwise
20:50:15 484 -- lob returned if pathname found
20:50:15 485 function rjbc_request(pathname VARCHAR2, rtype NUMBER, lob out BLOB)
20:50:15 486 return NUMBER;
20:50:15 487
20:50:15 488 -- rjbc_normalize: called from runjava to ask for the normalized, absolute
20:50:15 489 -- pathname on the client filesystem of the file identified by the input
20:50:15 490 -- argument pathname. Puts pathname in the java$jvm$rjbc row then waits
20:50:15 491 ---for client response.
20:50:15 492 -- rtype is not used.
20:50:15 493 -- status returned is 0 if the file is a directory, non-zero otherwise.
20:50:15 494 -- This value is also not used.
20:50:15 495 -- normalized_pathname is returned containing the normalized path.
20:50:15 496 function rjbc_normalize(pathname VARCHAR2, rtype NUMBER,
20:50:15 497 normalized_pathname out VARCHAR2)
20:50:15 498 return NUMBER;
20:50:15 499
20:50:15 500 -- rjbc_output: set_output_to_sql entrypoint used by runjava to pass
20:50:15 501 -- output back to the client.
20:50:15 502 -- Puts text in the java$jvm$rjbc row then waits for client response.
20:50:15 503 procedure rjbc_output(text VARCHAR2, nl NUMBER);
20:50:15 504
20:50:15 505 -- rjbc_done: called from client to shutdown back channel
20:50:15 506 procedure rjbc_done(id VARCHAR2 := null);
20:50:15 507
20:50:15 508 -- back channel entrypoint
20:50:15 509 -- rjbc_respond. Called in loop by back channel client thread to respond
20:50:15 510 -- to requests queued by rjbc_request, rjbc_normalize and rjbc_output.
20:50:15 511 -- status argument indicates result of processing the previous request.
20:50:15 512 -- status values are: -1 = initial call (there was no previous request)
20:50:15 513 -- 0 = file content found and returned
20:50:15 514 -- 1 = file not found
20:50:15 515 -- p in argument receives the normalized path for an rjbc_normalize request
20:50:15 516 -- l in argument receives the lob containing the file content for an
20:50:15 517 -- rjbc_request request.
20:50:15 518 -- return values indicate the kind of the new request. These values are:
20:50:15 519 -- -1 = no request (ie, time to exit)
20:50:15 520 -- 0 = file content (rjbc_request)
20:50:15 521 -- 1 = normalize path (rjbc_normalize)
20:50:15 522 -- 2 = newline terminated output (rjbc_output)
20:50:15 523 -- 3 = nonnewline terminated output (rjbc_output)
20:50:15 524 -- For return values 0 and 1, the p out argument contains the name of the
20:50:15 525 -- file to be processed. For return values 2 and 3 p contains the text
20:50:15 526 -- to be output.
20:50:15 527 function rjbc_respond(sid VARCHAR2, status NUMBER, p in out VARCHAR2, l BLOB)
20:50:15 528 return NUMBER;
20:50:15 529
20:50:15 530
20:50:15 531 -- import/export interface --
20:50:15 532 function start_export(short_name in varchar2,
20:50:15 533 schema in varchar2,
20:50:15 534 flags in number,
20:50:15 535 type in number,
20:50:15 536 properties out number,
20:50:15 537 raw_chunk_count out number,
20:50:15 538 total_raw_byte_count out number,
20:50:15 539 text_chunk_count out number,
20:50:15 540 total_text_byte_count out number)
20:50:15 541 return number;
20:50:15 542 pragma restrict_references(start_export, wnds);
20:50:15 543
20:50:15 544 function export_raw_chunk(chunk out raw, length out number)
20:50:15 545 return number;
20:50:15 546 pragma restrict_references(export_raw_chunk, wnds);
20:50:15 547
20:50:15 548 function export_text_chunk(chunk out varchar2, length out number)
20:50:15 549 return number;
20:50:15 550 pragma restrict_references(export_text_chunk, wnds);
20:50:15 551
20:50:15 552
20:50:15 553 function end_export return number;
20:50:15 554 pragma restrict_references(end_export, wnds);
20:50:15 555
20:50:15 556
20:50:15 557 function start_import(long_name in varchar2,
20:50:15 558 flags in number,
20:50:15 559 type in number,
20:50:15 560 properties in number,
20:50:15 561 raw_chunk_count in number,
20:50:15 562 total_raw_byte_count in number,
20:50:15 563 text_chunk_count in number)
20:50:15 564 return number;
20:50:15 565 pragma restrict_references(start_import, wnds);
20:50:15 566
20:50:15 567
20:50:15 568 function import_raw_chunk(chunk in raw, length in number)
20:50:15 569 return number;
20:50:15 570 pragma restrict_references(import_raw_chunk, wnds);
20:50:15 571
20:50:15 572
20:50:15 573 function import_text_chunk(chunk in varchar2, length in number)
20:50:15 574 return number;
20:50:15 575 pragma restrict_references(import_text_chunk, wnds);
20:50:15 576
20:50:15 577
20:50:15 578 function end_import return number;
20:50:15 579 pragma restrict_references(end_import, wnds);
20:50:15 580
20:50:15 581
20:50:15 582 -- grant or revoke execute via Handle methods. Needed with system class
20:50:15 583 -- loading since SQL grant/revoke can't manipulate permanently kept objects
20:50:15 584 procedure set_execute_privilege(object_name varchar2,
20:50:15 585 object_schema varchar2,
20:50:15 586 object_type varchar2,
20:50:15 587 grantee_name varchar2,
20:50:15 588 grant_if_nonzero number)
20:50:15 589 as language java name
20:50:15 590 'oracle.aurora.rdbms.DbmsJava.setExecutePrivilege(java.lang.String,
20:50:15 591 oracle.sql.CHAR,
20:50:15 592 java.lang.String,
20:50:15 593 oracle.sql.CHAR,
20:50:15 594 boolean)';
20:50:15 595
20:50:15 596 -- convenience functions to support development environments --
20:50:15 597 -- There procedures allow PL/SQL to get at Java Schem Objects.
20:50:15 598 -- There are a lot of them, but they can be understood from the
20:50:15 599 -- grammar
20:50:15 600 -- export_<what>(name, [schema,] lob)
20:50:15 601 --
20:50:15 602 -- <what> is either source, class or resource
20:50:15 603 -- name a varchar argument that is the name of the java schema object
20:50:15 604 -- schema is an optional argument, if it is present it is a varchar that
20:50:15 605 -- names a schema, if it ommitted the current schema is used
20:50:15 606 -- lob is either a BLOB or CLOB. The contents of the object are placed
20:50:15 607 -- into it. CLOB's are allowed only for source and resource (i.e. not
20:50:15 608 -- for class). Note that the internal representation of source uses
20:50:15 609 -- UTF8 and that is what is stored into the BLOB
20:50:15 610 --
20:50:15 611 -- If the java schema object does not exist an ORA-29532 (Uncaught Java
20:50:15 612 -- exception) will occur.
20:50:15 613
20:50:15 614
20:50:15 615 procedure export_source(name varchar2, schema varchar2, src BLOB)
20:50:15 616 as language java name
20:50:15 617 'oracle.aurora.rdbms.ExportSchemaObjects.exportSource(java.lang.String, java.lang.String, oracle.sql.BLOB)';
20:50:15 618
20:50:15 619 procedure export_source(name varchar2, src BLOB)
20:50:15 620 as language java name
20:50:15 621 'oracle.aurora.rdbms.ExportSchemaObjects.exportSource(java.lang.String, oracle.sql.BLOB)';
20:50:15 622
20:50:15 623 procedure export_source(name varchar2, schema varchar2, src CLOB)
20:50:15 624 as language java name
20:50:15 625 'oracle.aurora.rdbms.ExportSchemaObjects.exportSource(java.lang.String, java.lang.String, oracle.sql.CLOB)';
20:50:15 626
20:50:15 627 procedure export_source(name varchar2, src CLOB)
20:50:15 628 as language java name
20:50:15 629 'oracle.aurora.rdbms.ExportSchemaObjects.exportSource(java.lang.String, oracle.sql.CLOB)';
20:50:15 630
20:50:15 631 procedure export_class(name varchar2, schema varchar2, clz BLOB)
20:50:15 632 as language java name
20:50:15 633 'oracle.aurora.rdbms.ExportSchemaObjects.exportClass(java.lang.String, java.lang.String, oracle.sql.BLOB)';
20:50:15 634
20:50:15 635 procedure export_class(name varchar2, clz BLOB)
20:50:15 636 as language java name
20:50:15 637 'oracle.aurora.rdbms.ExportSchemaObjects.exportClass(java.lang.String, oracle.sql.BLOB)';
20:50:15 638
20:50:15 639 procedure export_resource(name varchar2, schema varchar2, res BLOB)
20:50:15 640 as language java name
20:50:15 641 'oracle.aurora.rdbms.ExportSchemaObjects.exportResource(java.lang.String, java.lang.String, oracle.sql.BLOB)';
20:50:15 642
20:50:15 643 procedure export_resource(name varchar2, res BLOB)
20:50:15 644 as language java name
20:50:15 645 'oracle.aurora.rdbms.ExportSchemaObjects.exportResource(java.lang.String, oracle.sql.BLOB)';
20:50:15 646
20:50:15 647 procedure export_resource(name varchar2, schema varchar2, res CLOB)
20:50:15 648 as language java name
20:50:15 649 'oracle.aurora.rdbms.ExportSchemaObjects.exportResource(java.lang.String, java.lang.String, oracle.sql.CLOB)';
20:50:15 650
20:50:15 651 procedure export_resource(name varchar2, res CLOB)
20:50:15 652 as language java name
20:50:15 653 'oracle.aurora.rdbms.ExportSchemaObjects.exportResource(java.lang.String, oracle.sql.CLOB)';
20:50:15 654
20:50:15 655 procedure loadjava(options varchar2)
20:50:15 656 as language java name
20:50:15 657 'oracle.aurora.server.tools.loadjava.LoadJavaMain.serverMain(java.lang.String)';
20:50:15 658
20:50:15 659 procedure loadjava(options varchar2, resolver varchar2)
20:50:15 660 as language java name
20:50:15 661 'oracle.aurora.server.tools.loadjava.LoadJavaMain.serverMain(java.lang.String, java.lang.String)';
20:50:15 662
20:50:15 663 procedure loadjava(options varchar2, resolver varchar2, status OUT number)
20:50:15 664 as language java name
20:50:15 665 'oracle.aurora.server.tools.loadjava.LoadJavaMain.serverMain(java.lang.String, java.lang.String, int[])';
20:50:15 666
20:50:15 667 procedure dropjava(options varchar2)
20:50:15 668 as language java name
20:50:15 669 'oracle.aurora.server.tools.loadjava.DropJavaMain.serverMain(java.lang.String)';
20:50:15 670
20:50:15 671 -- handleMd5 accesses information about schema objects that
20:50:15 672 -- is needed by loadjava
20:50:15 673 function handleMd5(s varchar2, name varchar2, type number) return raw
20:50:15 674 as language java name
20:50:15 675 'oracle.aurora.server.tools.loadjava.HandleMd5.get
20:50:15 676 (java.lang.String,java.lang.String,int) return oracle.sql.RAW';
20:50:15 677
20:50:15 678 -- variant that looks in current schema
20:50:15 679 function handleMd5(name varchar2, type number) return raw
20:50:15 680 as language java name
20:50:15 681 'oracle.aurora.server.tools.loadjava.HandleMd5.get
20:50:15 682 (java.lang.String,int) return oracle.sql.RAW';
20:50:15 683
20:50:15 684
20:50:15 685 -- jar loading
20:50:15 686 function start_loading_jar(name varchar2,
20:50:15 687 schema varchar2,
20:50:15 688 path varchar2,
20:50:15 689 flags number,
20:50:15 690 content blob,
20:50:15 691 msg out varchar2) return number
20:50:15 692 as language java name
20:50:15 693 'oracle.aurora.rdbms.DbmsJava.startLoadingJar
20:50:15 694 (java.lang.String,
20:50:15 695 java.lang.String,
20:50:15 696 java.lang.String,
20:50:15 697 int,
20:50:15 698 oracle.sql.BLOB,
20:50:15 699 java.lang.String[])
20:50:15 700 return int';
20:50:15 701
20:50:15 702 function finish_loading_jar(flags number,
20:50:15 703 msg out varchar2) return number
20:50:15 704 as language java name
20:50:15 705 'oracle.aurora.rdbms.DbmsJava.finishLoadingJar
20:50:15 706 (int,
20:50:15 707 java.lang.String[])
20:50:15 708 return int';
20:50:15 709
20:50:15 710 function jar_status(name varchar2,
20:50:15 711 schema varchar2,
20:50:15 712 msg out varchar2) return number
20:50:15 713 as language java name
20:50:15 714 'oracle.aurora.rdbms.DbmsJava.jarStatus
20:50:15 715 (java.lang.String,
20:50:15 716 java.lang.String,
20:50:15 717 java.lang.String[])
20:50:15 718 return int';
20:50:15 719
20:50:15 720 function drop_jar(name varchar2,
20:50:15 721 schema varchar2,
20:50:15 722 msg out varchar2) return number
20:50:15 723 as language java name
20:50:15 724 'oracle.aurora.rdbms.DbmsJava.dropJar
20:50:15 725 (java.lang.String,
20:50:15 726 java.lang.String,
20:50:15 727 java.lang.String[])
20:50:15 728 return int';
20:50:15 729
20:50:15 730
20:50:15 731 -- interface to manage Security Policy Table
20:50:15 732
20:50:15 733 -- create an active row in the policy table granting the Permission
20:50:15 734 -- as specified to grantee. If a row already exists granting the
20:50:15 735 -- exact Permission specified then the table is unmodifed.
20:50:15 736 -- If a row exists but is disabled then it is enabled.
20:50:15 737 -- Finally if no row exists one is inserted.
20:50:15 738 --
20:50:15 739 -- the table
20:50:15 740 -- grantee is the name of a schema
20:50:15 741 -- permission_type is the fully qualified name of a class that
20:50:15 742 -- extends java.lang.security.Permission. If the class does
20:50:15 743 -- not have a public synonymn then the name should be prefixed
20:50:15 744 -- by <schema>:. For example 'myschema:scott.MyPermission'.
20:50:15 745 -- permission_name is the name of the permission
20:50:15 746 -- permission_action is the action of the permission
20:50:15 747 -- key is set to the key of the created row or to -1 if an
20:50:15 748 -- error occurs.
20:50:15 749 --
20:50:15 750 -- See ... for more details of the Security Policy Table
20:50:15 751
20:50:15 752 procedure grant_permission(
20:50:15 753 grantee varchar2, permission_type varchar2,
20:50:15 754 permission_name varchar2, permission_action varchar2,
20:50:15 755 key OUT number)
20:50:15 756 as language java name
20:50:15 757 'oracle.aurora.rdbms.security.PolicyTableManager.grant(
20:50:15 758 java.lang.String, java.lang.String, java.lang.String,
20:50:15 759 java.lang.String, long[])';
20:50:15 760
20:50:15 761 -- similar to grant except create a restrict row.
20:50:15 762 procedure restrict_permission(
20:50:15 763 grantee varchar2, permission_type varchar2,
20:50:15 764 permission_name varchar2, permission_action varchar2,
20:50:15 765 key OUT number)
20:50:15 766 as language java name
20:50:15 767 'oracle.aurora.rdbms.security.PolicyTableManager.restrict(
20:50:15 768 java.lang.String, java.lang.String, java.lang.String,
20:50:15 769 java.lang.String, long[])';
20:50:15 770
20:50:15 771
20:50:15 772
20:50:15 773 -- special case for granting PolicyTablePermission's. The name of
20:50:15 774 -- a PolicyTablePermission allows updates of rows relating to
20:50:15 775 -- a particular type (i.e. class that extends Permission) to
20:50:15 776 -- specify the class you must specify the schema containing the
20:50:15 777 -- class. In the table that is stored as the user number, but this
20:50:15 778 -- procedure lets it be specified via a name.
20:50:15 779 procedure grant_policy_permission(
20:50:15 780 grantee varchar2,
20:50:15 781 permisssion_schema varchar2, permission_type varchar2,
20:50:15 782 permission_name varchar2,
20:50:15 783 key OUT number)
20:50:15 784 as language java name
20:50:15 785 'oracle.aurora.rdbms.security.PolicyTableManager.grantPolicyPermission(
20:50:15 786 java.lang.String, java.lang.String, java.lang.String,
20:50:15 787 java.lang.String, long[])';
20:50:15 788
20:50:15 789 -- The follwing versions of grant_permission, restrict_permission
20:50:15 790 -- and grant_policy permission are identical to the previous
20:50:15 791 -- versions except that they do not have the key OUT parameter.
20:50:15 792
20:50:15 793 procedure grant_permission(
20:50:15 794 grantee varchar2, permission_type varchar2,
20:50:15 795 permission_name varchar2, permission_action varchar2)
20:50:15 796 as language java name
20:50:15 797 'oracle.aurora.rdbms.security.PolicyTableManager.grant(
20:50:15 798 java.lang.String, java.lang.String, java.lang.String,
20:50:15 799 java.lang.String)';
20:50:15 800
20:50:15 801 procedure restrict_permission(
20:50:15 802 grantee varchar2, permission_type varchar2,
20:50:15 803 permission_name varchar2, permission_action varchar2)
20:50:15 804 as language java name
20:50:15 805 'oracle.aurora.rdbms.security.PolicyTableManager.restrict(
20:50:15 806 java.lang.String, java.lang.String, java.lang.String,
20:50:15 807 java.lang.String)';
20:50:15 808
20:50:15 809 procedure grant_policy_permission(
20:50:15 810 grantee varchar2,
20:50:15 811 permisssion_schema varchar2, permission_type varchar2,
20:50:15 812 permission_name varchar2)
20:50:15 813 as language java name
20:50:15 814 'oracle.aurora.rdbms.security.PolicyTableManager.grantPolicyPermission(
20:50:15 815 java.lang.String, java.lang.String, java.lang.String,
20:50:15 816 java.lang.String)';
20:50:15 817
20:50:15 818 -- revoke disables any permissions that might have been granted
20:50:15 819 procedure revoke_permission(
20:50:15 820 grantee varchar2, permission_type varchar2,
20:50:15 821 permission_name varchar2, permission_action varchar2)
20:50:15 822 as language java name
20:50:15 823 'oracle.aurora.rdbms.security.PolicyTableManager.revoke(
20:50:15 824 java.lang.String, java.lang.String, java.lang.String,
20:50:15 825 java.lang.String)';
20:50:15 826
20:50:15 827 -- enable the existing row with specified key
20:50:15 828 procedure enable_permission(key number)
20:50:15 829 as language java name
20:50:15 830 'oracle.aurora.rdbms.security.PolicyTableManager.enable(long)';
20:50:15 831
20:50:15 832 -- disable the existing row with specified key
20:50:15 833 procedure disable_permission(key number)
20:50:15 834 as language java name
20:50:15 835 'oracle.aurora.rdbms.security.PolicyTableManager.disable(long)';
20:50:15 836
20:50:15 837 -- delete the existing row with specified key
20:50:15 838 -- the row must be diabled, if it is still active then this
20:50:15 839 -- procedure does nothing.
20:50:15 840 procedure delete_permission(key number)
20:50:15 841 as language java name
20:50:15 842 'oracle.aurora.rdbms.security.PolicyTableManager.delete(long)';
20:50:15 843
20:50:15 844 -- set debugging level
20:50:15 845 procedure set_permission_debug(level number)
20:50:15 846 as language java name
20:50:15 847 'oracle.aurora.rdbms.security.PolicyTableManager.setDebugLevel(int)';
20:50:15 848
20:50:15 849 -- turn byte code verifier on or off for current session
20:50:15 850 -- 0 is off, 1 is on
20:50:15 851 -- you need JServerPermission("Verifier") to do this operation
20:50:15 852 procedure set_verifier(flag number)
20:50:15 853 as language java name
20:50:15 854 'oracle.aurora.rdbms.Compiler.sessionOptionController(int)';
20:50:15 855
20:50:15 856 function option_controller(opt number, action number) return number
20:50:15 857 as language java name
20:50:15 858 'oracle.aurora.rdbms.Compiler.optionController(int, int) return boolean';
20:50:15 859
20:50:15 860 -- turn system class loading on or off for current session
20:50:15 861 -- 0 is off, 1 is on
20:50:15 862 -- you need to be running as SYS to do this operation
20:50:15 863 procedure set_system_class_loading(flag number);
20:50:15 864
20:50:15 865 -- The following functions are used by loadjava
20:50:15 866
20:50:15 867 -- starts the actions of copying a file to the server.
20:50:15 868 -- b is used repeatedly to copy chuncks.
20:50:15 869 procedure deploy_open(filename varchar, b out BLOB)
20:50:15 870 as language java name
20:50:15 871 'oracle.aurora.server.tools.loadjava.Deploy.open(java.lang.String, oracle.sql.BLOB[])' ;
20:50:15 872
20:50:15 873 -- copys a chunk out of the BLOB
20:50:15 874 procedure deploy_copy(b BLOB)
20:50:15 875 as language java name 'oracle.aurora.server.tools.loadjava.Deploy.copy(oracle.sql.BLOB)';
20:50:15 876
20:50:15 877 -- invokes the a deployed class
20:50:15 878 function deploy_invoke(schema varchar, classname varchar) return varchar
20:50:15 879 as language java name 'oracle.aurora.server.tools.loadjava.Deploy.invoke(java.lang.String, java.lang.String) return java.lang.String' ;
20:50:15 880
20:50:15 881 -- start_jmx_agent: Start an agent activating OJVM JMX server and remote listener.
20:50:15 882 -- The JMX server starts as a collection of daemon threads in the current session.
20:50:15 883 -- The session is expected to run with JMXSERVER role or a superset, otherwise
20:50:15 884 -- JMX-related security exceptions will be raised.
20:50:15 885 -- Arguments:
20:50:15 886 -- port the port for the JMX listener,
20:50:15 887 -- the value for the property com.sun.management.jmxremote.port
20:50:15 888 -- ssl the value for the property com.sun.management.jmxremote.ssl
20:50:15 889 -- auth the value for the property com.sun.management.jmxremote.authenticate
20:50:15 890 -- Each argument can be null or omitted, with null as default.
20:50:15 891 -- When an argument is null, the corresponding property is not altered,
20:50:15 892 -- holding the value, if any, previously present in the session.
20:50:15 893 -- These three and other JMX-related properties can be configured in a session prior
20:50:15 894 -- to a call to start_jmx_agent by means of dbms_java.set_property.
20:50:15 895 -- Examples:
20:50:15 896 -- start_jmx_agent('9999', 'false', 'false')
20:50:15 897 -- start JMX server and listener on port 9999 with no SSL and no authentication
20:50:15 898 -- start_jmx_agent('9999')
20:50:15 899 -- start JMX server and listener on port 9999 with the other JMX settings
20:50:15 900 -- having the default values or the values set using dbms_java.set_property
20:50:15 901 -- earlier in the same session
20:50:15 902 -- start_jmx_agent
20:50:15 903 -- start JMX server and listener with the JMX settings
20:50:15 904 -- having the default values or the values set using dbms_java.set_property
20:50:15 905 -- earlier in the same session
20:50:15 906 procedure start_jmx_agent(port VARCHAR2 default NULL,
20:50:15 907 ssl VARCHAR2 default NULL,
20:50:15 908 auth VARCHAR2 default NULL);
20:50:15 909
20:50:15 910 -- Send command chunks to shell
20:50:15 911 procedure send_command (chunk long raw);
20:50:15 912
20:50:15 913 -- Get reply chunks from shell
20:50:15 914 function get_reply return long raw;
20:50:15 915
20:50:15 916 -- add a preference to the database
20:50:15 917 -- user user schema name
20:50:15 918 -- type U for user or S for system
20:50:15 919 -- abspath absolute path of the preference
20:50:15 920 -- key key for value lookup
20:50:15 921 -- value value to be stored (string)
20:50:15 922 procedure set_preference(user varchar2,type varchar2, abspath varchar2,
20:50:15 923 key varchar2, value varchar2);
20:50:15 924
20:50:15 925 function ncomp_status_msg return VARCHAR2 as language java name
20:50:15 926 'oracle.aurora.rdbms.DbmsJava.ncompEnabledMsg() return java.lang.String';
20:50:15 927
20:50:15 928 function full_ncomp_enabled return VARCHAR2;
20:50:15 929
20:50:15 930 function get_ojvm_property(propstring VARCHAR2) return VARCHAR2 as language
20:50:15 931 java name 'java.lang.System.getProperty(java.lang.String)
20:50:15 932 return java.lang.String';
20:50:15 933
20:50:15 934 function getVersion return VARCHAR2;
20:50:15 935
20:50:15 936 procedure dbms_feature_ojvm(ojvm_boolean OUT NUMBER,
20:50:15 937 aux_count OUT NUMBER,
20:50:15 938 ojvm_info OUT CLOB);
20:50:15 939
20:50:15 940 procedure dbms_feature_system_ojvm(ojvm_boolean OUT NUMBER,
20:50:15 941 aux_count OUT NUMBER,
20:50:15 942 ojvm_info OUT CLOB);
20:50:15 943
20:50:15 944 procedure set_runtime_exec_credentials(dbuser varchar2,
20:50:15 945 osuser varchar2,
20:50:15 946 ospass varchar2);
20:50:15 947 end;
20:50:15 948 /
Package created.
Elapsed: 00:00:00.07
20:50:15 SYS@cndb>
20:50:15 SYS@cndb>
20:50:15 SYS@cndb> --
20:50:15 SYS@cndb> -- definers-rights functions and procedures should live here
20:50:15 SYS@cndb> --
20:50:15 SYS@cndb> create or replace package dbms_java_definers authid definer as
20:50:15 2
20:50:15 3 FUNCTION get_nth_native_compiler_option(n number) return VARCHAR2;
20:50:15 4
20:50:15 5
20:50:15 6 -- sets a native-compiler option to the specified value for the
20:50:15 7 -- given schema
20:50:15 8 PROCEDURE set_native_compiler_option_(optionName VARCHAR2,
20:50:15 9 value VARCHAR2,
20:50:15 10 owner NUMBER);
20:50:15 11
20:50:15 12 -- decode, into a user-readable format, a persisted native-compiler
20:50:15 13 -- option. This function is not intended to be used by users
20:50:15 14 -- directly
20:50:15 15 FUNCTION decode_native_compiler_option_(optionName VARCHAR2,
20:50:15 16 value VARCHAR2) RETURN VARCHAR2;
20:50:15 17
20:50:15 18 -- unsets a native-compiler option given by the tuple
20:50:15 19 -- [optionName, value] for the given schema
20:50:15 20 --
20:50:15 21 -- if the option given by optionName is not allowed to have
20:50:15 22 -- duplicate values, then the value is ignored.
20:50:15 23 PROCEDURE unset_native_compiler_option_(optionName VARCHAR2,
20:50:15 24 value VARCHAR2,
20:50:15 25 owner NUMBER);
20:50:15 26
20:50:15 27 -- compile all methods defined by the class identified by
20:50:15 28 -- classname in the supplied schema.
20:50:15 29 -- return the number of methods successfully compiled
20:50:15 30 --
20:50:15 31 -- If the class does not exist in the schema, or the schema does not
20:50:15 32 -- exist, an ORA-29532 (Uncaught Java exception) will occur.
20:50:15 33 FUNCTION compile_class_(schema VARCHAR2,
20:50:15 34 classname VARCHAR2) return NUMBER;
20:50:15 35
20:50:15 36 -- compile the method specified by name and Java type signature
20:50:15 37 -- defined by the class identified by classname in the supplied
20:50:15 38 -- schema.
20:50:15 39 -- return the number of methods successfully compiled
20:50:15 40 --
20:50:15 41 -- If the class does not exist in the schema, or the schema does not
20:50:15 42 -- exist, an ORA-29532 (Uncaught Java exception) will occur.
20:50:15 43 FUNCTION compile_method_(schema VARCHAR2,
20:50:15 44 classname VARCHAR2,
20:50:15 45 methodname VARCHAR2,
20:50:15 46 methodsig VARCHAR2) return NUMBER;
20:50:15 47
20:50:15 48 -- uncompile all methods defined by the class identified by
20:50:15 49 -- classname in the supplied schema.
20:50:15 50 --
20:50:15 51 -- return the number of methods successfully uncompiled.
20:50:15 52 --
20:50:15 53 -- If permanentp, then mark these methods as permanently dynamicaly
20:50:15 54 -- un-compilable, otherwise, they are eligible for future dynamic
20:50:15 55 -- recompilation.
20:50:15 56 --
20:50:15 57 -- If the class does not exist in the schema, or the schema does not
20:50:15 58 -- exist an ORA-29532 (Uncaught Java exception) will occur.
20:50:15 59 FUNCTION uncompile_class_(schema VARCHAR2,
20:50:15 60 classname VARCHAR2,
20:50:15 61 permanentp NUMBER) return NUMBER;
20:50:15 62
20:50:15 63 -- uncompile the method specified by the name and Java type
20:50:15 64 -- signature defined by the class identified by classname in the
20:50:15 65 -- supplied schema.
20:50:15 66 --
20:50:15 67 -- return the number of methods successfully uncompiled.
20:50:15 68 --
20:50:15 69 -- If permanentp, then mark the method as permanently dynamicaly
20:50:15 70 -- un-compilable, otherwise, it is eligible for future dynamic
20:50:15 71 -- recompilation.
20:50:15 72 --
20:50:15 73 -- If the class does not exist in the schema, or the schema does not
20:50:15 74 -- exist an ORA-29532 (Uncaught Java exception) will occur.
20:50:15 75 FUNCTION uncompile_method_(schema VARCHAR2,
20:50:15 76 classname VARCHAR2,
20:50:15 77 methodname VARCHAR2,
20:50:15 78 methodsig VARCHAR2,
20:50:15 79 permanentp NUMBER) return NUMBER;
20:50:15 80 end;
20:50:15 81 /
Package created.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> -- package defining api to java$jvm$rjbc
20:50:16 SYS@cndb> create or replace package jvmrjbc as
20:50:16 2 function init return VARCHAR2;
20:50:16 3 procedure putpath(sessid VARCHAR2, pathname VARCHAR2);
20:50:16 4 function getlob(sessid VARCHAR2) return BLOB;
20:50:16 5 function getpath(sessid VARCHAR2) return VARCHAR2;
20:50:16 6 procedure putlob(sessid VARCHAR2, l BLOB);
20:50:16 7 procedure done(sessid VARCHAR2);
20:50:16 8 end;
20:50:16 9 /
Package created.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> create or replace package dbms_java_misc authid current_user as
20:50:16 2
20:50:16 3 -- Support for dbms_java.runjava
20:50:16 4
20:50:16 5 FUNCTION runjava(cmdline VARCHAR2,
20:50:16 6 rjbc_sessid VARCHAR2, rjbc_flags VARCHAR2) RETURN VARCHAR2;
20:50:16 7 FUNCTION runjava_in_current_session(cmdline VARCHAR2,
20:50:16 8 rjbc_sessid VARCHAR2, rjbc_flags VARCHAR2) RETURN VARCHAR2;
20:50:16 9
20:50:16 10 FUNCTION runjava(f NUMBER) RETURN VARCHAR2;
20:50:16 11 FUNCTION runjava_in_current_session(f NUMBER) RETURN VARCHAR2;
20:50:16 12
20:50:16 13 end dbms_java_misc;
20:50:16 14 /
Package created.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> create or replace package body dbms_java as
20:50:16 2
20:50:16 3 -- runjava back channel state
20:50:16 4 rjbc_sessid VARCHAR2(100);
20:50:16 5 rjbc_toclient VARCHAR2(120);
20:50:16 6 rjbc_fromclient VARCHAR2(120);
20:50:16 7 rjbc_client_started BOOLEAN;
20:50:16 8 rjbc_action NUMBER;
20:50:16 9 rjbc_flags NUMBER;
20:50:16 10
20:50:16 11 PROCEDURE start_btl as language java name
20:50:16 12 'oracle.aurora.perf.OracleBTL.startBTL()';
20:50:16 13
20:50:16 14 PROCEDURE stop_btl as language java name
20:50:16 15 'oracle.aurora.perf.OracleBTL.stopBTL()';
20:50:16 16
20:50:16 17 PROCEDURE terminate_btl as language java name
20:50:16 18 'oracle.aurora.perf.OracleBTL.terminateBTL()';
20:50:16 19
20:50:16 20 FUNCTION init_btl(files_prefix VARCHAR2, type NUMBER,
20:50:16 21 sample_limit NUMBER, exclude_java NUMBER) return NUMBER as language java name
20:50:16 22 'oracle.aurora.perf.OracleBTL.initBTL(java.lang.String, int, long, boolean)
20:50:16 23 return boolean';
20:50:16 24
20:50:16 25 FUNCTION compile_class(classname VARCHAR2) return NUMBER as
20:50:16 26 begin
20:50:16 27 return dbms_java_definers.compile_class_(sys_context('userenv', 'current_schema'),
20:50:16 28 classname);
20:50:16 29 end;
20:50:16 30
20:50:16 31 FUNCTION compile_method(classname VARCHAR2,
20:50:16 32 methodname VARCHAR2,
20:50:16 33 methodsig VARCHAR2) return NUMBER as
20:50:16 34 begin
20:50:16 35 return dbms_java_definers.compile_method_(sys_context('userenv', 'current_schema'),
20:50:16 36 classname, methodname,
20:50:16 37 methodsig);
20:50:16 38 end;
20:50:16 39
20:50:16 40 FUNCTION uncompile_class(classname VARCHAR2,
20:50:16 41 permanentp NUMBER default 0) return NUMBER as
20:50:16 42 begin
20:50:16 43 -- call-specs can't have default params
20:50:16 44 return dbms_java_definers.uncompile_class_(sys_context('userenv', 'current_schema'),
20:50:16 45 classname, permanentp);
20:50:16 46 end;
20:50:16 47
20:50:16 48 FUNCTION uncompile_class(schema VARCHAR2,
20:50:16 49 classname VARCHAR2,
20:50:16 50 permanentp NUMBER default 0) return NUMBER as
20:50:16 51 begin
20:50:16 52 -- call-specs can't have default params
20:50:16 53 return dbms_java_definers.uncompile_class_(schema, classname, permanentp);
20:50:16 54 end;
20:50:16 55
20:50:16 56
20:50:16 57 FUNCTION uncompile_method(classname VARCHAR2,
20:50:16 58 methodname VARCHAR2,
20:50:16 59 methodsig VARCHAR2,
20:50:16 60 permanentp NUMBER default 0) return NUMBER as
20:50:16 61 begin
20:50:16 62 -- call-specs can't have default params
20:50:16 63 return dbms_java_definers.uncompile_method_(sys_context('userenv', 'current_schema'),
20:50:16 64 classname, methodname,
20:50:16 65 methodsig, permanentp);
20:50:16 66 end;
20:50:16 67
20:50:16 68 FUNCTION uncompile_method(schema VARCHAR2,
20:50:16 69 classname VARCHAR2,
20:50:16 70 methodname VARCHAR2,
20:50:16 71 methodsig VARCHAR2,
20:50:16 72 permanentp NUMBER default 0) return NUMBER as
20:50:16 73 begin
20:50:16 74 -- call-specs can't have default params
20:50:16 75 return dbms_java_definers.uncompile_method_(schema, classname,
20:50:16 76 methodname, methodsig,
20:50:16 77 permanentp);
20:50:16 78 end;
20:50:16 79
20:50:16 80 PROCEDURE dump_native_machine_code(classname VARCHAR2,
20:50:16 81 methodname VARCHAR2,
20:50:16 82 methodsig VARCHAR2) as language java name
20:50:16 83 'oracle.aurora.vm.OracleRuntime.dumpNativeMachineCode(java.lang.String,
20:50:16 84 java.lang.String,
20:50:16 85 java.lang.String)';
20:50:16 86
20:50:16 87 FUNCTION native_compiler_options return compiler_option_type_table pipelined as
20:50:16 88 opstr varchar2(4000);
20:50:16 89 token varchar2(4000);
20:50:16 90 newline constant varchar2(2) := chr(10);
20:50:16 91 opidx number;
20:50:16 92 lastidx number;
20:50:16 93 idx number;
20:50:16 94 n number;
20:50:16 95 line compiler_option_type;
20:50:16 96 begin
20:50:16 97 opidx := 0;
20:50:16 98 opstr := dbms_java_definers.get_nth_native_compiler_option(opidx);
20:50:16 99 while opstr is not null loop
20:50:16 100 idx := instr(opstr, newline);
20:50:16 101 lastidx := 0;
20:50:16 102 while idx <> 0 loop
20:50:16 103 token := substr(opstr, lastidx + length(newline), idx - lastidx - length(newline));
20:50:16 104 lastidx := idx;
20:50:16 105 line.option_line := token;
20:50:16 106 PIPE ROW(line);
20:50:16 107 idx := instr(opstr, newline, idx + length(newline));
20:50:16 108 end loop;
20:50:16 109
20:50:16 110 opidx := opidx + 1;
20:50:16 111 opstr := dbms_java_definers.get_nth_native_compiler_option(opidx);
20:50:16 112 end loop;
20:50:16 113 end;
20:50:16 114
20:50:16 115 PROCEDURE set_native_compiler_option(optionName VARCHAR2,
20:50:16 116 value VARCHAR2) as
20:50:16 117 begin
20:50:16 118 dbms_java_definers.set_native_compiler_option_(optionName,
20:50:16 119 value,
20:50:16 120 sys_context('userenv','current_schemaid'));
20:50:16 121 end;
20:50:16 122
20:50:16 123
20:50:16 124 PROCEDURE unset_native_compiler_option(optionName VARCHAR2,
20:50:16 125 value VARCHAR2) as
20:50:16 126 begin
20:50:16 127 dbms_java_definers.unset_native_compiler_option_(optionName,
20:50:16 128 value,
20:50:16 129 sys_context('userenv','current_schemaid'));
20:50:16 130 end;
20:50:16 131
20:50:16 132 FUNCTION decode_native_compiler_option(optionName VARCHAR2,
20:50:16 133 value VARCHAR2) RETURN VARCHAR2 as
20:50:16 134 begin
20:50:16 135 return dbms_java_definers.decode_native_compiler_option_(optionName, value);
20:50:16 136 end;
20:50:16 137
20:50:16 138
20:50:16 139 FUNCTION longname (shortname VARCHAR2) RETURN VARCHAR2 as language java name
20:50:16 140 'oracle.aurora.rdbms.DbmsJava.longNameForSQL(java.lang.String)
20:50:16 141 return java.lang.String';
20:50:16 142
20:50:16 143 FUNCTION shortname (longname VARCHAR2) RETURN VARCHAR2 as language java name
20:50:16 144 'oracle.aurora.rdbms.DbmsJava.shortName(java.lang.String)
20:50:16 145 return java.lang.String';
20:50:16 146
20:50:16 147 FUNCTION get_compiler_option(what VARCHAR2, optionName VARCHAR2)
20:50:16 148 RETURN varchar2
20:50:16 149 as language java name
20:50:16 150 'oracle.aurora.jdkcompiler.CompilerOptions.get(java.lang.String, java.lang.String) return java.lang.String' ;
20:50:16 151
20:50:16 152 PROCEDURE set_compiler_option(what VARCHAR2, optionName VARCHAR2, value VARCHAR2)
20:50:16 153 as language java name
20:50:16 154 'oracle.aurora.jdkcompiler.CompilerOptions.set(java.lang.String, java.lang.String, java.lang.String)' ;
20:50:16 155
20:50:16 156
20:50:16 157 PROCEDURE reset_compiler_option(what VARCHAR2, optionName VARCHAR2)
20:50:16 158 as language java name
20:50:16 159 'oracle.aurora.jdkcompiler.CompilerOptions.reset(java.lang.String, java.lang.String)' ;
20:50:16 160
20:50:16 161
20:50:16 162 FUNCTION initGetSourceChunks (name VARCHAR2, owner VARCHAR2, type VARCHAR2)
20:50:16 163 RETURN NUMBER as language java name
20:50:16 164 'oracle.aurora.rdbms.DbmsJava.initGetSourceChunks(java.lang.String,
20:50:16 165 oracle.sql.CHAR,
20:50:16 166 java.lang.String)
20:50:16 167 return int';
20:50:16 168
20:50:16 169 FUNCTION getSourceChunk RETURN VARCHAR2 as language java name
20:50:16 170 'oracle.aurora.rdbms.DbmsJava.getSourceChunk() return oracle.sql.CHAR';
20:50:16 171
20:50:16 172 FUNCTION resolver (name VARCHAR2, owner VARCHAR2, type VARCHAR2)
20:50:16 173 RETURN VARCHAR2 as language java name
20:50:16 174 'oracle.aurora.rdbms.DbmsJava.resolver(java.lang.String,
20:50:16 175 oracle.sql.CHAR,
20:50:16 176 java.lang.String)
20:50:16 177 return oracle.sql.CHAR';
20:50:16 178
20:50:16 179 FUNCTION derivedFrom (name VARCHAR2, owner VARCHAR2, type VARCHAR2)
20:50:16 180 RETURN VARCHAR2 as language java name
20:50:16 181 'oracle.aurora.rdbms.DbmsJava.derivedFrom(java.lang.String,
20:50:16 182 oracle.sql.CHAR,
20:50:16 183 java.lang.String)
20:50:16 184 return java.lang.String';
20:50:16 185
20:50:16 186 FUNCTION sharedPrivateClassName (name VARCHAR2)
20:50:16 187 RETURN VARCHAR2 as language java name
20:50:16 188 'oracle.aurora.rdbms.DbmsJava.sharedPrivateClassName(java.lang.String)
20:50:16 189 return java.lang.String';
20:50:16 190
20:50:16 191 FUNCTION fixed_in_instance (name VARCHAR2, owner VARCHAR2, type VARCHAR2)
20:50:16 192 RETURN NUMBER as language java name
20:50:16 193 'oracle.aurora.rdbms.DbmsJava.fixedInInstance(java.lang.String,
20:50:16 194 oracle.sql.CHAR,
20:50:16 195 java.lang.String)
20:50:16 196 return boolean';
20:50:16 197
20:50:16 198 PROCEDURE set_fixed_in_instance (name VARCHAR2, owner VARCHAR2,
20:50:16 199 type VARCHAR2, value NUMBER)
20:50:16 200 as language java name
20:50:16 201 'oracle.aurora.rdbms.DbmsJava.setFixedInInstance(java.lang.String,
20:50:16 202 oracle.sql.CHAR,
20:50:16 203 java.lang.String,
20:50:16 204 boolean)';
20:50:16 205
20:50:16 206 -- RUNJAVA interface
20:50:16 207 FUNCTION runjava(cmdline VARCHAR2) RETURN VARCHAR2 as begin
20:50:16 208 execute immediate 'select sys.dbms_java_misc.runjava(1) from dual';
20:50:16 209 return dbms_java_misc.runjava(cmdline, rjbc_sessid, rjbc_flags);
20:50:16 210 end;
20:50:16 211
20:50:16 212 FUNCTION runjava_in_current_session(cmdline VARCHAR2) RETURN VARCHAR2 as begin
20:50:16 213 execute immediate 'select sys.dbms_java_misc.runjava_in_current_session(1) from dual';
20:50:16 214 return dbms_java_misc.runjava_in_current_session(cmdline, rjbc_sessid, rjbc_flags);
20:50:16 215 end;
20:50:16 216
20:50:16 217 FUNCTION endsession RETURN VARCHAR2 as
20:50:16 218 begin
20:50:16 219 return dbms_java_test.funcall('-endsession', ' ');
20:50:16 220 end;
20:50:16 221
20:50:16 222 FUNCTION endsession_and_related_state RETURN VARCHAR2 as
20:50:16 223 begin
20:50:16 224 return dbms_java_test.funcall('-endsession', ' ', 'x');
20:50:16 225 end;
20:50:16 226
20:50:16 227 FUNCTION set_property(name VARCHAR2, value VARCHAR2) RETURN VARCHAR2 as
20:50:16 228 begin
20:50:16 229 return dbms_java_test.funcall('-setprop', ' ', name, value);
20:50:16 230 end;
20:50:16 231
20:50:16 232 FUNCTION get_property(name VARCHAR2) RETURN VARCHAR2 as
20:50:16 233 begin
20:50:16 234 return dbms_java_test.funcall('-getprop', ' ', name);
20:50:16 235 end;
20:50:16 236
20:50:16 237 FUNCTION remove_property(name VARCHAR2) RETURN VARCHAR2 as
20:50:16 238 begin
20:50:16 239 return dbms_java_test.funcall('-setprop', ' ', name, '', 'x');
20:50:16 240 end;
20:50:16 241
20:50:16 242 FUNCTION show_property(name VARCHAR2) RETURN VARCHAR2 as
20:50:16 243 begin
20:50:16 244 return dbms_java_test.funcall('-showprop', ' ', name);
20:50:16 245 end;
20:50:16 246
20:50:16 247 -- Methods for controlling destination of java output
20:50:16 248 PROCEDURE set_output (buffersize NUMBER) as
20:50:16 249 junk varchar2(20);
20:50:16 250 sz number := buffersize;
20:50:16 251 begin
20:50:16 252 if sz <= 0 then sz := 20000; end if;
20:50:16 253 if sz > 1000000 then sz := 1000000; end if;
20:50:16 254 dbms_output.enable(sz);
20:50:16 255 junk := set_output_to_sql('dbout',
20:50:16 256 'begin dbms_output.put_line(:1);end;',
20:50:16 257 'TEXT',
20:50:16 258 'begin dbms_output.put(:1);end;',
20:50:16 259 'TEXT',
20:50:16 260 'begin dbms_output.new_line;end;',
20:50:16 261 ' ',
20:50:16 262 255,
20:50:16 263 eager => 1);
20:50:16 264 end;
20:50:16 265
20:50:16 266 FUNCTION set_output_to_sql (id VARCHAR2,
20:50:16 267 stmt VARCHAR2,
20:50:16 268 bindings VARCHAR2,
20:50:16 269 no_newline_stmt VARCHAR2 default null,
20:50:16 270 no_newline_bindings VARCHAR2 default null,
20:50:16 271 newline_only_stmt VARCHAR2 default null,
20:50:16 272 newline_only_bindings VARCHAR2 default null,
20:50:16 273 maximum_line_segment_length NUMBER default 0,
20:50:16 274 allow_replace NUMBER default 1,
20:50:16 275 from_stdout NUMBER default 1,
20:50:16 276 from_stderr NUMBER default 1,
20:50:16 277 include_newlines NUMBER default 0,
20:50:16 278 eager NUMBER default 0) return VARCHAR2 as
20:50:16 279 flags number := 0;
20:50:16 280 replace number := allow_replace;
20:50:16 281 maxlen number := maximum_line_segment_length;
20:50:16 282 begin
20:50:16 283 if id is null then return 'ID must not be null'; end if;
20:50:16 284 if length(id) > 30 then
20:50:16 285 return 'ID length must not be greater than 30'; end if;
20:50:16 286 if stmt is null then return 'STMT must not be null'; end if;
20:50:16 287 if bindings is null then return 'BINDINGS must not be null'; end if;
20:50:16 288 if allow_replace !=0 then replace := 1; end if;
20:50:16 289 if from_stdout != 0 then flags := flags + 1; end if;
20:50:16 290 if from_stderr != 0 then flags := flags + 2; end if;
20:50:16 291 if flags = 0 then
20:50:16 292 return 'one of FROM_STDOUT or FROM_STDERR must be true (non zero)';
20:50:16 293 end if;
20:50:16 294 if eager != 0 then flags := flags + 4; end if;
20:50:16 295 if include_newlines != 0 then flags := flags + 8; end if;
20:50:16 296 if maxlen is null then maxlen := 0; end if;
20:50:16 297 if maxlen < 0 or maxlen != floor(maxlen) then
20:50:16 298 return 'MAXIMUM_LINE_SEGMENT_LENGTH must be a non zero integer'; end if;
20:50:16 299
20:50:16 300 return dbms_java_test.funcall('-set_output_to_sql', ' ',
20:50:16 301 id,
20:50:16 302 replace,
20:50:16 303 stmt,
20:50:16 304 bindings,
20:50:16 305 no_newline_stmt,
20:50:16 306 no_newline_bindings,
20:50:16 307 newline_only_stmt,
20:50:16 308 newline_only_bindings,
20:50:16 309 maximum_line_segment_length,
20:50:16 310 flags);
20:50:16 311 end;
20:50:16 312
20:50:16 313 FUNCTION remove_output_to_sql (id VARCHAR2) return VARCHAR2 as
20:50:16 314 begin
20:50:16 315 return dbms_java_test.funcall('-remove_output_to_sql', ' ', id);
20:50:16 316 end;
20:50:16 317
20:50:16 318 FUNCTION enable_output_to_sql (id VARCHAR2) return VARCHAR2 as
20:50:16 319 begin
20:50:16 320 return dbms_java_test.funcall('-enable_output_to_sql', ' ', id);
20:50:16 321 end;
20:50:16 322
20:50:16 323 FUNCTION disable_output_to_sql (id VARCHAR2) return VARCHAR2 as
20:50:16 324 begin
20:50:16 325 return dbms_java_test.funcall('-disable_output_to_sql', ' ', id);
20:50:16 326 end;
20:50:16 327
20:50:16 328 FUNCTION query_output_to_sql (id VARCHAR2) return VARCHAR2 as
20:50:16 329 begin
20:50:16 330 return dbms_java_test.funcall('-query_output_to_sql', ' ', id);
20:50:16 331 end;
20:50:16 332
20:50:16 333 FUNCTION set_output_to_java_ (id VARCHAR2,
20:50:16 334 class_name VARCHAR2,
20:50:16 335 class_schema VARCHAR2,
20:50:16 336 method VARCHAR2,
20:50:16 337 bindings VARCHAR2,
20:50:16 338 no_newline_method VARCHAR2 default null,
20:50:16 339 no_newline_bindings VARCHAR2 default null,
20:50:16 340 newline_only_method VARCHAR2 default null,
20:50:16 341 newline_only_bindings VARCHAR2 default null,
20:50:16 342 maximum_line_segment_length NUMBER default 0,
20:50:16 343 allow_replace NUMBER default 1,
20:50:16 344 from_stdout NUMBER default 1,
20:50:16 345 from_stderr NUMBER default 1,
20:50:16 346 include_newlines NUMBER default 0,
20:50:16 347 eager NUMBER default 0,
20:50:16 348 initialization_statement VARCHAR2 default null,
20:50:16 349 finalization_statement VARCHAR2 default null,
20:50:16 350 call_type NUMBER)
20:50:16 351 return VARCHAR2 as
20:50:16 352 flags number := 0;
20:50:16 353 replace number := allow_replace;
20:50:16 354 maxlen number := maximum_line_segment_length;
20:50:16 355 begin
20:50:16 356 if id is null then return 'ID must not be null'; end if;
20:50:16 357 if call_type != 1 and substr(ID, 1, 4) = '_tf_' then
20:50:16 358 return 'ID must not begin with ''_tf_'''; end if;
20:50:16 359 if length(id) > 30 then
20:50:16 360 return 'ID length must not be greater than 30'; end if;
20:50:16 361 if class_name is null then return 'CLASS_NAME must not be null'; end if;
20:50:16 362 if method is null then return 'METHOD must not be null'; end if;
20:50:16 363 if bindings is null then return 'BINDINGS must not be null'; end if;
20:50:16 364 if allow_replace !=0 then replace := 1; end if;
20:50:16 365 if from_stdout != 0 then flags := flags + 1; end if;
20:50:16 366 if from_stderr != 0 then flags := flags + 2; end if;
20:50:16 367 if flags = 0 then
20:50:16 368 return 'one of FROM_STDOUT or FROM_STDERR must be true (non zero)';
20:50:16 369 end if;
20:50:16 370 if eager != 0 then flags := flags + 4; end if;
20:50:16 371 if include_newlines != 0 then flags := flags + 8; end if;
20:50:16 372 if maxlen is null then maxlen := 0; end if;
20:50:16 373 if maxlen < 0 or maxlen != floor(maxlen) then
20:50:16 374 return 'MAXIMUM_LINE_SEGMENT_LENGTH must be a non zero integer'; end if;
20:50:16 375
20:50:16 376 return dbms_java_test.funcall('-set_output_to_java', ' ',
20:50:16 377 id,
20:50:16 378 replace,
20:50:16 379 class_name,
20:50:16 380 class_schema,
20:50:16 381 method,
20:50:16 382 bindings,
20:50:16 383 no_newline_method,
20:50:16 384 no_newline_bindings,
20:50:16 385 newline_only_method,
20:50:16 386 newline_only_bindings,
20:50:16 387 maximum_line_segment_length,
20:50:16 388 flags,
20:50:16 389 initialization_statement,
20:50:16 390 finalization_statement);
20:50:16 391 end;
20:50:16 392
20:50:16 393 FUNCTION set_output_to_java (id VARCHAR2,
20:50:16 394 class_name VARCHAR2,
20:50:16 395 class_schema VARCHAR2,
20:50:16 396 method VARCHAR2,
20:50:16 397 bindings VARCHAR2,
20:50:16 398 no_newline_method VARCHAR2 default null,
20:50:16 399 no_newline_bindings VARCHAR2 default null,
20:50:16 400 newline_only_method VARCHAR2 default null,
20:50:16 401 newline_only_bindings VARCHAR2 default null,
20:50:16 402 maximum_line_segment_length NUMBER default 0,
20:50:16 403 allow_replace NUMBER default 1,
20:50:16 404 from_stdout NUMBER default 1,
20:50:16 405 from_stderr NUMBER default 1,
20:50:16 406 include_newlines NUMBER default 0,
20:50:16 407 eager NUMBER default 0,
20:50:16 408 initialization_statement VARCHAR2 default null,
20:50:16 409 finalization_statement VARCHAR2 default null)
20:50:16 410 return VARCHAR2 as
20:50:16 411 begin
20:50:16 412 return set_output_to_java_ (id,
20:50:16 413 class_name,
20:50:16 414 class_schema,
20:50:16 415 method,
20:50:16 416 bindings,
20:50:16 417 no_newline_method,
20:50:16 418 no_newline_bindings,
20:50:16 419 newline_only_method,
20:50:16 420 newline_only_bindings,
20:50:16 421 maximum_line_segment_length,
20:50:16 422 allow_replace,
20:50:16 423 from_stdout,
20:50:16 424 from_stderr,
20:50:16 425 include_newlines,
20:50:16 426 eager,
20:50:16 427 initialization_statement,
20:50:16 428 finalization_statement,
20:50:16 429 0);
20:50:16 430 end;
20:50:16 431
20:50:16 432 FUNCTION enable_output_to_java (id VARCHAR2) return VARCHAR2 as
20:50:16 433 begin
20:50:16 434 return dbms_java_test.funcall('-enable_output_to_java', ' ', id);
20:50:16 435 end;
20:50:16 436
20:50:16 437 FUNCTION disable_output_to_java (id VARCHAR2) return VARCHAR2 as
20:50:16 438 begin
20:50:16 439 return dbms_java_test.funcall('-disable_output_to_java', ' ', id);
20:50:16 440 end;
20:50:16 441
20:50:16 442 FUNCTION remove_output_to_java (id VARCHAR2) return VARCHAR2 as
20:50:16 443 begin
20:50:16 444 return dbms_java_test.funcall('-remove_output_to_java', ' ', id);
20:50:16 445 end;
20:50:16 446
20:50:16 447 FUNCTION query_output_to_java (id VARCHAR2) return VARCHAR2 as
20:50:16 448 begin
20:50:16 449 return dbms_java_test.funcall('-query_output_to_java', ' ', id);
20:50:16 450 end;
20:50:16 451
20:50:16 452 FUNCTION set_output_to_file (id VARCHAR2,
20:50:16 453 file_path VARCHAR2,
20:50:16 454 allow_replace NUMBER default 1,
20:50:16 455 from_stdout NUMBER default 1,
20:50:16 456 from_stderr NUMBER default 1)
20:50:16 457 return VARCHAR2 as
20:50:16 458 full_id varchar2(30);
20:50:16 459 begin
20:50:16 460 if id is null then return 'ID must not be null'; end if;
20:50:16 461 if file_path is null then return 'FILE_PATH must not be null'; end if;
20:50:16 462 if length(id) > 26 then
20:50:16 463 return 'ID length must not be greater than 26'; end if;
20:50:16 464 full_id := '_tf_'||id;
20:50:16 465 return set_output_to_java_(full_id,
20:50:16 466 'oracle/aurora/rdbms/DbmsJava',
20:50:16 467 null,
20:50:16 468 'writeOutputToFile',
20:50:16 469 'ID TEXT',
20:50:16 470 null,
20:50:16 471 null,
20:50:16 472 null,
20:50:16 473 null,
20:50:16 474 0,
20:50:16 475 allow_replace,
20:50:16 476 from_stdout,
20:50:16 477 from_stderr,
20:50:16 478 1,
20:50:16 479 0,
20:50:16 480 'call dbms_java.initialize_output_to_file('||
20:50:16 481 sys.dbms_assert.enquote_literal(full_id) ||','||
20:50:16 482 sys.dbms_assert.enquote_literal(file_path) ||')',
20:50:16 483 'call dbms_java.finalize_output_to_file('||
20:50:16 484 sys.dbms_assert.enquote_literal(full_id) ||')',
20:50:16 485 1);
20:50:16 486 end;
20:50:16 487
20:50:16 488 FUNCTION remove_output_to_file (id VARCHAR2) return VARCHAR2 as
20:50:16 489 begin
20:50:16 490 return remove_output_to_java('_tf_'||id);
20:50:16 491 end;
20:50:16 492
20:50:16 493 FUNCTION enable_output_to_file (id VARCHAR2) return VARCHAR2 as
20:50:16 494 begin
20:50:16 495 return enable_output_to_java('_tf_'||id);
20:50:16 496 end;
20:50:16 497
20:50:16 498 FUNCTION disable_output_to_file (id VARCHAR2) return VARCHAR2 as
20:50:16 499 begin
20:50:16 500 return disable_output_to_java('_tf_'||id);
20:50:16 501 end;
20:50:16 502
20:50:16 503 FUNCTION query_output_to_file (id VARCHAR2) return VARCHAR2 as
20:50:16 504 begin
20:50:16 505 return query_output_to_java('_tf_'||id);
20:50:16 506 end;
20:50:16 507
20:50:16 508 PROCEDURE initialize_output_to_file (id VARCHAR2, path VARCHAR2) as
20:50:16 509 language java name
20:50:16 510 'oracle.aurora.rdbms.DbmsJava.initializeOutputToFile(java.lang.String,
20:50:16 511 java.lang.String)';
20:50:16 512
20:50:16 513 PROCEDURE finalize_output_to_file (id VARCHAR2) as
20:50:16 514 language java name
20:50:16 515 'oracle.aurora.rdbms.DbmsJava.finalizeOutputToFile(java.lang.String)';
20:50:16 516
20:50:16 517
20:50:16 518 PROCEDURE enable_output_to_trc as
20:50:16 519 trash varchar2(100) :=
20:50:16 520 dbms_java_test.funcall('-output_to_trc', ' ', 'ENABLE');
20:50:16 521 begin
20:50:16 522 null;
20:50:16 523 end;
20:50:16 524
20:50:16 525 PROCEDURE disable_output_to_trc as
20:50:16 526 trash varchar2(100) :=
20:50:16 527 dbms_java_test.funcall('-output_to_trc', ' ', 'DISABLE');
20:50:16 528 begin
20:50:16 529 null;
20:50:16 530 end;
20:50:16 531
20:50:16 532 FUNCTION query_output_to_trc return VARCHAR2 as
20:50:16 533 begin
20:50:16 534 return dbms_java_test.funcall('-output_to_trc', ' ', 'QUERY');
20:50:16 535 end;
20:50:16 536
20:50:16 537 -- support for calling runjava from ojvmjava
20:50:16 538
20:50:16 539 -- private subroutines
20:50:16 540 procedure rjbc_send(pipename VARCHAR2) as
20:50:16 541 s integer := dbms_pipe.send_message(pipename);
20:50:16 542 begin
20:50:16 543 if s <> 0 then
20:50:16 544 raise_application_error(-20000,
20:50:16 545 'rjbc_send pipe error:' || to_char(s));
20:50:16 546 end if;
20:50:16 547 end;
20:50:16 548
20:50:16 549 procedure rjbc_receive(pipename VARCHAR2) as
20:50:16 550 s integer := dbms_pipe.receive_message(pipename);
20:50:16 551 begin
20:50:16 552 if s <> 0 then
20:50:16 553 raise_application_error(-20000,
20:50:16 554 'rjbc_receive pipe error:' || to_char(s));
20:50:16 555 end if;
20:50:16 556 end;
20:50:16 557
20:50:16 558 -- rjbc_ack: acknowledge client's startup message if not previously done
20:50:16 559 procedure rjbc_ack as
20:50:16 560 begin
20:50:16 561 if not rjbc_client_started then
20:50:16 562 rjbc_receive(rjbc_fromclient);
20:50:16 563 dbms_pipe.reset_buffer;
20:50:16 564 rjbc_client_started := true;
20:50:16 565 end if;
20:50:16 566 end;
20:50:16 567
20:50:16 568 procedure rjbc_set_pipe_names as
20:50:16 569 begin
20:50:16 570 rjbc_toclient := rjbc_sessid||'_TO_CLIENT';
20:50:16 571 rjbc_fromclient := rjbc_sessid||'_FROM_CLIENT';
20:50:16 572 end;
20:50:16 573
20:50:16 574 -- entrypoints for runjava session
20:50:16 575
20:50:16 576 -- rjbc_init: setup back channel, return id that identifies it. Called
20:50:16 577 -- prior to runjava in the same session as runjava will run in.
20:50:16 578 -- flags non zero means dont use back channel for file content
20:50:16 579 -- this corresponds to the ojvmjava runjava mode server_file_system
20:50:16 580 function rjbc_init(flags NUMBER) return VARCHAR2 as
20:50:16 581 trash VARCHAR2(100);
20:50:16 582 begin
20:50:16 583 loop
20:50:16 584 rjbc_sessid := jvmrjbc.init;
20:50:16 585 rjbc_set_pipe_names;
20:50:16 586 begin
20:50:16 587 trash := dbms_pipe.remove_pipe(rjbc_toclient);
20:50:16 588 trash := dbms_pipe.remove_pipe(rjbc_fromclient);
20:50:16 589 trash := dbms_pipe.create_pipe(rjbc_toclient, private => true);
20:50:16 590 trash := dbms_pipe.create_pipe(rjbc_fromclient, private => true);
20:50:16 591 exit;
20:50:16 592 exception when others then
20:50:16 593 if sqlcode not in (-23322) then raise; end if;
20:50:16 594 begin
20:50:16 595 trash := dbms_pipe.remove_pipe(rjbc_toclient);
20:50:16 596 exception when others then
20:50:16 597 null;
20:50:16 598 end;
20:50:16 599 begin
20:50:16 600 trash := dbms_pipe.remove_pipe(rjbc_fromclient);
20:50:16 601 exception when others then
20:50:16 602 null;
20:50:16 603 end;
20:50:16 604 jvmrjbc.done(rjbc_sessid);
20:50:16 605 end;
20:50:16 606 end loop;
20:50:16 607 rjbc_flags := flags;
20:50:16 608 rjbc_client_started := false;
20:50:16 609
20:50:16 610 dbms_pipe.purge(rjbc_toclient);
20:50:16 611 dbms_pipe.purge(rjbc_fromclient);
20:50:16 612 trash :=
20:50:16 613 remove_output_to_sql('___rjbc');
20:50:16 614 trash :=
20:50:16 615 set_output_to_sql('___rjbc',
20:50:16 616 'begin dbms_java.rjbc_output(:1,:2);end;',
20:50:16 617 'TEXT NL');
20:50:16 618 return rjbc_sessid;
20:50:16 619 end;
20:50:16 620
20:50:16 621 -- rjbc_request: called from runjava to ask for the contents of
20:50:16 622 -- the file identified by pathname on the client filesystem. Puts pathname
20:50:16 623 -- in the java$jvm$rjbc row then waits for client response.
20:50:16 624 -- rtype is not used.
20:50:16 625 -- status returned is 0 if the file was found, non-zero otherwise.
20:50:16 626 -- lob is returned containing the file content.
20:50:16 627 function rjbc_request(pathname VARCHAR2, rtype NUMBER, lob out BLOB)
20:50:16 628 return NUMBER as
20:50:16 629 status NUMBER;
20:50:16 630 begin
20:50:16 631 rjbc_ack;
20:50:16 632 jvmrjbc.putpath(rjbc_sessid, pathname);
20:50:16 633 dbms_pipe.pack_message(rtype);
20:50:16 634 rjbc_send(rjbc_toclient);
20:50:16 635 rjbc_receive(rjbc_fromclient);
20:50:16 636 dbms_pipe.unpack_message(status);
20:50:16 637 if status = 0 and rtype = 0 then
20:50:16 638 lob := jvmrjbc.getlob(rjbc_sessid);
20:50:16 639 end if;
20:50:16 640 return status;
20:50:16 641 end;
20:50:16 642
20:50:16 643 -- rjbc_normalize: called from runjava to ask for the normalized, absolute
20:50:16 644 -- pathname on the client filesystem of the file identified by the input
20:50:16 645 -- argument pathname. Puts pathname in the java$jvm$rjbc row then waits
20:50:16 646 ---for client response.
20:50:16 647 -- rtype is not used.
20:50:16 648 -- status returned is 0 if the file is a directory, non-zero otherwise.
20:50:16 649 -- This value is also not used.
20:50:16 650 -- normalized_pathname is returned containing the normalized path.
20:50:16 651 function rjbc_normalize(pathname VARCHAR2, rtype NUMBER,
20:50:16 652 normalized_pathname out VARCHAR2)
20:50:16 653 return NUMBER as
20:50:16 654 status NUMBER;
20:50:16 655 begin
20:50:16 656 rjbc_ack;
20:50:16 657 jvmrjbc.putpath(rjbc_sessid, pathname);
20:50:16 658 dbms_pipe.pack_message(rtype);
20:50:16 659 rjbc_send(rjbc_toclient);
20:50:16 660 rjbc_receive(rjbc_fromclient);
20:50:16 661 dbms_pipe.unpack_message(status);
20:50:16 662 normalized_pathname := jvmrjbc.getpath(rjbc_sessid);
20:50:16 663 return status;
20:50:16 664 end;
20:50:16 665
20:50:16 666 -- rjbc_output: set_output_to_sql entrypoint used by runjava to pass
20:50:16 667 -- output back to the client.
20:50:16 668 -- Puts text in the java$jvm$rjbc row then waits for client response.
20:50:16 669 procedure rjbc_output(text VARCHAR2, nl NUMBER) as
20:50:16 670 trash number;
20:50:16 671 begin
20:50:16 672 rjbc_ack;
20:50:16 673 jvmrjbc.putpath(rjbc_sessid, text);
20:50:16 674 if nl = 0 then
20:50:16 675 dbms_pipe.pack_message(3);
20:50:16 676 else
20:50:16 677 dbms_pipe.pack_message(2);
20:50:16 678 end if;
20:50:16 679 rjbc_send(rjbc_toclient);
20:50:16 680 rjbc_receive(rjbc_fromclient);
20:50:16 681 dbms_pipe.unpack_message(trash);
20:50:16 682 end;
20:50:16 683
20:50:16 684 -- rjbc_done: called from client to shutdown back channel
20:50:16 685 procedure rjbc_done(id VARCHAR2 := null) as
20:50:16 686 trash VARCHAR2(100);
20:50:16 687 begin
20:50:16 688 if id is not null then
20:50:16 689 rjbc_sessid := id;
20:50:16 690 rjbc_set_pipe_names;
20:50:16 691 rjbc_client_started := true;
20:50:16 692 end if;
20:50:16 693 rjbc_ack;
20:50:16 694 dbms_pipe.pack_message(-1);
20:50:16 695 rjbc_send(rjbc_toclient);
20:50:16 696 trash := dbms_pipe.remove_pipe(rjbc_toclient);
20:50:16 697 trash := dbms_pipe.remove_pipe(rjbc_fromclient);
20:50:16 698 jvmrjbc.done(rjbc_sessid);
20:50:16 699 trash :=
20:50:16 700 remove_output_to_sql('___rjbc');
20:50:16 701 rjbc_sessid := null;
20:50:16 702 end;
20:50:16 703
20:50:16 704 -- back channel entrypoint
20:50:16 705 -- rjbc_respond. Called in loop by back channel client thread to respond
20:50:16 706 -- to requests queued by rjbc_request, rjbc_normalize and rjbc_output.
20:50:16 707 -- status argument indicates result of processing the previous request.
20:50:16 708 -- status values are: -1 = initial call (there was no previous request)
20:50:16 709 -- 0 = file content found and returned
20:50:16 710 -- 1 = file not found
20:50:16 711 -- p in argument receives the normalized path for an rjbc_normalize request
20:50:16 712 -- l in argument receives the lob containing the file content for an
20:50:16 713 -- rjbc_request request.
20:50:16 714 -- return values indicate the kind of the new request. These values are:
20:50:16 715 -- -1 = no request (ie, time to exit)
20:50:16 716 -- 0 = file content (rjbc_request)
20:50:16 717 -- 1 = normalize path (rjbc_normalize)
20:50:16 718 -- 2 = newline terminated output (rjbc_output)
20:50:16 719 -- 3 = nonnewline terminated output (rjbc_output)
20:50:16 720 -- For return values 0 and 1, the p out argument contains the name of the
20:50:16 721 -- file to be processed. For return values 2 and 3 p contains the text
20:50:16 722 -- to be output.
20:50:16 723 function rjbc_respond(sid VARCHAR2, status NUMBER, p in out VARCHAR2, l BLOB)
20:50:16 724 return NUMBER as
20:50:16 725 begin
20:50:16 726 if status = -1 or rjbc_sessid is null then
20:50:16 727 rjbc_sessid := sid;
20:50:16 728 rjbc_set_pipe_names;
20:50:16 729 end if;
20:50:16 730 if status = 0 and rjbc_action = 0 then
20:50:16 731 jvmrjbc.putlob(rjbc_sessid, l);
20:50:16 732 end if;
20:50:16 733 if rjbc_action = 1 then
20:50:16 734 jvmrjbc.putpath(rjbc_sessid, p);
20:50:16 735 end if;
20:50:16 736 dbms_pipe.pack_message(status);
20:50:16 737 rjbc_send(rjbc_fromclient);
20:50:16 738 rjbc_receive(rjbc_toclient);
20:50:16 739 dbms_pipe.unpack_message(rjbc_action);
20:50:16 740 if rjbc_action <> -1 then
20:50:16 741 p := jvmrjbc.getpath(rjbc_sessid);
20:50:16 742 end if;
20:50:16 743 return rjbc_action;
20:50:16 744 end;
20:50:16 745
20:50:16 746 -- import/export interface --
20:50:16 747 function start_export(short_name in varchar2,
20:50:16 748 schema in varchar2,
20:50:16 749 flags in number,
20:50:16 750 type in number,
20:50:16 751 properties out number,
20:50:16 752 raw_chunk_count out number,
20:50:16 753 total_raw_byte_count out number,
20:50:16 754 text_chunk_count out number,
20:50:16 755 total_text_byte_count out number)
20:50:16 756 return number
20:50:16 757 as language java name 'oracle.aurora.rdbms.DbmsJava.
20:50:16 758 startExport(oracle.sql.CHAR, oracle.sql.CHAR,
20:50:16 759 int, int, int[], int[], int[], int[],
20:50:16 760 int[])
20:50:16 761 return int';
20:50:16 762
20:50:16 763 function export_raw_chunk(chunk out raw, length out number)
20:50:16 764 return number
20:50:16 765 as language java name 'oracle.aurora.rdbms.DbmsJava.
20:50:16 766 exportRawChunk(byte[][], int[]) return int';
20:50:16 767
20:50:16 768 function export_text_chunk(chunk out varchar2, length out number)
20:50:16 769 return number
20:50:16 770 as language java name 'oracle.aurora.rdbms.DbmsJava.
20:50:16 771 exportTextChunk(oracle.sql.CHAR[], int[]) return int';
20:50:16 772
20:50:16 773 function end_export return number
20:50:16 774 as language java name 'oracle.aurora.rdbms.DbmsJava.endExport() return int';
20:50:16 775
20:50:16 776 function start_import(long_name in varchar2,
20:50:16 777 flags in number,
20:50:16 778 type in number,
20:50:16 779 properties in number,
20:50:16 780 raw_chunk_count in number,
20:50:16 781 total_raw_byte_count in number,
20:50:16 782 text_chunk_count in number)
20:50:16 783 return number
20:50:16 784 as language java name 'oracle.aurora.rdbms.DbmsJava.
20:50:16 785 startImport(oracle.sql.CHAR,
20:50:16 786 int, int, int, int, int, int)
20:50:16 787 return int';
20:50:16 788 function import_raw_chunk(chunk in raw, length in number)
20:50:16 789 return number
20:50:16 790 as language java name 'oracle.aurora.rdbms.DbmsJava.
20:50:16 791 importRawChunk(byte[], int) return int';
20:50:16 792
20:50:16 793 function import_text_chunk(chunk in varchar2, length in number)
20:50:16 794 return number
20:50:16 795 as language java name 'oracle.aurora.rdbms.DbmsJava.
20:50:16 796 importTextChunk(oracle.sql.CHAR, int) return int';
20:50:16 797
20:50:16 798 function end_import return number
20:50:16 799 as language java name 'oracle.aurora.rdbms.DbmsJava.endImport() return int';
20:50:16 800
20:50:16 801
20:50:16 802 -- call-specs can't have default params
20:50:16 803 procedure start_jmx_agent_(port VARCHAR2, ssl VARCHAR2, auth VARCHAR2)
20:50:16 804 as language java name
20:50:16 805 'oracle.aurora.rdbms.JMXAgent.startOJVMAgent(java.lang.String, java.lang.String, java.lang.String)';
20:50:16 806
20:50:16 807 procedure start_jmx_agent(port VARCHAR2 default NULL,
20:50:16 808 ssl VARCHAR2 default NULL,
20:50:16 809 auth VARCHAR2 default NULL) as
20:50:16 810 begin
20:50:16 811 -- call-specs can't have default params
20:50:16 812 start_jmx_agent_(port, ssl, auth);
20:50:16 813 end;
20:50:16 814
20:50:16 815 -- Send command chunks to shell
20:50:16 816 procedure send_command (chunk long raw)
20:50:16 817 as language java name
20:50:16 818 'oracle.aurora.server.tools.shell.ShellStoredProc.receive_command (byte[])';
20:50:16 819
20:50:16 820 -- Get reply chunks from shell
20:50:16 821 function get_reply return long raw
20:50:16 822 as language java name
20:50:16 823 'oracle.aurora.server.tools.shell.ShellStoredProc.get_reply () return byte[]';
20:50:16 824
20:50:16 825 -- set a preference for the database
20:50:16 826 procedure set_preference(user varchar2,type varchar2, abspath varchar2,
20:50:16 827 key varchar2, value varchar2)
20:50:16 828 as language java name
20:50:16 829 'java.util.prefs.OraclePreferences.DbmsSetPreference(
20:50:16 830 java.lang.String, java.lang.String, java.lang.String,
20:50:16 831 java.lang.String, java.lang.String)';
20:50:16 832
20:50:16 833 -- turn system class loading on or off for current session
20:50:16 834 -- 0 is off, 1 is on
20:50:16 835 -- you need to be running as SYS to do this operation
20:50:16 836 procedure set_system_class_loading(flag number)
20:50:16 837 as
20:50:16 838 x number := 3;
20:50:16 839 begin
20:50:16 840 if flag = 1 then x := 2; end if;
20:50:16 841 x := option_controller(4, x);
20:50:16 842 exception
20:50:16 843 when others then
20:50:16 844 if sqlcode not in (-29549) then raise; end if;
20:50:16 845 end;
20:50:16 846
20:50:16 847 function full_ncomp_enabled return VARCHAR2
20:50:16 848 as
20:50:16 849 -- RHLEE: 9/7/2006 disable this for now
20:50:16 850 -- foo exception;
20:50:16 851 -- x varchar2(100) := ncomp_status_msg;
20:50:16 852 -- pragma exception_init(foo,-29558);
20:50:16 853 begin
20:50:16 854 -- if x = 'NComp status: DISABLED' then raise foo; end if;
20:50:16 855 return 'OK';
20:50:16 856 end;
20:50:16 857
20:50:16 858 function getVersion return VARCHAR2 as
20:50:16 859 begin
20:50:16 860 return get_ojvm_property('oracle.jserver.version');
20:50:16 861 end;
20:50:16 862
20:50:16 863 procedure set_runtime_exec_credentials(dbuser varchar2,
20:50:16 864 osuser varchar2,
20:50:16 865 ospass varchar2)
20:50:16 866 as
20:50:16 867 msg varchar2(100);
20:50:16 868 begin
20:50:16 869 msg := dbms_java_test.funcall('-setrtexeccreds', ' ',
20:50:16 870 UPPER(dbuser),
20:50:16 871 osuser,
20:50:16 872 ospass);
20:50:16 873 end;
20:50:16 874
20:50:16 875 -- OJVM version of user feature tracking procedure
20:50:16 876 procedure dbms_feature_ojvm(ojvm_boolean OUT NUMBER,
20:50:16 877 aux_count OUT NUMBER,
20:50:16 878 ojvm_info OUT CLOB) as
20:50:16 879
20:50:16 880 TYPE data_arr is varray(3) of INTEGER;
20:50:16 881 TYPE user_data is table of data_arr index by varchar(30);
20:50:16 882 ud user_data;
20:50:16 883 owner varchar2(30);
20:50:16 884 otype varchar2(30);
20:50:16 885 tmp_info varchar2(1000);
20:50:16 886 cursor c1 is select owner, object_type
20:50:16 887 from dba_objects where
20:50:16 888 (object_type='JAVA CLASS' or
20:50:16 889 object_type='JAVA RESOURCE' or
20:50:16 890 object_type='JAVA SOURCE') and
20:50:16 891 (owner != 'SYS' and owner != 'SYSTEM' and
20:50:16 892 owner != 'EXFSYS' and owner != 'MDSYS'
20:50:16 893 and owner != 'ORDSYS');
20:50:16 894 begin
20:50:16 895 aux_count := 0;
20:50:16 896 ojvm_boolean := 0;
20:50:16 897 tmp_info := NULL;
20:50:16 898 open c1;
20:50:16 899
20:50:16 900 loop
20:50:16 901 fetch c1 into owner, otype;
20:50:16 902 exit when c1%NOTFOUND or c1%NOTFOUND is null;
20:50:16 903
20:50:16 904 -- this block will initialize the assoc array the first time it
20:50:16 905 -- is used
20:50:16 906
20:50:16 907 begin
20:50:16 908 if ud(owner).exists(1) then
20:50:16 909 null;
20:50:16 910 end if;
20:50:16 911 exception
20:50:16 912 WHEN NO_DATA_FOUND THEN
20:50:16 913 ud(owner) := data_arr(0,0,0);
20:50:16 914 end;
20:50:16 915
20:50:16 916 case
20:50:16 917 when otype = 'JAVA CLASS' then ud(owner)(1) := ud(owner)(1) + 1;
20:50:16 918 when otype = 'JAVA RESOURCE' then ud(owner)(2) := ud(owner)(2) + 1;
20:50:16 919 when otype = 'JAVA SOURCES' then ud(owner)(3) := ud(owner)(3) + 1;
20:50:16 920 else null;
20:50:16 921 end case;
20:50:16 922 end loop;
20:50:16 923 close c1;
20:50:16 924
20:50:16 925 owner := ud.FIRST;
20:50:16 926 tmp_info := 'Non-system users: ';
20:50:16 927 while owner is not null loop
20:50:16 928 aux_count := aux_count + ud(owner)(1) + ud(owner)(2) + ud(owner)(3);
20:50:16 929 tmp_info := tmp_info || owner || ' with ' ||
20:50:16 930 ud(owner)(1) || ' classes, ' ||
20:50:16 931 ud(owner)(2) || ' resources, ' ||
20:50:16 932 ud(owner)(3) || ' sources. ';
20:50:16 933 owner := ud.NEXT(owner);
20:50:16 934 end loop;
20:50:16 935
20:50:16 936 if aux_count > 0 then
20:50:16 937 ojvm_boolean := 1; -- we have user data;
20:50:16 938 ojvm_info := tmp_info;
20:50:16 939 end if;
20:50:16 940 end;
20:50:16 941
20:50:16 942 -- OJVM version of system feature tracking procedure
20:50:16 943 --
20:50:16 944 -- This procedure is problematic in that we do not
20:50:16 945 -- know when someone adds classes to a product that
20:50:16 946 -- belongs to Oracle. This needs to be checked release to
20:50:16 947 -- release and != clauses will need to be added above to the
20:50:16 948 -- user query.
20:50:16 949
20:50:16 950 procedure dbms_feature_system_ojvm(ojvm_boolean OUT NUMBER,
20:50:16 951 aux_count OUT NUMBER,
20:50:16 952 ojvm_info OUT CLOB) as
20:50:16 953 TYPE data_arr is varray(3) of INTEGER;
20:50:16 954 TYPE user_data is table of data_arr index by varchar(30);
20:50:16 955 owner varchar2(30);
20:50:16 956 otype varchar2(30);
20:50:16 957 tmp_info varchar2(1000);
20:50:16 958 cursor c1 is select owner, object_type
20:50:16 959 from dba_objects where
20:50:16 960 (object_type='JAVA CLASS' or
20:50:16 961 object_type='JAVA RESOURCE' or
20:50:16 962 object_type='JAVA SOURCE') and
20:50:16 963 (owner = 'SYS' or owner = 'SYSTEM' or
20:50:16 964 owner = 'EXFSYS' or owner = 'MDSYS'
20:50:16 965 or owner = 'ORDSYS');
20:50:16 966 ud user_data;
20:50:16 967 begin
20:50:16 968 -- this reflects the number schemas of Oracle products using java.
20:50:16 969 -- OJVM is always installed
20:50:16 970 ojvm_boolean := 1; -- always there.
20:50:16 971 open c1;
20:50:16 972 tmp_info := NULL;
20:50:16 973 aux_count := 0;
20:50:16 974 loop
20:50:16 975 fetch c1 into owner, otype;
20:50:16 976 exit when c1%NOTFOUND or c1%NOTFOUND is null;
20:50:16 977 -- this block will initialize the assoc array the first time it
20:50:16 978 -- is used
20:50:16 979
20:50:16 980 begin
20:50:16 981 if ud(owner).exists(1) then
20:50:16 982 null;
20:50:16 983 end if;
20:50:16 984 exception
20:50:16 985 WHEN NO_DATA_FOUND THEN
20:50:16 986 ud(owner) := data_arr(0,0,0);
20:50:16 987 end;
20:50:16 988
20:50:16 989 case
20:50:16 990 when otype = 'JAVA CLASS' then ud(owner)(1) := ud(owner)(1) + 1;
20:50:16 991 when otype = 'JAVA RESOURCE' then ud(owner)(2) := ud(owner)(2) + 1;
20:50:16 992 when otype = 'JAVA SOURCES' then ud(owner)(3) := ud(owner)(3) + 1;
20:50:16 993 else null;
20:50:16 994 end case;
20:50:16 995 end loop;
20:50:16 996 close c1;
20:50:16 997
20:50:16 998 owner := ud.FIRST;
20:50:16 999 tmp_info := 'System users: ';
20:50:16 1000 while owner is not null loop
20:50:16 1001 aux_count := aux_count + ud(owner)(1) + ud(owner)(2) + ud(owner)(3);
20:50:16 1002 tmp_info := tmp_info || owner || ' with ' ||
20:50:16 1003 ud(owner)(1) || ' classes, ' ||
20:50:16 1004 ud(owner)(2) || ' resources, ' ||
20:50:16 1005 ud(owner)(3) || ' sources. ';
20:50:16 1006 owner := ud.NEXT(owner);
20:50:16 1007 end loop;
20:50:16 1008 ojvm_info := tmp_info;
20:50:16 1009 end;
20:50:16 1010 end;
20:50:16 1011 /
Package body created.
Elapsed: 00:00:00.12
20:50:16 SYS@cndb>
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> CREATE PUBLIC SYNONYM dbms_java FOR dbms_java;
Synonym created.
Elapsed: 00:00:00.01
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> GRANT EXECUTE ON dbms_java TO PUBLIC;
Grant succeeded.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb>
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> create or replace package body dbms_java_definers as
20:50:16 2
20:50:16 3 FUNCTION get_nth_native_compiler_option(n number) return VARCHAR2 as language java name
20:50:16 4 'oracle.aurora.zephyr.CompilerOptions.describeOption(int) return java.lang.String';
20:50:16 5
20:50:16 6 PROCEDURE set_native_compiler_option_(optionName VARCHAR2,
20:50:16 7 value VARCHAR2,
20:50:16 8 owner NUMBER) as language java name
20:50:16 9 'oracle.aurora.zephyr.CompilerOptions.setCompilerOption(java.lang.String,java.lang.String,int)';
20:50:16 10
20:50:16 11
20:50:16 12 FUNCTION decode_native_compiler_option_(optionName VARCHAR2,
20:50:16 13 value VARCHAR2) RETURN VARCHAR2 as language java name
20:50:16 14 'oracle.aurora.zephyr.CompilerOptions.decodeCompilerOption(java.lang.String, java.lang.String) return java.lang.String';
20:50:16 15
20:50:16 16 PROCEDURE unset_native_compiler_option_(optionName VARCHAR2,
20:50:16 17 value VARCHAR2,
20:50:16 18 owner NUMBER) as language java name
20:50:16 19 'oracle.aurora.zephyr.CompilerOptions.unsetCompilerOption(java.lang.String,java.lang.String,int)';
20:50:16 20
20:50:16 21 FUNCTION compile_class_(schema VARCHAR2,
20:50:16 22 classname VARCHAR2) return NUMBER as language java name
20:50:16 23 'oracle.aurora.zephyr.AOTDriver.compileClass(java.lang.String, java.lang.String) return int';
20:50:16 24
20:50:16 25 FUNCTION compile_method_(schema VARCHAR2,
20:50:16 26 classname VARCHAR2,
20:50:16 27 methodname VARCHAR2,
20:50:16 28 methodsig VARCHAR2) return NUMBER as language java name
20:50:16 29 'oracle.aurora.zephyr.AOTDriver.compileMethod(java.lang.String, java.lang.String, java.lang.String, java.lang.String) return int';
20:50:16 30
20:50:16 31 FUNCTION uncompile_class_(schema VARCHAR2,
20:50:16 32 classname VARCHAR2,
20:50:16 33 permanentp NUMBER) return NUMBER as language java name
20:50:16 34 'oracle.aurora.zephyr.AOTDriver.uncompileClass(java.lang.String, java.lang.String, boolean) return int';
20:50:16 35
20:50:16 36
20:50:16 37 FUNCTION uncompile_method_(schema VARCHAR2,
20:50:16 38 classname VARCHAR2,
20:50:16 39 methodname VARCHAR2,
20:50:16 40 methodsig VARCHAR2,
20:50:16 41 permanentp NUMBER) return NUMBER as language java name
20:50:16 42 'oracle.aurora.zephyr.AOTDriver.uncompileMethod(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean) return int';
20:50:16 43
20:50:16 44 end;
20:50:16 45 /
Package body created.
Elapsed: 00:00:00.01
20:50:16 SYS@cndb>
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> --- The following is redundant but needed for the time being by existing
20:50:16 SYS@cndb> --- code, so leave it alone:
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> create or replace
20:50:16 2 FUNCTION dbj_long_name (shortname VARCHAR2) RETURN VARCHAR2
20:50:16 3 as language java name
20:50:16 4 'oracle.aurora.rdbms.DbmsJava.longNameForSQL(java.lang.String)
20:50:16 5 return java.lang.String';
20:50:16 6 /
Function created.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> create or replace function "NameFromLastDDL" (longp number) return varchar2 as
20:50:16 2 language java name 'oracle.aurora.rdbms.DbmsJava.NameFromLastDDL(boolean) return oracle.sql.CHAR';
20:50:16 3 /
Function created.
Elapsed: 00:00:00.01
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> CREATE PUBLIC SYNONYM "NameFromLastDDL" FOR sys."NameFromLastDDL";
Synonym created.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> GRANT EXECUTE ON "NameFromLastDDL" TO PUBLIC;
Grant succeeded.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> create or replace FUNCTION dbj_short_name (longname VARCHAR2)
20:50:16 2 return VARCHAR2 as
20:50:16 3 begin
20:50:16 4 return dbms_java.shortname(longname);
20:50:16 5 end dbj_short_name;
20:50:16 6 /
Function created.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> CREATE PUBLIC SYNONYM dbj_short_name FOR dbj_short_name;
Synonym created.
Elapsed: 00:00:00.01
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> GRANT EXECUTE ON dbj_short_name TO PUBLIC;
Grant succeeded.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> create or replace package body jvmrjbc as
20:50:16 2 function init return VARCHAR2 as
20:50:16 3 sessid VARCHAR2(100);
20:50:16 4 begin
20:50:16 5 loop
20:50:16 6 begin
20:50:16 7 sessid := dbms_pipe.unique_session_name||dbms_crypto.randombytes(35);
20:50:16 8 insert into java$jvm$rjbc values (sessid, null, empty_blob);
20:50:16 9 commit;
20:50:16 10 return sessid;
20:50:16 11 exception when others then
20:50:16 12 if sqlcode not in (-1) then raise; end if;
20:50:16 13 end;
20:50:16 14 end loop;
20:50:16 15 end;
20:50:16 16
20:50:16 17 procedure putpath(sessid VARCHAR2, pathname VARCHAR2) as
20:50:16 18 begin
20:50:16 19 update java$jvm$rjbc set path=pathname where id=sessid;
20:50:16 20 commit;
20:50:16 21 end;
20:50:16 22
20:50:16 23 function getlob(sessid VARCHAR2) return BLOB as
20:50:16 24 lob BLOB;
20:50:16 25 begin
20:50:16 26 select lob into lob from java$jvm$rjbc where id=sessid;
20:50:16 27 return lob;
20:50:16 28 end;
20:50:16 29
20:50:16 30 function getpath(sessid VARCHAR2) return VARCHAR2 as
20:50:16 31 p VARCHAR2(4000);
20:50:16 32 begin
20:50:16 33 select path into p from java$jvm$rjbc where id=sessid;
20:50:16 34 return p;
20:50:16 35 end;
20:50:16 36
20:50:16 37 procedure putlob(sessid VARCHAR2, l BLOB) as
20:50:16 38 tl BLOB;
20:50:16 39 begin
20:50:16 40 select lob into tl from java$jvm$rjbc where id=sessid for update;
20:50:16 41 dbms_lob.trim(tl, 0);
20:50:16 42 dbms_lob.append(tl, l);
20:50:16 43 commit;
20:50:16 44 end;
20:50:16 45
20:50:16 46 procedure done(sessid VARCHAR2) as
20:50:16 47 begin
20:50:16 48 delete from java$jvm$rjbc where id=sessid;
20:50:16 49 commit;
20:50:16 50 end;
20:50:16 51
20:50:16 52 end;
20:50:16 53 /
Package body created.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> GRANT EXECUTE ON jvmrjbc TO PUBLIC;
Grant succeeded.
Elapsed: 00:00:00.01
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> -- support for calling runjava from dbms_java
20:50:16 SYS@cndb> create or replace package body dbms_java_misc as
20:50:16 2 FUNCTION runjava(f NUMBER) RETURN VARCHAR2 as
20:50:16 3 begin
20:50:16 4 return null;
20:50:16 5 end;
20:50:16 6
20:50:16 7 FUNCTION runjava_in_current_session(f NUMBER) RETURN VARCHAR2 as
20:50:16 8 begin
20:50:16 9 return null;
20:50:16 10 end;
20:50:16 11 -- line 13
20:50:16 12 FUNCTION runjava(cmdline VARCHAR2,
20:50:16 13 rjbc_sessid VARCHAR2, rjbc_flags VARCHAR2) RETURN VARCHAR2 as
20:50:16 14 begin
20:50:16 15 return dbms_java_test.funcall('-runjava', ' ', cmdline,
20:50:16 16 rjbc_sessid, rjbc_flags);
20:50:16 17 end;
20:50:16 18
20:50:16 19 FUNCTION runjava_in_current_session(cmdline VARCHAR2,
20:50:16 20 rjbc_sessid VARCHAR2, rjbc_flags VARCHAR2) RETURN VARCHAR2 as
20:50:16 21 begin
20:50:16 22 return dbms_java_test.funcall('-runjava', ' ', cmdline,
20:50:16 23 rjbc_sessid, rjbc_flags, 'x');
20:50:16 24 end;
20:50:16 25
20:50:16 26 end dbms_java_misc;
20:50:16 27 /
Package body created.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> -- make sure dbms_java_misc is not granted
20:50:16 SYS@cndb> begin
20:50:16 2 execute immediate 'revoke execute on sys.dbms_java_misc from public';
20:50:16 3 exception when others
20:50:16 4 then null;
20:50:16 5 end;
20:50:16 6 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb> @@?/javavm/install/jvmpsu1.sql
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem $Header: javavm/install/jvmpsu1.sql /st_javavm_11.2.0.4.0dbpsu/1 2019/03/26 03:54:33 mohshanm Exp $
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem jvmpsu.sql
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem Copyright (c) 2013, 2019, Oracle and/or its affiliates.
20:50:16 SYS@cndb> Rem All rights reserved.
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem NAME
20:50:16 SYS@cndb> Rem jvmpsu.sql - JAVAVM Patch Set Update script
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem DESCRIPTION
20:50:16 SYS@cndb> Rem Script to be run during post-install and post-deinstall in a PSU.
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem NOTES
20:50:16 SYS@cndb> Rem To be run as SYS
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem MODIFIED (MM/DD/YY)
20:50:16 SYS@cndb> Rem nneeluru 10/29/14 - Move all the stuff to jvmpsui.sql
20:50:16 SYS@cndb> Rem nneeluru 10/07/14 - Re-open to fix insert statement
20:50:16 SYS@cndb> Rem nneeluru 10/04/14 - Backport nneeluru_bug-19699946 from main
20:50:16 SYS@cndb> Rem nneeluru 08/16/13 - JAVAVM post-install script for PSU
20:50:16 SYS@cndb> Rem nneeluru 08/16/13 - Created
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem BEGIN SQL_FILE_METADATA
20:50:16 SYS@cndb> Rem SQL_SOURCE_FILE: javavm/install/jvmpsu.sql
20:50:16 SYS@cndb> Rem SQL_SHIPPED_FILE: javavm/install/jvmpsu.sql
20:50:16 SYS@cndb> Rem SQL_PHASE: post-install for a PSU
20:50:16 SYS@cndb> Rem SQL_STARTUP_MODE: NORMAL
20:50:16 SYS@cndb> Rem SQL_IGNORABLE_ERRORS: NONE
20:50:16 SYS@cndb> Rem SQL_CALLING_FILE: catbundle.sql
20:50:16 SYS@cndb> Rem END SQL_FILE_METADATA
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> SET ECHO ON
20:50:16 SYS@cndb> SET FEEDBACK 1
20:50:16 SYS@cndb> SET NUMWIDTH 10
20:50:16 SYS@cndb> SET LINESIZE 80
20:50:16 SYS@cndb> SET TRIMSPOOL ON
20:50:16 SYS@cndb> SET TAB OFF
20:50:16 SYS@cndb> SET PAGESIZE 100
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> variable jvmscript varchar2(50);
20:50:16 SYS@cndb> column :jvmscript new_value jvm_script noprint;
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> declare
20:50:16 2 stat varchar2(30);
20:50:16 3 begin
20:50:16 4 :jvmscript := '?/javavm/install/jvmempty.sql';
20:50:16 5 select status into stat from dba_registry where comp_id = 'JAVAVM';
20:50:16 6 if stat != 'REMOVED' then
20:50:16 7 :jvmscript := '?/javavm/install/jvmpsui.sql';
20:50:16 8 end if;
20:50:16 9 exception when no_data_found then null;
20:50:16 10 end;
20:50:16 11 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> select :jvmscript from dual;
1 row selected.
Elapsed: 00:00:00.00
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> @@&jvm_script
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem $Header: javavm/install/jvmpsui.sql /st_javavm_11.2.0.4.0dbpsu/40 2022/09/01 09:08:53 sbusa Exp $
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem jvmpsui.sql
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem Copyright (c) 2014, 2022, Oracle and/or its affiliates.
20:50:16 SYS@cndb> Rem All rights reserved.
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem NAME
20:50:16 SYS@cndb> Rem jvmpsui.sql - OJVM PSU internal
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem DESCRIPTION
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem NOTES
20:50:16 SYS@cndb> Rem This script does the steps that jvmpsu.sql was doing earlier.
20:50:16 SYS@cndb> Rem It is invoked by jvmpsu.sql if JAVAVM is installed in the database.
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem BEGIN SQL_FILE_METADATA
20:50:16 SYS@cndb> Rem SQL_SOURCE_FILE: javavm/install/jvmpsui.sql
20:50:16 SYS@cndb> Rem SQL_SHIPPED_FILE:
20:50:16 SYS@cndb> Rem SQL_PHASE:
20:50:16 SYS@cndb> Rem SQL_STARTUP_MODE: NORMAL
20:50:16 SYS@cndb> Rem SQL_IGNORABLE_ERRORS: NONE
20:50:16 SYS@cndb> Rem SQL_CALLING_FILE:
20:50:16 SYS@cndb> Rem END SQL_FILE_METADATA
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb> Rem MODIFIED (MM/DD/YY)
20:50:16 SYS@cndb> Rem sbusa 08/30/22 - CI# 34473571 of sbusa_oct22_11.2.0.4_l_jdk7_2
20:50:16 SYS@cndb> Rem sbusa 08/30/22 - from st_javavm_11.2.0.4.0dbpsu.
20:50:16 SYS@cndb> Rem sbusa 08/30/22 - CI# 34473571
20:50:16 SYS@cndb> Rem sbusa 08/30/22 - sbusa_ci_backport_34473555_11.2.0.4.221018ojvmpsu
20:50:16 SYS@cndb> Rem sbusa 05/25/22 - Backport sbusa_july22_11.2.0.4_jdk7 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 02/22/22 - Backport sbusa_l_apr22_11.2.0.4_jdk7 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 11/29/21 - Backport sbusa_jan22_11.2.0.3_jdk7 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 09/03/21 - Backport sbusa_oct21_11.2.0.4_jdk7_2 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 05/27/21 - Backport sbusa_july21_11.2.0.4_jdk7 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 03/25/21 - Backport sbusa_jan21_apr21_11.2.0.4_jdk7 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 08/18/20 - Backport sbusa_oct20_11.2.0.4_jdk7 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 05/22/20 - Backport sbusa_july20_11.2.0.4_jdk7_2 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 02/13/20 - Backport sbusa_apr20_11.2.0.4_jdk7 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 11/26/19 - Backport sbusa_jan20_psu_11.2.0.4_jdk7 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem mohshanm 08/31/19 - Backport mohshanm_octmpsu from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem mohshanm 07/08/19 - Backport mohshanm_jvmpatchissu from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem mohshanm 05/30/19 - Backport mohshanm_psujly from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem mohshanm 04/05/19 - Backport mohshanm_uifix from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem mohshanm 03/25/19 - Backport mohshanm_pilpsu from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 08/23/18 - Backport sbusa_oct18_psu_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem sbusa 05/16/18 - Backport sbusa_july18_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem etucker 02/20/18 - Backport etucker_bug-25649873 from st_javavm_12.1
20:50:16 SYS@cndb> Rem sbusa 02/19/18 - Backport sbusa_apr18_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 11/11/17 - Backport sbusa_jan18_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 08/28/17 - Backport sbusa_oct_17_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 05/29/17 - Backport sbusa_l_july17_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 02/18/17 - Backport sbusa_apr17_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 11/17/16 - Backport sbusa_j17_l_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 09/01/16 - Backport sbusa_o_l_11.2.0.4_jdk6_2 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 05/31/16 - Backport sbusa_j5_l_11.2.0.4_jdk6 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sbusa 02/23/16 - Backport sbusa_javavm_11.2.0.4_java6_april16 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem mohshanm 11/11/15 - Backport mohshanm_psujan_11204 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem mohshanm 09/11/15 - Backport mohshanm_bug-21811517 from
20:50:16 SYS@cndb> Rem st_javavm_11.2.0.4.0dbpsu
20:50:16 SYS@cndb> Rem sgovinda 03/18/15 - fix for bug 20702790
20:50:16 SYS@cndb> Rem sgovinda 12/10/14 - check on jit during deinstall
20:50:16 SYS@cndb> Rem nneeluru 10/29/14 - OJVM PSU post-install internal script
20:50:16 SYS@cndb> Rem nneeluru 10/29/14 - Created
20:50:16 SYS@cndb> Rem
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> SET ECHO ON
20:50:16 SYS@cndb> SET FEEDBACK 1
20:50:16 SYS@cndb> SET NUMWIDTH 10
20:50:16 SYS@cndb> SET LINESIZE 80
20:50:16 SYS@cndb> SET TRIMSPOOL ON
20:50:16 SYS@cndb> SET TAB OFF
20:50:16 SYS@cndb> SET PAGESIZE 100
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> -- do CJS, etc.
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> VARIABLE jitstate VARCHAR2(8);
20:50:16 SYS@cndb> VARIABLE jvmversion VARCHAR2(30);
20:50:16 SYS@cndb> VARIABLE dbtime varchar2(30);
20:50:16 SYS@cndb> VARIABLE cjstime varchar2(30);
20:50:16 SYS@cndb>
20:50:16 SYS@cndb> BEGIN
20:50:16 2
20:50:16 3 :jvmversion := 'NONE';
20:50:16 4 :jitstate := 'FALSE';
20:50:16 5 SELECT value INTO :jitstate FROM v$parameter WHERE name='java_jit_enabled';
20:50:16 6 select nvl((SELECT name FROM obj$ WHERE name like 'JAVA$CBRLS%' and type#=30 and owner#=0), 'NONE') into :jvmversion from dual;
20:50:16 7 select to_char((select startup_time from v$instance),'DD-MON-YYYY HH24:MI:SS') INTO :dbtime from dual;
20:50:16 8 select to_char
20:50:16 9 ((select nvl((SELECT MTIME FROM obj$ WHERE name like 'JAVA$CBRLS%' and type#=30 and owner#=0),to_date('01-JAN-0001','DD-MON-YYYY'))
20:50:16 10 from dual),'DD-MON-YYYY HH24:MI:SS') INTO :cjstime from dual;
20:50:16 11
20:50:16 12
20:50:16 13 EXECUTE IMMEDIATE 'alter system set java_jit_enabled = false';
20:50:16 14
20:50:16 15
20:50:16 16 IF ((not(:jvmaction = 'APPLY' and :jvmversion = 'JAVA$CBRLS$11.2.0.4.221018'))
20:50:16 17 and (not(:jvmaction = 'ROLLBACK' and
20:50:16 18 :jvmversion != 'JAVA$CBRLS$11.2.0.4.221018'))) and
20:50:16 19 (to_date(:cjstime,'DD-MON-YYYY HH24:MI:SS') = to_date ('01-JAN-0001','DD-MON-YYYY HH24:MI:SS')
20:50:16 20 or to_date(:dbtime,'DD-MON-YYYY HH24:MI:SS') > to_date(:cjstime,'DD-MON-YYYY HH24:MI:SS')) THEN
20:50:16 21
20:50:16 22 initjvmaux.drop_sros();
20:50:16 23
20:50:16 24
20:50:16 25 EXECUTE IMMEDIATE 'create or replace java system';
20:50:16 26
20:50:16 27 update dependency$
20:50:16 28 set p_timestamp=(select stime from obj$ where obj#=p_obj#)
20:50:16 29 where (select stime from obj$ where obj#=p_obj#)!=p_timestamp and
20:50:16 30 (select type# from obj$ where obj#=p_obj#)=29 and
20:50:16 31 (select owner# from obj$ where obj#=p_obj#)=0;
20:50:16 32
20:50:16 33
20:50:16 34 -- Check the validity of JAVAVM and let the registry be updated accordingly.
20:50:16 35
20:50:16 36 initjvmaux.validate_javavm;
20:50:16 37
20:50:16 38 -- Add a row in registry$history to indicate this script was run.
20:50:16 39
20:50:16 40 EXECUTE IMMEDIATE 'insert into registry$history
20:50:16 41 (action_time, action, namespace, version, id, comments)
20:50:16 42 values(SYSTIMESTAMP, ''jvmpsu.sql'', ''SERVER'',
20:50:16 43 ''11.2.0.4.221018OJVMPSU'', 0, ''RAN jvmpsu.sql'')';
20:50:16 44
20:50:16 45 END IF;
20:50:16 46
20:50:16 47 EXECUTE IMMEDIATE 'alter system set java_jit_enabled = ' || :jitstate;
20:50:16 48
20:50:16 49 END;
20:50:16 50 /
PL/SQL procedure successfully completed.
Elapsed: 00:02:17.83
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> commit;
Commit complete.
Elapsed: 00:00:00.01
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> -- bug 25649873 create a policy SRO
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> @@jvmsec6
20:52:34 SYS@cndb> -- Create the table now to avoid creation of a lot of
20:52:34 SYS@cndb> -- unneccessary shared objects by the above grant_permissions,
20:52:34 SYS@cndb> -- and redundantly grant something to cause creation of a shared object.
20:52:34 SYS@cndb> call initjvmaux.create_if_not_present('
20:52:34 2 create table java$policy$shared$table (version number)
20:52:34 3 ');
Call completed.
Elapsed: 00:00:00.00
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> call dbms_java.grant_permission('PUBLIC', 'SYS:oracle.aurora.security.JServerPermission', 'DUMMY', '');
Call completed.
Elapsed: 00:00:00.17
20:52:34 SYS@cndb> call dbms_java.revoke_permission('PUBLIC', 'SYS:oracle.aurora.security.JServerPermission', 'DUMMY', '');
Call completed.
Elapsed: 00:00:00.03
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> commit;
Commit complete.
Elapsed: 00:00:00.00
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> begin
20:52:34 2 execute immediate 'drop package SYS.sqljutl2';
20:52:34 3 exception when others
20:52:34 4 then null;
20:52:34 5 end;
20:52:34 6 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> insert into
20:52:34 2 registry$history (action_time, action, namespace, version, id, comments)
20:52:34 3 values (SYSTIMESTAMP, 'APPLY', 'SERVER', '11.2.0.4.221018OJVMPSU',
20:52:34 4 0, 'OJVM PSU post-install');
1 row created.
Elapsed: 00:00:00.00
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> commit;
Commit complete.
Elapsed: 00:00:00.00
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> rem Update registry$history
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> ALTER SESSION SET CURRENT_SCHEMA = SYS;
Session altered.
Elapsed: 00:00:00.00
20:52:34 SYS@cndb> declare
20:52:34 2 lv_insert_stmt varchar2(1000) := 'insert into registry$history (action_time, action, id, comments) values (systimestamp, ''APPLY'', 34412266, ''Patch 34412266 applied'')';
20:52:34 3 begin
20:52:34 4 execute immediate lv_insert_stmt;
20:52:34 5 exception
20:52:34 6 when others then
20:52:34 7 null;
20:52:34 8 end;
20:52:34 9 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
20:52:34 SYS@cndb> commit;
Commit complete.
Elapsed: 00:00:00.00
20:52:34 SYS@cndb> set head off
20:52:34 SYS@cndb> select * from registry$history order by id;
24-AUG-13 12.03.45.119862 PM
APPLY SERVER
11.2.0.4 0
Patchset 11.2.0.2.0
PSU
25-SEP-23 02.36.05.785046 PM
APPLY SERVER
11.2.0.4 0
Patchset 11.2.0.2.0
PSU
29-SEP-23 03.07.20.243489 PM
APPLY SERVER
11.2.0.4.221018OJVMPSU 0
OJVM PSU post-install
25-MAR-24 08.52.34.357935 PM
APPLY SERVER
11.2.0.4.221018OJVMPSU 0
OJVM PSU post-install
25-MAR-24 08.52.33.900187 PM
jvmpsu.sql SERVER
11.2.0.4.221018OJVMPSU 0
RAN jvmpsu.sql
29-SEP-23 02.45.08.922813 PM
APPLY SERVER
11.2.0.4 221018
PSU 11.2.0.4.221018
PSU
29-SEP-23 03.07.20.245345 PM
APPLY
34412266
Patch 34412266 applied
25-MAR-24 08.52.34.360580 PM
APPLY
34412266
Patch 34412266 applied
8 rows selected.
Elapsed: 00:00:00.00
20:52:34 SYS@cndb>
20:52:34 SYS@cndb> 20:52:34 SYS@cndb> 20:52:34 SYS@cndb> 20:52:34 SYS@cndb> 20:52:34 SYS@cndb> 20:52:34 SYS@cndb> 20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:34 SYS@cndb>
20:52:35 SYS@cndb>
20:52:35 SYS@cndb>
20:52:35 SYS@cndb>
20:52:35 SYS@cndb> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
20:53:00 SYS@cndb> startup
ORACLE instance started.
Total System Global Area 4.0353E+10 bytes
Fixed Size 2261928 bytes
Variable Size 5771365464 bytes
Database Buffers 3.4494E+10 bytes
Redo Buffers 85204992 bytes
Database mounted.
Database opened.
20:55:01 SYS@cndb> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/sqlpatch/34412266]$cd $ORACLE_HOME/rdbms/admin
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 25 20:55:17 2024
Copyright (c) 1982, 2013, Oracle. All rights reserved.
20:55:17 @> CONNECT / AS SYSDBA
Connected.
20:55:38 SYS@cndb> SELECT * FROM dba_objects WHERE status = 'INVALID';
OWNER OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
------------------------------ -------------------------------------------------------------------------------------------------------------------------------- ------------------------------ ---------- -------------- -------------------
CREATED LAST_DDL_TIME TIMESTAMP STATUS T G S NAMESPACE EDITION_NAME
------------------- ------------------- ------------------- ------- - - - ---------- ------------------------------
SYS GET_ERROR$ 64995 PACKAGE BODY
2013-08-24 11:46:24 2024-03-25 20:25:07 2024-03-25:20:25:07 INVALID N N N 2
SYS USER_JAVA_COMPILER_OPTIONS 65072 VIEW
2013-08-24 11:46:32 2024-03-25 20:25:07 2024-03-25:20:25:07 INVALID N N N 1
PUBLIC USER_JAVA_COMPILER_OPTIONS 65073 SYNONYM
2013-08-24 11:46:32 2024-03-25 20:25:08 2024-03-25:20:25:08 INVALID N N N 1
SYS ALL_JAVA_COMPILER_OPTIONS 65074 VIEW
2013-08-24 11:46:32 2024-03-25 20:25:07 2024-03-25:20:25:07 INVALID N N N 1
PUBLIC ALL_JAVA_COMPILER_OPTIONS 65075 SYNONYM
2013-08-24 11:46:32 2024-03-25 20:25:08 2024-03-25:20:25:08 INVALID N N N 1
SYS DBA_JAVA_COMPILER_OPTIONS 65076 VIEW
2013-08-24 11:46:32 2024-03-25 20:25:07 2024-03-25:20:25:07 INVALID N N N 1
PUBLIC DBA_JAVA_COMPILER_OPTIONS 65077 SYNONYM
2013-08-24 11:46:32 2024-03-25 20:25:08 2024-03-25:20:25:08 INVALID N N N 1
SYS DBMS_JVM_EXP_PERMS 65496 PACKAGE BODY
2013-08-24 11:46:40 2013-08-24 11:46:40 2013-08-24:11:46:40 INVALID N N N 2
MDSYS SDO_NET 79998 PACKAGE BODY
2013-08-24 11:55:00 2013-08-24 11:55:00 2013-08-24:11:55:00 INVALID N N N 2
9 rows selected.
Elapsed: 00:00:00.03
20:55:47 SYS@cndb> @utlrp.sql
TIMESTAMP
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2024-03-25 20:55:55
Elapsed: 00:00:00.02
20:55:55 DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
20:55:55 DOC> objects in the database. Recompilation time is proportional to the
20:55:55 DOC> number of invalid objects in the database, so this command may take
20:55:55 DOC> a long time to execute on a database with a large number of invalid
20:55:55 DOC> objects.
20:55:55 DOC>
20:55:55 DOC> Use the following queries to track recompilation progress:
20:55:55 DOC>
20:55:55 DOC> 1. Query returning the number of invalid objects remaining. This
20:55:55 DOC> number should decrease with time.
20:55:55 DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
20:55:55 DOC>
20:55:55 DOC> 2. Query returning the number of objects compiled so far. This number
20:55:55 DOC> should increase with time.
20:55:55 DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
20:55:55 DOC>
20:55:55 DOC> This script automatically chooses serial or parallel recompilation
20:55:55 DOC> based on the number of CPUs available (parameter cpu_count) multiplied
20:55:55 DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
20:55:55 DOC> On RAC, this number is added across all RAC nodes.
20:55:55 DOC>
20:55:55 DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
20:55:55 DOC> recompilation. Jobs are created without instance affinity so that they
20:55:55 DOC> can migrate across RAC nodes. Use the following queries to verify
20:55:55 DOC> whether UTL_RECOMP jobs are being created and run correctly:
20:55:55 DOC>
20:55:55 DOC> 1. Query showing jobs created by UTL_RECOMP
20:55:55 DOC> SELECT job_name FROM dba_scheduler_jobs
20:55:55 DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
20:55:55 DOC>
20:55:55 DOC> 2. Query showing UTL_RECOMP jobs that are running
20:55:55 DOC> SELECT job_name FROM dba_scheduler_running_jobs
20:55:55 DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
20:55:55 DOC>#
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.90
TIMESTAMP
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2024-03-25 20:55:58
Elapsed: 00:00:00.01
20:55:58 DOC> The following query reports the number of objects that have compiled
20:55:58 DOC> with errors.
20:55:58 DOC>
20:55:58 DOC> If the number is higher than expected, please examine the error
20:55:58 DOC> messages reported with each object (using SHOW ERRORS) to see if they
20:55:58 DOC> point to system misconfiguration or resource constraints that must be
20:55:58 DOC> fixed before attempting to recompile these objects.
20:55:58 DOC>#
OBJECTS WITH ERRORS
-------------------
0
Elapsed: 00:00:00.00
20:55:58 DOC> The following query reports the number of errors caught during
20:55:58 DOC> recompilation. If this number is non-zero, please query the error
20:55:58 DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
20:55:58 DOC> are due to misconfiguration or resource constraints that must be
20:55:58 DOC> fixed before objects can compile successfully.
20:55:58 DOC>#
ERRORS DURING RECOMPILATION
---------------------------
0
Elapsed: 00:00:00.00
Function created.
Elapsed: 00:00:00.01
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
Function dropped.
Elapsed: 00:00:00.01
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.51
20:56:00 SYS@cndb>
20:56:17 SYS@cndb>
20:56:17 SYS@cndb>
20:56:17 SYS@cndb>
20:56:18 SYS@cndb> SELECT * FROM dba_objects WHERE status = 'INVALID';
no rows selected
Elapsed: 00:00:00.02
20:56:23 SYS@cndb> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$$ORACLE_HOME/OPatch/opatch lspatches;
34412266;OJVM PATCH SET UPDATE 11.2.0.4.221018
34386237;Database Patch Set Update : 11.2.0.4.221018 (34386237)
OPatch succeeded.
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$$ORACLE_HOME/OPatch/opatch lsinventory;
Oracle Interim Patch Installer version 11.2.0.3.39
Copyright (c) 2024, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.39
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2024-03-25_20-56-39PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2024-03-25_20-56-39PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: qian04a
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.
Interim patches (2) :
Patch 34412266 : applied on Fri Sep 29 15:05:36 CST 2023
Unique Patch ID: 24946751
Patch description: "OJVM PATCH SET UPDATE 11.2.0.4.221018"
Created on 23 Sep 2022, 14:08:32 hrs UTC
Bugs fixed:
32523233, 23727132, 19554117, 19006757, 14774730, 18933818, 18458318
18166577, 19231857, 19153980, 19058059, 19007266, 17285560, 17201047
17056813, 19223010, 19852360, 19909862, 19895326, 19374518, 20408829
21047766, 21566944, 19176885, 17804361, 17528315, 21811517, 22253904
19187988, 21911849, 22118835, 22670385, 23265914, 22675136, 24448240
25067795, 24534298, 25076732, 25494379, 26023002, 19699946, 26637592
27000663, 25649873, 27461842, 27952577, 27642235, 28502128, 28915933
29254615, 29774367, 29992392, 29448234, 30160639, 30534664, 30855121
31306274, 30772207, 31476032, 30561292, 28394726, 26716835, 24817447
23082876, 31668867, 32892894, 32720458, 33223294, 33131742, 33563123
33805168, 34149259, 33239083, 28492769, 34473555
Patch 34386237 : applied on Fri Sep 29 14:38:14 CST 2023
Unique Patch ID: 24946740
Patch description: "Database Patch Set Update : 11.2.0.4.221018 (34386237)"
Created on 23 Sep 2022, 01:50:11 hrs UTC
Sub-patch 34057724; "Database Patch Set Update : 11.2.0.4.220719 (34057724)"
Sub-patch 33711103; "Database Patch Set Update : 11.2.0.4.220419 (33711103)"
Sub-patch 33477185; "Database Patch Set Update : 11.2.0.4.220118 (33477185)"
Sub-patch 33128584; "Database Patch Set Update : 11.2.0.4.211019 (33128584)"
Sub-patch 32758711; "Database Patch Set Update : 11.2.0.4.210720 (32758711)"
Sub-patch 32328626; "Database Patch Set Update : 11.2.0.4.210420 (32328626)"
Sub-patch 31983472; "Database Patch Set Update : 11.2.0.4.210119 (31983472)"
Sub-patch 31537677; "Database Patch Set Update : 11.2.0.4.201020 (31537677)"
Sub-patch 31103343; "Database Patch Set Update : 11.2.0.4.200714 (31103343)"
Sub-patch 30670774; "Database Patch Set Update : 11.2.0.4.200414 (30670774)"
Sub-patch 30298532; "Database Patch Set Update : 11.2.0.4.200114 (30298532)"
Sub-patch 29913194; "Database Patch Set Update : 11.2.0.4.191015 (29913194)"
Sub-patch 29497421; "Database Patch Set Update : 11.2.0.4.190716 (29497421)"
Sub-patch 29141056; "Database Patch Set Update : 11.2.0.4.190416 (29141056)"
Sub-patch 28729262; "Database Patch Set Update : 11.2.0.4.190115 (28729262)"
Sub-patch 28204707; "Database Patch Set Update : 11.2.0.4.181016 (28204707)"
Sub-patch 27734982; "Database Patch Set Update : 11.2.0.4.180717 (27734982)"
Sub-patch 27338049; "Database Patch Set Update : 11.2.0.4.180417 (27338049)"
Sub-patch 26925576; "Database Patch Set Update : 11.2.0.4.180116 (26925576)"
Sub-patch 26392168; "Database Patch Set Update : 11.2.0.4.171017 (26392168)"
Sub-patch 26609445; "Database Patch Set Update : 11.2.0.4.170814 (26609445)"
Sub-patch 25869727; "Database Patch Set Update : 11.2.0.4.170718 (25869727)"
Sub-patch 24732075; "Database Patch Set Update : 11.2.0.4.170418 (24732075)"
Sub-patch 24006111; "Database Patch Set Update : 11.2.0.4.161018 (24006111)"
Sub-patch 23054359; "Database Patch Set Update : 11.2.0.4.160719 (23054359)"
Sub-patch 22502456; "Database Patch Set Update : 11.2.0.4.160419 (22502456)"
Sub-patch 21948347; "Database Patch Set Update : 11.2.0.4.160119 (21948347)"
Sub-patch 21352635; "Database Patch Set Update : 11.2.0.4.8 (21352635)"
Sub-patch 20760982; "Database Patch Set Update : 11.2.0.4.7 (20760982)"
Sub-patch 20299013; "Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch 19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch 19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch 18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch 18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch 17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
Bugs fixed:
18619917, 19309466, 28876684, 28855981, 18189036, 19781326, 13609098
16285691, 16756406, 18430495, 17323222, 13854364, 29483723, 19915271
22468255, 19516448, 14458214, 23713236, 23140259, 29434301, 22502493
19540573, 18272672, 16410570, 16494615, 19174430, 21352646, 16901385
16596890, 22243719, 32741584, 18996843, 21387964, 20334344, 17174582
22250006, 17798953, 24307571, 14015842, 18031668, 15955387, 30758943
17391136, 21534893, 16832076, 16065166, 16579084, 25427662, 21179898
24589081, 11786053, 15990359, 17982832, 18685892, 20142975, 24835538
16315398, 20861693, 30018017, 17037130, 17284817, 17643573, 18832544
17891946, 17279227, 17588480, 17291347, 16731148, 21097043, 24528741
22321741, 17165204, 26245237, 17891943, 25205368, 32776891, 17359610
17265217, 17465741, 29621961, 22551446, 31492176, 18191164, 16721594
18614015, 27825893, 18440095, 19769489, 20596234, 25115178, 18482502
16043574, 20936905, 17360606, 22321756, 19211724, 17392698, 19463893
31492164, 29033139, 17477958, 17040764, 18362222, 19463897, 24624166
17853456, 14521849, 17816865, 32190132, 19692824, 21868720, 17951233
25505407, 17040527, 31022191, 24975421, 19888853, 18009564, 20882568
20803583, 23026585, 18604692, 17622427, 34100909, 16903536, 29483771
17865671, 17883081, 16228604, 17325413, 17082359, 30517516, 12747740
22168163, 16091637, 20569094, 31492144, 17468141, 30365745, 29962939
19469538, 29633753, 20598042, 32775512, 16042673, 23302839, 17437634
24473736, 28734355, 19049453, 33027553, 16941434, 20387265, 16833527
21343775, 17297939, 16069901, 34339279, 14285317, 22380919, 18436647
23065323, 31885190, 21983325, 31927930, 17853498, 24790914, 23571055
16542886, 21286665, 17365043, 17752995, 25914276, 17296856, 18783224
22353199, 22083366, 28305362, 21419850, 16180763, 23294548, 26679352
13960236, 33441073, 25328093, 25423453, 18339044, 17282229, 28384353
25600421, 18856999, 31031715, 18259031, 28806384, 21354456, 23725036
31885162, 18471685, 30237239, 17258090, 16344544, 17903598, 17011832
18135678, 18704244, 17786518, 19718981, 25655390, 17242746, 20250147
19197175, 17390431, 17835627, 17672719, 31125948, 17393915, 21566639
18765602, 21425496, 26544823, 22228324, 29962927, 18682983, 30179644
25165496, 12816846, 31885179, 18774543, 31885173, 18747196, 17824637
21834568, 19429927, 21429602, 16524926, 17343514, 19271443, 17019345
18681862, 17186905, 23330119, 17811438, 26474853, 17215560, 16875449
21380789, 17184721, 18508861, 19466309, 33065437, 23330124, 17811429
17019356, 25654936, 17754782, 17752121, 22809871, 17201159, 34100044
18308268, 19777862, 16198143, 29027694, 18828868, 17586955, 28076295
19445860, 26654363, 30200680, 22977256, 16692232, 27374796, 21142837
20869721, 17649265, 24555417, 17847764, 25879656, 21756699, 19697993
28364007, 17787259, 30578221, 23628685, 30252098, 23007241, 27351628
18094246, 18460587, 20031873, 17375354, 21698350, 26513067, 32153619
21538567, 18232865, 22683212, 16450169, 17478145, 17311728, 17648596
17308789, 22836801, 21756677, 33040335, 18674047, 14084247, 19788303
22683225, 27534509, 16833845, 18948177, 32368789, 17205719, 21756661
20004021, 17922254, 13837378, 32368792, 18084625, 17912217, 11883252
24842886, 12982566, 26203182, 14176370, 14764829, 21847223, 16875230
28079127, 22568797, 34088194, 17237521, 29511611, 25635149, 16934803
17848897, 20441797, 20175161, 19831647, 16613964, 17532245, 18334586
17288409, 17341326, 31338362, 17449815, 15913355, 16399083, 27404573
18740837, 20294666, 14565184, 21517440, 17614134, 32222473, 33873839
19854503, 14245531, 16194160, 18325460, 15979965, 30562923, 20671094
29965888, 27870645, 25093656, 18247991, 16912439, 30562936, 17047404
24433711, 19930276, 22092979, 20506715, 31884535, 23003979, 20506706
13871092, 33933784, 19272701, 17397545, 16785708, 19461270, 21051862
13829543, 16220077, 17008068, 18061914, 20448824, 30275359, 18674024
29343156, 19689979, 24411921, 23184013, 30275351, 17596908, 17036973
22175564, 22499356, 17612828, 20725343, 31001455, 28199085, 23194294
17630484, 21051858, 20017509, 21051852, 17767676, 17232014, 22893153
12611721, 25555252, 18356166, 17071721, 19315668, 25764020, 16863422
21051840, 17820741, 17267114, 33106822, 18043064, 21538558, 26243698
20324049, 21612959, 30305880, 16392068, 18744139, 24348685, 26746894
17806696, 18628388, 27302681, 27072923, 14010183, 16595641, 31711889
17080436, 17332800, 20777150, 21453153, 20299015, 18413820, 18264060
16819962, 22465352, 21351877, 21051833, 18673342, 30393318, 30562907
30562909, 29200700, 27441326, 16571443, 18328509, 27567477, 18674465
16422541, 18306996, 19359219, 21424824, 17443671, 17478514, 23054054
21067387, 16268425, 32846272, 17381384, 18723434, 17235750, 23328639
22195448, 24570598, 21172913, 17655240, 18384391, 16992075, 22195441
17025461, 30562891, 16472716, 19289642, 31987278, 21502702, 22195457
20475845, 22148226, 26030218, 18331850, 17945983, 13498382, 24652769
31885230, 18673304, 17610798, 19891090, 25369547, 18456514, 8322815
22657942, 17313525, 17050888, 18317531, 19835133, 17495022, 11733603
18798250, 19285025, 18260550, 17390160, 18316692, 19458377, 14368995
17551063, 21343838, 12905058, 14735792, 28612674, 16855292, 23315889
24480567, 13364795, 33096609, 18235390, 18293054, 32190284, 18673325
30215130, 19393542, 14657740, 17532729, 17393683, 17389192, 17783588
17852463, 19358317, 17441661, 14034426, 28254374, 20631274, 19207117
26569225, 17518652, 24662775, 19475971, 31885201, 18282562, 33232606
30421204, 19896336, 17348614, 19827973, 31883489, 17346671, 31022281
19791273, 32359044, 24476274, 22296366, 13853126, 18273830, 17570606
13558557, 20425790, 26007010, 16685417, 31885223, 18180390, 14692762
18159793, 17027426, 24476265, 23177648, 17851160, 16870214, 18202441
32984679, 17227073, 20657411, 19006849, 22606521, 20506699, 28000269
23536835, 17761775, 20382309, 16306373, 31885213, 17801017, 19680952
16850630, 17694209, 26667015, 17877323, 18230522, 25288078, 24563422
17446237, 17889549, 17551674, 16233738, 22730454, 17571039, 26667023
19972570, 18849970, 21532755, 20860659, 22905130, 21168487, 17016369
21263635, 17231779, 17717883, 21343897, 27710072, 18522509, 23209741
17484731, 21972320, 19972569, 19972568, 17716305, 21059919, 19972566
19972564, 26667032, 17394950, 26318200, 20657441, 17551699, 17006570
18051556, 12364061, 18029658, 17546973, 18262334, 19699191, 30387666
17227277, 32676350, 18018515, 16943711, 18388363, 17982555, 20828947
18098207, 18436307, 19584068, 16898135, 13936038, 19601762, 31010960
14054676, 25505394, 18228645, 29782211, 19013183, 25042823, 17721717
17239687, 25248384, 25634317, 20134113, 20273319, 28501075, 31945038
30624864, 21063322, 31834759, 17344412, 22507210, 32097882, 16354467
21795111, 25505371, 16777840, 25879984, 17811456, 19730508, 17385178
18166013, 17484762, 10136473, 6599380, 20717359, 20296213, 27097854
13955826, 18193833, 17545847, 16837842, 18964939, 19871910, 25505382
14786201, 17811447, 18554763, 21132297, 25957038, 20004087, 17889583
19544839, 26631046, 22507234, 24719736, 18868646, 17042658, 20627866
10088587, 14106803, 13951456, 18139690, 18277454, 13680635, 22750215
25823754, 18554871, 18515268, 20169408, 24908321, 17274537, 17602269
26575788, 31951628, 19032867, 17762296, 14829250, 16929165, 14602788
28849751, 21794615, 18899974, 29944660, 18441944, 14521218, 17811789
34421053, 20074391, 14852021, 17705023, 13645875, 24316947, 16668584
17786278, 25947799, 20879889, 19578350, 28022101, 22594718, 16384983
26439748, 17957017, 19121551, 17570240, 19788842, 18382302, 27086138
21330264, 21197626, 14338435, 13944971, 21656630, 22826067, 18886413
28289945, 17156148, 17936109, 20509482, 27255377, 24717859, 18762750
21526048, 24560906, 18096714, 17238511, 26078387, 27053456, 20144308
25364628, 18244962, 19433930, 20476175, 19297917, 19330795, 31506720
21174504, 18280813, 28819280, 17614227, 28357401, 32335769, 21911701
25809524, 17006183, 18092127, 19727057, 17695685, 26039623, 22820579
20856766, 15861775, 17258582, 21668627, 19487147, 20925795, 28100487
22760679, 26482376, 19554106, 21629064, 18199537, 18091059, 17299889
26999139, 21538485, 17546761, 26336977, 25775213, 18155762, 30803210
31683205, 31194264, 16956380, 19207156, 14705949, 31836113, 23105538
26198926, 19258504, 16314254, 17890099, 17246576, 17655634, 16989630
20067212, 19721304, 25077278, 19490948, 18203835, 18203838, 18973907
18203837, 29483672, 19615136, 17587063, 18000422, 18641451, 18090142
21641760, 17019086, 30559616, 19373893, 18373438, 21820934, 18641461
17346091, 21422580, 22351572, 18604493, 23008056, 22901797, 18610915
22666802, 17892268, 31668061, 17501491, 20907061, 14354737, 17835048
21787056, 22195485, 22782647, 17082983, 23266217, 28362607, 18641419
16618694, 14133975, 22195492, 18331812, 18093615, 24385983, 25897615
20513399, 21281607, 13866822, 18841764, 17600719, 17842825, 20558005
17088068, 9756271, 22195465, 18440047, 32834168, 19211433, 20078186
21515534, 20331945, 22686674, 18384537, 18607546, 34381414, 17254374
18315328, 31172207, 23115139, 28790634, 21394225, 16360112, 22195477
17726838, 18510194, 17571306, 24766121, 17302277, 21842740, 33090781
17551709, 28566241, 26910644, 17634921, 25489607, 16538760
--------------------------------------------------------------------------------
OPatch succeeded.
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$set pagesize 200 linesize 200
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$col time for a30
Usage:
col [options]
Options:
-b, --no-backspaces do not output backspaces
-f, --fine permit forward half line feeds
-p, --pass pass unknown control sequences
-h, --tabs convert spaces to tabs
-x, --spaces convert tabs to spaces
-l, --lines NUM buffer at least NUM lines
-V, --version output version information and exit
-H, --help display this help and exit
col reads from standard input and writes to standard output
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$col action for a15
Usage:
col [options]
Options:
-b, --no-backspaces do not output backspaces
-f, --fine permit forward half line feeds
-p, --pass pass unknown control sequences
-h, --tabs convert spaces to tabs
-x, --spaces convert tabs to spaces
-l, --lines NUM buffer at least NUM lines
-V, --version output version information and exit
-H, --help display this help and exit
col reads from standard input and writes to standard output
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$col version for a30
Usage:
col [options]
Options:
-b, --no-backspaces do not output backspaces
-f, --fine permit forward half line feeds
-p, --pass pass unknown control sequences
-h, --tabs convert spaces to tabs
-x, --spaces convert tabs to spaces
-l, --lines NUM buffer at least NUM lines
-V, --version output version information and exit
-H, --help display this help and exit
col reads from standard input and writes to standard output
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$col BUNDLE_SERIES for a10
Usage:
col [options]
Options:
-b, --no-backspaces do not output backspaces
-f, --fine permit forward half line feeds
-p, --pass pass unknown control sequences
-h, --tabs convert spaces to tabs
-x, --spaces convert tabs to spaces
-l, --lines NUM buffer at least NUM lines
-V, --version output version information and exit
-H, --help display this help and exit
col reads from standard input and writes to standard output
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$col COMMENTS for a40
Usage:
col [options]
Options:
-b, --no-backspaces do not output backspaces
-f, --fine permit forward half line feeds
-p, --pass pass unknown control sequences
-h, --tabs convert spaces to tabs
-x, --spaces convert tabs to spaces
-l, --lines NUM buffer at least NUM lines
-V, --version output version information and exit
-H, --help display this help and exit
col reads from standard input and writes to standard output
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$select to_char(ACTION_TIME,'yyyy-MM-dd hh24:mi:ss') time,action,VERSION,BUNDLE_SERIES,COMMENTS from dba_registry_history;
-bash: syntax error near unexpected token `('
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$
[oracle@qian04a /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin]$sql
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 25 20:56:49 2024
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
set pagesize 200 linesize 200
col time for a30
col action for a15
col version for a30
col BUNDLE_SERIES for a10
col COMMENTS for a40
20:56:50 SYS@cndb> select to_char(ACTION_TIME,'yyyy-MM-dd hh24:mi:ss') time,action,VERSION,BUNDLE_SERIES,COMMENTS from dba_registry_history;
TIME ACTION VERSION BUNDLE_SER COMMENTS
------------------------------ --------------- ------------------------------ ---------- ----------------------------------------
2013-08-24 12:03:45 APPLY 11.2.0.4 PSU Patchset 11.2.0.2.0
2023-09-25 14:36:05 APPLY 11.2.0.4 PSU Patchset 11.2.0.2.0
2023-09-29 14:45:08 APPLY 11.2.0.4 PSU PSU 11.2.0.4.221018
2023-09-29 15:07:20 APPLY 11.2.0.4.221018OJVMPSU OJVM PSU post-install
2023-09-29 15:07:20 APPLY Patch 34412266 applied
2024-03-25 20:52:33 jvmpsu.sql 11.2.0.4.221018OJVMPSU RAN jvmpsu.sql
2024-03-25 20:52:34 APPLY 11.2.0.4.221018OJVMPSU OJVM PSU post-install
2024-03-25 20:52:34 APPLY Patch 34412266 applied
修复后完美解决