Oracle - Dudas con el uso de SET UNUSED

 
Vista:

Dudas con el uso de SET UNUSED

Publicado por Lorena Escovar (1 intervención) el 08/05/2007 19:24:14
Hola, tengo una duda con el uso de SET UNUSED,

1. Al realizar

ALTER TABLE tabla SET UNUSED COLUMN columna

y realizar un query a tabla ya no aparece la columna, pero que pasa si quiero reversar esa operacion, es decir volver a usar 'columna', ¿si se puede?

2. Ahora, si realizo lo siguiente

ALTER TABLE tabla SET UNUSED (columna1, columna2)

y quiero solo hacer el DROP UNUSED a columna1 ¿tambien se puede?

y por último

3. que diferencia hay en el uso de SET UNUSED y DROP COLUMN ?

Muchisimas gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Dudas con el uso de SET UNUSED

Publicado por Rodolfo Reyes (445 intervenciones) el 08/05/2007 21:49:16
Lo siguiente lo saque de Metalink:

SQL>Alter table <TABLENAME> DROP COLUMN f1;

The DROP removes the column descriptor and the data associated with the target
column from each row in the table. If you explicitly drop a particular
column, all columns currently marked as unused in the target table are
dropped at the same time.

When the column data is dropped:
All indexes defined on any of the target columns are also dropped.
All constraints that reference a target column are removed.
If any statistics types are associated with the target columns,
Oracle disassociates the statistics from the column with the
FORCE option and drops any statistics collected using the
statistics type. For more information on disassociating statistics
types, see "DISASSOCIATE STATISTICS".(8i Documentation)


The following drop_column_clauses can, also, be used:

SQL>ALTER TABLE <TABLENAME> SET UNUSED COLUMN f1;

The SET UNUSED marks one or more columns as unused.
Specifying this clause does not actually remove the target columns
from each row in the table (that is, it does not restore the disk space used by
these columns). Therefore, the response time is faster than it would be if you
execute the DROP clause.


SQL>ALTER TABLE <TABLENAME> DROP UNUSED COLUMNS f1;

removes from the table all columns currently marked as unused.
Use this statement when you want to reclaim the extra disk space from unused
columns in the table. If the table contains no unused columns, the
statement returns with no errors.

Y hasta donde entiendo no existe algun comando con el cual puedas revertir un UNESED COLUMN
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar