PREIN
/bin/sh
/usr/sbin/groupadd -r -f oinstall >/dev/null 2>&1 ||:
/usr/sbin/groupadd -r -f dba >/dev/null 2>&1 ||:
/usr/sbin/groupadd -r -f oper >/dev/null 2>&1 ||:
/usr/sbin/useradd -g oinstall -G dba,oper \
-c "Oracle database server" -n oracle >/dev/null 2>&1 ||:
/bin/su - oracle -c "ssh-keygen -t dsa -b 2048 -C 'Autogenerated key' -f ~/.ssh/id_dsa -N '' -q" ||:
if [ ! -f /etc/oraInst.loc ]
then
echo "inventory_loc=/opt/oracle/oraInventory" > /etc/oraInst.loc
echo "inst_group=oinstall" >> /etc/oraInst.loc
chown oracle:oinstall /etc/oraInst.loc
echo "File /etc/oraInst.loc created."
fi
if [ ! -f /etc/oratab ]
then
echo "# Oracle instances" >> /etc/oratab
chown oracle:oinstall /etc/oratab
echo "File /etc/oratab created."
fi
PREUN
/bin/sh
/usr/sbin/preun_service oracle-lsnr
/usr/sbin/preun_service oracle-db