2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

運用設計サンプル

Posted at
■OS監視
 ┣取得対象
 ┣実行間隔
 ┣ログ名
 ┗格納場所

・CPU
例:nohup bash -c "vmstat 10 | awk '{print strftime(\"%y/%m/%d %H:%M:%S\"), \$0} { system(\":\") }'" > vmstat_$(date "+%Y%m%d_%H%M%S").log 2>&1 &
・メモリ
例:nohup bash -c "vmstat 10 | awk '{print strftime(\"%y/%m/%d %H:%M:%S\"), \$0} { system(\":\") }'" > vmstat_$(date "+%Y%m%d_%H%M%S").log 2>&1 &
・IO
例:nohup bash -c "iostat 10 | awk '{print strftime(\"%y/%m/%d %H:%M:%S\"), \$0} { system(\":\") }'" > vmstat_$(date "+%Y%m%d_%H%M%S").log 2>&1 &
・プロセス
例:ps aux |awk '{print strftime("%y-%m-%d %H:%M:%S"), $0}' | grep -iE " ora_|MEM" | grep -v grep
・ディスク使用率
例:df -ah

■DB監視
 ┣取得対象
 ┣実行間隔
 ┣ログ名
 ┗格納場所

・待機イベント(V$SESSION)
例:★書式を参照すること。
・PGAサイズ(V$PROCESS)
例:★書式を参照すること。
・SQL文(V$SQL)
例:★書式を参照すること。
・ロック(V$LOCK)
例:★書式を参照すること。
・表領域の使用率
例:https://oha-yo.com/oracle/tablespace-size/

■STATSPACK
例:https://www.ashisuto.co.jp/db_blog/article/jpoug-oracledb-logfiles-command.html
・スナップショット
 ┣間隔
 ┣格納場所
 ┣取得レベル
 ┣取得ユーザ
 ┣取得表領域
 ┗その他

・レポート出力(もしくは手動とか)
 ┣間隔
 ┣保存期間
 ┗場所

■ログ監視(Zabbix詳細設計書を参照すること)
https://docs.oracle.com/cd/E16338_01/server.112/b56301/monitoring.htm

■ログローテーション(圧縮込み)
・OS監視ログファイル一式
・DB監視ログファイル一式
・STATSPACKレポート一式
・アラート・ログ/トレース・ファイル
<diagnostic_dest>/diag/rdbms/<db_unique_name>/<sid>/trace/alert_<sid>.log
<diagnostic_dest>/diag/rdbms/<db_unique_name>/<sid>/trace/<sid>_<process_name>_<pid>.trc
・インシデント・ファイル
<diagnostic_dest>/diag/rdbms/<db_unique_name>/<sid>/incident/incdir_<incident_number>/*
・リスナー・ログ
<diagnostic_dest>/diag/tnslsnr/<hostname>/<listener_name>/trace/listener.log
・sqlnetログ
<diagnostic_dest>/diag/clients/user_<OS_USERNAME>/host_<MASHINE_HASH_VALUE>_<ADR_VERSION>/trace/

■GUIツール
Cloud Controlのurl

★SQL書式
set feedback off  -- N行が選択されましたを非表示
set NULL '<NULL>' -- NULLを<NULL>として表示
set pages 0       -- SELECTの結果のみを表示
set lines 4000    -- 1行の長さを指定

select
  saddr
  || ',' || SID
  ~
  || ',' || TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS')
FROM V$SESSION
ORDER BY SID;

sqlplus @XXX.sql > /dev/null
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?