Comments (3)
I went through the same path not so long ago...
If you build the container image yourself (using the Dockerfile from this repo), then it should work as documented.
The first time you start a container, the database will be expanded and the startup script will run.
However, the image on the Oracle Container Registry is slightly different: the database is already expanded in the image which makes that the startup scripts won't run when a container is instantiated.
The benefit of that is that it starts a bit faster at the expense of a larger container image (that is: the OCR image is larger than the one you would build yourself).
WRT your workaround, I would recommend to touch
a file in /opt/oracle/oradata/
for persistence.
/opt/oracle/oradata/
is typically a mounted volume, while the Oracle home isn't.
@gvenzl / @IshaanDesai45, if the above is expected behavior, can we update the README on OCR to make it clear that startup scripts aren't run on the pre-built image?
from docker-images.
For anyone interested, as a workaround, I've actually put my database setup Bash script in /opt/oracle/scripts/startup
, which is sourced every time the container starts, as it should, and in order to ensure that the setup actions in the script will execute only the first time the container runs, I just check for the existence of a dummy "database initialised" indicator file that is created by the script in the user's home directory and, if it exists, the script just exits without further actions, as shown below:
#!/usr/bin/env bash
DB_INITIALISED="/opt/oracle/oradata/dbinit"
[ -f ${DB_INITIALISED} ] && exit
touch ${DB_INITIALISED}
# Do actual database setup stuff with sqlplus from this point onwards, e.g. sourcing any additional sql scripts!
from docker-images.
WRT your workaround, I would recommend to
touch
a file in/opt/oracle/oradata/
for persistence./opt/oracle/oradata/
is typically a mounted volume, while the Oracle home isn't.
Indeed, I've updated my comment accordingly, thanks for the tip!
from docker-images.
Related Issues (20)
- oracle docker 19 ee, when server shutdown cause oracle creating database, cause all data lost.
- Error occur when installing Oracle 21.3.0 in ubuntu 18 HOT 3
- Oracle DB: buildContainerImage.sh should check container architecture, not host architecture
- dockerfile:174 error is an error code, but I don't know which configuration part the error is in. HOT 5
- Cannot download repomd.xml
- README update for placing OPatch zip filename in extensions/patching/patches/one_offs directory
- docker version check warning for `-ce` HOT 2
- RMAN backup and restore to a specific point in time -> getting RMAN-06025 errors HOT 3
- Unable to pull oracle/weblogic:12.1.3-developer image HOT 2
- Creation of OracleDatabase 21c errors with out of memory HOT 2
- oracle 19c image doesn't work :LRM-00109: could not open parameter file HOT 1
- Request to change instances of "PDB_ADMIN" to "PDBADMIN" in documentation/READMEs
- Building Oracle EE arm64 on x86 with docker buildx fails
- The Oracle port has not been modified
- Can DB_DOMAIN in OracleDatabase/SingleInstance? HOT 2
- How to use yum when running scripts after setup HOT 6
- any plan to support of oracle instant client with oraclelinux 9 HOT 1
- Unable to create multiple replicas on kubernetes cluster HOT 2
- Install manually oracle-database-preinstall-19c HOT 1
- Reuse Existing Database Files When Re-creating an Oracle 19c Container HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-images.