Teamcenter10 step-by-step installation in Linux env-Oracle services startup and shutdown

After following the first three posts about Oracle installation, you should finish installing Oracle successfully. We will further discuss how to start up and shutdown Oracle related services manually and automatically in this post.

Manually

1) Start up

Login as oracle user and start sqlplus utility.

SQL > startup

Start Oracle listener

Start emctl (Optional)

$ emctl start dbconsole

Start web browser and log into the console

2) Shutdown

Login as oracle user and start sqlplus utility.

Stop listener

Stop Oracle server

SQL > shutdown immediate

Stop emctl

$ emctl stop dbconsole

Automatically

1) Modify Oracle system configuration to enable dbstart and dbshut

$su - oracle
   $vi /etc/oratab

 

2) Create Oracle startup&shutdown script in /etc/init.d. The sample script is attached below.

#!/bin/sh
#chkconfig: 35 80 99
# description: Oracle auto start-stop script.

#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/pdm/db/oracle/product/11.2.0/dbhome_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi
case "$1" in
‘start‘)
# Start the Oracle databases:
echo "Starting Oracle Databases and listener ... "
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" >>/var/log/oracle
echo "Done"

# Start the Listener:
#echo "Starting Oracle Listeners ... "
#echo "-------------------------------------------------" >> /var/log/oracle
#date +" %T %a %D : Starting Oracle Listeners as part of system up." >> /var/log/oracle
#echo "-------------------------------------------------" >> /var/log/oracle
#su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start" >>/var/log/oracle
#echo "Done."
#echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Finished." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
touch /var/lock/subsys/oracle
;;

‘stop‘)
# Stop the Oracle Listener:
#echo "Stoping Oracle Listeners ... "
#echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Stoping Oracle Listener and Server as part of system down." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
#su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" >>/var/log/oracle
#echo "Done."
rm -f /var/lock/subsys/oracle

# Stop the Oracle Database:
echo "Stoping Oracle Databases and Listener... "
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Stoping Oracle Databases as part of system down." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" >>/var/log/oracle
echo "Done."
echo ""
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Finished." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
;;

‘restart‘)
$0 stop
$0 start
;;
esac

3)Change script mode to 755

# chmod 755 /etc/init.d/oracle

4) Add oracle service

# chkconfig –level 35 oracle on

5)Create symbolic links for oracle shutdown on run level 0 and 6

#for run level 0 (shutdown)
# ln -s /etc/init.d/oracle /etc/rc0.d/K99oracle
   # for run level 6 (restart)
# ln -s /etc/init.d/oracle /etc/rc6.d/K99oracle

Reference Material

The following urls are useful about Oracle services startup and shutdown.

http://www.cnblogs.com/panjun-Donet/archive/2010/08/10/1796873.html   (Linux下chkconfig命令详解)

http://www.cnblogs.com/mchina/archive/2012/11/27/2782993.html (Linux Oracle服务启动&停止脚本与开机自启动)

http://www.linuxidc.com/Linux/2007-06/4892.htm (实现linux在关机或重启时自动执行某个任务)

http://wenku.baidu.com/link?url=sK_FphbS_rtO_BkbpshLzJRxLu76s3bWWrgtAqlh540f4CNnRcQr5PffiRGd-eVZCjffcBPs8_kmM3junDNrLenQel0ltaRWUSwI0OiuGRO

http://www.cnblogs.com/bangerlee/archive/2012/03/30/2412652.html (Linux进程托管与守护进程设置)

Teamcenter10 step-by-step installation in Linux env-Oracle services startup and shutdown

时间: 2024-08-24 06:28:29

Teamcenter10 step-by-step installation in Linux env-Oracle services startup and shutdown的相关文章

Teamcenter10 step-by-step installation in Linux env-Oracle Server Installation

Recommended Reference Material <<Teamcenter 10.1 Installation on Unix and Linux Servers Guide>> <<Oracle Database Installation Guide 11g Release2(11.2) for Linux>> The detailed screenshots about installation and upgrading Oracle Se

Teamcenter10 step-by-step installation in Linux env-Teamcenter Server Installation

Introduction In the post, we will start to deploy two-tier Teamcenter env step by step. We will use the following two Teamcenter installation tools which enable you to build and manage your Teamcenter installation. Teamcenter Environment Manager (TEM

Teamcenter10 step-by-step installation in Linux env-Teamcenter License Server Installation and Configuration

Teamcenter is a business platform and so it is inevitable to install related license server before install Teamcenter server. What's more,  the interface of SPLM license server has been modified greatly from Teamcenter 10 on. So the post comprises ho

Teamcenter10 step-by-step installation in Linux env-Oracle Instance Creation

Configure Oracle environment It is recommended that user sets the specific environment for Oracle installation in ~/.bash_profile file prior to instance creation. $ vi ~/.bash_profile create $Oracle_BASE, $ORACLE_HOME, $ORACLE_SID and append $ORACLE_

Linux Booting Process: A step by step tutorial for understanding Linux boot sequence

One of the most remarkable achievement in the history of mankind is computers. Another amazing fact about this remarkable achievement called computers is that its a collection of different electronic components, and they work together in coordination

转载自~浮云比翼:Step by Step:Linux C多线程编程入门(基本API及多线程的同步与互斥)

Step by Step:Linux C多线程编程入门(基本API及多线程的同步与互斥) 介绍:什么是线程,线程的优点是什么 线程在Unix系统下,通常被称为轻量级的进程,线程虽然不是进程,但却可以看作是Unix进程的表亲,同一进程中的多条线程将共享该进程中的全部系统资源,如虚拟地址空间,文件描述符和信号处理等等.但同一进程中的多个线程有各自的调用栈(call stack),自己的寄存器环境(register context),自己的线程本地存储(thread-local storage). 一

Program for Linux USB-devices driver step by step (ONE)

Program for Linux USB-devices driver 开始啃硬骨头~ 这里我打算一步步给出USB device driver 的demo,希望有心能能够共同交流学习. 希望认识更多对Linux有兴趣的geek. 目前由于环境和自身能力方面原因还没能做实物的测试,篇章的最后打算给出一个在x86上模拟USB读写的driver,以后能够做实物测试之后再更新this blog 我的联系方式: [email protected](由于偶不能登QQ,所以thunder bird的邮件只要

Teamcenter10 step-by-step installation in Linux env-Teamcenter WebTier Installation

Introduction Actually, in the last post Teamcenter10 step-by-step installation in Linux env-Teamcenter Server Installation, we have finished both 2-tier deployment and resource & enterprise tiers deployment in four-tier architecture using TEM (Part 1

Teamcenter10 step-by-step installation in Linux env-Teamcenter 4 tier RichClient Installation

Introduction In this post, we will introduce OTW(over the web) mode to install Teamcenter 4-tier rich client and also use WAM tool to generate it. To install the four-tier rich client, you use a Web browser open the URL of a Web application server th