-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build a development database using a Docker container based on oracle…
…/database:12.1.0.2-ee The oracle/database:12.1.0.2-ee image can be created by using Oracles script from https://github.com/oracle/docker-images/tree/master/OracleDatabase. Be careful: You need a separate download of the database installation files. Then use the Maven docker plugin to create and provide a custom DOAG2016 image. See: https://fabric8io.github.io/docker-maven-plugin/
- Loading branch information
1 parent
4807ce1
commit 43f32ba
Showing
4 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
-- Change to PDB which was created inside parent iamge | |||
ALTER SESSION SET CONTAINER = ORCLPDB1; | |||
|
|||
-- Enable Enterprise Manager Express on port 5501 | |||
EXEC dbms_xdb_config.sethttpsport(5501); | |||
|
|||
-- Create table space for demo application | |||
DECLARE | |||
v_ts_id V$TABLESPACE.TS#%TYPE; | |||
BEGIN | |||
SELECT TS# into v_ts_id FROM V$TABLESPACE WHERE name = 'DOAG2016'; | |||
EXCEPTION | |||
WHEN no_data_found THEN | |||
EXECUTE IMMEDIATE | |||
'CREATE SMALLFILE TABLESPACE "DOAG2016" ' || | |||
' DATAFILE ''/opt/oracle/oradata/ORCLCDB/ORCLPDB1/doag2016-1.dbf'' SIZE 512M AUTOEXTEND ON NEXT 128M MAXSIZE 1024M ' || | |||
' LOGGING ' || | |||
' DEFAULT NOCOMPRESS ' || | |||
' ONLINE ' || | |||
' EXTENT MANAGEMENT LOCAL AUTOALLOCATE ' || | |||
' SEGMENT SPACE MANAGEMENT AUTO'; | |||
END; | |||
/ | |||
|
|||
-- Create doag2016 user | |||
DECLARE | |||
v_id DBA_USERS.USER_ID%TYPE; | |||
BEGIN | |||
SELECT USER_ID INTO v_id FROM DBA_USERS WHERE username = 'DOAG2016'; | |||
EXCEPTION | |||
WHEN no_data_found THEN | |||
EXECUTE IMMEDIATE | |||
'CREATE USER doag2016 IDENTIFIED BY doag2016 PROFILE "DEFAULT" ACCOUNT UNLOCK DEFAULT TABLESPACE "DOAG2016" TEMPORARY TABLESPACE "TEMP"'; | |||
END; | |||
/ | |||
|
|||
GRANT "CONNECT" TO doag2016; | |||
GRANT "DBA" TO doag2016; | |||
|
|||
EXIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
#!/bin/bash | |||
|
|||
echo 'Initialising database' | |||
|
|||
export ORACLE_SID=ORCLCDB | |||
|
|||
sqlplus / as sysdba @/var/tmp/scripts/create_tablespace_and_user.sql | |||
|
|||
echo 'Tablespace and user created' |