Tips

「Tips」の編集履歴(バックアップ)一覧はこちら

Tips」(2010/11/25 (木) 12:26:05) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

●改行コード変換 <<CRLF→LF>> tr -d \\r < CRLF-file > LF-file <<LF→CRLF>> perl -pe 's/\n/\r\n/' LF-file > CRLF-file gzip -dc toyotsu.tar.gz | tar xvf - tar cvf tar_name.tar * ps -ef | grep wasusr1 ●WAS強制終了 kill -9 pid ※pid=起動時にコンソールに出力 766090 ●DB再起動 su - ユーザ名 db2 force application all セッション強制終了 db2 deactivate db db_name DB停止 db2stop インスタンス停止 db2start インスタンス、DBスタート ■DB2 エクスポートインポート db2move nd01 export -sn スキマー名 db2move nd01 import -u スキマー名 -p パスワード db2 export to ./×××.ixf of ixf messages ./20090911_exp.log select * from スキマー.××_××_tbl ※エクスポートは対象テーブルをロックする。 ■DB2 ロック情報確認 $ db2 get snapshot for locks on db_name ■DB2 テーブルTruncate $ alter table <<Table-Name>> activate not logged initially with empty table ■ DB2 セッションを切る db2 force application ALL ■ セッションを確認する db2 list applications ■ 表スペースを確認する db2 list tablespaces show detail ************************************************************** ■ DB2 キャッシュメモリ開放コマンド # sysctl -w vm.drop_caches=option option 1・・・ページキャッシュのみを解放 2・・・ダーティページとinodeキャッシュを解放 3・・・ ページキャッシュとダーティページとinode ■ メモリーチューニング(AIX) # vmstat -v 524288 memory pages ←実メモリページ数   494223 lruable pages 4115 free pages 2 memory pools 176832 pinned pages ←ページアウトされない使用メモリ 80.0 maxpin percentage 20.0 minperm percentage ←ファイルキャッシュの最低保持割合 80.0 maxperm percentage ←ファイルキャッシュの最大保持割合 15.5 numperm percentage ←実メモリに対するファイルキャッシュの占める割合 76722 file pages ←ファイルキャッシュのページ数 0.0 compressed percentage 0 compressed pages 16.4 numclient percentage ←現在のバッファキャッシュの実メモリに対する割合 80.0 maxclient percentage ←バッファキャッシュの最大保持割合 81069 client pages ←現在のバッファキャッシュのページ数 0 remote pageouts scheduled 9203 pending disk I/Os blocked with no pbuf 8718 paging space I/Os blocked with no psbuf 2740 filesystem I/Os blocked with no fsbuf 30 client filesystem I/Os blocked with no fsbuf 0 external pager filesystem I/Os blocked with no fsbuf ******************************************************************** ■アラート照会 db2 get alert cfg for db on db_name ■ヘルス・アラートの構成情報を照会する。 db2 "select substr(name,1,30) as name, substr(short_description,1,50) as short_description, substr(category,1,80) as category from table(sysproc.health_get_ind_definition('ja_JP')) as ind_definition" ■アラート・アクションの設定情報を照会する。 db2 "select substr(A.objecttype,1,3) as objecttype, substr(A.cfg_level,1,1) as cfg_level, substr(A.dbname,1,10) as dbname, A.id, substr(I.name,1,30) as name, A.warning_threshold, A.alarm_threshold, A.evaluate, A.action_enabled from table(sysproc.health_get_alert_cfg('db','o','nd01','')) as A, table(sysproc.health_get_ind_definition('ja_JP')) as I where A.id = I.id" ■PDLOGMSGS_LAST24HOURSビューの定義 ●1日以内に出力されたメッセージを参照する場合は、ビューを使用する。 例)現在からさかのぼり、24時間以内に出力されたSEVERITY=‘C’(Critical)のメッセージを、メッセージ 出力時刻に並び替えて照会する。 db2 "select * from SYSIBMADM.PDLOGMSGS_LAST24HOURS where MSGSEVERITY = 'C' order by TIMESTAMP desc" ●特定の期間に出力されたメッセージを参照する場合は、UDFを使用する。 例)過去1週間以内に出力されたSEVERITY=‘C’(Critical)のメッセージを、メッセージ出力時刻に並び 替えて照会する。 db2 "select * from table(SYSPROC.PD_GET_LOG_MSGS(current_timestamp - 7 days)) as t where MSGSEVERITY = 'C' order by TIMESTAMP desc" ■Notifyログへのすべての出力から、SEVERITY=‘E’(Error)のメッセージを、メッセージ出力時刻に 並び替えて照会する。 db2 "select timestamp, msg from table ( pd_get_log_msgs(cast(null as timestamp))) as t where msgseverity='E' order by timestamp desc" ******************************************************************* &link_editmenu(text=ここを編集)
●改行コード変換 <<CRLF→LF>> tr -d \\r < CRLF-file > LF-file <<LF→CRLF>> perl -pe 's/\n/\r\n/' LF-file > CRLF-file gzip -dc toyotsu.tar.gz | tar xvf - tar cvf tar_name.tar * ps -ef | grep wasusr1 ●WAS強制終了 kill -9 pid ※pid=起動時にコンソールに出力 766090 ●DB再起動 su - ユーザ名 db2 force application all セッション強制終了 db2 deactivate db db_name DB停止 db2stop インスタンス停止 db2start インスタンス、DBスタート ■DB2 エクスポートインポート db2move nd01 export -sn スキマー名 db2move nd01 import -u スキマー名 -p パスワード db2 export to ./×××.ixf of ixf messages ./20090911_exp.log select * from スキマー.××_××_tbl ※エクスポートは対象テーブルをロックする。 ■DB2 ロック情報確認 $ db2 get snapshot for locks on db_name ■DB2 テーブルTruncate $ alter table <<Table-Name>> activate not logged initially with empty table ■ DB2 セッションを切る db2 force application ALL ■ セッションを確認する db2 list applications ■ 表スペースを確認する db2 list tablespaces show detail ************************************************************** ■ DB2 キャッシュメモリ開放コマンド # sysctl -w vm.drop_caches=option option 1・・・ページキャッシュのみを解放 2・・・ダーティページとinodeキャッシュを解放 3・・・ ページキャッシュとダーティページとinode ■ メモリーチューニング(AIX) # vmstat -v 524288 memory pages ←実メモリページ数   494223 lruable pages 4115 free pages 2 memory pools 176832 pinned pages ←ページアウトされない使用メモリ 80.0 maxpin percentage 20.0 minperm percentage ←ファイルキャッシュの最低保持割合 80.0 maxperm percentage ←ファイルキャッシュの最大保持割合 15.5 numperm percentage ←実メモリに対するファイルキャッシュの占める割合 76722 file pages ←ファイルキャッシュのページ数 0.0 compressed percentage 0 compressed pages 16.4 numclient percentage ←現在のバッファキャッシュの実メモリに対する割合 80.0 maxclient percentage ←バッファキャッシュの最大保持割合 81069 client pages ←現在のバッファキャッシュのページ数 0 remote pageouts scheduled 9203 pending disk I/Os blocked with no pbuf 8718 paging space I/Os blocked with no psbuf 2740 filesystem I/Os blocked with no fsbuf 30 client filesystem I/Os blocked with no fsbuf 0 external pager filesystem I/Os blocked with no fsbuf ******************************************************************** ■アラート照会 db2 get alert cfg for db on db_name ■ヘルス・アラートの構成情報を照会する。 db2 "select substr(name,1,30) as name, substr(short_description,1,50) as short_description, substr(category,1,80) as category from table(sysproc.health_get_ind_definition('ja_JP')) as ind_definition" ■アラート・アクションの設定情報を照会する。 db2 "select substr(A.objecttype,1,3) as objecttype, substr(A.cfg_level,1,1) as cfg_level, substr(A.dbname,1,10) as dbname, A.id, substr(I.name,1,30) as name, A.warning_threshold, A.alarm_threshold, A.evaluate, A.action_enabled from table(sysproc.health_get_alert_cfg('db','o','nd01','')) as A, table(sysproc.health_get_ind_definition('ja_JP')) as I where A.id = I.id" ■PDLOGMSGS_LAST24HOURSビューの定義 ●1日以内に出力されたメッセージを参照する場合は、ビューを使用する。 例)現在からさかのぼり、24時間以内に出力されたSEVERITY=‘C’(Critical)のメッセージを、メッセージ 出力時刻に並び替えて照会する。 db2 "select * from SYSIBMADM.PDLOGMSGS_LAST24HOURS where MSGSEVERITY = 'C' order by TIMESTAMP desc" ●特定の期間に出力されたメッセージを参照する場合は、UDFを使用する。 例)過去1週間以内に出力されたSEVERITY=‘C’(Critical)のメッセージを、メッセージ出力時刻に並び 替えて照会する。 db2 "select * from table(SYSPROC.PD_GET_LOG_MSGS(current_timestamp - 7 days)) as t where MSGSEVERITY = 'C' order by TIMESTAMP desc" ■Notifyログへのすべての出力から、SEVERITY=‘E’(Error)のメッセージを、メッセージ出力時刻に 並び替えて照会する。 db2 "select timestamp, msg from table ( pd_get_log_msgs(cast(null as timestamp))) as t where msgseverity='E' order by timestamp desc" *******************************************************************

表示オプション

横に並べて表示:
変化行の前後のみ表示: