讓oracle自動啟動方法!

2021-04-07 08:47:11 字數 1466 閱讀 6403

#!/bin/sh

echo "begin to start oracle"

su - oracle -c "lsnrctl start"

su - oracle -c "agentctl start"

su - oracle -c "sqlplus /nolog" <

##以下部分為自動停止

#!/bin/sh

su - oracle -c "lsnrctl stop"

su - oracle -c "agentctl stop"

su - oracle -c "sqlplus /nolog"

##另附oracle常見啟動方式: 1

、startup nomount

非安裝啟動,這種方式啟動下可執行:重建控制檔案、重建資料庫

讀取init.ora

檔案,啟動

instance

,即啟動

sga和後台程序,這種啟動只需要

init.ora

檔案。2

、startup mount dbname

安裝啟動,這種方式啟動下可執行:

資料庫日誌歸檔、

資料庫介質恢復、

使資料檔案聯機或離線,

重新定位資料檔案、重做日誌檔案。

執行「nomount」

,然後開啟控制檔案,確認資料檔案和聯機日誌檔案的位置,

但此時不對資料檔案和日誌檔案進行校驗檢查。3、

startup open dbname

先執行「nomount」

,然後執行

「mount」

,再開啟包括

redo log

檔案在內的所有資料庫檔案,

這種方式下可訪問資料庫中的資料。4、

startup

,等於以下三個命令

startup nomount

alter database mount

alter database open5、

startup restrict

約束方式啟動

這種方式能夠啟動資料庫,但只允許具有一定特權的使用者訪問

error

:ora-01035: oracle 

只允許具有

restricted session 

許可權的使用者使用6、

startup force

強制啟動方式

當不能關閉資料庫時,可以用

startup force

來完成資料庫的關閉

先關閉資料庫,再執行正常啟動資料庫命令7、

startup pfile=

引數檔名

帶初始化引數檔案的啟動方式

先讀取引數檔案,再按引數檔案中的設定啟動資料庫

例:startup pfile=e:oracleadminoradbpfileinit.ora8、

startup exclusive

讓oracle自動啟動方法

bin sh echo begin to start oracle su oracle c lsnrctl start su oracle c agentctl start su oracle c sqlplus nolog connect as sysdba startup open exit 以...

讓Mac啟動的時候自動啟動mysql

用mac的launchctl來實現mysql自啟動。方法也簡單。1 編輯乙個mysql啟動檔案。在終端裡面輸入 plain view plain copy sudo vi library launchdaemons com.mysql.mysql.plist 2 輸入啟動檔案內容 html view...

讓Mac啟動的時候自動啟動mysql

之前安裝mysql的時候,安裝器自動新增了系統服務,啟動系統的時候會自動啟動mysql。不過今天公升級mac osx到10.10.1 yosemite之後,發現啟動系統的時候mysql沒啟動了。那就試一下用mac的launchctl來實現這個功能吧。方法也簡單。1 編輯乙個mysql啟動檔案。在終端...