No es una cosa que me guste especialmente, pero es posible que nos encontremos con personas que digan que si el rendimiento de la BD mejora mucho con los redolog en raw, frente a un sistema de ficheros (ext4 por ejemplo).
Para salir de dudas podemos trabajar con los redologs en modo RAW de forma muy sencilla. Vamos a poner un ejemplo hecho en Red Hat 4, con una BDD de pruebas con 3 redologs de 51 MB cada uno:
[oracle@clu01 DBU]$ ls -l
total 1502076
-rw-r----- 1 oracle oinstall 9748480 Jun 25 20:38 control01.ctl
-rw-r----- 1 oracle oinstall 9748480 Jun 25 20:38 control02.ctl
-rw-r----- 1 oracle oinstall 7061504 Jun 12 11:36 control03.ctl
-rw-r----- 1 oracle oinstall 52429312 Jun 25 11:06 redo01.log
-rw-r----- 1 oracle oinstall 52429312 Jun 25 10:39 redo02.log
-rw-r----- 1 oracle oinstall 52429312 Jun 25 10:39 redo03.log
-rw-r----- 1 oracle oinstall 545267712 Jun 25 20:38 sysaux01.dbf
-rw-r----- 1 oracle oinstall 744497152 Jun 25 20:38 system01.dbf
-rw-r----- 1 oracle oinstall 20979712 Jun 23 21:22 temp01.dbf
-rw-r----- 1 oracle oinstall 36708352 Jun 25 20:38 undotbs01.dbf
-rw-r----- 1 oracle oinstall 5251072 Jun 25 20:38 users01.dbf
Vamos a usar un HD de la increible capacidad de 1GB y vamos a hacer tres particiones (de 52MB) quedando:
[root@clu01 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): +52M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (8-130, default 8):
Using default value 8
Last cylinder or +size or +sizeM or +sizeK (8-130, default 130): +52M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (15-130, default 15):
Using default value 15
Last cylinder or +size or +sizeM or +sizeK (15-130, default 130): +52M
Command (m for help): p
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 7 56196 83 Linux
/dev/sdb2 8 14 56227+ 83 Linux
/dev/sdb3 15 21 56227+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Con los devices:
[oracle@clu01 DBU]$ ls -l /dev/sdb*
brw-rw---- 1 root disk 8, 16 Jun 25 2013 /dev/sdb
brw-rw---- 1 root disk 8, 17 Jun 25 2013 /dev/sdb1
brw-rw---- 1 root disk 8, 18 Jun 25 2013 /dev/sdb2
brw-rw---- 1 root disk 8, 19 Jun 25 2013 /dev/sdb3
Le damos propiedad a los devices al usuario oracle grupo oinstall (ojo que los cambios no son permanentes en el siguiente reinicio los perdemos):
chown oracle:oinstall /dev/sdb1
chown oracle:oinstall /dev/sdb2
chown oracle:oinstall /dev/sdb3
Quedando:
brw-rw---- 1 oracle oinstall 8, 17 Jun 25 20:31 /dev/sdb1
brw-rw---- 1 oracle oinstall 8, 18 Jun 25 20:31 /dev/sdb2
brw-rw---- 1 oracle oinstall 8, 19 Jun 25 20:31 /dev/sdb3
Con la BD parada renombramos los redologs (como backup), creamos links simbólicos y copiamos el contenido de los redo en los raw.
[oracle@clu01 DBU]$ ls
control01.ctl control02.ctl control03.ctl redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
[oracle@clu01 DBU]$ mv redo01.log redo01.log.ori
[oracle@clu01 DBU]$ mv redo02.log redo02.log.ori
[oracle@clu01 DBU]$ mv redo03.log redo03.log.ori
[oracle@clu01 DBU]$ ls -l
total 1502076
-rw-r----- 1 oracle oinstall 9748480 Jun 25 11:06 control01.ctl
-rw-r----- 1 oracle oinstall 9748480 Jun 25 11:06 control02.ctl
-rw-r----- 1 oracle oinstall 7061504 Jun 12 11:36 control03.ctl
-rw-r----- 1 oracle oinstall 52429312 Jun 25 11:06 redo01.log.ori
-rw-r----- 1 oracle oinstall 52429312 Jun 25 10:39 redo02.log.ori
-rw-r----- 1 oracle oinstall 52429312 Jun 25 10:39 redo03.log.ori
-rw-r----- 1 oracle oinstall 545267712 Jun 25 11:06 sysaux01.dbf
-rw-r----- 1 oracle oinstall 744497152 Jun 25 11:06 system01.dbf
-rw-r----- 1 oracle oinstall 20979712 Jun 23 21:22 temp01.dbf
-rw-r----- 1 oracle oinstall 36708352 Jun 25 11:06 undotbs01.dbf
-rw-r----- 1 oracle oinstall 5251072 Jun 25 11:06 users01.dbf
[oracle@clu01 DBU]$ ln -s /dev/sdb1 redo01.log
[oracle@clu01 DBU]$ ln -s /dev/sdb2 redo02.log
[oracle@clu01 DBU]$ ln -s /dev/sdb3 redo03.log
[oracle@clu01 DBU]$ ls -l
total 1502076
-rw-r----- 1 oracle oinstall 9748480 Jun 25 11:06 control01.ctl
-rw-r----- 1 oracle oinstall 9748480 Jun 25 11:06 control02.ctl
-rw-r----- 1 oracle oinstall 7061504 Jun 12 11:36 control03.ctl
lrwxrwxrwx 1 oracle oinstall 9 Jun 25 20:34 redo01.log -> /dev/sdb1
-rw-r----- 1 oracle oinstall 52429312 Jun 25 11:06 redo01.log.ori
lrwxrwxrwx 1 oracle oinstall 9 Jun 25 20:34 redo02.log -> /dev/sdb2
-rw-r----- 1 oracle oinstall 52429312 Jun 25 10:39 redo02.log.ori
lrwxrwxrwx 1 oracle oinstall 9 Jun 25 20:35 redo03.log -> /dev/sdb3
-rw-r----- 1 oracle oinstall 52429312 Jun 25 10:39 redo03.log.ori
-rw-r----- 1 oracle oinstall 545267712 Jun 25 11:06 sysaux01.dbf
-rw-r----- 1 oracle oinstall 744497152 Jun 25 11:06 system01.dbf
-rw-r----- 1 oracle oinstall 20979712 Jun 23 21:22 temp01.dbf
-rw-r----- 1 oracle oinstall 36708352 Jun 25 11:06 undotbs01.dbf
-rw-r----- 1 oracle oinstall 5251072 Jun 25 11:06 users01.dbf
[oracle@clu01 DBU]$ dd if=redo01.log.ori of=/dev/sdb1
102401+0 records in
102401+0 records out
[oracle@clu01 DBU]$ dd if=redo02.log.ori of=/dev/sdb2
102401+0 records in
102401+0 records out
[oracle@clu01 DBU]$ dd if=redo03.log.ori of=/dev/sdb3
102401+0 records in
102401+0 records out
Bien ahora tenemos copiados los redolog en los raw, que son apuntados por los links simbólicos. Ya podemos arrancar la BD sin problemas y hacer todas la pruebas de rendimiento pertinentes.
Para deshacer esto simplemente hacemos el paso a la inversa. Eliminamos los links simbólicos y copiamos el contenido de los RAW en los redos.
[oracle@clu01 DBU]$ ls -l
total 1502076
-rw-r----- 1 oracle oinstall 9748480 Jun 25 20:57 control01.ctl
-rw-r----- 1 oracle oinstall 9748480 Jun 25 20:57 control02.ctl
-rw-r----- 1 oracle oinstall 7061504 Jun 12 11:36 control03.ctl
lrwxrwxrwx 1 oracle oinstall 9 Jun 25 20:34 redo01.log -> /dev/sdb1
-rw-r----- 1 oracle oinstall 52429312 Jun 25 11:06 redo01.log.ori
lrwxrwxrwx 1 oracle oinstall 9 Jun 25 20:34 redo02.log -> /dev/sdb2
-rw-r----- 1 oracle oinstall 52429312 Jun 25 10:39 redo02.log.ori
lrwxrwxrwx 1 oracle oinstall 9 Jun 25 20:35 redo03.log -> /dev/sdb3
-rw-r----- 1 oracle oinstall 52429312 Jun 25 10:39 redo03.log.ori
-rw-r----- 1 oracle oinstall 545267712 Jun 25 20:38 sysaux01.dbf
-rw-r----- 1 oracle oinstall 744497152 Jun 25 20:38 system01.dbf
-rw-r----- 1 oracle oinstall 20979712 Jun 23 21:22 temp01.dbf
-rw-r----- 1 oracle oinstall 36708352 Jun 25 20:38 undotbs01.dbf
-rw-r----- 1 oracle oinstall 5251072 Jun 25 20:38 users01.dbf
[oracle@clu01 DBU]$ rm redo01.log
[oracle@clu01 DBU]$ rm redo02.log
[oracle@clu01 DBU]$ rm redo03.log
[oracle@clu01 DBU]$ dd if=/dev/sdb1 of=redo01.log.ori
112392+0 records in
112392+0 records out
[oracle@clu01 DBU]$ dd if=/dev/sdb2 of=redo02.log.ori
112455+0 records in
112455+0 records out
[oracle@clu01 DBU]$ dd if=/dev/sdb3 of=redo03.log.ori
112455+0 records in
112455+0 records out
[oracle@clu01 DBU]$ mv redo01.log.ori redo01.log
[oracle@clu01 DBU]$ mv redo02.log.ori redo02.log
[oracle@clu01 DBU]$ mv redo03.log.ori redo03.log
[oracle@clu01 DBU]$ ls -l
total 1517128
-rw-r----- 1 oracle oinstall 9748480 Jun 25 20:57 control01.ctl
-rw-r----- 1 oracle oinstall 9748480 Jun 25 20:57 control02.ctl
-rw-r----- 1 oracle oinstall 7061504 Jun 12 11:36 control03.ctl
-rw-r----- 1 oracle oinstall 57544704 Jun 25 21:33 redo01.log
-rw-r----- 1 oracle oinstall 57576960 Jun 25 21:34 redo02.log
-rw-r----- 1 oracle oinstall 57576960 Jun 25 21:34 redo03.log
-rw-r----- 1 oracle oinstall 545267712 Jun 25 20:38 sysaux01.dbf
-rw-r----- 1 oracle oinstall 744497152 Jun 25 20:38 system01.dbf
-rw-r----- 1 oracle oinstall 20979712 Jun 23 21:22 temp01.dbf
-rw-r----- 1 oracle oinstall 36708352 Jun 25 20:38 undotbs01.dbf
-rw-r----- 1 oracle oinstall 5251072 Jun 25 20:38 users01.dbf
Y arrancamos la BD sin problemas:
[oracle@clu01 DBU]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Jun 25 21:35:33 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 464519168 bytes
Fixed Size 1345660 bytes
Variable Size 297797508 bytes
Database Buffers 159383552 bytes
Redo Buffers 5992448 bytes
Database mounted.
Database opened.