Skip to content

Commit

Permalink
Mindre tilpasning
Browse files Browse the repository at this point in the history
  • Loading branch information
jolarsen committed Aug 2, 2024
1 parent 81738c7 commit ebc41d8
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 36 deletions.
13 changes: 13 additions & 0 deletions .oracle/oracle-init/00_initdb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
alter database set TIME_ZONE='Europe/Oslo';
alter database datafile 1 autoextend on maxsize 2G;
alter system set recyclebin=OFF DEFERRED;
alter system set processes=150 scope=spfile;
alter system set session_cached_cursors=100 scope=spfile;
alter system set session_max_open_files=100 scope=spfile;
alter system set sessions=100 scope=spfile;
alter system set license_max_sessions=100 scope=spfile;
alter system set license_sessions_warning=100 scope=spfile;
alter system set disk_asynch_io=FALSE scope=spfile;
alter system set open_cursors=300 scope=both sid='*';
alter profile default limit password_life_time unlimited;
alter profile default limit password_verify_function null;
83 changes: 83 additions & 0 deletions .oracle/oracle-init/01_fplos.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
DECLARE
userexists INTEGER;
BEGIN
SELECT count(*)
INTO userexists
FROM SYS.ALL_USERS
WHERE USERNAME = 'FPLOS';
IF (userexists = 0)
THEN
EXECUTE IMMEDIATE ('CREATE USER FPLOS IDENTIFIED BY fplos PROFILE DEFAULT ACCOUNT UNLOCK');
END IF;
END;
/

DECLARE
userexists INTEGER;
BEGIN
SELECT count(*)
INTO userexists
FROM SYS.ALL_USERS
WHERE USERNAME = 'FPLOS_UNIT';
IF (userexists = 0)
THEN
EXECUTE IMMEDIATE ('CREATE USER FPLOS_UNIT IDENTIFIED BY fplos_unit PROFILE DEFAULT ACCOUNT UNLOCK');
END IF;
END;
/

DECLARE
userexists INTEGER;
BEGIN
SELECT count(*)
INTO userexists
FROM SYS.ALL_USERS
WHERE USERNAME = 'VL_DBA';
IF (userexists = 0)
THEN
EXECUTE IMMEDIATE ('CREATE USER VL_DBA IDENTIFIED BY vl_dba PROFILE DEFAULT ACCOUNT UNLOCK');
END IF;
END;
/

-- 1 Role for vl_dba
GRANT DBA TO VL_DBA;
ALTER USER VL_DBA DEFAULT ROLE ALL;

-- 2 System Privileges for vl_dba
GRANT CREATE SESSION TO VL_DBA;
GRANT UNLIMITED TABLESPACE TO VL_DBA;

GRANT
CREATE SESSION,
ALTER SESSION,
CONNECT,
RESOURCE,
CREATE MATERIALIZED VIEW,
CREATE JOB,
CREATE TABLE,
CREATE SYNONYM,
CREATE VIEW,
CREATE SEQUENCE,
UNLIMITED TABLESPACE,
SELECT ANY TABLE
TO FPLOS;

GRANT
CREATE SESSION,
ALTER SESSION,
CONNECT,
RESOURCE,
CREATE MATERIALIZED VIEW,
CREATE JOB,
CREATE TABLE,
CREATE SYNONYM,
CREATE VIEW,
CREATE SEQUENCE,
UNLIMITED TABLESPACE,
SELECT ANY TABLE
TO FPLOS_UNIT;

ALTER USER FPLOS QUOTA UNLIMITED ON SYSTEM;
ALTER USER FPLOS_UNIT QUOTA UNLIMITED ON SYSTEM;

35 changes: 0 additions & 35 deletions .oracle/oracle-init/fplos.sql

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void testHentingAvEventerVedBehandlingId() {
}

private Long setupOppgaveMedEgenskaper(AndreKriterierType... kriterier) {
Long saksnummer = (long) (Math.random() * 10000);
var saksnummer = (long) (Math.random() * 10000);
var oppgave = Oppgave.builder().dummyOppgave(AVDELING_DRAMMEN_ENHET).medFagsakSaksnummer(saksnummer).build();
entityManager.persist(oppgave);
for (var kriterie : kriterier) {
Expand Down

0 comments on commit ebc41d8

Please sign in to comment.