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.

  • Monitor redo switchs

    REM NAME         :log_hist.sql
    REM PURPOSE      :Provide info on logs for last 24 hours since last
    REM PURPOSE      :log switch

    REM USE          :From SQLPLUS
    REM Limitations  : None
    REM MRA 10/14/01 Updated for Oracle9i
    REM

    COLUMN thread#             FORMAT 999      HEADING 'Thrd#'
    COLUMN sequence#           FORMAT 99999    HEADING 'Seq#'
    COLUMN first_change#                       HEADING 'SCN Low#'
    COLUMN next_change#                        HEADING 'SCN High#'
    COLUMN archive_name        FORMAT a50      HEADING 'Log File'
    COLUMN first_time          FORMAT a20      HEADING 'Switch Time'
    COLUMN name                FORMAT a30      HEADING 'Archive Log'

    SET LINES 132 FEEDBACK OFF VERIFY OFF
    START title132 "Log History Report"

    SPOOL rep_out&dblog_hist
    REM
    SELECT
         X.recid,a.thread#,
         a.sequence#,a.first_change#,
         a.switch_change#,
         TO_CHAR(a.first_time,'DD-MON-YYYY HH24:MI:SS') first_time,x.name
    FROM
     v$loghist a, v$archived_log x
    WHERE
      a.first_time>
       (SELECT b.first_time-1
       FROM v$loghist b WHERE b.switch_change# =
        (SELECT MAX(c.switch_change#) FROM v$loghist c)) AND
         x.recid(+)=a.sequence#;
    SPOOL OFF
    SET LINES 80 VERIFY ON FEEDBACK ON
    CLEAR COLUMNS
    TTITLE OFF
    PAUSE Press Enter to continue

     

     

  • Pour les switch de logs Oracle c'est ici

    Messages dans l'alert.log :


    Alert Log Messages: Private Strand Flush Not Complete

    Si le paramètre archive_lag_target est valorisée à  0, cela désactive le time-based thread advance feature (merci pour la traduction en french).

     

    Quelques pistes :

    https://asktom.oracle.com/pls/asktom/f?p=100:11:::NO:RP:P11_QUESTION_ID:9529265900346002171

    doc officielle :

    https://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams009.htm#REFRN10003

    Lire la suite

  • Optimiser requete sql pour postgres

    Installer au préalable le module : pg_stats_statements

    Exécuter la requête suivante :

    SELECT * FROM pg_stat_statements ORDER BY total_time DESC;
  • Déplacer index dans le bon tablespace Oracle

    SELECT 'ALTER INDEX ' || OWNER || '.' || segment_name || ' REBUILD TABLESPACE ' || 'TBS_INDEX' || ';'
    FROM dba_segments  
    WHERE OWNER <> 'EXPLOIT'
    AND segment_type = 'INDEX'
    AND tablespace_name like '%DATA'
    UNION
    SELECT 'ALTER TABLE ' || OWNER || '.' || segment_name || ' MOVE TABLESPACE ' || 'TBS_DATA' || ';'
    FROM dba_segments  
    WHERE OWNER <> 'EXPLOIT'
    AND segment_type = 'TABLE'
    AND tablespace_name like '%INDEX';