Ok

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.

  • 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';\""