[PSQL] Que contient les fichiers wal
Un bon tuto à faire !
En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies. Ces derniers assurent le bon fonctionnement de nos services. En savoir plus.
Un bon tuto à faire !
SELECT relname AS "relation", pg_size_pretty ( pg_total_relation_size (C .oid) ) AS "total_size" FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C .relnamespace) WHERE nspname NOT IN ( 'pg_catalog', 'information_schema' ) AND C .relkind <> 'i' AND nspname !~ '^pg_toast' ORDER BY pg_total_relation_size (C .oid) DESC LIMIT 5;
Prendre une carte de marchand de bien. Acheter le bien avev un credit in fine et le revendre a ma sci avant 5 ans pour ne pas payer de TVA.
Little bash script
Oracle backup batch file - Stack Overflow
need to split in two files: a batch file and RMAN script
Batch file: backup.bat
@echo off echo Automatic Backup Oracle pushd . SET ORACLE_HOME=C:apporacleproduct12.2.0dbhome_1 SET ORACLE_SID=ORCL echo ---------------------------------------------------- echo ORACLE_HOME : %ORACLE_HOME% echo ORACLE_SID : %ORACLE_SID% echo ---------------------------------------------------- RMAN TARGET / @file.rman log=backup.log
Script RMAN called file.rman or another name
run {
backup database;
backup archivelog all delete input;
}
This part is setup:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'c:backup%F';
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:backup%d_%T_%u';
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'c:backupSNCFORCL.ORA';
Can be removed from the script and run once for each bank. Once configured, the settings are permanent.
script need two files: backup.bat and file.rman
Je partage une commande qui peut être utilisée pour afficher les connections actives d'une base, qui s'actualise toutes les 2 secondes, depuis le shell :
export BASE=tata
watch -n 2 "psql $BASE -c \"select * from pg_stat_activity where state='active' and datname='$BASE';\""
Connaitre la date du dernier reboot de l'instance :
SQL :
SELECT pg_postmaster_start_time();
Savoir depuis quand l'instance tourne :
SQL :
select current_timestamp - pg_postmaster_start_time() as uptime;
Commande système
systemctl status postgres
postgresql - How can I get my server's uptime? - Database Administrators Stack Exchange
Pour se connecter bien comme il faut
client en python pour se connecter à hvault :
Psycopg is the most popular PostgreSQL database adapter for the Python programming language.