odb service (#2)
* Create odb.service * Create odb-start.sh * Create odb-stop.sh
This commit is contained in:
18
odb-start.sh
Normal file
18
odb-start.sh
Normal 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
18
odb-stop.sh
Normal 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
17
odb.service
Normal 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
|
||||
2
oinit.sh
2
oinit.sh
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#/bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
cd /u01/app/oracle/product/18/dbhome_1/lib/stubs
|
||||
rm libc.*
|
||||
|
||||
Reference in New Issue
Block a user