Skip to content

Determine if database is up #179

Answered by gvenzl
pmulgaonkar asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @pmulgaonkar,

Thanks a lot for using these images!

The container provides a healthcheck.sh script that will tell you the state of the database. Depending on your requirements, you can invoke it from the shell or other script to see whether the database is up or not. If the database instance is up, it will return 0, otherwise 1.

For example:

[gvenzl@localhost oci-oracle-xe]$ podman run -d --name test -e ORACLE_RANDOM_PASSWORD=y gvenzl/oracle-xe:latest
78f0ee7bb9bc939ccabd1a2e68501d0dc70a723fd1623ffd6f9da149ec284514
[gvenzl@localhost oci-oracle-xe]$
[gvenzl@localhost oci-oracle-xe]$
[gvenzl@localhost oci-oracle-xe]$
[gvenzl@localhost oci-oracle-xe]$ podman exec test healthcheck.sh && ec…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gvenzl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants