linux 的启动执行脚本 (+oracle)
来源:互联网 发布:如何在淘宝上买盗版书 编辑:程序博客网 时间:2024/05/21 14:30
1.在/etc/init.d目录新建可执行文件 A, 编辑A文件内容,写入要执行的shell , 赋予文件执行的权限
2. 新建软连接 如: ln -s /etc/init.d/a /etc/rc.d/rcN.d/S99AAA (S 代表 start , 99执行优先级 ,N 服务起的运行级别)
3.oracle的自动启动
2.2.2 Automating Database Startup and Shutdown on Other Operating Systems
To automate database startup and shutdown by using the dbstart
anddbshut
scripts:
Log in as the
root
user.Edit the
oratab
file for your platform.To open the file, use one of the following commands:
On Solaris:
# vi /var/opt/oracle/oratab
On AIX, HP-UX, Linux, and Tru64 UNIX:
# vi /etc/oratab
Database entries in the
oratab
file are displayed in the following format:SID:ORACLE_HOME:{Y|N|W}
In this example, the values
Y
andN
specify whether you want the scripts to start or shut down the database, respectively. For each database for which you want to automate shutdown and startup, first determine the instance identifier (SID) for that database, which is identified by theSID
in the first field. Then, change the last field for each toY
.You can set
dbstart
to autostart a single-instance database that uses an Automatic Storage Management installation that is auto-started by Oracle Clusterware. This is the default behavior for an Automatic Storage Management cluster. If you want to do this, then you must change theoratab
entry of the database and the Automatic Storage Management installation to use a third field with the valueW
andN
, respectively. These values specify thatdbstart
auto-starts the database only after the Automatic Storage Management instance is started.Note:
If you add new database instances to the system and if you want to automate startup for them, then you must edit the entries for those instances in theoratab
file.Change directory to one of the following depending on your operating system.
Platform Initialization File Directory AIX/etc
Linux and Solaris/etc/init.d
HP-UX and Tru64 UNIX/sbin/init.d
Create a file called
dbora
, and copy the following lines into this file:Note:
Change the value of theORACLE_HOME
environment variable to an Oracle home directory for the installation. Change the value of theORACLE
environment variable to the user name of the owner of the database installed in the Oracle home directory (typically,oracle
).#! /bin/sh -x## Change the value of ORACLE_HOME to specify the correct Oracle home# directory for your installation.ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1## Change the value of ORACLE to the login name of the# oracle owner at your site.#ORACLE=oraclePATH=${PATH}:$ORACLE_HOME/binHOST=`hostname`PLATFORM=`uname`export ORACLE_HOME PATH#if [ ! "$2" = "ORA_DB" ] ; then if [ "$PLATFORM" = "HP-UX" ] ; then remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB" exit else rsh $HOST -l $ORACLE $0 $1 ORA_DB exit fifi#case $1 in'start') if [ "$PLATFORM" = "Linux" ] ; then touch /var/lock/subsys/dbora fi $ORACLE_HOME/bin/dbstart $ORACLE_HOME & ;;'stop') $ORACLE_HOME/bin/dbshut $ORACLE_HOME & ;;*) echo "usage: $0 {start|stop}" exit ;;esac#exit
Note:
This script can only stop Oracle Net listener for which a password has not been set. In addition, if the listener name is not the default name,LISTENER
, then you must specify the listener name in thestop
andstart
commands:$ORACLE_HOME/bin/lsnrctl {start|stop} listener_name
Change the group of the
dbora
file to the OSDBA group (typicallydba
), and set the permissions to 750:# chgrp dba dbora# chmod 750 dbora
Create symbolic links to the
dbora
script in the appropriate run-level script directories as follows.Platform Symbolic Links Commands AIX# ln -s /etc/dbora /etc/rc.d/rc2.d/S99dbora# ln -s /etc/dbora /etc/rc.d/rc2.d/K01dbora
HP-UX# ln -s /sbin/init.d/dbora /sbin/rc3.d/S990dbora# ln -s /sbin/init.d/dbora /sbin/rc0.d/K001dbora
Linux# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
Solaris# ln -s /etc/init.d/dbora /etc/rc0.d/K01dbora# ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
Tru64 UNIX# ln -s /sbin/init.d/dbora /sbin/rc3.d/S99dbora# ln -s /sbin/init.d/dbora /sbin/rc0.d/K01dbora
- linux 的启动执行脚本 (+oracle)
- linux启动执行脚本
- linux oracle启动脚本
- LINUX 下ORACLE的启动脚本
- Linux启动脚本执行顺序
- Windows下启动/关闭oracle、执行SQL的bat脚本
- Windows下启动/关闭oracle、执行SQL的bat脚本
- Linux 启动过程中各脚本的执行顺序
- RedHat Linux下Oracle启动脚本的建立 dbstart oracle
- linux自动启动 oracle脚本
- linux启动后自动执行某个脚本
- Linux自启动执行脚本方法
- linux开机启动自动执行某个脚本
- oracle脚本的执行方式
- LINUX 脚本的启动
- linux下启动oracle数据库实例的脚本
- linux 后台执行oracle sql脚本
- linux下执行oracle sql脚本
- 如何将voicebox等等工具包toolbox或者文件加入到matlab搜索路径
- 安装html5lib-0.95时出现的问题
- 重要资料查询网址
- javascript中浮点型数字的运算精度
- arx 自定义实体简单实例
- linux 的启动执行脚本 (+oracle)
- 经典心理学效应
- CRUD for table pwr_user continue 2
- ELisp编程十一:正则表达式一
- 实现URL编码解码的python程序
- 云端的迷失-2012年5月江西IDC排行榜
- 控制文件中的 MAXDATAFILES 参数
- Android提高十八篇之自定义Menu(TabMenu)
- linux文件操作