Little bash script
Professionnel
-
[POSTGRES] Easy to migrate
-
Oracle backup batch file
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
-
Pratique le "watch"
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';\""
-
[Postgres] commande simple qui donne la durée depuis laquelle un instance postgres est démarrée
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 -
ALIAS SQLPLUS SQLDBA se connecter bien comme il faut
Pour se connecter bien comme il faut
-
Client en python
client en python pour se connecter à hvault :
Psycopg is the most popular PostgreSQL database adapter for the Python programming language.
-
Référencement
Quelques liens à étudier
Se faire référencer auprès des grands comptes (actionco.fr)
Dix clés pour réussir son approche grands comptes - Nomination
Freelance : comment travailler avec des grands comptes ? (cadresenmission.com)
-
[Postgres] YOUR postgresql.conf CONFIGURATIONS
-
[PostgreSQL] Replication logique
a completer
-
[Postgres] Monitor autovacuum_freeze_max_age
This query allows you to monitor the : autovacuum_freeze_max_age
SELECT datname, round(age(datfrozenxid)/to_number(current_setting('autovacuum_freeze_max_age'),'999999999')*100,1) as Percent FROM pg_database where datname != 'template0';