【正文】
your desktops. Password: Verify: New 39。 do echo $pslist | grep ora_pmon_$db_name /dev/null 2amp。 then grep i ^ORA /oracle/admin/law/bdump/ | \ mail s There are some erros in alert file! fi 對上面修改后的代碼如下: [rootlocalhost oracle] cat ! /bin/bash . /home/oracle/.bash_profile cd $ORACLE_BASE/admin/$ORACLE_SID/bdump if [ f alert_$ ] then mv alert_$ touch alert_$ cat alert_$ grep ORA fi if [ `cat |wc l` gt 0 ] then mail s ORACLE ALERT ERRORS fi rm f rm f 監(jiān)控磁盤空間 腳本文件內(nèi)容: /bin/bash RESULT=$(df | grep ^/dev/ | awk 39。 select 39。 $backup_dir/39。139。 sortorder, 39。 sortorder, 39。39。 Linux 是用 C 語 言編寫的,我們有學(xué)習(xí) C 語言的基礎(chǔ),讀程序和編寫代碼方面存在的困難小一點,不管怎樣多花些時間動手操作。 這學(xué)期講了很多知識,從安裝虛擬機(jī),再到 linux 操作系統(tǒng),再安裝 oracle10g 數(shù)據(jù)庫 ... 在本次課程設(shè)計中,學(xué)會了在 linux 平臺下安裝 oracle 10g 數(shù)據(jù)庫,熟練了 linux 基本命令的操作,使用 dbca 命令創(chuàng)建數(shù)據(jù)庫,圖形卸載 oracle 數(shù)據(jù)庫,掌握了 mail 命令發(fā)送郵 件, putty vncview及 tel 遠(yuǎn)程連接基本實現(xiàn),配置了專用服務(wù)器,使用了 shell 腳本對 oracle 數(shù)據(jù)庫的管理操作,對備份還存在不足,對一些復(fù)雜的 shell 程序達(dá)不到熟練理解, 在操作過程中遇到的問題還不能解決, 需加強(qiáng) .............. 兩周的課程設(shè)計也將結(jié)束了,數(shù)據(jù)庫老師上課給我們傳授的不僅僅是知識,更重要的是一些道理,包括一些做人的道理,講課時也抓住重點,循序漸進(jìn),讓同學(xué)理解很快;實驗結(jié)合理論,讓我樹立了很大的信心學(xué)好這門課程,也學(xué)到了不少專業(yè)知識和技能。 spool off hot_backup_$ exit EOF rm f hot_backup_$ echo Hot backup finished. $log_file (四) Rman 備份 shell 程序 [oracleoracle ~]$ cat n ! /bin/bash if [ $1 ] then backup_level=$1 else backup_level=0 fi backup_user=sys backup_user_pw=oracle catlog_user=rman catlog_user_pw=rman log_file=/oracle/admin/$ORACLE_SID/ echo Beginning rman backup... $log_file date $log_file rman target $backup_user/$backup_user_pw EOF $log_file catlog $catlog_user/$catlog_user_pwrman backup incremental level=$backup_level database。 || tablespace_name || 39。 || file_name || 39。alter tablespace 39。 spool off shutdown immediate。 || file_name || 39。 | sort nr | head 1| tr d %) if [ $RESULT gt 85 ]。 then echo Oracle Instance $db_name: Down else echo Oracle Instance $db_name: Up fi done 監(jiān)控歸檔目錄空間 [rootlocalhost ~] cat ! /bin/bash df k | grep arch archive_filesystem=`awk F 39。 desktop is :1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/: 在 windows 使用 dos 命令遠(yuǎn)程連接 linux 系統(tǒng) 在 linux 系統(tǒng)中打開 Tel 服務(wù): [rootlocalhost ~] service xid start 檢查服務(wù)是否打開 [rootlocalhost ~] chkconfig list|grep tel ekrb5tel: 關(guān)閉 krb5tel: 啟用 [rootlocalhost ~] service iptables stop [rootlocalhost ~] ifconfig 運行 dos 命令: 配置服務(wù)器: [rootlocalhost ~] xhost + access control disabled, clients can connect from any host [rootlocalhost ~] su oracle [oraclelocalhost ~]$ lsnrctl start [oraclelocalhost ~]$ xhost + access control disabled, clients can connect from any host [oraclelocalhost ~]$ mgr [oraclelocalhost ~]$ sqlplus system/oraclezhouxiong SQL*Plus: Release Production on Tue May 28 17:17:48 2022 Copyright (c) 1982, 2022, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release Production With the Partitioning, OLAP and Data Mining options shell 腳本管理 oracle 數(shù)據(jù)庫 啟動監(jiān)聽器及數(shù)據(jù)庫的 shell 腳本文件 [rootlocalhost ~] su oracle [oraclelocalhost ~]$ cd $ORACLE_HOME/bin [oraclelocalhost bin]$ vi dbstartup /bin/bash lsnrctl start sqlplus /nolog eof