linux涓嬪惎鍔╫racle鏈嶅姟鍜岀洃鍚▼搴?
oracle鏁版嵁搴撴槸閲嶉噺绾х殑锛屽叾绠$悊闈炲父澶嶆潅锛屽皢鍏跺湪linux骞冲彴涓婄殑鍚姩鍜屽叧闂楠ゆ暣鐞嗕竴涓嬨€?
瀹夎瀹屾瘯oracle浠ュ悗锛岄渶瑕佸垱寤簅racle绯荤粺鐢ㄦ埛锛屽苟鍦?home/oracle涓嬮潰鐨?bash_profile娣诲姞鍑犱釜鐜鍙橀噺锛歄RACLE_SID,ORACLE_BASE,ORACLE_HOME銆傛瘮濡傦細
export ORACLE_SID=test export ORACLE_BASE=oracle_install_dir export ORACLE_HOME=xxx
鍚姩姝ラ锛氭敞鎰?浠h〃shell鍛戒护鎻愮ず绗︼紝杩欓噷鐨刼racle鏄?.0浠ヤ笂鐗堟湰銆?
$ su - oracle
$ sqlplus /nolog
sql> conn / as sysdba
sql> startup (涓€鑸笉闇€瑕佸姞鍙傛暟锛屽彧瑕佽缃ソ鐜鍙橀噺锛?
sql> quit (閫€鍑簊ql妯″紡)
$ lsnrctl start (鍚姩鐩戝惉鍣級鍏抽棴oracle
$ lsnrctl stop(鍏抽棴鐩戝惉鍣紝鍦ㄨ繖涔嬪墠锛屽簲璇ュ厛鍏抽棴搴旂敤绋嬪簭锛?
$ sqlplus /nolog
sql>shutdown 鍏跺弬鏁?锛歴hutdown鏈夊洓涓弬鏁帮紝鍥涗釜鍙傛暟鐨勫惈涔夊涓嬶細
Normal 闇€瑕佺瓑寰呮墍鏈夌殑鐢ㄦ埛鏂紑杩炴帴
Immediate 绛夊緟鐢ㄦ埛瀹屾垚褰撳墠鐨勮鍙?
Transactional 绛夊緟鐢ㄦ埛瀹屾垚褰撳墠鐨勪簨鍔?
Abort 涓嶅仛浠讳綍绛夊緟锛岀洿鎺ュ叧闂暟鎹簱
normal闇€瑕佸湪鎵€鏈夎繛鎺ョ敤鎴锋柇寮€鍚庢墠鎵ц鍏抽棴鏁版嵁搴撲换鍔★紝鎵€浠ユ湁鐨勬椂鍊欑湅璧锋潵濂借薄鍛戒护娌℃湁杩愯涓€鏍凤紒鍦ㄦ墽琛岃繖涓懡浠ゅ悗涓嶅厑璁告柊鐨勮繛鎺?
immediate鍦ㄧ敤鎴锋墽琛屽畬姝e湪鎵ц鐨勮鍙ュ悗灏辨柇寮€鐢ㄦ埛杩炴帴锛屽苟涓嶅厑璁告柊鐢ㄦ埛杩炴帴銆?
transactional 鍦ㄦ嫢鎶ゆ墽琛屽畬褰撳墠浜嬬墿鍚庢柇寮€杩炴帴锛屽苟涓嶅厑璁告柊鐨勭敤鎴疯繛鎺ユ暟鎹簱銆?
abort 鎵ц寮鸿鏂紑杩炴帴骞剁洿鎺ュ叧闂暟鎹簱銆?
鍓嶄笁绉嶆柟寮忎笉鍥炰涪澶辩敤鎴锋暟鎹€傜鍥涚鍦ㄤ笉鐨勫凡鐨勬儏鍐典笅锛屼笉寤鸿閲囩敤锛?
缁忓父閬囧埌鐨勯棶棰橈細
1锛夋潈闄愰棶棰橈紝瑙e喅鏂规硶锛屽垏鎹㈠埌oracle鐢ㄦ埛锛?
2锛夋病鏈夊叧闂洃鍚櫒 锛岃В鍐虫柟娉曪細鍏抽棴鐩戝惉鍣?
3锛夋湁oracle瀹炰緥娌℃湁鍏抽棴锛岃В鍐冲姙娉曪細鍏抽棴oracle瀹炰緥
4锛夌幆澧冨彉閲忚缃笉鍏紝瑙e喅鍔炴硶锛氫慨鏀圭幆澧冨彉閲?
Oracle鏁版嵁搴撶殑鍚姩鍜屽叧闂柟寮忓皬缁?
Oracle鏁版嵁搴撶殑鍚姩鍜屽叧闂柟寮?
涓€銆佸嚑绉嶅惎鍔ㄦ柟寮忥細
1銆乻tartup nomount
闈炲畨瑁呭惎鍔紝杩欑鏂瑰紡鍚姩涓嬪彲鎵ц锛氶噸寤烘帶鍒舵枃浠躲€侀噸寤烘暟鎹簱
鍚姩instance锛屽嵆鍚姩SGA鍜屽悗鍙拌繘绋嬶紝杩欑鍚姩鍙渶瑕乮nit.ora鏂囦欢銆?
2銆乻tartup mount dbname
瀹夎鍚姩锛岃繖绉嶆柟寮忓惎鍔ㄤ笅鍙墽琛岋細鏁版嵁搴撴棩蹇楀綊妗c€佹暟鎹簱鎭㈠銆侀噸鏂板懡鍚嶄竴浜涙暟鎹簱鏂囦欢
濡傦細绯荤粺琛ㄧ┖闂存垨鏃ュ織鏂囦欢銆?
鎵ц鈥渘omount鈥濓紝鐒跺悗鎵撳紑鎺у埗鏂囦欢
3銆乻tartup open dbname
鍏堟墽琛屸€渘omount鈥濓紝鐒跺悗鎵ц鈥渕ount鈥濓紝鍐嶆墦寮€鍖呮嫭Redo log鏂囦欢鍦ㄥ唴鐨勬墍鏈夋暟鎹簱鏂囦欢锛?
杩欑鏂瑰紡涓嬪彲璁块棶鏁版嵁搴撲腑鐨勬暟鎹€?
4銆乻tartup锛岀瓑浜庝互涓嬩笁涓懡浠?
startup nomount
alter database mount
alter database open
5銆乻tartup restrict
绾︽潫鏂瑰紡鍚姩
杩欑鏂瑰紡鑳藉鍚姩鏁版嵁搴擄紝浣嗗彧鍏佽鍏锋湁涓€瀹氱壒鏉冪殑鐢ㄦ埛璁块棶
闈炵壒鏉冪敤鎴疯闂椂锛屼細鍑虹幇浠ヤ笅鎻愮ず锛?
ERROR锛?
ORA-01035: ORACLE 鍙厑璁稿叿鏈?RESTRICTED SESSION 鏉冮檺鐨勭敤鎴蜂娇鐢?
6銆乻tartup force
寮哄埗鍚姩鏂瑰紡
褰撲笉鑳藉叧闂暟鎹簱鏃讹紝鍙互鐢╯tartup force鏉ュ畬鎴愭暟鎹簱鐨勫叧闂?
鍏堝叧闂暟鎹簱锛屽啀鎵ц姝e父鍚姩鏁版嵁搴撳懡浠?
7銆乻tartup pfile=鍙傛暟鏂囦欢鍚?
甯﹀垵濮嬪寲鍙傛暟鏂囦欢鐨勫惎鍔ㄦ柟寮?
鍏堣鍙栧弬鏁版枃浠讹紝鍐嶆寜鍙傛暟鏂囦欢涓殑璁剧疆鍚姩鏁版嵁搴?
渚嬶細startup pfile=E:\Oracle\admin\oradb\pfile\init.ora
8銆乻tartup EXCLUSIVE
浜屻€佸嚑绉嶅叧闂柟寮忥細
1銆乻hutdown normal
姝e父鏂瑰紡鍏抽棴鏁版嵁搴撱€?
2銆乻hutdown immediate
绔嬪嵆鏂瑰紡鍏抽棴鏁版嵁搴撱€?
鍦⊿VRMGRL涓墽琛宻hutdown immediate锛屾暟鎹簱骞朵笉绔嬪嵆鍏抽棴锛?
鑰屾槸鍦∣racle鎵ц鏌愪簺娓呴櫎宸ヤ綔鍚庢墠鍏抽棴锛堢粓姝細璇濄€侀噴鏀句細璇濊祫婧愶級锛?
褰撲娇鐢╯hutdown涓嶈兘鍏抽棴鏁版嵁搴撴椂锛宻hutdown immediate鍙互瀹屾垚鏁版嵁搴撳叧闂殑鎿嶄綔銆?
3銆乻hutdown abort
鐩存帴鍏抽棴鏁版嵁搴擄紝姝e湪璁块棶鏁版嵁搴撶殑浼氳瘽浼氳绐佺劧缁堟锛?
濡傛灉鏁版嵁搴撲腑鏈夊ぇ閲忔搷浣滄鍦ㄦ墽琛岋紝杩欐椂鎵цshutdown abort鍚庯紝閲嶆柊鍚姩鏁版嵁搴撻渶瑕佸緢闀挎椂闂?