pg_controldata -- It display control information of a PostgreSQL database cluster
-bash-4.1$ ./pg_controldata /u01/postgres/data
pg_control version number: 1002
Catalog version number: 201707211
Database system identifier: 6754729802804905833
...
..........
Query Monitoring:
=================
postgres=# SELECT * FROM pg_stat_activity;
datid | datname | pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | xact_start |
query_start | state_change | wait_event_type | wait_event | state | backend_xid | backend_xmin | query | backend_
type
-------+----------+-------+----------+----------+------------------+-------------+-----------------+-------------+----------------------------------+----------------------------------+-----
-----------------------------+----------------------------------+-----------------+---------------------+--------+-------------+--------------+---------------------------------+------------
---------
| | 89107 | | | | | | | 2017-10-13 21:33:17.427986+05:30 | |
| | Activity | AutoVacuumMain | | | | | autovacuum
launcher
| | 89109 | 10 | postgres | | | | | 2017-10-13 21:33:17.430675+05:30 | |
| | Activity | LogicalLauncherMain | | | | | background
worker
13804 | postgres | 89818 | 10 | postgres | | | | -1 | 2017-10-13 21:45:38.093483+05:30 | 2019-11-13 21:45:39.471797+05:30 | 2019
-11-13 21:45:39.471797+05:30 | 2017-10-13 21:45:39.471805+05:30 | | | active | | 571 | SELECT * FROM pg_stat_activity; | client back
end
| | 89105 | | | | | | | 2017-10-13 21:33:17.426106+05:30 | |
| | Activity | BgWriterMain | | | | | background
writer
| | 89104 | | | | | | | 2017-10-13 21:33:17.429943+05:30 | |
| | Activity | CheckpointerMain | | | | | checkpointe
r
| | 89106 | | | | | | | 2017-10-13 21:33:17.427542+05:30 | |
| | Activity | WalWriterMain | | | | | walwriter
(6 rows)
Database Statistics:
====================
postgres=# SELECT * FROM pg_stat_database;
datid | datname | numbackends | xact_commit | xact_rollback | blks_read | blks_hit | tup_returned | tup_fetched | tup_inserted | tup_updated | tup_deleted | conflicts | temp_files | temp
_bytes | deadlocks | blk_read_time | blk_write_time | stats_reset
-------+-----------+-------------+-------------+---------------+-----------+----------+--------------+-------------+--------------+-------------+-------------+-----------+------------+-----
-------+-----------+---------------+----------------+----------------------------------
13804 | postgres | 1 | 53 | 0 | 208 | 4054 | 26818 | 1639 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 2017-10-13 21:21:18.233825+05:30
16393 | test | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 |
1 | template1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Table activities:
=================
postgres=# SELECT * FROM pg_stat_all_tables;
relid | schemaname | relname | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup | n_
mod_since_analyze | last_vacuum | last_autovacuum | last_analyze | last_autoanalyze | vacuum_count | autovacuum_count | analyze_count | autoanalyze_count
-------+--------------------+-------------------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------+---
------------------+-------------+-----------------+--------------+------------------+--------------+------------------+---------------+-------------------
2606 | pg_catalog | pg_constraint | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | | | | | 0 | 0 | 0 | 0
13644 | information_schema | sql_implementation_info | 0 | 0 | | | 0 | 0 | 0 | 0 | 0 | 0 |
0 | | | | | 0 | 0 | 0 | 0
Table Block activity:
====================
postgres=# SELECT * FROM pg_statio_all_tables;
relid | schemaname | relname | heap_blks_read | heap_blks_hit | idx_blks_read | idx_blks_hit | toast_blks_read | toast_blks_hit | tidx_blks_read | tidx_blks_hit
-------+--------------------+-------------------------+----------------+---------------+---------------+--------------+-----------------+----------------+----------------+---------------
13646 | pg_toast | pg_toast_13644 | 0 | 0 | 0 | 0 | | | |
3596 | pg_catalog | pg_seclabel | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
2603 | pg_catalog | pg_amproc | 8 | 51 | 6 | 108 | | | |
Lock monitoring:
================
postgres=# SELECT * FROM pg_locks;
locktype | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid | mode | granted | fastpath
------------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-------+-----------------+---------+----------
relation | 13804 | 11577 | | | | | | | | 3/37 | 90315 | AccessShareLock | t | t
virtualxid | | | | | 3/37 | | | | | 3/37 | 90315 | ExclusiveLock | t | t
(2 rows)
-bash-4.1$ ./pg_controldata /u01/postgres/data
pg_control version number: 1002
Catalog version number: 201707211
Database system identifier: 6754729802804905833
...
..........
Query Monitoring:
=================
postgres=# SELECT * FROM pg_stat_activity;
datid | datname | pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | xact_start |
query_start | state_change | wait_event_type | wait_event | state | backend_xid | backend_xmin | query | backend_
type
-------+----------+-------+----------+----------+------------------+-------------+-----------------+-------------+----------------------------------+----------------------------------+-----
-----------------------------+----------------------------------+-----------------+---------------------+--------+-------------+--------------+---------------------------------+------------
---------
| | 89107 | | | | | | | 2017-10-13 21:33:17.427986+05:30 | |
| | Activity | AutoVacuumMain | | | | | autovacuum
launcher
| | 89109 | 10 | postgres | | | | | 2017-10-13 21:33:17.430675+05:30 | |
| | Activity | LogicalLauncherMain | | | | | background
worker
13804 | postgres | 89818 | 10 | postgres | | | | -1 | 2017-10-13 21:45:38.093483+05:30 | 2019-11-13 21:45:39.471797+05:30 | 2019
-11-13 21:45:39.471797+05:30 | 2017-10-13 21:45:39.471805+05:30 | | | active | | 571 | SELECT * FROM pg_stat_activity; | client back
end
| | 89105 | | | | | | | 2017-10-13 21:33:17.426106+05:30 | |
| | Activity | BgWriterMain | | | | | background
writer
| | 89104 | | | | | | | 2017-10-13 21:33:17.429943+05:30 | |
| | Activity | CheckpointerMain | | | | | checkpointe
r
| | 89106 | | | | | | | 2017-10-13 21:33:17.427542+05:30 | |
| | Activity | WalWriterMain | | | | | walwriter
(6 rows)
Database Statistics:
====================
postgres=# SELECT * FROM pg_stat_database;
datid | datname | numbackends | xact_commit | xact_rollback | blks_read | blks_hit | tup_returned | tup_fetched | tup_inserted | tup_updated | tup_deleted | conflicts | temp_files | temp
_bytes | deadlocks | blk_read_time | blk_write_time | stats_reset
-------+-----------+-------------+-------------+---------------+-----------+----------+--------------+-------------+--------------+-------------+-------------+-----------+------------+-----
-------+-----------+---------------+----------------+----------------------------------
13804 | postgres | 1 | 53 | 0 | 208 | 4054 | 26818 | 1639 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 2017-10-13 21:21:18.233825+05:30
16393 | test | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 |
1 | template1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Table activities:
=================
postgres=# SELECT * FROM pg_stat_all_tables;
relid | schemaname | relname | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup | n_
mod_since_analyze | last_vacuum | last_autovacuum | last_analyze | last_autoanalyze | vacuum_count | autovacuum_count | analyze_count | autoanalyze_count
-------+--------------------+-------------------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------+---
------------------+-------------+-----------------+--------------+------------------+--------------+------------------+---------------+-------------------
2606 | pg_catalog | pg_constraint | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | | | | | 0 | 0 | 0 | 0
13644 | information_schema | sql_implementation_info | 0 | 0 | | | 0 | 0 | 0 | 0 | 0 | 0 |
0 | | | | | 0 | 0 | 0 | 0
Table Block activity:
====================
postgres=# SELECT * FROM pg_statio_all_tables;
relid | schemaname | relname | heap_blks_read | heap_blks_hit | idx_blks_read | idx_blks_hit | toast_blks_read | toast_blks_hit | tidx_blks_read | tidx_blks_hit
-------+--------------------+-------------------------+----------------+---------------+---------------+--------------+-----------------+----------------+----------------+---------------
13646 | pg_toast | pg_toast_13644 | 0 | 0 | 0 | 0 | | | |
3596 | pg_catalog | pg_seclabel | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
2603 | pg_catalog | pg_amproc | 8 | 51 | 6 | 108 | | | |
Lock monitoring:
================
postgres=# SELECT * FROM pg_locks;
locktype | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid | mode | granted | fastpath
------------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-------+-----------------+---------+----------
relation | 13804 | 11577 | | | | | | | | 3/37 | 90315 | AccessShareLock | t | t
virtualxid | | | | | 3/37 | | | | | 3/37 | 90315 | ExclusiveLock | t | t
(2 rows)
Thanks,
No comments:
Post a Comment