Catégorie : Scripts
-
[Postgres] Mettre à jour les séquences
Script pour mettre à jour les séquences. Indispensable pour la réplication logique. #!/bin/sh cat /dev/null > update_sequence_DB.sqlfor sequname in $(psql DB -t -c « select sequence_name as _sequence from […]
-
PostgreSQL Defrag les plus gros indexes et tables
Réduire la fragmentation https://www.timescale.com/learn/how-to-reduce-bloat-in-large-postgresql-tables Afficher les (10) plus gros indexes : SELECT indexrelname AS index_name, pg_size_pretty(pg_relation_size(relid)) AS index_size, pg_size_pretty(pg_total_relation_size(relid)) As « Total Size »FROM pg_catalog.pg_stat_all_indexes WHERE schemaname =’public’ORDER BY pg_total_relation_size(relid) […]
-
Migration from Oracle Legacy to postgreSQL dMZR
Migration from Oracle Legacy to postgreSQL dMZR //on the ora2Pg management server : 0- prerequisite create role role_own_DB login; 1 – export schema gives the metadata // on […]
-
[SYSTEM]
This script uses the local tnsnames.ora file to create a connection, and requires the variable ${p} to hold the current SYSTEM password. #on récupère le mdp systeme[[ -z « ${p} » ]] […]
-
Ora2PG script creation project
#!/bin/sh#——————————————————————————-## Script to create an ora2pg project# Author : JJY##——————————————————————————-#set -vxclearecho » « echo » Welcome in the program to create a migration project. « echo » « echo » Write the working […]
-
[HVAULT] Roles postgreSQL
Script de création des roles HVAULT dans ibm cloud pour postgreSQL (dMZR); #!/bin/sh#-ex#set -xwhile truedoclear if [[ « $VAULT_ADDR » == <adresse de prod>]] then […]
-
[PostgreSQL] Streaming Replication Monitoring Script
Script de création d’une fonction « streaming_slave_check » pour la réplication en postgreSQL.
-
[Oracle] Calculate the lobs size
#!/bin/sh#script to calculate the lobs sizesqlplus /nolog<<!EOF conn / as sysdbaspool req1.sqlset head offset feed offselect ‘SELECT max(dbms_lob.getlength( »’||col.column_name|| »’)) from ‘||col.owner||’.’||col.table_name||’;’from sys.dba_tab_columns col inner join sys.dba_tables t on col.owner = t.owner and […]