Saturday, August 27, 2016

Renaming or Moving Oracle Data Files

>>Query datafiles which want to move.
SELECT name FROM v$datafile WHERE name LIKE '%credit%';

>>Take the tablespace that contains the datafiles offline. The database must be open.
ALTER TABLESPACE credittestdata OFFLINE NORMAL;

>> Host move datafiles
host mv /areadb2/credittestdata08.dbf /area_db/credittestdata08.dbf

>> Renaming Datafiles
ALTER TABLESPACE credittestdata RENAME DATAFILE '/areadb2/credittestdata08.dbf' to '/area_db/credittestdata08.dbf';

>>Take the tablespace that contains the datafiles Online.

ALTER TABLESPACE credittestdata ONLINE;

No comments:

Post a Comment