oracle
資料庫服務由兩部分組成:資料庫程序和網路***程序,它們分別可通過
sqlplus
和lsnrctl
命令控制啟動關閉。
1.資料庫程序
使用dbca
工具建立資料庫後,其程序已經自動啟動,這些程序都是以資料庫名稱(在本例中為
orcl
)命名,如下所示。
$ ps -ef|grep orcl
oracle870
10 11:54 ?00:00:00 ora_pmon_orcl//
程序監控器程序
oracle872
10 11:54 ?00:00:00 ora_vktm_orcl//
時鐘更新程序
oracle876
10 11:54 ?00:00:00 ora_diag_orcl//
資料庫診斷程序
oracle878
10 11:54 ?00:00:00 ora_dbrm_orcl//
資料庫資源管理程序
oracle880
10 11:54 ?00:00:00 ora_psp0_orcl//
程序產生
oracle884
10 11:54 ?00:00:03 ora_dia0_orcl//
另乙個資料庫診斷程序
oracle886
10 11:54 ?00:00:00 ora_mman_orcl//
執行資料庫的內部任務
oracle888
10 11:54 ?00:00:00 ora_dbw0_orcl//
資料庫寫程序
oracle890
10 11:54 ?00:00:01 ora_lgwr_orcl//
日誌程序
oracle892
10 11:54 ?00:00:01 ora_ckpt_orcl//
檢查點程序
oracle894
10 11:54 ?00:00:04 ora_smon_orcl//
系統監控程序
oracle896
10 11:54 ?00:00:00 ora_reco_orcl
oracle898
10 11:54 ?00:00:05 ora_mmon_orcl//
收集sql
物件資訊
oracle900
10 11:54 ?00:00:00 ora_mmnl_orcl//
負責將sga
統計資訊輸出
//到資料庫表中的程序
oracle910
10 11:54 ?00:00:00 ora_smco_orcl//
負責空間管理協調的程序
oracle912
10 11:54 ?00:00:00 ora_fbda_orcl//
快速歸檔程序
oracle914
10 11:54 ?00:00:00 ora_qmnc_orcl//
負責監控佇列資訊的程序
oracle930
10 11:54 ?00:00:00 ora_q000_orcl
oracle932
10 11:54 ?00:00:00 ora_q001_orcl
oracle11312 10 13:52 ?00:00:00 oracleorcl (local=no)//
資料庫連線程序
oracle13153 10 14:14 ?00:00:00 ora_w000_orcl//
由smco
產生的程序
可以通過
sqlplus
管理工具手工啟動和關閉資料庫
。首先執行如下命令進入
sqlplus
並連線資料庫。
$ export oracle_sid=orcl//
指定使用的資料庫名稱
$ export nls_lang=american_america.zhs16gbk//
指定sqlplus
中使用的語言
$ sqlplus /nolog
sql*plus: release 11.1.0.6.0 - production on wed oct 29 14:22:46 2008
ghts reserved.
sql> conn sys as sysdba//
以sys
使用者登入資料庫
enter password://
輸入sys
使用者的密碼
connected.//
登入成功
如果要啟動資料庫,可在
sqlplus
中執行startup
命令,如下所示。
sql> startup//
啟動oracle
資料庫oracle instance started.
total system global area179941376 bytes//
總的sga
大小fixed size1298724 bytes//
固定記憶體大小
variable size125832924 bytes//
可變記憶體大小
database buffers50331648 bytes//
資料庫快取區大小
redo buffers
2478080 bytes//
重做快取區大小
database mounted.
database opened.
如果要關閉資料庫,可在
sqlplus
中執行shutdown
命令,如下所示。
sql> shutdown immediate//
關閉資料庫
database closed.
database dismounted.
oracle instance shut down.
2.網路監聽程式程序
資料庫程序啟動後,使用者只能在本地伺服器上對資料庫進行訪問。如果要通過網路訪問資料庫,還需要啟動網路監聽程式。
啟動網路監聽程式的命令如下所示。
$ lsnrctl start//
啟動監聽程式
lsnrctl for linux: version 11.1.0.6.0 - production on 29-oct-2008 14:40:20
tnslsnr for linux: version 11.1.0.6.0 – production
//網路監聽程式配置檔案
listening on: (description=(address=(protocol=tcp)(host=localhost.locald-
omain)(port=1521)))
listening on: (description=(address=(protocol=ipc)(key=extproc1521)))
//伺服器和埠號
connecting to (description=(address=(protocol=tcp)(host=demoserver)(port=
1521)))
status of the listener
------------------------
aliaslistener//
監聽程式的別名
versiontnslsnr for linux: version 11.1.0.6.0 – production
//版本號
start date29-oct-2008 14:40:21//
啟動時間
uptime0 days 0 hr. 0 min. 1 sec//
已經執行的時間
trace leveloff//
跟蹤級別
securityon: local os authentication
snmpoff//
禁用snmp
監聽程式的引數檔名
監聽程式的日誌檔案
listening endpoints summary...
(description=(address=(protocol=tcp)(host=localhost.localdomain)(port=1521)))
(description=(address=(protocol=ipc)(key=extproc1521)))
the listener supports no services
the command completed successfully
//啟動成功
關閉網路監聽程式。
$ lsnrctl stop
lsnrctl for linux: version 11.1.0.6.0 - production on 29-oct-2008 14:39:31
connecting to (description=(address=(protocol=tcp)(host=demoserver)(port=
1521)))
the command completed successfully//
關閉成功
oracle啟動和關閉
資料庫的啟動有三中 1 startup nomount 這種過程又稱為 非安裝啟動 啟動過程為 啟動oracle例項,不載入資料庫,不開啟資料庫。在這個過程中只需要init.ora初始化引數檔案,重建控制檔案,即啟動sga和後台程序 在以下幾種情況下需要用到這種模式 a 資料庫的控制檔案全部損害 b...
oracle啟動和關閉方式
啟動過程 啟動例項 裝載資料庫 開啟資料庫,與之對應的讀取相應檔案的順序 引數檔案 控制檔案 資料檔案 有以下幾種啟動方式 1 startup nomount 非安裝啟動,只啟動資料庫例項,不裝載資料庫,不開啟資料庫,這是只讀取引數檔案,主要量部分工作 一是分配記憶體sga區,二是啟動oracle後...
Oracle的啟動和關閉
例項的概念 例項是oracle用來管理資料庫的乙個實體,它由位於伺服器中的記憶體結構和一系列服務程序組成.乙個例項只能訪問乙個資料庫,而乙個資料庫可以由多個例項同時訪問.例項在使用者和資料庫之間充當乙個中介軟體的角色.資料庫跟例項是兩回事情,資料庫主要是指oracle儲存資料的一系列物理儲存結構.資...