lunes, 8 de septiembre de 2008

Oracle Restore Point Laboratorio

select * from v$flash_recovery_area_usage;

SQL>gt; flashback table aud_sesiones to before drop;

DETERMINAR PRIMER FLASHBACK

SELECT OLDEST_FLASHBACK_SCN, to_char(OLDEST_FLASHBACK_TIME,'YYYY-MM-DD:HH24:MI:SS'),"OLDEST_FLASHBACK_TIME" FROM V$FLASHBACK_DATABASE_LOG;


LABORATORIO DE RESTORE POINT

RMAM> list restore point all;


SQL>CREATE RESTORE POINT good_data;

Punto de restauracion creado.

SQL> select descripcion from per_sexo where codigo_sexo=1;

DESCRIPCION
----------------------------------------
MASCULINO

SQL> update per_sexo set descripcion='OTRO' where codigo_sexo=1;

1 fila actualizada.

SQL> select descripcion from per_sexo where codigo_sexo=1;

DESCRIPCION
----------------------------------------
OTRO

SQL> commit;

Confirmacion terminada.

SQL> FLASHBACK TABLE PER_SEXO TO RESTORE POINT GOOD_DATA;
FLASHBACK TABLE PER_SEXO TO RESTORE POINT GOOD_DATA
*
ERROR en linea 1:
ORA-08189: no se puede realizar flashback en la tabla porque el movimiento de filas no esta activado


SQL> alter table per_sexo enable row movement;

Tabla modificada.

SQL> flashback table per_sexo to restore point good_data;

Flashback terminado.

SQL> select descripcion from per_sexo where codigo_sexo=1;

DESCRIPCION
----------------------------------------
MASCULINO

PARA VER PUNTOS DE RESTAURACION CREADOS EN LA INSTANCIA

SQL> select name, storage_size from v$restore_point;

BORRAR PUNTO DE RESTAURACION

drop restore point good_data;

No hay comentarios: