Busca

Google
 
BuscaPé, líder em comparação de preços na América Latina
BuscaPé, líder em comparação de preços na América Latina

domingo, 4 de novembro de 2007

Movendo uma Tablespace (Moving a tablespace)


Algumas dicar para se move uma tablespace (Datafiles) para outra área.


Quando mover?

- Quando for necessário liberar área movendo um datafile.

- Para ajustar o problema de I/O movendo o datafile para outro volume de disco.
Restrições.

- Nunca altere o nome das tablespaces SYSTEM e SYSAUX


Movendo uma tablespace (Datafile)

1. If the database is up, shut it down.

2. Copy the datafile to the new name/location at operating system level.

3. Mount the database.

> STARTUP MOUNT

( This command will read the control file but will not mount the datafiles. )

4. Rename the file inside Oracle.

> ALTER DATABASE RENAME FILE

'/FULL_PATH_OF_OLD_LOCATION/AND_DATAFILE_NAME.DBF'

TO

'/FULL_PATH_OF_NEW_LOCATION/AND_DATAFILE_NAME.DBF';

Do this for all the datafiles that were renamed or moved at the operating system level.

5. Open the database.

> ALTER DATABASE OPEN;


6. Query v$dbfile to confirm that the changes made were correct.

> SELECT * FROM V$DBFILE;


7. Remove the datafile(s) from the old location at the operating system level.
Ps.: Antes de remover o datafile verifique se a data de alteração do arquivo foi alterada, caso esteja com a mesma data dos outros datafiles, houve algum erro e o datafile ainda esta sendo acessado. A exclusão pode causar problemas sérios no banco.

Já apliquei estes comandos em um banco 9i e 10g, funcionou perfeitamente.

Nenhum comentário: