odb service (#2)

* Create odb.service
* Create odb-start.sh
* Create odb-stop.sh
This commit is contained in:
Tekaoh
2019-09-25 21:52:50 -05:00
committed by GitHub
parent 1cb122581a
commit 6566789c3e
5 changed files with 55 additions and 2 deletions

18
odb-start.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
export TMP=/tmp;
export TMPDIR=$TMP;
export ORACLE_HOSTNAME=swg;
export ORACLE_BASE=/u01/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/18/dbhome_1;
export ORACLE_SID=swg;
export ORACLE_UNQNAME=$ORACLE_SID;
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH;
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64;
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
lsnrctl start
sqlplus "/as sysdba" << EOF
startup;
exit;
EOF

18
odb-stop.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
export TMP=/tmp;
export TMPDIR=$TMP;
export ORACLE_HOSTNAME=swg;
export ORACLE_BASE=/u01/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/18/dbhome_1;
export ORACLE_SID=swg;
export ORACLE_UNQNAME=$ORACLE_SID;
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH;
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64;
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
sqlplus "/as sysdba" << EOF
shutdown;
exit;
EOF
lsnrctl stop

17
odb.service Normal file
View File

@@ -0,0 +1,17 @@
[Unit]
Description=Oracle Database Autostart
After=syslog.target network.target
[Service]
LimitMEMLOCK=infinity
LimitNOFILE=65536
Type=simple
RemainAfterExit=yes
User=oracle
Group=oinstall
ExecStart=/etc/odb-start.sh >> /home/oracle/odbstart.log 2>&1
ExecStop=/etc/odb-stop.sh >> /home/oracle/odbstop.log 2>&1
[Install]
WantedBy=multi-user.target

View File

@@ -1,4 +1,4 @@
#/bin/bash
#!/bin/bash
#Install the dependencies
echo 'deb [trusted=yes] http://cz.archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list.d/extra.list

View File

@@ -1,4 +1,4 @@
#/bin/bash
#!/bin/bash
cd /u01/app/oracle/product/18/dbhome_1/lib/stubs
rm libc.*