PostgreSQLスキルアップノート(自己啓発のための個人サイト)
PostgresSQL環境総合確認・DB基盤環境編
【一覧に戻る】
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
■■■■ PostgreSQL スキルアップノート
■■■■
■◆■■ PostgresSQL環境総合確認・DB基盤環境編
■■■■
■■■■
■■■■ 2013/02/24
■■■■ 使用環境:PostgreSQL9.1.7 (CentOS6.2)
(C) 2013 ohdb
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┌────────────┐
│このページ徐々に追記予定│
└────────────┘
PostgreSQL環境全般を把握していく方法。
【マニュアル】
マニュアル(トップページ)→●[マニュアル]
■■ スーパユーザ(postgres)の環境
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 su - postgres
【□】 env
【□】 env|grep PG
【□】 cat ~/.bash_profile
【□】 cat ~/.bashrc
■■ プロセッサ/メモリ/ディスク
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 cat /proc/cpuinfo |grep proc
【□】 free
【□】 df -m
■■ 共有メモリ等
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
共有メモリセグメント、セマフォ等
【□】 ipcs
各上限等
【□】 ipcs -l
サマリ
【□】 ipcs -u
ページサイズ
【□】 getconf PAGESIZE
■■ カーネルパラメータ
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 sysctl -a
【□】 sysctl -a | grep パラメータ名
■■ cron設定
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
各ユーザにて
【□】 crontab -l
■■ 製品環境(RPMインストールの場合)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 rpm -qa | grep postgres
postgresql91-9.1.7-1PGDG.rhel6.x86_64
postgresql91-server-9.1.7-1PGDG.rhel6.x86_64
postgresql91-contrib-9.1.7-1PGDG.rhel6.x86_64
postgresql91-libs-9.1.7-1PGDG.rhel6.x86_64
【□】 rpm -qa | grep pg_
pg_statsinfo-2.4.1-1.el6.x86_64
【□】 その他
■■ PostgreSQLバージョン/ビット版
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 psql -c "select version()"
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.7 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4), 64-bit
■■ 設定ファイル
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 cat $PGDATA/postgresql.conf
【□】 cat $PGDATA/pg_hba.conf
■■ 実行時パラメータpg_settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 psql -P pager=off -c "select category,name,setting,unit,context,source,sourcefile,sourceline from pg_settings order by 1"
■■ ロール
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 psql -c '\du+'
■■ データベース/テーブルスペース
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 psql -l
【□】 psql -c "\db+"
テーブルスペース一覧
名前 | 所有者 | 場所 | アクセス権 | 説明
--------------+----------+-----------------+------------+------
pg_default | postgres | | |
pg_global | postgres | | |
tablespace01 | postgres | /db1/pgsql/data | |
■■ 拡張の一覧(Extension)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
拡張はデータベース単位のインストールとなるためそれぞれ確認
【□】 psql -d postgres -c '\dx+'
【□】 psql -d template1 -c '\dx+'
【□】 psql -d database1 -c '\dx+'
■■ ディレクトリ
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【□】 du -m $PGDATA --max-depth=2
【□】 du -m 各テーブルスペースのディレクトリ --max-depth=2
以上