Warning, file /sdk/codevis/thirdparty/soci/scripts/ci/install_oracle.sh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #!/usr/bin/env bash
0002 # Sets up Oracle database for SOCI Oracle backend CI builds.
0003 #
0004 source ${SOCI_SOURCE_DIR}/scripts/ci/common.sh
0005 
0006 docker run --name ${ORACLE_CONTAINER} --detach --publish 1521:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g-r2
0007 
0008 echo 'Waiting for Oracle startup...'
0009 num_tries=1
0010 wait_time=6 # seconds
0011 while true; do
0012     if oracle_exec /etc/init.d/oracle-xe status | grep -q 'Instance "XE", status READY'; then
0013         if echo "SELECT STATUS, DATABASE_STATUS FROM V\$INSTANCE WHERE INSTANCE_NAME='XE';" | \
0014             oracle_sqlplus sys/oracle AS SYSDBA | grep -q 'OPEN'; then
0015             echo 'Oracle database is available now'
0016             break
0017         fi
0018     fi
0019 
0020     if [[ $num_tries -gt 50 ]]; then
0021         echo 'Timed out waiting for Oracle startup'
0022         break
0023     fi
0024 
0025     echo "Waiting $wait_time more seconds (attempt #$num_tries)"
0026     sleep $wait_time
0027     ((num_tries++))
0028 done
0029 
0030 echo 'Oracle log:'
0031 docker logs --timestamps ${ORACLE_CONTAINER}
0032 echo 'Oracle global status:'
0033 oracle_exec /etc/init.d/oracle-xe status
0034 echo 'Oracle instance status:'
0035 echo 'SELECT INSTANCE_NAME, STATUS, DATABASE_STATUS FROM V$INSTANCE;' | \
0036 oracle_sqlplus sys/oracle AS SYSDBA
0037 
0038 # Copy Oracle directory, notably containing the headers and the libraries
0039 # needed for the compilation, from the container.
0040 sudo mkdir -p ${ORACLE_HOME}
0041 sudo docker cp ${ORACLE_CONTAINER}:${ORACLE_HOME} ${ORACLE_HOME}/..