Skip to content

Commit 11c4d58

Browse files
authored
Merge pull request #280 from yahonda/fix-dbms-lock-grant
Grant execute on dbms_lock as SYS
2 parents 416e451 + 476bdd2 commit 11c4d58

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

ci/setup_accounts.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ sqlplus system/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME} <<SQL
77
@@spec/support/create_arunit_user.sql
88
exit
99
SQL
10+
11+
# `grant execute on dbms_lock` requires SYS in 12c+; SYSTEM no longer has the
12+
# privilege. Run it through a separate `as sysdba` session so the same script
13+
# works on both gvenzl/oracle-xe:11 and gvenzl/oracle-free.
14+
sqlplus -s sys/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME} as sysdba <<SQL
15+
whenever sqlerror exit failure
16+
grant execute on dbms_lock to hr;
17+
exit
18+
SQL
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
create user hr identified by hr;
22
alter user hr identified by hr account unlock;
33
grant dba to hr;
4-
grant execute on dbms_lock to hr;

0 commit comments

Comments
 (0)