From ec201342f8df265df4dd6c0ce7ae54f3c4e76d3d Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 27 Jul 2018 17:05:18 -0400 Subject: [PATCH] adds --- bash.md | 10 ++++++++++ pgbadger.md | 2 +- postgres.md | 28 +++++++++++++++++++++++++++- postgres_features.md | 6 ++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/bash.md b/bash.md index c23a7b3..7c2f4c3 100644 --- a/bash.md +++ b/bash.md @@ -26,3 +26,13 @@ put .psqlrc in home directory Size of directory: `du -hcs //mnt/c/PostgreSQL/cassandra30/` list lines in file `wc file` + + +General tasks +------------------------------------------------------------------------------------------------------------ + +wc - print line counts + +free - memory usage + +du - disk space by file \ No newline at end of file diff --git a/pgbadger.md b/pgbadger.md index b339129..072610d 100644 --- a/pgbadger.md +++ b/pgbadger.md @@ -1 +1 @@ -"C:\PostgreSQL\perl5\perl\bin\perl.exe" "C:\PostgreSQL\pgbadger\pgbadger" "C:\PostgreSQL\data\logs\pg10\postgresql-Mon.log" -o "C:\Users\ptrowbridge\Downloads\pgb.html" \ No newline at end of file +"C:\PostgreSQL\perl5\perl\bin\perl.exe" "C:\PostgreSQL\pgbadger\pgbadger" -o "C:\Users\ptrowbridge\Downloads\pgb.html" "C:\PostgreSQL\data\logs\pg10\postgresql-Mon.log" "C:\PostgreSQL\data\logs\pg10\postgresql-Tue.log" "C:\PostgreSQL\data\logs\pg10\postgresql-Wed.log" "C:\PostgreSQL\data\logs\pg10\postgresql-Thu.log" "C:\PostgreSQL\data\logs\pg10\postgresql-Fri.log" \ No newline at end of file diff --git a/postgres.md b/postgres.md index 4caf32c..19c05ac 100644 --- a/postgres.md +++ b/postgres.md @@ -1,3 +1,29 @@ setup for single sign on with [SSPI](https://wiki.postgresql.org/wiki/Configuring_for_single_sign-on_using_SSPI_on_Windows) -md5 hash is salted with username in front \ No newline at end of file +md5 hash is salted with username in front + + +Memory +========================================================= +see whats in the buffer cache with pg_buffercache + +`CREATE EXTENSION pg_buffercache` + +``` +SELECT + c.relname, + COUNT(*) AS buffers +FROM + pg_class c +INNER JOIN pg_buffercache b ON + b.relfilenode = c.relfilenode +INNER JOIN pg_database d ON + ( b.reldatabase = d.oid + AND d.datname = CURRENT_DATABASE()) +GROUP BY + c.relname +ORDER BY + 2 DESC +LIMIT 100; +``` + diff --git a/postgres_features.md b/postgres_features.md index 0ea1ac3..2b6ffb3 100644 --- a/postgres_features.md +++ b/postgres_features.md @@ -28,3 +28,9 @@ Security LDAP & Active Directory [blog](https://www.openscg.com/2017/07/setting-up-ldap-with-active-directory-in-postgresql/) Add SCRAM-SHA-256 support for password negotiation and storage (Michael Paquier, Heikki Linnakangas) + + +Monitoring +==================== + +file system info - [pg_stat_kcache](https://rjuju.github.io/postgresql/2018/07/17/pg_stat_kcache-2-1-is-out.html)