2
2
3
3
# Prevent owner issues on mounted folders
4
4
chown -R oracle:dba /u01/app/oracle
5
+ rm -f /u01/app/oracle/product
6
+ ln -s /u01/app/oracle-product /u01/app/oracle/product
5
7
# Update hostname
6
8
sed -i -E " s/HOST = [^)]+/HOST = $HOSTNAME /g" /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
9
+ sed -i -E " s/PORT = [^)]+/PORT = 1521/g" /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
7
10
echo " export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe" > /etc/profile.d/oracle-xe.sh
8
11
echo " export PATH=\$ ORACLE_HOME/bin:\$ PATH" >> /etc/profile.d/oracle-xe.sh
9
12
echo " export ORACLE_SID=XE" >> /etc/profile.d/oracle-xe.sh
@@ -14,8 +17,16 @@ case "$1" in
14
17
# Check for mounted database files
15
18
if [ " $( ls -A /u01/app/oracle/oradata) " ]; then
16
19
echo " found files in /u01/app/oracle/oradata Using them instead of initial database"
20
+ echo " XE:$ORACLE_HOME :N" >> /etc/oratab
21
+ chown oracle:dba /etc/oratab
22
+ chown 664 /etc/oratab
23
+ printf " ORACLE_DBENABLED=false\nLISTENER_PORT=1521\nHTTP_PORT=8080\nCONFIGURE_RUN=true\n" > /etc/default/oracle-xe
24
+ rm -rf /u01/app/oracle-product/11.2.0/xe/dbs
25
+ ln -s /u01/app/oracle/dbs /u01/app/oracle-product/11.2.0/xe/dbs
17
26
else
18
27
echo " Database not initialized. Initializing database."
28
+ mv /u01/app/oracle-product/11.2.0/xe/dbs /u01/app/oracle/dbs
29
+ ln -s /u01/app/oracle/dbs /u01/app/oracle-product/11.2.0/xe/dbs
19
30
printf 8080\\ n1521\\ noracle\\ noracle\\ ny\\ n | /etc/init.d/oracle-xe configure
20
31
echo " Database initialized. Please visit http://#containeer:8080/apex to proceed with configuration"
21
32
fi
0 commit comments