




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Oracle數(shù)據(jù)庫(kù)日常管理_項(xiàng)目現(xiàn)場(chǎng)篇修改:2010/2/8A. 查看所有的實(shí)例及其后臺(tái)進(jìn)程是否正常確認(rèn)所有的instance工作正常,登陸到所有的數(shù)據(jù)庫(kù)或instance上,檢測(cè)oracle后臺(tái)進(jìn)程GDDB4-/export/home/oracle> env | grep SIDORACLE_SID=UWNMS3GDDB4-/export/home/oracle> ps -ef|grep UWNMS3 | grep -v grep | grep ora oracle 25119 1 0 Jun 24 ? 0:04 ora_dbw4_UWNMS3 oracle 25110 1 0
2、Jun 24 ? 3:20 ora_dbw1_UWNMS3 oracle 25146 1 0 Jun 24 ? 0:00 ora_reco_UWNMS3 oracle 25125 1 0 Jun 24 ? 0:09 ora_dbw5_UWNMS3 oracle 25142 1 0 Jun 24 ? 5:41 ora_smon_UWNMS3 oracle 25155 1 0 Jun 24 ? 1:17 ora_mmon_UWNMS3 oracle 25152 1 0 Jun 24 ? 101:32 ora_cjq0_UWNMS3 oracle 25102 1 0 Jun 24 ? 0:02 or
3、a_mman_UWNMS3 oracle 25108 1 0 Jun 24 ? 7:37 ora_dbw0_UWNMS3 oracle 25478 1 0 Jun 24 ? 0:45 ora_arc1_UWNMS3 oracle 25470 1 0 Jun 24 ? 0:47 ora_arc0_UWNMS3 oracle 25159 1 0 Jun 24 ? 84:02 ora_mmnl_UWNMS3 oracle 25094 1 0 Jun 24 ? 17:30 ora_pmon_UWNMS3 oracle 25117 1 0 Jun 24 ? 0:41 ora_dbw3_UWNMS3 or
4、acle 25131 1 0 Jun 24 ? 13:12 ora_lgwr_UWNMS3 oracle 20175 1 0 18:27:25 ? 0:00 ora_j000_UWNMS3 oracle 25100 1 0 Jun 24 ? 1:10 ora_psp0_UWNMS3 oracle 25113 1 0 Jun 24 ? 0:14 ora_dbw2_UWNMS3 oracle 25135 1 0 Jun 24 ? 23:50 ora_ckpt_UWNMS3B檢查文件系統(tǒng)的使用情況如果文件系統(tǒng)的剩余空間小于10,則需要?jiǎng)h除不必要的文件以釋放空間。GDDB4-/export/home/
5、oracle> df -hFilesystem size used avail capacity Mounted on/dev/md/dsk/d0 20G 17G 3.1G 85% /proc 0K 0K 0K 0% /procmnttab 0K 0K 0K 0% /etc/mnttabfd 0K 0K 0K 0% /dev/fdswap 85G 192K 85G 1% /var/rundmpfs 85G 0K 85G 0% /dev/vx/dmpdmpfs 85G 0K 85G 0% /dev/vx/rdmpswap 85G 213M 85G 1% /tmp/dev/vx/dsk/da
6、ta10dg/Ora_File_Vol01 394G 292G 98G 75% /data05/dev/vx/dsk/data1dg/vola0131 443G 156G 283G 36% /archivelog注意:需要特別關(guān)注根目錄,數(shù)據(jù)庫(kù)軟件和數(shù)據(jù)庫(kù)備份所在目錄的剩余空間情況!備注:數(shù)據(jù)庫(kù)運(yùn)行日志的及時(shí)清除1). 可清除bdump,cdump,udump下的相關(guān)日志$ cd bdump$ ls -ltotal 174-rwxrwxrwx 1 oracle dba 59047 Jul 30 22:02 alert_UWNMS1.log-rwxrwxrwx 1 oracle dba 1000
7、 Jul 14 22:00 uwnms1_j000_18128.trc-rw-r- 1 oracle dba 1000 Jul 22 22:00 uwnms1_j001_5369.trc-rwxrwxrwx 1 oracle dba 695 Jul 14 19:12 uwnms1_lgwr_18100.trc-rwxrwxrwx 1 oracle dba 2668 Jul 30 22:02 uwnms1_lgwr_19661.trc-rwxrwxrwx 1 oracle dba 983 Jul 14 17:36 uwnms1_lgwr_7816.trc-rwxrwxrwx 1 oracle d
8、ba 955 Jul 14 19:11 uwnms1_lgwr_7883.trc-rwxrwxrwx 1 oracle dba 803 Jul 14 17:31 uwnms1_p000_7714.trc-rwxrwxrwx 1 oracle dba 801 Jul 14 17:31 uwnms1_p001_7716.trc$ cp /dev/null alert_UWNMS1.log$ rm *.trc$ cd ./cdump$ ls -ltotal 4drwxr-x- 2 oracle dba 512 Jul 25 14:12 core_18095drwxr-x- 2 oracle dba
9、512 Jul 25 19:17 core_25934$ cd ./udump$ ls -ltotal 20042-rw-r- 1 oracle dba 505 Jul 16 16:33 uwnms1_ora_14771.trc-rw-r- 1 oracle dba 4516169 Jul 25 14:12 uwnms1_ora_18095.trc-rwxrwxrwx 1 oracle dba 644 Jul 14 19:12 uwnms1_ora_18119.trc-rw-r- 1 oracle dba 505 Jul 30 15:11 uwnms1_ora_18820.trc-rwxrwx
10、rwx 1 oracle dba 774 Jul 15 10:23 uwnms1_ora_19573.trc-rwxrwxrwx 1 oracle dba 587 Jul 15 10:23 uwnms1_ora_19645.trc-rwxrwxrwx 1 oracle dba 644 Jul 15 10:23 uwnms1_ora_19680.trc-rw-r- 1 oracle dba 720942 Jul 15 16:28 uwnms1_ora_24759.trc-rw-r- 1 oracle dba 4951562 Jul 25 19:17 uwnms1_ora_25934.trc-rw
11、-r- 1 oracle dba 505 Jul 15 17:21 uwnms1_ora_27326.trc-rw-r- 1 oracle dba 503 Jul 30 16:54 uwnms1_ora_6612.trc-rwxrwxrwx 1 oracle dba 585 Jul 14 17:12 uwnms1_ora_7523.trc-rwxrwxrwx 1 oracle dba 767 Jul 14 17:30 uwnms1_ora_7566.trc2). 可清除oracle的監(jiān)聽(tīng)日志$ cd $ORACLE_HOME/network/log$ ls -ltotal 533072-rwx
12、rwxrwx 1 oracle-rw-r-r- 1 oracle dba 257876 Jul 31 08:48 sqlnet.log$ cp /dev/null listener.logC查找警告日志文件1. 聯(lián)接每一個(gè)操作管理系統(tǒng)2. 使用TELNET或是可比較程序3. 對(duì)每一個(gè)管理實(shí)例,經(jīng)常的執(zhí)行$ORACLE_BASE/<SID>/bdump 操作,并使其能回退到控制數(shù)據(jù)庫(kù)的SID。4. 在提示下,使用UNIX 中的TAIL命令查看alert_<SID>.log,或是用其他方式檢查文件中最近時(shí)期的警告日志5. 如果發(fā)現(xiàn)任何ORA_ERRORS (ORA-XXX)
13、 的錯(cuò)誤,將它記錄并且仔細(xì)的研究它們,或反饋給DB組如何確定警告日志文件的路徑? 通過(guò)參看起始參數(shù)文件 init<SID>.ora,而起始參數(shù)文件一般存儲(chǔ)在$ORACLE_HOME/dbs下$ cd $ORACLE_HOME/dbs$ cat initUWNMS1.ora*.background_dump_dest='/opt/oracle/product/10g/admin/UWNMS1/bdump'*.core_dump_dest='/opt/oracle/product/10g/admin/UWNMS1/cdump'*.user_dump_de
14、st='/opt/oracle/product/10g/admin/UWNMS1/udump'D檢查數(shù)據(jù)庫(kù)備份是否成功對(duì)RMAN備份方式:檢查第三方備份工具的備份日志以確定備份是否成功如果具備恢復(fù)目錄的,可直接登陸到rman環(huán)境下,發(fā)命令list backup查看具體備份集合的情況; GDDB4-/> rman target=sys/xxxuwnms3 catalog=rman/rmanuwnms3Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jul 31 11:39:37 2008Copyright (
15、c) 1982, 2005, Oracle. All rights reserved.connected to target database: UWNMS3 (DBID=connected to recovery catalog databaseRMAN> list backup; List of Backup Sets=BS Key Type LV Size Device Type Elapsed Time Completion Time - - - - - - -422624 Incr 0 12.59M DISK 00:00:07 2008-07-28 03:15:21 BP Ke
16、y: 422631 Status: AVAILABLE Compressed: YES Tag: BK0 List of Datafiles in backup set 422624 File LV Type Ckp SCN Ckp Time Name - - - - - -對(duì)EXPORT,EXPDP邏輯備份方式:檢查exp,expdp日志文件以確定備份是否成功對(duì)其他備份方式:檢查相應(yīng)的日志文件E檢查表空間的使用情況1. 檢查在表空間中有沒(méi)有剩余空間。對(duì)每一個(gè)實(shí)例來(lái)說(shuō),檢查在表空間中是否存在有剩余空間來(lái)滿足當(dāng)天的預(yù)期的需要。當(dāng)數(shù)據(jù)庫(kù)中已有的數(shù)據(jù)是穩(wěn)定的,數(shù)據(jù)日增長(zhǎng)的平均數(shù)也是可以計(jì)算出來(lái),最小
17、的剩余空間至少要能滿足每天數(shù)據(jù)的增長(zhǎng)。腳本:select t.tablespace_name, total, free, round(100*(1-(free/total),3)|'%' as已使用的空間比例from (select tablespace_name, sum(bytes)/1024/1024 total from dba_data_files group by tablespace_name) t,(select tablespace_name, sum(bytes)/1024/1024 free from dba_free_space group by tab
18、lespace_name) f where t.tablespace_name=f.tablespace_name(+)and t.tablespace_name not in ('DRSYS','ORDIM','SPATIAL','USERS','TOOLS','XDB')order by round(100*(1-(free/total),3) desc;2. 識(shí)別出表空間下一些過(guò)分的對(duì)象空間增長(zhǎng)查看數(shù)據(jù)庫(kù)中超出資源或是增長(zhǎng)速度過(guò)大的段,具體分析看是否需要調(diào)整。select owner,segm
19、ent_name,partition_name,bytes/1024/1024 from dba_segments where tablespace_name = 'NRMTBS' order by bytes desc根據(jù)實(shí)際情況,先清除臨時(shí)無(wú)用的數(shù)據(jù)庫(kù)對(duì)象;或回收部分頻繁dml操作的庫(kù)表空間Oracle 10g下的一些處理:- 庫(kù)表:alter table prdb.MLOG$_FACT_AGG2BSC_BASE_PI move注意:move后建立于數(shù)據(jù)庫(kù)對(duì)象上的索引會(huì)失效,記住一定要重新編譯!/* - 以下腳本用于檢查失效的索引select * from dba_inde
20、xes where status not in ('VALID','N/A')SELECT index_name,PARTITION_NAME,TABLESPACE_NAME FROM USER_IND_PARTITIONS WHERE status = 'UNUSABLE' ORDER BY PARTITION_NAME;*/- 索引:alter index NPMDB.UQ_TPA_SAE_SUM rebuild tablespace idxdbs online nologging parallel 4 ;alter index NPMDB.
21、UQ_TPA_SAE_SUM noparallel;3. 表空間管理- 創(chuàng)建表空間CREATE tablespace apmdbs1 datafile '/dev/vx/rdsk/data1dg/vola0101' size 4095M extent management local segment space management auto;注: 添加裸設(shè)備上的數(shù)據(jù)文件請(qǐng)注意路徑/dev/rdsk/c0t0d0s0? ? ?裸設(shè)備/dev/dsk/c0t0d0s0? ? ? ?塊設(shè)備它們鏈接的是同一塊物理設(shè)備,具體區(qū)別是在訪問(wèn)方式上。裸設(shè)備是假設(shè)硬盤(pán)上沒(méi)有文件系統(tǒng)時(shí)的訪問(wèn)方式
22、。裸設(shè)備是按順序訪問(wèn),塊設(shè)備是按文件系統(tǒng)和i節(jié)點(diǎn)“隨機(jī)”訪問(wèn)。二者的使用場(chǎng)合也不同。在做newfs之前,因?yàn)闆](méi)有文件系統(tǒng),只能訪問(wèn)裸設(shè)備;做了newfs,進(jìn)行掛接時(shí),因?yàn)樾枰L問(wèn)磁盤(pán)上的文件系統(tǒng),所以只能用塊設(shè)備- 增加數(shù)據(jù)文件,擴(kuò)充表空間ALTER TABLESPACE PRTBS19 ADD DATAFILE '/dev/vx/rdsk/data2dg/volb0082' SIZE 4095M AUTOEXTEND OFF;ASM下:Uwnms1:alter tablespace NRMTBS add datafile '+DISKGROUP1' size
23、8192M autoextend offUwnms2:alter tablespace PRTBS add datafile '+DISKGROUP2' size 8192M autoextend off- 增加臨時(shí)文件,擴(kuò)充臨時(shí)表空間ALTER tablespace TEMP ADD tempfile '/dev/vx/rdsk/data2dg/temp02' size 4095M reuse;- 數(shù)據(jù)文件收縮,針對(duì)文件系統(tǒng)上的數(shù)據(jù)文件alter database datafile '$HOME/DATA/DISK5/data02.dbf' r
24、esize 1500k;ASM下:Select file_name,tablespace_name,bytes/1024/1024|'M','alter database datafile '''|file_name|''' resize 22528M;' from dba_data_files where tablespace_name = 'IDXDBS' alter database datafile resize 15360M;F檢查數(shù)據(jù)文件的狀態(tài)檢查數(shù)據(jù)文件的狀態(tài)記錄狀態(tài)不是“online
25、”的數(shù)據(jù)文件,并及時(shí)聯(lián)系DB組跟進(jìn)。SQL> set linesize 200SQL> set pagesize 200SQL> Select file_name from dba_data_files where status='OFFLINE'no rows selectedG檢查數(shù)據(jù)庫(kù)會(huì)話分?jǐn)?shù)據(jù)庫(kù)用戶統(tǒng)計(jì)數(shù)據(jù)庫(kù)會(huì)話的情況:select schemaname,count(1) from v$session group by schemaname分?jǐn)?shù)據(jù)庫(kù)用戶,模塊統(tǒng)計(jì)數(shù)據(jù)庫(kù)會(huì)話的情況:select schemaname,program,count(1) fr
26、om v$session where schemaname <> 'SYS' group by schemaname,program殺掉異常的會(huì)話或會(huì)話對(duì)應(yīng)的進(jìn)程:(以具有DBA權(quán)限的用戶來(lái)清除會(huì)話)select sid,serial# from v$session where sid = $sidselect spid from v$process where addr in ( select paddr from v$session where sid = $sid )alter system kill session <sid>,<seria
27、l#>如果執(zhí)行上述命令后,仍然沒(méi)有能及時(shí)釋放會(huì)話,可直接殺掉會(huì)話對(duì)應(yīng)的服務(wù)器進(jìn)程kill -9 <spid>H檢查數(shù)據(jù)庫(kù)主機(jī)的性能情況檢查數(shù)據(jù)庫(kù)所在主機(jī)的性能,記錄數(shù)據(jù)庫(kù)的cpu使用、IO、buffer命中率等等,使用vmstat,iostat,top等命令Vmstat: 關(guān)注cpu的idleIostat:關(guān)注磁盤(pán)IO的繁忙程度(%b)Top: 關(guān)注消耗cpu多的相關(guān)進(jìn)程O(píng)racle 10g EM監(jiān)控:I. 數(shù)據(jù)庫(kù)的正常啟動(dòng)與關(guān)閉- 關(guān)閉步驟:1停止監(jiān)聽(tīng)GDDB4-/export/home/oracle> lsnrctl stop2停止實(shí)例使用sql*plus工具,以具
28、有DBA權(quán)限的數(shù)據(jù)庫(kù)用戶登陸到具體實(shí)例上操作GDDB4-/export/home/oracle> setenv ORACLE_SID UWNMS3 GDDB4-/export/home/oracle> sqlplus /nolog SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jul 31 15:06:23 2008Copyright (c) 1982, 2006, Oracle. All Rights Reserved.SQL> conn sys/xxxxxx as sysdbaConnected.SQL> shut
29、down immediate3. 檢查實(shí)例相關(guān)進(jìn)程GDDB4-/export/home/oracle> ps -ef|grep UWNMS3 oracle 25119 1 0 Jun 24 ? 0:04 ora_dbw4_UWNMS3 oracle 25110 1 0 Jun 24 ? 3:23 ora_dbw1_UWNMS3 oracle 25146 1 0 Jun 24 ? 0:00 ora_reco_UWNMS3 oracle 25125 1 0 Jun 24 ? 0:09 ora_dbw5_UWNMS3 oracle 25142 1 0 Jun 24 ? 5:49 ora_smo
30、n_UWNMS3 oracle 25155 1 0 Jun 24 ? 1:19 ora_mmon_UWNMS3 oracle 25152 1 0 Jun 24 ? 103:58 ora_cjq0_UWNMS3 oracle 25102 1 0 Jun 24 ? 0:02 ora_mman_UWNMS3 oracle 25108 1 0 Jun 24 ? 7:49 ora_dbw0_UWNMS3 oracle 25478 1 0 Jun 24 ? 0:46 ora_arc1_UWNMS3 oracle 25470 1 0 Jun 24 ? 0:49 ora_arc0_UWNMS3 oracle
31、7770 1 0 15:06:42 ? 0:00 ora_j000_UWNMS3 oracle 25159 1 0 Jun 24 ? 86:03 ora_mmnl_UWNMS3 oracle 25094 1 0 Jun 24 ? 17:55 ora_pmon_UWNMS3 oracle 25117 1 0 Jun 24 ? 0:42 ora_dbw3_UWNMS3 oracle 25131 1 0 Jun 24 ? 13:32 ora_lgwr_UWNMS3 oracle 25100 1 0 Jun 24 ? 1:11 ora_psp0_UWNMS3 oracle 25113 1 0 Jun
32、24 ? 0:15 ora_dbw2_UWNMS3 oracle 25135 1 0 Jun 24 ? 24:23 ora_ckpt_UWNMS3 oracle 18673 1 0 Jun 11 ? 47:45 oracleUWNMS3 (LOCAL=NO) oracle 14299 1 0 15:00:06 ? 0:00 oracleUWNMS3 (LOCAL=NO) oracle 28391 1 0 11:23:55 ? 0:12 oracleUWNMS3 (LOCAL=NO) oracle 10004 1 1 15:08:02 ? 0:17 oracleUWNMS3 (LOCAL=NO)
33、緊急情況下,可手工直接殺掉帶LOCAL標(biāo)識(shí)的進(jìn)程,加快數(shù)據(jù)庫(kù)的關(guān)閉操作;但oracle的相關(guān)后臺(tái)進(jìn)程請(qǐng)不要隨便KILL掉。- 啟動(dòng)步驟:1啟動(dòng)實(shí)例使用sql*plus工具,以具有DBA權(quán)限的數(shù)據(jù)庫(kù)用戶登陸到具體實(shí)例上操作GDDB4-/export/home/oracle> setenv ORACLE_SID UWNMS3 GDDB4-/export/home/oracle> sqlplus /nolog SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jul 31 15:06:23 2008Copyright (c) 1982, 2
34、006, Oracle. All Rights Reserved.SQL> conn sys/xxxxxx as sysdbaConnected.SQL> startup2啟動(dòng)監(jiān)聽(tīng)GDDB4-/export/home/oracle> lsnrctl start3. 檢查實(shí)例相關(guān)進(jìn)程GDDB4-/export/home/oracle> ps -ef|grep UWNMS3 oracle 25119 1 0 Jun 24 ? 0:04 ora_dbw4_UWNMS3 oracle 25110 1 0 Jun 24 ? 3:23 ora_dbw1_UWNMS3 oracle 25146 1 0 Jun 24 ? 0:00 ora_reco_UWNMS3 oracle 25125 1 0 Jun 24 ? 0:09 ora_dbw5_UWNMS3
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2 周末巧安排 教學(xué)設(shè)計(jì)-2024-2025學(xué)年道德與法治二年級(jí)上冊(cè)統(tǒng)編版
- 經(jīng)營(yíng)權(quán)轉(zhuǎn)讓合同模板
- 合同樣本商業(yè)地產(chǎn)項(xiàng)目投資合作協(xié)議書(shū)
- 個(gè)人向公司借款合同簡(jiǎn)例
- 1-1《子路、曾皙、冉有、公西華侍坐》教學(xué)設(shè)計(jì)-2024-2025學(xué)年高一語(yǔ)文下學(xué)期同步教學(xué)設(shè)計(jì)(統(tǒng)編版必修下冊(cè))
- Module 3 Unit 9 Great cities of the world(教學(xué)設(shè)計(jì))-2023-2024學(xué)年滬教牛津版(深圳用)英語(yǔ)六年級(jí)上冊(cè)
- 25《慢性子裁縫和急性子顧客》(教學(xué)設(shè)計(jì))-2023-2024學(xué)年統(tǒng)編版語(yǔ)文三年級(jí)下冊(cè)
- 豬舍購(gòu)銷合同范本
- 沉降檢測(cè)合同范本
- 毛毛新車網(wǎng)合同范本
- 中醫(yī)醫(yī)療技術(shù)手冊(cè)2013普及版
- 腹部血管解剖-1
- 結(jié)構(gòu)化表達(dá)思維訓(xùn)練(完整版)
- 介紹南京大學(xué)
- SYT 6925-2021 鉆井用天然氣發(fā)動(dòng)機(jī)及供氣站安全規(guī)程-PDF解密
- 養(yǎng)生館租賃協(xié)議合同
- 供應(yīng)室停水停電應(yīng)急預(yù)案
- 魚(yú)燈非遺文化知識(shí)介紹
- 兒童常用藥物及安全用藥課件
- 冬季安全生產(chǎn)知識(shí)講座
- 幼兒園廚師廚房崗位管理培訓(xùn)教學(xué)課件(一)
評(píng)論
0/150
提交評(píng)論