Rechercher dans ce blog

mardi 4 octobre 2011

dataguard 11g le switch over avec et sans broker

         Switch  over :

6.     Standby (aix_rac2) :

·      Verification de  la bonne  synchronisation de la standby :
Sur  la  primaire 
Archive log list;
Oldest online log sequence     26
Next log sequence to archive   28
La sequence  courante  est la   27.
Sur la  standby   avec  la  requete de  verification on est  aussi  a la   sequence  27.

·      Arrêter le  recover managed
alter   database recover  managed  standby database cancel;
·      Verification de la log db
·      Verification  du  switchover status :
select switchover_status from v$database;
to  primary
·         le  switch :
                    alter database commit to switchover to primary;
                    shutdown  immediate
                    startup
                    select  database_role  from  V$database;
                    alter  system  switch  logfile;

7.     Primaire (aix_rac1) :

                    alter database commit to switchover to standby;
                    shutdown  immediate
                    startup mount
                    select  database_role  from  V$database;
alter  database  recover  managed  standby  database disconnect  from  session;

 VI.            Broker

Avant  meme  de  demarrer  voila  la configuration par  defaut  sur la   primaire :
SQL> show  parameter  broker
NAME                                                                          VALUE
dg_broker_config_file1                    /u01/app/oracle/11.2.0/dbs/dr1 MG.dat
dg_broker_config_file2                     /u01/app/oracle/11.2.0/dbs/dr2MG.dat
dg_broker_start                                FALSE
alter  system set  dg_broker_config_file1=’ +data/MG/DATAGUARDCONFIG/dr1 MG.dat ';
alter  system  set dg_broker_config_file2='+FRA/MG/DATAGUARDCONFIG/dr2 MG.dat ';
Si  on met  les  fichiers de   config   sur  le  meme  dg  on recoit  l erreur  ORA-02097
Sur les 2  serveurs  je  demarre  le  broker  (process  dmon)
alter   system  set dg_broker_start=true;
Dans le  broker :
create  configuration dguard as  primary  database is 'MG' connect  identifier is 'MG';
add  database ‘MGSTDBY’ as  connect   identifier  is ‘MGSTDBY’ maintained  as  physical;
enable   configuration;
·         administration du  broker :
Show  configuration ;
DGMGRL> show  configuration;

Configuration - dguard

  Protection Mode: MaxPerformance
  Databases:
    MG      - Primary database
      Warning: ORA-16789: standby redo logs not configured

    MGSTDBY - Physical standby database
      Error: ORA-16797: database is not using a server parameter file

Fast-Start Failover: DISABLED

Configuration Status:
ERROR
Correction   de  ses erreurs
Sur MG@aix_rac1
ALTER DATABASE ADD STANDBY LOGFILE '+data';   quatre fois.

Sur MGSTDBY@aix_rac2
SQL>  ALTER DATABASE ADD STANDBY LOGFILE '/u01/app/oracledata/arch/MGSTDBY/stdbylog/stdbylog1'  size 104857600;
SQL> ALTER DATABASE ADD STANDBY LOGFILE '/u01/app/oracledata/arch/MGSTDBY/stdbylog/stdbylog2' size 104857600;
SQL> ALTER DATABASE ADD STANDBY LOGFILE '/u01/app/oracledata/arch/MGSTDBY/stdbylog/stdbylog3' size 104857600;
SQL> ALTER DATABASE ADD STANDBY LOGFILE '/u01/app/oracledata/arch/MGSTDBY/stdbylog/stdbylog4' size 104857600;
Create spfile   from pfile;
Shutdown immediate
Startup  mount
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
  
DGMGRL> show  configuration;
Configuration - dguard
  Protection Mode: MaxPerformance
  Databases:
    MG      - Primary database
    MGSTDBY - Physical standby database (disabled)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show  database  verbose 'MG';
Voila  les  properties :

DGConnectIdentifier
'MG'
ObserverConnectIdentifier
''
LogXptMode
'ASYNC'
DelayMins
'0'
Binding
'optional'
MaxFailure
'0'
MaxConnections
'1'
ReopenSecs
'300'
NetTimeout
'30'
RedoCompression
'DISABLE'
LogShipping
'ON'
PreferredApplyInstance
''
ApplyInstanceTimeout
'0'
ApplyParallel
'AUTO'
StandbyFileManagement
'MANUAL'
ArchiveLagTarget
'0'
LogArchiveMaxProcesses
'4'
LogArchiveMinSucceedDest
'1'
DbFileNameConvert
'/u01/app/oracledata/stdby, +DATA/MG/datafile, /u01/app/oracledata/stdby, +DATA/MG/tempfile'
LogFileNameConvert
' /u01/app/oracledata/stdby, +DATA/MG/onelinelog'
FastStartFailoverTarget
''
StatusReport
'(monitor)'
InconsistentProperties
'(monitor)'
InconsistentLogXptProps
'(monitor)'
SendQEntries
'(monitor)'
LogXptStatus
'(monitor)'
RecvQEntries
'(monitor)'
HostName
'aix_rac1'
SidName
'MG'
StaticConnectIdentifier
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.180)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=MG_DGMGRL)(INSTANCE_NAME=MG)(SERVER=DEDICATED)))'
StandbyArchiveLocation
'USE_DB_RECOVERY_FILE_DEST'
AlternateLocation
''
LogArchiveTrace
'0'
LogArchiveFormat
'%t_%s_%r.dbf'
TopWaitEvents
'(monitor)'



DGMGRL> show  database  verbose 'MGSTDBY';
·         La log du   broker  est 
$diag_dest/rdbms/<$ORACLE_SID>/<$ORACLE_SID>/trace/drc<$ORACLE_SID>.log

8.     Bascule  dataguard  avec  le  broker :

Elle  peut  se faire  a distance  mais  je  fais  ca depuis    un des serveurs  impliqué dans  la   configuration.
switchover  to ‘MGSTDBY’; ( dep uis  le role standby  vers le  primaire).
DGMGRL> switchover  to 'MGSTDBY';
Performing switchover NOW, please wait...
New primary database "MGSTDBY" is opening...
Operation requires shutdown of instance "MG" on database "MG"
Shutting down instance "MG"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "MG" on database "MG"
Starting instance "MG"...
Unable to connect to database
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Failed.
Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:
        start up and mount instance "MG" of database "MG"

DGMGRL>
Apres   stop/start de la  base MG@aix_rac1
DGMGRL> show   configuration;

Configuration - dguard

  Protection Mode: MaxPerformance
  Databases:
    MGSTDBY - Primary database
    MG      - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS
Les  db   sont   synchrones .
Retoure  sur  MG :
switchover   to 'MG';
startup  de  MGSTDBY;
Remarque :
Avec   le   broker  la   standby  passe   de facon automatique  en  mode  recover  managed.

9.     Fast-start  Failover (P438/439):

Moyen de   basculer   automatiquement   selon des  cas  bien  precis  sans  intervention :
Offline  datafile
Corruption  du   dictionnaire , du  controlfile
Logfile  innacessible
Stuck  archiver
Threshold,….
Commande  pour  mettre  ca   en place
Dgmgrl>Enable  fast_start failover condition ‘XXXXX’;
                Show  fast_start  failover;
On peut avoir  en  plus  un observer :
L observer   est  sur  un autre  serveur .

VII.            Clusterware  to  manage  service applicatif

Ca  fontionne pas  encore  .

http://uhesse.wordpress.com/2010/09/06/data-guard-oracle-restart-in-11gr2/

Aucun commentaire:

Enregistrer un commentaire