Rechercher dans ce blog

vendredi 3 juin 2016

Rename DG

Le but est de passer  le diskgroup POCDB à DATARAD et POCREDO à REDO_RAD.
On a une bd qui s appuie sur ces diskgroups.
De preference pratiquer sur de la non prod voir un poc afin d’etre à l aise.
La lecture des note oracle : Doc ID 948040.1, Doc ID 1335975.1 serait un plus.

exemple

Ci-dessous c’est un exemple bien sur à adapter.
#actions
commande
user
1
# srvctl config database -d POCRAD
oracle os
2
select 'ALTER DATABASE RENAME FILE '''||MEMBER||''' TO '''||REPLACE(MEMBER,'+POCREDO','+REDO_RAD')||'''; ' FROM v$logfile;
oracle sqlplus
3
Select 'ALTER DATABASE RENAME FILE '''||NAME||''' TO '''||REPLACE(NAME,'+POCDB','+DATARAD')||'''; ' from  V$tempfile;
oracle sqlplus
4
Select 'ALTER DATABASE RENAME FILE '''||NAME||''' TO '''||REPLACE(NAME,'+POCDB','+DATARAD')||'''; ' from  V$datafile;
oracle sqlplus
5
alter database disable block change tracking;
oracle sqlplus

Attention au controlfiles

6
alter database flashback off;
oracle sqlplus
7
create pfile from spfile;
modifier le  spfile  pour les  nouveau diskgroupe
oracle sqlplus
8
srvctl stop database -d POCRAD
oracle os
9
ASMCMD> lsdg
lsdsk  -k  -G  <diskgroup>
grid  asmcmd
10
ASMCMD> umount POCDB
grid  asmcmd
11
ASMCMD> umount POCREDO
grid  asmcmd
12
#renamedg phase=both dgname=POCREDO newdgname=REDO_RAD verbose=true asm_diskstring='/dev/oracleasm/disks/*
grid  os
13
#renamedg phase=both dgname=POCDB newdgname=DATARAD verbose=true asm_diskstring='/dev/oracleasm/disks/*
grid  os
14
ASMCMD> lsdg
grid  asmcmd
15
ASMCMD> mount DATARAD
grid  asmcmd
16
ASMCMD> mount  REDO_RAD
grid  asmcmd
17
crsctl stat res -w 'TYPE = ora.diskgroup.type' –t
grid os
18
startup nomount pfile='/u01/oracle/product/11.2.0/db_1/dbs/initorcl.ora.bkp'
oracle sqlplus
19
alter database mount;
oracle sqlplus
20
Rejouer les scripts issus des etapes #2,#3,#4
oracle sqlplus
21
alter database mount;
oracle sqlplus
22
alter database open;
oracle sqlplus
23
create spfile from pfile=’xxxxxx’;
oracle sqlplus
24
srvctl modify database -d POCRAD -p '+REDO_RAD/POCRAD/PARAMETERFILE/spfilePOCRAD.ora'
oracle os
25
modifier le fichier initSID.ora pour ajouter le nouveau spfile (sur chaque noeud)
oracle os
26
srvctl modify database -d POCRAD -a "POCARCH,REDO_RAD,DATARAD"
oracle os
28
shutdown immediate
oracle sqlplus
29
srvctl start database -d POCRAD
oracle os
30
srvctl remove diskgroup -g POCREDO -f
oracle os
31
srvctl remove diskgroup -g POCDB -f
oracle os

Etape #9 : output  du  lsdsk

ASMCMD> lsdsk  -k  -G  datarad
Total_MB  Free_MB   OS_MB  Name          Failgroup     Failgroup_Type  Library  Label  UDID  Product  Redund   Path
  262064    23752  262064  DATARAD_0006  DATARAD_0006  REGULAR         System                         UNKNOWN  /dev/rdsk/c1d14s0
  262064    23752  262064  DATARAD_0001  DATARAD_0001  REGULAR         System                         UNKNOWN  /dev/rdsk/c1d18s0
  262064    23752  262064  DATARAD_0007  DATARAD_0007  REGULAR         System                         UNKNOWN  /dev/rdsk/c1d19s0
ASMCMD> lsdsk  -k  -G redo_rad
Total_MB  Free_MB  OS_MB  Name           Failgroup      Failgroup_Type  Library  Label  UDID  Product  Redund   Path
   65448    56920  65448  REDO_RAD_0001  REDO_RAD_0001  REGULAR         System                         UNKNOWN  /dev/rdsk/c1d16s0

Etape #12 :  outout  renamdg

[dev-mtlunt119:grid::/home/grid/mg]#renamedg phase=both dgname=REDO_RAD newdgname=REDORA verbose=true asm_diskstring='/dev/rdsk/*'

Parsing parameters..

Parameters in effect:

         Old DG name       : REDO_RAD
         New DG name          : REDORA
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : /dev/rdsk/*
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: phase=both dgname=REDO_RAD newdgname=REDORA verbose=true asm_diskstring=/dev/rdsk/*
Executing phase 1
Discovering the group
Performing discovery with string:/dev/rdsk/*
Identified disk UFS:/dev/rdsk/c1d16s0 with disk number:1 and timestamp (33036270 -1617638400)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:/dev/rdsk/*
Identified disk UFS:/dev/rdsk/c1d16s0 with disk number:1 and timestamp (33036270 -1617638400)
Checking if the diskgroup is mounted or used by CSS
Checking disk number:1
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for /dev/rdsk/c1d16s0
Modifying the header
Completed phase 2
Terminating kgfd context 1001bb480

Output   du lsdsk  post  rename:

ASMCMD> lsdsk  -k  -G datara
Total_MB  Free_MB   OS_MB  Name          Failgroup     Failgroup_Type  Library  Label  UDID  Product  Redund   Path
  262064    23752  262064  DATARAD_0006  DATARAD_0006  REGULAR         System                         UNKNOWN  /dev/rdsk/c1d14s0
  262064    23752  262064  DATARAD_0001  DATARAD_0001  REGULAR         System                         UNKNOWN  /dev/rdsk/c1d18s0
  262064    23752  262064  DATARAD_0007  DATARAD_0007  REGULAR         System                         UNKNOWN  /dev/rdsk/c1d19s0
ASMCMD> lsdsk  -k -g redora
ASMCMD> lsdsk  -k  -G redora
Total_MB  Free_MB  OS_MB  Name           Failgroup      Failgroup_Type  Library  Label  UDID  Product  Redund   Path
   65448    56920  65448  REDO_RAD_0001  REDO_RAD_0001  REGULAR         System                         UNKNOWN  /dev/rdsk/c1d16s0

Erreur

Si on a  cette  erreur  dans les logs  cluster c est lie a golden gate :
2016-05-26 13:54:17.296: [   CRSPE][1177860416] {2:48629:58091} Register Resource Opora.DATARAD.dg] has failed:CRS-2566:
 User 'grid' does not have sufficient permissions to operate on resource 'pocrac-gg', which is part of the dependency specification.
Faire executer  par un root user  cette  commande :

crsctl  setperm resource  pocrac-gg -u user:grid:rwx

Aucun commentaire:

Enregistrer un commentaire