Skip to content

Commit

Permalink
Merge 39e9aff into daaceb4
Browse files Browse the repository at this point in the history
  • Loading branch information
jgebal committed Jan 14, 2019
2 parents daaceb4 + 39e9aff commit 52ee31a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/userguide/install.md
Expand Up @@ -80,6 +80,8 @@ sqlplus sys/sys_pass@db as sysdba @install_headless.sql utp3 my_verySecret_passw

The script needs to be executed by `SYSDBA`, in order to grant access to `DBMS_LOCK` and `DBMS_CRYPTO` system packages.

*Note:* Grant on `DBMS_LOCK` is required on Oracle versions below 18c


# Recommended Schema
It is highly recommended to install utPLSQL in it's own schema. You are free to choose any name for this schema.
Expand Down
7 changes: 5 additions & 2 deletions source/check_object_grants.sql
@@ -1,6 +1,9 @@
declare
c_expected_grants constant dbmsoutput_linesarray := dbmsoutput_linesarray('DBMS_LOCK','DBMS_CRYPTO');

$if dbms_db_version.version >= 18 $then
c_expected_grants constant dbmsoutput_linesarray := dbmsoutput_linesarray('DBMS_CRYPTO');
$else
c_expected_grants constant dbmsoutput_linesarray := dbmsoutput_linesarray('DBMS_LOCK','DBMS_CRYPTO');
$end
l_missing_grants varchar2(4000);
l_target_table varchar2(128);
l_owner_column varchar2(128);
Expand Down
6 changes: 5 additions & 1 deletion source/core/output_buffers/ut_output_table_buffer.tpb
Expand Up @@ -123,7 +123,11 @@ create or replace type body ut_output_table_buffer is

--nothing fetched from output, wait and try again
if l_buffer_data.count = 0 then
dbms_lock.sleep(l_sleep_time);
$if dbms_db_version.version >= 18 $then
dbms_session.sleep(l_sleep_time);
$else
dbms_lock.sleep(l_sleep_time);
$end
l_already_waited_for := l_already_waited_for + l_sleep_time;
if l_already_waited_for > lc_long_wait_time then
l_sleep_time := lc_long_sleep_time;
Expand Down
9 changes: 8 additions & 1 deletion source/create_utplsql_owner.sql
Expand Up @@ -31,7 +31,14 @@ create user &ut3_user identified by "&ut3_password" default tablespace &ut3_tabl

grant create session, create sequence, create procedure, create type, create table, create view, create synonym to &ut3_user;

grant execute on dbms_lock to &ut3_user;
begin
$if dbms_db_version.version < 18 $then
execute immediate 'grant execute on dbms_lock to &ut3_user';
$else
null;
$end
end;
/

grant execute on dbms_crypto to &ut3_user;

Expand Down
6 changes: 5 additions & 1 deletion test/core/annotations/test_annotation_manager.pkb
Expand Up @@ -124,7 +124,11 @@ create or replace package body test_annotation_manager is
ut3.ut_annotation_manager.rebuild_annotation_cache(user,'PACKAGE');
recompile_dummy_package();
l_start_date := sysdate;
dbms_lock.sleep(1);
$if dbms_db_version.version >= 18 $then
dbms_session.sleep(1);
$else
dbms_lock.sleep(1);
$end
--Act
ut3.ut_annotation_manager.rebuild_annotation_cache(user,'PACKAGE');
--Assert
Expand Down
6 changes: 5 additions & 1 deletion test/core/test_ut_executable.pkb
Expand Up @@ -70,7 +70,11 @@ create or replace package body test_ut_executable is
auto_drop => TRUE,
comments => 'one-time job'
);
dbms_lock.sleep(0.4);
$if dbms_db_version.version >= 18 $then
dbms_session.sleep(0.4);
$else
dbms_lock.sleep(0.4);
$end
while l_cnt > 0 loop
select count(1) into l_cnt
from dba_scheduler_running_jobs srj
Expand Down

0 comments on commit 52ee31a

Please sign in to comment.