提取DB2多分割槽環境當前的狀態
##最近整理了一下先前主機的內容,竟然發現好多的內容都沒有備份,失誤呀
########################################################################
##echo "本指令碼是提取DB2多分割槽環境當前的狀態"
##echo "主要是每個分割槽中對應的表空間和容器的資訊"
##echo "使用方法:db2_check_dpf_status.sh dbname"
##echo "CopyRight "
########################################################################
#!/bin/sh
check_time=`date '+%Y%m%d'`
FILEPATH=$0
FILENAME=${FILEPATH##*/}
########################################################################
##echo "本指令碼是提取DB2多分割槽環境當前的狀態"
##echo "主要是每個分割槽中對應的表空間和容器的資訊"
##echo "使用方法:db2_check_dpf_status.sh dbname"
##echo "CopyRight "
########################################################################
#!/bin/sh
check_time=`date '+%Y%m%d'`
FILEPATH=$0
FILENAME=${FILEPATH##*/}
echo
usage()
{
echo "Invalid parameter,you must use it like this:${FILENAME} dbname !"
exit 3
}
if [ $# -ne 1 ]
then
usage
fi
dbname=$1
usage()
{
echo "Invalid parameter,you must use it like this:${FILENAME} dbname !"
exit 3
}
if [ $# -ne 1 ]
then
usage
fi
dbname=$1
db2level >> db2status.${dbname}.log.$check_time
db2 list db directory >> db2status.${dbname}.log.$check_time
db2 get dbm cfg show detail>> db2status.${dbname}.log.$check_time
db2 connect to $dbname >> db2status.${dbname}.log.$check_time
db2 list database partition groups >> db2status.${dbname}.log.$check_time
db2 "select * from syscat.bufferpools" >> db2status.${dbname}.log.$check_time
db2 list DBPARTITIONNUMS | grep " " >> /tmp/DBPARTITIONNUMS.$dbname.log
cat /tmp/DBPARTITIONNUMS.$dbname.log | while read line
do
db_partnum=`echo $line | awk '{print $1}'`
if [ "$db_partnum" = "" ]
then
break
fi
echo "Begin to get Information of partition Node $db_partnum " >> db2status.${dbname}.log.$check_time
export DB2NODE=$db_partnum >> db2status.${dbname}.log.$check_time
db2 terminate >> db2status.${dbname}.log.$check_time
db2 connect to $dbname >> db2status.${dbname}.log.$check_time
db2 "values (current dbpartitionnum)" >> db2status.${dbname}.log.$check_time
db2 get db cfg for $dbname show detail >> db2status.${dbname}.log.$check_time
db2 list tablespaces show detail >> db2status.${dbname}.log.$check_time
db2 list tablespaces | grep "Tablespace ID" | while read line2
do
tbsp_id=`echo $line2 | awk '{print $4}'`
if [ "$tbsp_id" = "" ]
then
break
fi
db2 list tablespace containers for $tbsp_id show detail >> db2status.${dbname}.log.$check_time
done
sleep 2
done
rm -rf /tmp/DBPARTITIONNUMS.$dbname.log
echo "Get Information successful!"
exit 0
db2 list db directory >> db2status.${dbname}.log.$check_time
db2 get dbm cfg show detail>> db2status.${dbname}.log.$check_time
db2 connect to $dbname >> db2status.${dbname}.log.$check_time
db2 list database partition groups >> db2status.${dbname}.log.$check_time
db2 "select * from syscat.bufferpools" >> db2status.${dbname}.log.$check_time
db2 list DBPARTITIONNUMS | grep " " >> /tmp/DBPARTITIONNUMS.$dbname.log
cat /tmp/DBPARTITIONNUMS.$dbname.log | while read line
do
db_partnum=`echo $line | awk '{print $1}'`
if [ "$db_partnum" = "" ]
then
break
fi
echo "Begin to get Information of partition Node $db_partnum " >> db2status.${dbname}.log.$check_time
export DB2NODE=$db_partnum >> db2status.${dbname}.log.$check_time
db2 terminate >> db2status.${dbname}.log.$check_time
db2 connect to $dbname >> db2status.${dbname}.log.$check_time
db2 "values (current dbpartitionnum)" >> db2status.${dbname}.log.$check_time
db2 get db cfg for $dbname show detail >> db2status.${dbname}.log.$check_time
db2 list tablespaces show detail >> db2status.${dbname}.log.$check_time
db2 list tablespaces | grep "Tablespace ID" | while read line2
do
tbsp_id=`echo $line2 | awk '{print $4}'`
if [ "$tbsp_id" = "" ]
then
break
fi
db2 list tablespace containers for $tbsp_id show detail >> db2status.${dbname}.log.$check_time
done
sleep 2
done
rm -rf /tmp/DBPARTITIONNUMS.$dbname.log
echo "Get Information successful!"
exit 0
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/177006/viewspace-762832/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Spark獲取當前分割槽的partitionIdSpark
- Hive的靜態分割槽與動態分割槽Hive
- 當前EVA4400儲存分割槽情況
- 在範圍分割槽表上分割槽維護操作對索引狀態的影響索引
- JavaFX:當前的狀態和不久的將來Java
- unity 動態修改當前橫豎屏狀態Unity
- 在範圍分割槽表上分割槽維護操作對索引狀態的影響(1)索引
- status 返回當前請求的http狀態碼HTTP
- 如何檢視資料庫當前的狀態?資料庫
- 搭建 MongoDB分片(sharding) / 分割槽 / 叢集環境MongoDB
- 修改oracle當前會話的語言環境Oracle會話
- Hive中靜態分割槽和動態分割槽總結Hive
- SSD固態硬碟要分割槽嗎?SSD固態硬碟分割槽與不分割槽的效能對比硬碟
- java檢測當前CPU負載狀態的方法Java負載
- uboot環境變數與核心MTD分割槽關係boot變數
- 提取java環境資訊Java
- Hive動態分割槽Hive
- 使用sestatus命令來檢視SELinux的當前狀態Linux
- 固態硬碟分割槽與不分割槽的區別 秒懂SSD要不要分割槽硬碟
- 當前分割槽不支援大於4g的檔案怎麼辦?
- 在範圍分割槽表上分割槽維護操作對全域性及本地索引狀態的影響(2)索引
- Linux 應用程式處理當前執行環境的環境變數(轉)Linux變數
- Rac 環境中分割槽表建立index hang(row cache lock)Index
- Python 檢視當前環境所有變數的大小Python變數
- 巢狀表段的等同分割槽巢狀
- DB2 V9表分割槽(四)DB2
- DB2 V9表分割槽(三)DB2
- DB2 V9表分割槽(二)DB2
- DB2 V9表分割槽(一)DB2
- Asp.Net在多執行緒環境下的狀態儲存問題ASP.NET執行緒
- Linux環境下實現NTFS分割槽完全讀寫的方法(轉)Linux
- SQL提取當前庫內索引的建立語句SQL索引
- DB2多分割槽資料庫的常用管理NWDB2資料庫
- 裝系統時提示目標分割槽是動態磁碟的gpt分割槽,需要在pe環境下進行備份或還原怎麼解決GPT
- 如何查詢分割槽表的分割槽及子分割槽
- Hive動態分割槽詳解Hive
- 固態硬碟怎麼分割槽硬碟
- 設定DB2環境DB2