Skip to content

Commit

Permalink
HHH-17315 Reduce Oracle database user privileges to avoid cross schem…
Browse files Browse the repository at this point in the history
…as clashes
  • Loading branch information
loiclefevre authored and beikov committed Dec 1, 2023
1 parent 6b82346 commit 0ffe0af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docker_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ oracle_atps() {
export SERVICE=$(echo $INFO | jq -r '.database' | jq -r '.service')
export PASSWORD=$(echo $INFO | jq -r '.database' | jq -r '.password')

curl -s -X POST "https://${HOST}.oraclecloudapps.com/ords/admin/_/sql" -H 'content-type: application/sql' -H 'accept: application/json' -basic -u admin:${PASSWORD} --data-ascii "create user hibernate_orm_test_$RUNID identified by \"Oracle_19_Password\" DEFAULT TABLESPACE DATA TEMPORARY TABLESPACE TEMP;alter user hibernate_orm_test_$RUNID quota unlimited on data;grant pdb_dba to hibernate_orm_test_$RUNID;BEGIN ords_admin.enable_schema(p_enabled => TRUE, p_schema => 'hibernate_orm_test_$RUNID', p_url_mapping_type => 'BASE_PATH', p_url_mapping_pattern => 'hibernate_orm_test_$RUNID', p_auto_rest_auth => TRUE); END;"
curl -s -X POST "https://${HOST}.oraclecloudapps.com/ords/admin/_/sql" -H 'content-type: application/sql' -H 'accept: application/json' -basic -u admin:${PASSWORD} --data-ascii "create user hibernate_orm_test_$RUNID identified by \"Oracle_19_Password\" DEFAULT TABLESPACE DATA TEMPORARY TABLESPACE TEMP;alter user hibernate_orm_test_$RUNID quota unlimited on data;grant CREATE SESSION, RESOURCE, CREATE VIEW, CREATE SYNONYM, CREATE ANY INDEX, EXECUTE ANY TYPE to hibernate_orm_test_$RUNID;"
}

oracle_db19c() {
Expand All @@ -746,7 +746,7 @@ oracle_db19c() {
/home/opc/sqlcl/bin/sql -s system/$PASSWORD@$HOST:1521/$SERVICE <<EOF
create user hibernate_orm_test_$RUNID identified by "Oracle_19_Password" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
alter user hibernate_orm_test_$RUNID quota unlimited on users;
grant all privileges to hibernate_orm_test_$RUNID;
grant CREATE SESSION, RESOURCE, CREATE VIEW, CREATE SYNONYM, CREATE ANY INDEX, EXECUTE ANY TYPE to hibernate_orm_test_$RUNID;
EOF

}
Expand All @@ -761,7 +761,7 @@ oracle_db21c() {
/home/opc/sqlcl/bin/sql -s system/$PASSWORD@$HOST:1521/$SERVICE <<EOF
create user hibernate_orm_test_$RUNID identified by "Oracle_21_Password" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
alter user hibernate_orm_test_$RUNID quota unlimited on users;
grant all privileges to hibernate_orm_test_$RUNID;
grant CREATE SESSION, RESOURCE, CREATE VIEW, CREATE SYNONYM, CREATE ANY INDEX, EXECUTE ANY TYPE to hibernate_orm_test_$RUNID;
EOF
}

Expand All @@ -775,7 +775,7 @@ oracle_db23c() {
/home/opc/sqlcl/bin/sql -s system/$PASSWORD@$HOST:1521/$SERVICE <<EOF
create user hibernate_orm_test_$RUNID identified by "Oracle_23_Password" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
alter user hibernate_orm_test_$RUNID quota unlimited on users;
grant all privileges to hibernate_orm_test_$RUNID;
grant DB_DEVELOPER_ROLE to hibernate_orm_test_$RUNID;
EOF
}

Expand Down

0 comments on commit 0ffe0af

Please sign in to comment.