1. linux怎么自动启动Oracle服务和ArcSDE服务
1:修改Oracle系统配置文件/etc/oratab
[root@localhost ~]# vi /etc/oratab
我们查看下面内容,如果安装好了Oracle,这个配置文件会自动将ORACLE_HOME标识清楚
但是默认为:orcl:/opt/oracle/proct/11.2.0/dbhome_1:N,我们只需要修改为Y如下所示即可
orcl:/opt/oracle/proct/11.2.0/dbhome_1:Y
2:编写服务脚本
我们可以首先创建一个Oracle配置文件,位置为:/etc/rc.d/init.d文件夹里面
然后进行编辑该文件
[root@localhost ~]# vi /etc/rc.d/init.d/oracle
将下面的信息填入即可
#!/bin/bash
#
#chkconfig:3459910
#description:
#/etc/rc.d/init.d/oradbstart
exportORACLE_BASE=/opt/oracle/
exportORACLE_HOME=/opt/oracle/proct/11.2.0/dbhome_1
exportORACLE_SID=orcl
exportSDEHOME=/home/arcsde/sdeexe100
exportPATH=$PATH:$ORACLE_HOME/bin:$SDEHOME/bin
case"$1"in
start)
echo"-----startuporacle-----">>/var/log/oracle11log
su-oracle-c$ORACLE_HOME/bin/dbstart
touch/var/lock/subsys/oracle11
echo"-----startuporaclesuccessful-----">>/var/log/oracle11log
echo"OK"su-arcsde-c"sdemon-ostart-psde"
;;
stop)
echo"-----shutdownoracle-----">>/var/log/oracle11log
su-oracle-c$ORACLE_HOME/bin/dbshut
rm-f/var/lock/subsys/oracle11
echo"-----shutdownoraclesuccessful-----">>/var/log/oracle11log
echo"OK"
;;
*)
echo"Usage:'basename$0'start|stop"
exit1
esac
exit0
exportORACLE_SID=orcl
exportPATH=$PATH:$ORACLE_HOME/bin
case"$1"in
start)
echo"-----startuporacle-----">>/var/log/oracle11log
su-oracle-c$ORACLE_HOME/bin/dbstart
touch/var/lock/subsys/oracle11
echo"-----startuporaclesuccessful-----">>/var/log/oracle11log
echo"OK"
;;
stop)
echo"-----shutdwnoracle-----">>/var/log/oracle11log
su-oracle-c$ORACLE_HOME/bin/dbshut
rm-f/var/lock/subsys/oracle11
echo"-----shutdownoraclesuccessful-----">>/var/log/oracle11log
echo"OK"
;;
*)
echo"Usage:'basename$0'start|stop"
exit1
esac
exit0
2. linux怎么设置oracle自动启动
工具:
win10
方法如下:
1、先点击桌面右下角的时间,然后点击日期和时间设置;
2、在日期和时间那一项找到格式,然后点击更改格式,看图;
3、按图示找到短时间设置和长时间设置;
4、设置完成,直接就生效了,在右下角看一眼,然后关闭就可以了。
3. linux下的oracle自启动和环境变量启动生效
vi /etc/rc.d/rc.local
增加:
su - oracle -c "/home/oracle/start_ora.sh"
/home/oracle/start_ora.sh 内容
#!/bin/sh
echo"Begintostarttheoracle!"
sqlplus/nolog<<EOF
connect/assysdba
startup
exit
EOF
lsnrctlstart
echo"Oraclejusthavebeenstarted!"
exit
4. 如何在Linux中设置开机自动启动oracle
对于LINUX 操作系统 有很多技术知识是我们需要学习的。这里我就给大家介绍Linux中设置oracle开机自动启动的 方法 。一起来看看吧。
Linux中设置oracle开机自动启动的方法
在terminal中切换到root用户
查看/etc/oratab文件的内容,其内容如下
[root@golonglee ~]# cat /etc/oratab | grep -v ^$
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:N
使用命令vi /etc/oratab编辑文件/etc/oratab,在最后添加如下内容
##### what I have written is as following
oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:Y
#####Finished wrote in 2015-12-24
说明:/home/oracle/app/oracle/proct/11.2.0/dbhome_1为oracle的安装目录,要根据实际情况进行修改。
(注意:图中我用红色标记的N要改成Y)
找到最后的内容
oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:N
复制该行oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:N并注释掉
粘贴该行,并将该行
oel63:/home/oracle/app/oracle/proct/11.2.0/dbhome_1:N最后的N
改为Y
最后按2次ESC键,并输入:wq并按下enter保存,退出
使用命令vi /etc/rc.d/rc.local编辑rc.local文件,添加如下内容
##### what I have written is as following
su oracle -lc "/home/oracle/app/oracle/proct/11.2.0/dbhome_1/bin/lsnrctl start"
su oracle -lc /home/oracle/app/oracle/proct/11.2.0/dbhome_1/bin/dbstart
#####Finished wrote in 2015-12-24
说明:因为第一行命令中有空格所以用双引号(英文的双引号)
/home/oracle/app/oracle/proct/11.2.0/dbhome_1为oracle的安装目录,要根据实际情况进行修改。
最后按2次ESC键,并输入:wq并按下enter保存,退出,重启机器,验证成功。
是不是很简单呢~快跟着我一起学习吧!!!如果觉得这篇 文章 不错的话就给我点一个赞吧。
5. linux 怎么关闭oracle自动启动
单机ORACLE DB是不会默认自动启动的, 必然是用户自己部署了脚本,你只需要删除对应脚本即可
6. Linux下如何启动、关闭Oracle以及打开关闭监听
1、以oracle用户登录系统,如果是root用户,使用su - oracle切换用户。
7. 如何怎样Linux怎样启动Oracle实例
这里介绍在Linux系统中如何启动oracle数据库实例。
工具/原料
oracle Linux
方法/步骤
Linux中启动oracle的数据库实例,需要注意以下几点。
.
下面是Linux启动oracle数据库的步骤
首先打开命令行窗口,切换到su - oracle,这点很重要。
启动数据库监听
.
打开sqlplus
.
用sys账户以sysdba的身份登录
.
输入sys用户的密码,然后按下enter
.
登录成功后,输入startup
.
7
稍等片刻,可以看到数据库实例已经运行了。
8. Linux下安装了Oracle怎么开启
工具:sqlplus
打开Linux字符集界面,登录Oracle用户
启动监听:lsnrctl start
sqlplus / as sysdba(注意空格)
当现实已连接时,输入startup回车
select status from v$instance;查看是不是OPEN,如果是,此时说明数据库已经开启。
9. 如何在LINUX下启动ORACLE
手动启动:
用 oracle用户登录(或su - oracle)
lsnrctl start
sqlplus / as sysdba
startup
exit
自动启动,要编写一个启动脚本,用root用户拷到/etc/init.d下,取名叫oracle
然后, chkconfig oracle on,即可加入服务列表
/etc/init.d/oracle start #启动
/etc/init.d/oracle stop #停止
脚本的示例(里面的变量要按实际情况修改):
#!/bin/bash
#
# chkconfig: 345 99 01
# description: This is a program that is responsible for taking care of
# configuring the Oracle Database 11g Stardard/Enterprise Edition and its associated
# services.
#
# Source fuction library
if [ -f /lib/lsb/init-functions ]
then
. /lib/lsb/init-functions
elif [ -f /etc/init.d/functions ]
then
. /etc/init.d/functions
fi
# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/sbin:/etc
export PATH ;;
esac
# Save LD_LIBRARY_PATH
SAVE_LLP=$LD_LIBRARY_PATH
RETVAL=0
ORACLE_OWNER=oracle
ORACLE_OWNER_HOME=/opt/oracle
ORACLE_BASE=$ORACLE_OWNER_HOME/app/oracle
ORACLE_HOME=$ORACLE_BASE/proct/11.2.0/dbhome_1
ORACLE_SID=orcl
ORACLE_UNQNAME=$ORACLE_SID
LSNR=$ORACLE_HOME/bin/lsnrctl
SQLPLUS=$ORACLE_HOME/bin/sqlplus
STARTDB_SQL=$(mktemp /tmp/start.XXXXXX)
echo -e "startup;\nquit;\n" > $STRTDB_SQL
STOPDB_SQL=$(mktemp /tmp/stop.XXXXXX)
echo -e "shutdown immediate;\nquit;\n" > $STOPDB_SQL
SU=/bin/su
export ORACLE_HOME
export ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH
LOG="$ORACLE_HOME_LISTNER/listener.log"
export LC_ALL=C
if [ $(id -u) != "0" ]
then
echo "You must be root to run the configure script. Login as root and then run the
configure script."
exit 1
fi
if [ -f /etc/redhat-release ]
then
. /etc/init.d/functions
init_status()
{
return 0
}
exit_status()
{
exit $?
}
success_status()
{
success
echo
}
failure_status()
{
failure $?
echo
}
elif [ -f /etc/SuSE-release ]
then
. /etc/rc.status
init_status()
{
rc_reset
}
success_status()
{
echo "OK"
return 0
}
failure_status()
{
echo "Failed"
return 1
}
exit_status()
{
exit $?
}
else
if [ -d /etc/default ]
then
CONFIGURATION="/etc/default/$CONFIG_NAME"
fi
init_status()
{
return 0
}
success_status()
{
echo "OK"
return 0
}
failure_status()
{
echo "Failed"
return 0
}
exit_status()
{
exit $?
}
fi
init_status
start() {
status=`ps -ef | grep tns | grep oracle`
if [ "$status" == "" ]
then
if [ -f $ORACLE_HOME/bin/tnslsnr ]
then
echo "Starting Oracle Net Listener."
$SU -s /bin/bash $ORACLE_OWNER -c "$LSNR start" # > /dev/null 2>&1
fi
fi
echo "Starting Oracle Database 11g Instance."
$SU -s /bin/bash $ORACLE_OWNER -c "$SQLPLUS -s /nolog @${STARTDB_SQL}" # > /dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo
else
echo Failed to start Oracle Net Listener using $ORACLE_HOME/bin/tnslsnr\
and Oracle Database using $ORACLE_HOME/bin/sqlplus.
RETVAL=1
return $RETVAL
fi
}
startconsole() {
$SU -s /bin/bash $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole &" # > /dev/null 2>&1
RETVAL=$?
return $RETVAL
}
stop() {
# Stop Oracle 11g Database and Listener
$SU -s /bin/bash $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole &" # > /dev/null 2>&1
echo Shutting down Oracle Database 11g Instance.
$SU -s /bin/bash $ORACLE_OWNER -c "$SQLPLUS -s /nolog @${STOPDB_SQL}" # > /dev/null 2>&1
echo Stopping Oracle Net Listener.
$SU -s /bin/bash $ORACLE_OWNER -c "$LSNR stop" # > /dev/null 2>&1
RETVAL=$?
echo
if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$LSNR
then
return $RETVAL
fi
}
stopconsole() {
# Stop Oracle 11g Database and Listener
$SU -s /bin/bash $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole &" # > /dev/null 2>&1
RETVAL=$?
return $RETVAL
}
# See how we were called
case "$1" in
start)
start
;;
startconsole)
startconsole
;;
stop)
stop
;;
stopconsole)
stopconsole
;;
restart|reload|force-reload)
stop
start
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac