martes, 7 de julio de 2009

Cortitas...

Quizás este tipo de comentario tendrían que haber estado al inicio (cronológicamente) del blog, pero bueh, las disculpas del caso, se me ocurrió ahora!!!

Cómo creo un usuario?
create user usuario identified by password
default tablespace USERS
temporary tablespace TEMP
profile default;

Cómo cambio el password de un usuario existente?
alter user usuario identified by password;

Cómo creo un tablespace de 1Gb, autoextensible, tamaño máximo 10Gb?
create tablespace nombre_ts datafile
'c:\oracle\oradata\nombre_datafile.dbf' size 1024m autoextend on next 128m maxsize 10240m
logging
permanent
extent management local autoallocate
blocksize 8k
segment space management auto
flashback on;

Espacio disponible en Tablespaces?
select tablespace_name as "TABLESPACE",
sum(round(f.bytes/1024/1024)) "TAMAÑO ACTUAL (Mb)",
sum(round((((f.bytes / f.blocks) * x.maxextend) / 1024 /1024))) "TAMAÑO MAXIMO (Mb)"

, sum(round(((((f.bytes / f.blocks) * x.maxextend) / 1024 /1024) - (f.bytes/1024/1024)),0)) "ESPACIO DISPONIBLE (Mb)"
from sys.dba_data_files f,sys.filext$ x

where x.file# (+)= f.file_id
group by tablespace_name
order by "ESPACIO DISPONIBLE (Mb)";


Cómo eliminar columna de una tabla?
alter table nombre_tabla drop column nombre_columna;

No hay comentarios:

Publicar un comentario