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