Skip to content

script that waits for oracledb to be ready for use then executes a command

License

Notifications You must be signed in to change notification settings

01000111Maghamez/wait-for-oracledb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Execute script when Oracle DB is ready for use

The goal of this project is to provide a way of detecting when an oracle db is ready for use then running a command when it is. This is currently done using the wait-for-oracledb.sh script which will try to select from the V$INSTANCE view and get the status of the instance specified. The script accepts some options to configure the connection to the database. The default options are configured for a containerized oracle 12.2 db running with the default options. The script is useful for running containers that depend on an oracle db.

Getting Started

To get started, clone this repo and ensure the prerequiste packages are installed.

Prerequisites

Installing

Make sure the directory where the oracle instant client basiclite libraries are is part of your LD_LIBRARY_PATH LD_LIBRARY_PATH=/path/to/basiclite/libraries:"${LD_LIBRARY_PATH}"

Also make sure that sqlplus is your PATH PATH=/path/to/sqlplus/binary:"${PATH}"

Usage

./wait-for-oracledb.sh [-h host] [-S sid] [-D domain] [-u user] [-p password] [-R role] [-I poll_interval] command [args]

The script can accept a variety of options, but they default to values set as the defaults for the oracle db 12.2 image. The only required argument is the command which will be run when the db is in a ready state.

example ./wait-for-oracledb.sh echo 'The database is ready to for use.'

Options

  • -h host - specify a host. default: localhost
  • -S sid - specify database sid. default: ORCLCDB
  • -D domain - database domain server. default: localdomain
  • -u user - database user used for checking instance status. default: sys
  • -p password - database user password. default: Oradoc_db1
  • -R role - database user role. default: sysdba
  • -I poll_interval - how long should the process sleep between polls of instance status. default: 5 seconds

Examples

See the examples folder for usage examples

About

script that waits for oracledb to be ready for use then executes a command

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages