【正文】
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 對(duì)上面修改后的代碼如下: [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)控磁盤(pán)空間 腳本文件內(nèi)容: /bin/bash RESULT=$(df | grep ^/dev/ | awk 39。 select 39。 $backup_dir/39。139。 sortorder, 39。 sortorder, 39。39。 Linux 是用 C 語(yǔ) 言編寫(xiě)的,我們有學(xué)習(xí) C 語(yǔ)言的基礎(chǔ),讀程序和編寫(xiě)代碼方面存在的困難小一點(diǎn),不管怎樣多花些時(shí)間動(dòng)手操作。 這學(xué)期講了很多知識(shí),從安裝虛擬機(jī),再到 linux 操作系統(tǒng),再安裝 oracle10g 數(shù)據(jù)庫(kù) ... 在本次課程設(shè)計(jì)中,學(xué)會(huì)了在 linux 平臺(tái)下安裝 oracle 10g 數(shù)據(jù)庫(kù),熟練了 linux 基本命令的操作,使用 dbca 命令創(chuàng)建數(shù)據(jù)庫(kù),圖形卸載 oracle 數(shù)據(jù)庫(kù),掌握了 mail 命令發(fā)送郵 件, putty vncview及 tel 遠(yuǎn)程連接基本實(shí)現(xiàn),配置了專(zhuān)用服務(wù)器,使用了 shell 腳本對(duì) oracle 數(shù)據(jù)庫(kù)的管理操作,對(duì)備份還存在不足,對(duì)一些復(fù)雜的 shell 程序達(dá)不到熟練理解, 在操作過(guò)程中遇到的問(wèn)題還不能解決, 需加強(qiáng) .............. 兩周的課程設(shè)計(jì)也將結(jié)束了,數(shù)據(jù)庫(kù)老師上課給我們傳授的不僅僅是知識(shí),更重要的是一些道理,包括一些做人的道理,講課時(shí)也抓住重點(diǎn),循序漸進(jìn),讓同學(xué)理解很快;實(shí)驗(yàn)結(jié)合理論,讓我樹(shù)立了很大的信心學(xué)好這門(mén)課程,也學(xué)到了不少專(zhuān)業(yè)知識(shí)和技能。 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)中打開(kāi) Tel 服務(wù): [rootlocalhost ~] service xid start 檢查服務(wù)是否打開(kāi) [rootlocalhost ~] chkconfig list|grep tel ekrb5tel: 關(guān)閉 krb5tel: 啟用 [rootlocalhost ~] service iptables stop [rootlocalhost ~] ifconfig 運(yùn)行 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ù)庫(kù) 啟動(dòng)監(jiān)聽(tīng)器及數(shù)據(jù)庫(kù)的 shell 腳本文件 [rootlocalhost ~] su oracle [oraclelocalhost ~]$ cd $ORACLE_HOME/bin [oraclelocalhost bin]$ vi dbstartup /bin/bash lsnrctl start sqlplus /nolog eof