您好,登錄后才能下訂單哦!
從11G開始,安裝RAC已經變成了一個體力活兒,但是RAC安裝完成后,如何保證系統的穩定運行,如何得到系統的性能,這個對后期在線系統的穩定運行影響巨大。
下面是總結了最近1年多來工程實施中的一些經驗。
###################################################################################
## 0. 環境檢查
## 1. IO性能測試
## 2. 網絡性能測試
## 3. 高可用測試
## 4. HP-UX 硬件查看命令
## 5. 日志收集
## 備注:該文檔基于HP-UX平臺整理,平臺不同時請參考平臺對應的操作命令
###################################################################################
===================================================================================
## 0. 環境檢查
===================================================================================
-----------------------------------------------------------------------------------
# 0.1 系統時間/時區
-----------------------------------------------------------------------------------
# date
# cat /etc/TIMEZONE
# cat /etc/default/tz
# echo $TZ
-----------------------------------------------------------------------------------
# 0.2 檢測內核參數/異步IO/網絡參數
# 異步IO文件權限正確值為: oracle/oinstall 660 101 0x000104 /dev/async
-----------------------------------------------------------------------------------
--HP
# kctune | sort
# ls -la /dev/async
# cat /etc/rc.config.d/nddconf
# netstat -inw
--Linux
# sysctl -a | sort
-----------------------------------------------------------------------------------
# 0.3 互信檢查
-----------------------------------------------------------------------------------
$ more /etc/hosts | grep -Ev '^#|^$|127.0.0.1|vip|scan|:' | awk '{print "ssh " $2 " date;"}' > ping.sh
$ sh ./ping.sh
-----------------------------------------------------------------------------------
# 0.4 集群狀態檢查
-----------------------------------------------------------------------------------
# crsctl stat res -t
# olsnodes -n -i -s -t
# olsnodes -c
# oifcfg getif
-----------------------------------------------------------------------------------
# 0.5 檢查實例運行狀態
-----------------------------------------------------------------------------------
SQL>
set linesize 160;
select inst_id,instance_name, to_char(startup_time, 'yyyy-mm-dd hh34:mi:ss') START_TIME, status from gv$instance;
-----------------------------------------------------------------------------------
# 0.6 檢查ASM DG容量
-----------------------------------------------------------------------------------
SQL>
select group_number,
name,
state,
type,
ROUND(total_mb / 1024, 2) TOTAL_GB,
ROUND(free_mb / 1024, 2) FREE_GB,
round((total_mb - free_mb) / (case total_mb
when 0 then
1
else
total_mb
end) * 100,
2) ratio
from v$asm_diskgroup;
===================================================================================
## 1. IO性能測試
===================================================================================
-----------------------------------------------------------------------------------
# 1.1 calibrate_io測試
-----------------------------------------------------------------------------------
SELECT D.NAME,
I.ASYNCH_IO
FROM V$DATAFILE D,
V$IOSTAT_FILE I
WHERE D.FILE# = I.FILE_NO
AND I.FILETYPE_NAME = 'Data File';
--Enabled both direct I/O and asynchronous I/O where possible.
ALTER SYSTEM SET filesystemio_options=setall SCOPE=SPFILE;
SET SERVEROUTPUT ON
DECLARE
l_latency PLS_INTEGER;
l_iops PLS_INTEGER;
l_mbps PLS_INTEGER;
BEGIN
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (num_physical_disks => 26, --> 磁盤數量 select count(1) from v$asm_disk;
max_latency => 20, --> 最大延遲
max_iops => l_iops,
max_mbps => l_mbps,
actual_latency => l_latency);
DBMS_OUTPUT.put_line('Max IOPS = ' || l_iops);
DBMS_OUTPUT.put_line('Max MBPS = ' || l_mbps);
DBMS_OUTPUT.put_line('Latency = ' || l_latency);
END;
/
--監控IO及HBA卡的速率
# sar -H 2 10000
-----------------------------------------------------------------------------------
# 1.2 fio測試
-----------------------------------------------------------------------------------
===================================================================================
## 2. 網絡性能測試
===================================================================================
-----------------------------------------------------------------------------------
# 2.1 netperf測試
-----------------------------------------------------------------------------------
cd /usr/contrib/bin/tools
--服務器端
# netserver -4 -L 192.168.30.76 -p 8000
--客戶端
# netperf -H 192.168.30.76 -p 8000 -n 20 -l 60
--測試UDP發包
# netperf -t UDP_RR -H 192.168.30.76 -p 8000 -l 10 -- -r 1500 1500
# netperf -t UDP_RR -H 192.168.30.76 -p 8000 -l 10 -- -r 9000 9000
-----------------------------------------------------------------------------------
## 2.2 iperf測試,Linux中為iperf3
-----------------------------------------------------------------------------------
--服務器端
# iperf -s -p 5001 -i 2
--客戶端
# iperf -c 192.168.30.76 -P 4 -t 30 -i 2 -p 5001
-----------------------------------------------------------------------------------
## 2.3 ftp速率測試
-----------------------------------------------------------------------------------
ftp> put "|dd if=/dev/zero bs=32k count=10000" /dev/null
-----------------------------------------------------------------------------------
# 2.4 MUT測試為9000 (tcpdump需要root權限)
-----------------------------------------------------------------------------------
--lan902 心跳網卡
--192.168.20.67 對端心跳網卡地址
--從該節點通過訪問對方的心跳IP來建立tcp連接,隨后看上面抓到的TCP包即可看到mss值。如果為8960,則說明mtu為9000.
--通過netperf或ping進行發包測試,ICMP 長度為 8976
cd /usr/contrib/bin/tools
# tcpdump -i lan902 ip host 192.168.20.67
# telnet 192.168.20.67 22
# netperf -H 192.168.20.67 -p 8000 -n 20 -l 60
# ping 192.168.20.67 9000
===================================================================================
## 3. 高可用測試
===================================================================================
-----------------------------------------------------------------------------------
# 3.1 存儲鏈路測試
# 查看操作系統日志中鏈路disabled和endable狀態,查看HBA卡數據流量信息
# 查看磁盤鏈路聚合情況
# 存儲鏈路測試過程中,全程開啟DBMS_RESOURCE_MANAGER.CALIBRATE_IO進行加壓
-----------------------------------------------------------------------------------
--確認設備鏈路
# ioscan -m dsf /dev/rdisk/disk101
# tail -f /var/adm/syslog/syslog.log
# sar -H 2 10000
-----------------------------------------------------------------------------------
# 3.2 網卡/交換機測試
# 查看集群日志是否有網絡中斷情況,查看ASM告警日志 (grid用戶)
# 查看網卡聚合情況,查看網卡日志,查看是否丟包
# 網絡測試過程中,全程開啟netperf發包進行加壓
-----------------------------------------------------------------------------------
grid$ cd $ORACLE_HOME/log/`hostname`/; tail -f alert`hostname`.log
grid$ cd $ORACLE_BASE/diag/asm/+asm/$ORACLE_SID/trace; tail -f alert_$ORACLE_SID.log
# glance -> l
# nwmgr -S apa -c lan902 -v
# cd /var/adm; netfmt -f nettl.LOG000
# ping IP
===================================================================================
## 4. HP-UX 硬件查看命令
===================================================================================
-----------------------------------------------------------------------------------
## 4.1 查看設備
-----------------------------------------------------------------------------------
--FC設備
# ioscan -fnCfc
--網卡設備
# ioscan -fnClan
-----------------------------------------------------------------------------------
## 4.2 查看FC設備狀態
-----------------------------------------------------------------------------------
# fcmsutil /dev/fcd1
-----------------------------------------------------------------------------------
## 4.3 查看磁盤多路徑信息
-----------------------------------------------------------------------------------
# ioscan -m dsf /dev/rdisk/disk101
-----------------------------------------------------------------------------------
## 4.4 查看網卡信息
-----------------------------------------------------------------------------------
# lanscan -qv
# netstat -inw
-----------------------------------------------------------------------------------
## 4.5 查看網卡綁定信息
-----------------------------------------------------------------------------------
--網卡綁定信息
# nwmgr -S apa -c lan902 -v
--網卡優先級
# nwmgr -g -A all -c lan5 -S apa
===================================================================================
## 5. 日志收集
===================================================================================
-----------------------------------------------------------------------------------
## 5.1 ASM日志 (grid)
-----------------------------------------------------------------------------------
cd $ORACLE_BASE/diag/asm/+asm/$ORACLE_SID/trace; tail -f alert_$ORACLE_SID.log
-----------------------------------------------------------------------------------
## 5.2 集群日志 (grid)
-----------------------------------------------------------------------------------
cd $ORACLE_HOME/log/`hostname`/; tail -f alert`hostname`.log
-----------------------------------------------------------------------------------
## 5.3 數據庫日志 (oracle)
-----------------------------------------------------------------------------------
cd $ORACLE_BASE/diag/rdbms/`echo ${ORACLE_SID%?}`/$ORACLE_SID/trace; tail -f alert_$ORACLE_SID.log
-----------------------------------------------------------------------------------
## 5.4 操作系統日志 (root)
-----------------------------------------------------------------------------------
tail -f /var/adm/syslog/syslog.log
-----------------------------------------------------------------------------------
## 5.5 網卡日志 (root)
-----------------------------------------------------------------------------------
cd /var/adm; netfmt -f nettl.LOG000
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。