A quick and easy way to restore an Oracle DB dump for local development
You need to build official Oracle docker image for Oracle DB 12.1.0.2 for this setup, if you haven't done so already.
-
Clone the official oracle/docker-images repository
-
Download required files into
OracleDatabase/SingleInstance/dockerfiles/12.1.0.2
- Go to the Oracle Database 12c Release 1 (12.1.0.2.0) for Linux download page
- Download
linuxamd64_12c_database_1of2.zip
- Download
linuxamd64_12c_database_2of2.zip
-
Build the 12.1.02 Enterprise Edition image
cd OracleDatabase/SingleInstance/dockerfiles ./buildDockerImage.sh -v 12.1.0.2 -e
Docker for Mac / Docker for Windows
Make sure to increase the RAM (at least 8GB) and (if necessary) the disk size of the Docker VM!
-
Download this repo as zip
-
Unpack
-
Rename the unpacked folder to something more meaningful, e.g.
project_db
-
Place your Oracle
expdp
dump file in./dump
.
The file must be nameddump.dmp
. -
Tweak
docker-compose.yml
- make sure that
SOURCE_SCHEMA
andSOURCE_TABLESPACE
match the schema and tablespace of the dump - you may want to additionally exclude
GRANT
:EXCLUDE=USER,GRANT
, if your dump contains them
(If you don't know, ask the DBA that created the dump. Or try to import and check the errors in
./dump/import.log
) - make sure that
-
(optional) Add additional setup files to
setup-scripts
(initial setup supports*.sql
or*.sh
files, they are executed in order) -
cd project_db docker-compose up
-
Grab a pint of ☕ and wait until the database setup including dump import is done.
The password for all Oracle system accounts (SYSTEM
, SYS
, PDBADMIN
) is oracle
The db.*
properties for SAP Commerce are:
db.url=jdbc:oracle:thin:@localhost:1521/ORCLPDB1
db.driver=oracle.jdbc.driver.OracleDriver
db.username=localdev
db.password=localdev
Don't forget to place the
ojdbc*.jar
(Download here) inhybris/bin/platform/lib/dbdriver
!