Tagged: Physycal Standy RSS

  • Juanjinio 16:50 on 02/08/2009 Permalink | Reply
    Tags: , , Physycal Standy   

    NORMALIZAR LA CREACION DE DATAFILES EN DATAGUARD POR PROBLEMAS DE BALANCEO DE DISKGROUP ASM 

    Aca un problema que pasó en una plataforma con Oracle RAC y replicada con un StandBy. Por un trabajo de carga masiva de datos, en el RAC de producción se debió aumentar en un datafile a un tablespace, sin embargo, al aplicar esta transacción en el Dataguard, no se logró crear dicho archivo y el proceso MRP0 se cayó. Aca van los antecedentes del problema:

     

    En un RAC de producción, se genera un nuevo datafiles por problemas de espacio en tablespaces asociados. (FILE_ID = 133)

     

    ORA-1653: unable to extend table ESQUEMA.TABLA by 12800 in tablespace TBS_TABLESPACE

    Sat Aug  1 02:30:40 2009

    /* OracleOEM */ ALTER TABLESPACE “TBS_TABLESPACE” ADD DATAFILE ‘+DATOS/prod/TBS_DATAFILE_15.dbf’ SIZE 32740M

    Sat Aug  1 02:36:16 2009

    Completed: /* OracleOEM */ ALTER TABLESPACE “TBS_TABLESPACE” ADD DATAFILE ‘+DATOS/prod/TBS_DATAFILE_15.dbf’ SIZE 32740M

     

     

    En dataguard, aparece un error de creación de datafiles indicando que NO hay espacio suficiente para poder generar dicho archivo, y se genera un archivo temporal (Ver mensajes de error en AlertLog de instancia PROD)

     

    Sat Aug  1 02:45:05 2009

    Media Recovery Log +PROD_ARC/archivelog/2_19733_647723542.dbf

    WARNING: File being created with same name as in Primary

    Existing file may be overwritten

    File #133 added to control file as ‘UNNAMED00133′.

    Originally created as:

    ‘+DATOS/prod/TBS_DATAFILE_15.dbf’

    Recovery was unable to create the file as:

    ‘+DATOS/prod/TBS_DATAFILE_15.dbf’

    Errors with log +PROD_ARC/archivelog/2_19733_647723542.dbf

    MRP0: Background Media Recovery terminated with error 1119

    Sat Aug  1 02:45:14 2009

    Errors in file /oracle/Ora_Home/admin/PROD/bdump/PROD_mrp0_196642.trc:

    ORA-01119: error in creating database file ‘+DATOS/prod/TBS_DATAFILE_15.dbf’

    ORA-17502: ksfdcre:4 Failed to create file +DATOS/prod/TBS_DATAFILE_15.dbf

    ORA-15041: diskgroup space exhausted

    Sat Aug  1 02:45:16 2009

    Some recovered datafiles maybe left media fuzzy

    Media recovery may continue but open resetlogs may fail

    Sat Aug  1 02:45:17 2009

    Errors in file /oracle/Ora_Home/admin/PROD/bdump/PROD_mrp0_196642.trc:

    ORA-01119: error in creating database file ‘+DATOS/prod/TBS_DATAFILE_15.dbf’

    ORA-17502: ksfdcre:4 Failed to create file +DATOS/prod/TBS_DATAFILE_15.dbf

    ORA-15041: diskgroup space exhausted

    Sat Aug  1 02:45:17 2009

    MRP0: Background Media Recovery process shutdown (PROD)

    Sat Aug  1 02:45:18 2009

     

    Al revisar el proceso de sincronización, se aprecia que el proceso de aplicación de archivelogs en Dataguard MRP0 no existe como proceso activo

     

    PROCESS   STATUS          THREAD#  SEQUENCE#     BLOCK#     BLOCKS

    ——— ———— ———- ———- ———- ———-

    ARCH      CLOSING               2      19739      20481        869

    ARCH      CLOSING               1      29407    1972225       1267

    ARCH      CLOSING               2      19738    1509377        247

    ARCH      CLOSING               1      29404    2091009       1931

    ARCH      CLOSING               1      29405    2060289        729

    ARCH      CLOSING               1      29406    1896449        302

    RFS       IDLE                  0          0          0          0

    RFS       IDLE                  0          0          0          0

    RFS       IDLE                  0          0          0          0

    RFS       IDLE                  0          0          0          0

    RFS       IDLE                  1      29408     868483         34

     

    En alert Log de instancia +ASM, aparece un warning indicando que hay problemas con un disco de un diskgroup del ASM.

     

     

    Sat Aug  1 02:45:13 2009

    WARNING: allocation failure on disk PROD_DATOS_0000 for file 267 xnum 17367

    WARNING: allocation failure on disk PROD_DATOS_0000 for file 267 xnum 17366

     

     

    Al realizar un backup del controlfile de Datagurd, se aprecia que se generó un archivo en el HOME_ORACLE/dbs y este archivo NO existe fisicamente (ALTER DATABASE BACKUP CONTTOL FILE TO TRACE)

     

    DATAFILE

      ‘+DATOS/PROD/system01.dbf’,

      ‘+DATOS/PROD/tbs_data1_1g09.dbf’,

    .

    .

    .

      ‘+PROD_INDICES/PROD/tbs_ind_100m15.dbf’,

      ‘/oracle/Ora_Home/dbs/UNNAMED00133′

     

    Al revisar el espacio disponible en el diskgroup del nuevo datafile creado en producción, se observa que hay espacio físico disponible

     

    SQL>

    GROUP_NUMBER NAME                           GB_TOTALES  GB_LIBRES

    ———— —————————— ———- ———-

               1 PROD_ARC                           350      209,7

               2 PROD_DATOS                        1936     386,49

               3 PROD_INDICES                      1113     220,86

     

     

     

    CAUSA DEL PROBLEMA:

     

    El diskgroup del DATAGUARD no está correctamente balanceado, por esta razón desde el asmcmd (comando lsdg), se observa que hay espacio suficiente para poder crear el datafile.

     

    ACCIONES A SEGUIR:

     

    Desactivar la replicación desde el RAC de producción.

      

    SQL> sho parameter log_archive_dest_state_2;
     

    NAME                                 TYPE                             VALUE

    ———————————— ——————————– ———–

    log_archive_dest_state_2             string                           enable

     

    SQL> alter system set log_archive_dest_state_2=’defer’ scope=both sid=’*';

     

    System altered.

     

    SQL> sho parameter log_archive_dest_state_2

     

    NAME                                 TYPE                             VALUE

    ———————————— ——————————– ———–

    log_archive_dest_state_2             string                           defer

     

     

     Realizar un balanceo del diskgroup con problemas, en este caso como es un dataguard, se recomienda realizarlo en nivel 11, en caso de un diskgroup de producción se recomienda utilizar nivel 5 o 6 como máximo, ya que afectará el performance de la plataforma, y se percibirá una degradación en el servicio. 

     

    En StandBy:
    $ export ORACLE_SID=+ASM

    $ sqlplus “/as sysdba”

     

    SQL> alter diskgroup PROD_DATOS rebalance power 11;

     

    Diskgroup altered

     

    SQL> select * from v$asm_operation;

     

    GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES

    ———— —– —- ———- ———- ———- ———- ———- ———–

               2 REBAL RUN          11         11         21     286069       3491          81

     

    Una vez que el balanceo finalizó, se debe reiniciar la instancia dataguard, desactivar el standby_file_management y realizar la creación del datafile en el Dataguard.

     

     

     

    En StandBy:

    SQL> select * from v$asm_operation;

         

    No rows selected.

     

    SQL> alter database recover managed standby database cancel;

     

    Database altered.

     

    SQL> shutdown immediate;

    ORA-01109: database not open

     

     

    Database dismounted.

    ORACLE instance shut down.

     

    SQL> startup nomount

    ORACLE instance started.

     

    Total System Global Area 1,5032E+10 bytes

    Fixed Size                  2098928 bytes

    Variable Size             939526416 bytes

    Database Buffers         1,3942E+10 bytes

    Redo Buffers              148893696 bytes


    SQL> alter database mount standby database;

     

    Database altered.

     

    SQL> sho parameter standby_file_management

     

    NAME                                 TYPE                             VALUE

    ———————————— ——————————– ———–

    standby_file_management              string                           AUTO

     

     

    SQL> alter system set STANDBY_FILE_MANAGEMENT=’MANUAL’ scope=memory;

     

    System altered.
     

    SQL> show parameter STANDBY_FILE_MANAGEMENT

     

    NAME                                 TYPE                             VALUE

    ———————————— ——————————– ———–

    standby_file_management              string                           MANUAL


    SQL> alter database create datafile ‘/oracle/Ora_Home/dbs/UNNAMED00133′ as ‘+DATOS/prod/TBS_DATAFILE_15.dbf’;

     

    Database altered.

    Validar en el AlertLog de Dataguard

     

    Sat Aug  1 19:00:02 2009

    alter database create datafile ‘/oracle/Ora_Home/dbs/UNNAMED00133′ as ‘+DATOS/prod/TBS_DATAFILE_15.dbf’

    Sat Aug  1 19:56:05 2009

    Completed: alter database create datafile ‘/oracle/Ora_Home/dbs/UNNAMED00133′ as ‘+DATOS/prod/TBS_DATAFILE_15.dbf’

     

    SQL> sho parameter standby_file_management

     

    NAME                                 TYPE                             VALUE

    ———————————— ——————————– ———–

    standby_file_management              string                           MANUAL

    SQL> alter system set STANDBY_FILE_MANAGEMENT=auto;

     

    System altered.

     

    SQL> sho parameter standby_file_management

     

    NAME                                 TYPE                             VALUE

    ———————————— ——————————– ———–

    standby_file_management              string                           AUTO

     

    SQL> alter database recover managed standby database disconnect from session;

     

    Database altered.

     

    En produccion activar la replicación de archivelogs hacia el dataguard

    SQL> sho parameter log_archive_dest_state_2;

     

    NAME                                 TYPE                             VALUE

    ———————————— ——————————– ———–

    log_archive_dest_state_2             string                           defer

     

    SQL> alter system set log_archive_dest_state_2=’enable’ scope=both sid=’*';

     

    Sistema modificado.

     

    SQL> sho parameter log_archive_dest_state_2

     

    NAME                                 TYPE                             VALUE

    ———————————— ——————————– ———–

    log_archive_dest_state_2             string                           enable

     

    SQL> alter system switch logfile;

     

    System altered.


    Finalmente validar que se están reciviendo y aplicando las secuencias en el dataguard.-

     

    SQL> select process,status,thread#,sequence#,block#,blocks from v$managed_standby

     

    PROCESS   STATUS          THREAD#  SEQUENCE#     BLOCK#     BLOCKS

    ——— ———— ———- ———- ———- ———-

    ARCH      CONNECTED             0          0          0          0

    ARCH      CONNECTED             0          0          0          0

    ARCH      CONNECTED             0          0          0          0

    ARCH      CONNECTED             0          0          0          0

    ARCH      CONNECTED             0          0          0          0

    ARCH      CONNECTED             0          0          0          0

    MRP0      APPLYING_LOG          2      19737     861348     875275

    RFS       IDLE                  1      29435      61441      20480

    RFS       RECEIVING             0          0          0          0

    RFS       IDLE                  2      19755      42875        465

    RFS       IDLE                  2      19754     245761      20480

    RFS       IDLE                  1      29434     102401      20480

    RFS       IDLE                  1      29433      61441      20480

     

     

    NOTAS METALINK RELACIONADAS:452897.1

     

    431143.1

    Bug No. 4380450

     

    PROCEDIMIENTO REDUCIDO:

     

    En produccion:

    1,. Conectarse a la base orac con sqlplus “/ as sysdba”
    2.- alter system set log_archive_dest_state_2=’defer’ scope=both;
    3.- exit;

     

    Standby:

    1.- alter database recover managed standby database cancel;
    2.- shutdown;
    3.- startup nomount;
    4.- alter database mount standby database;
    5.- alter system set STANDBY_FILE_MANAGEMENT=manual;
    6.- alter database create datafile
    ‘/oracle/Ora_Home/dbs/UNNAMED00133′ as ‘+DATOS/prod/TBS_DATAFILE_15.dbf’;
    7.- alter system set STANDBY_FILE_MANAGEMENT=auto;
    8.- alter datbase recover managed standby database disconnect from session;

     

    En produccion:
    1,. Conectarse a la base orac con sqlplus “/ as sysdba”
    2.- alter system set log_archive_dest_state_2=’enable’ scope=both;
    3.- alter system switch logfile;
    3.- exit;

     

    Saludos y espero que les sirva.

     

    Juanjo

     

     
  • Juanjinio 16:39 on 02/08/2009 Permalink | Reply
    Tags: , , Physycal Standy   

    PROCEDIMIENTO PARA LEVANTAR DATAGUARD EN CASO DE CAIDAS 

    Me paso que tuvé que dejar disponible un dataguard que se había reiniciado, y bueno googleando y buscando por metalink pille algunas cosillas interesantes y aca dejo un procedimiento para poder dejar disponible un datagurd, en la practica no es complicado, sólo que hay que tener claro como se debe subir para que quede aplicando las secuencias de la BD primaria.-

     

     

    1.- Verificar AlertLog de ambas instancias
    2.- Levantar en modo “mount” el ASM [STANDBY]

     

     

     

    bash-3.00$ echo $ORACLE_SID

    +ASM

    bash-3.00$ sqlplus “/as sysdba”

     

    SQL*Plus: Release 10.2.0.3.0 – Production on Dom Jul 19 10:48:03 2009

     

    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

     

    Connected to an idle instance.

     

    SQL> startup mount

    ASM instance started

     

    Total System Global Area 130023424 bytes

    Fixed Size 2071104 bytes

    Variable Size 102786496 bytes

    ASM Cache 25165824 bytes

    ASM diskgroups mounted

    SQL> exit

    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production

    With the Partitioning, OLAP and Data Mining options

    bash-3.00$ echo $ORACLE_SID

    +ASM

     

    3.- Levantar en modo “nomount” la instancia PROD [STANDBY]

     

    bash-3.00$ export ORACLE_SID=PROD

    bash-3.00$ echo $ORACLE_SID

    PROD

    bash-3.00$ sqlplus “/as sysdba”

     

    SQL*Plus: Release 10.2.0.3.0 – Production on Dom Jul 19 10:50:26 2009

     

    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

     

    Connected to an idle instance.

     

    SQL> startup nomount

    ORACLE instance started.

     

    Total System Global Area 1,5032E+10 bytes

    Fixed Size 2098928 bytes

    Variable Size 939526416 bytes

    Database Buffers 1,3942E+10 bytes

    Redo Buffers 148893696 bytes

     

    4.- Cambiar a modo “mount standby” la instancia PROD [STANDBY]

     

    SQL> alter database mount standby database;

     

    Database altered.

     


    5.- Activar el proceso de recuperación y replicación de archivelogs [STANDBY]

     

    SQL> alter database recover managed standby database disconnect from session;

     

    Database altered.

     

    6.- Verificar si los procesos MRP0 y RFS se encuentran activos [STANDBY]

     

    bash-3.00$ cd /home/oracle

    bash-3.00$ sqlplus “/as sysdba”

     

    SQL*Plus: Release 10.2.0.3.0 – Production on Dom Jul 19 10:53:05 2009

     

    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

     

     

    Connected to:

    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production

    With the Partitioning, OLAP and Data Mining options

     

    SQL> @status

     

    PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS

    ——— ———— ———- ———- ———- ———-

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    MRP0 WAIT_FOR_LOG 1 28806 0 0

     

    7 rows selected.

     

    NOTA: Proceso RFS, no se encuentra arriba, se debe verificar el listener y la comunicación entre PRODUCCION y DATAGUARD

     

    7.- Verificar y Levantar listener [STANDBY]

     

     

    SQL> exit

    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production

    With the Partitioning, OLAP and Data Mining options

    bash-3.00$ lsnrctl status

     

    LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.3.0 – Production on 19-JUL-2009 10:54:01

     

    Copyright (c) 1991, 2006, Oracle. All rights reserved.

     

    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

    TNS-12541: TNS:no listener

    TNS-12560: TNS:protocol adapter error

    TNS-00511: No listener

    IBM/AIX RISC System/6000 Error: 79: Connection refused


    bash-3.00$ lsnrctl start

     

    LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.3.0 – Production on 19-JUL-2009 10:54:05

     

    Copyright (c) 1991, 2006, Oracle. All rights reserved.

     

    Starting /oracle/OraHomeDb/bin/tnslsnr: please wait…

     

    TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.3.0 – Production

    System parameter file is /oracle/HomeDb/network/admin/listener.ora

    Log messages written to /oracle/HomeDb/network/log/listener.log

    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dataguard)(PORT=1721)))

     

    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1721))

    STATUS of the LISTENER

    ————————

    Alias LISTENER

    Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.3.0 – Production

    Start Date 19-JUL-2009 10:54:06

    Uptime 0 days 0 hr. 0 min. 1 sec

    Trace Level off

    Security ON: Local OS Authentication

    SNMP ON

    Listener Parameter File /oracle/HomeDb/network/admin/listener.ora

    Listener Log File /oracle/HomeDb/network/log/listener.log

    Listening Endpoints Summary…

    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dataguard)(PORT=1721)))

    The listener supports no services

    The command completed successfully

     

    8.- Verificar sincronización en Dataguard [STANDBY]

     

    bash-3.00$ sqlplus “/as sysdba”

     

    SQL*Plus: Release 10.2.0.3.0 – Production on Dom Jul 19 10:54:25 2009

     

    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

     

     

    Connected to:

    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production

    With the Partitioning, OLAP and Data Mining options

     

    SQL> @status

     

    PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS

    ——— ———— ———- ———- ———- ———-

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    MRP0 WAIT_FOR_LOG 1 28806 0 0

     

    7 rows selected.

     

    NOTA: Se debe validar que el proceso RFS se encuentre disponible.-

     

    SQL> /

     

    PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS

    ——— ———— ———- ———- ———- ———-

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    MRP0 WAIT_FOR_GAP 1 28806 0 0

    RFS IDLE 0 0 0 0

    RFS IDLE 0 0 0 0

    RFS IDLE 0 0 0 0

    RFS IDLE 1 28806 1 20480

    RFS IDLE 2 19225 0 0

    RFS IDLE 2 19224 0 0

     

    13 rows selected.

     

    SQL> /

     

    PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS

    ——— ———— ———- ———- ———- ———-

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    ARCH CONNECTED 0 0 0 0

    MRP0 WAIT_FOR_LOG 1 28808 0 0

    RFS IDLE 0 0 0 0

    RFS IDLE 0 0 0 0

    RFS IDLE 0 0 0 0

    RFS IDLE 0 0 0 0

    RFS IDLE 0 0 0 0

    RFS IDLE 0 0 0 0

     

    13 rows selected.

     

     

    Se valida que los procesos RFS y MRP0 se encuentran disponibles y aplicando archivelogs.-

     

    Saludos

     

    Juanjo

     
    • Juanjinio 01:06 on 03/08/2009 Permalink

      lol

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel