TABLESPACE MANAGEMENT RENAME OR MOVE A DATAFILE

preview_player
Показать описание
RENAME OR MOVE A DATAFILE (when there is space issue in os level file movement is required)
==========================
1)TABLESPACE SHOULD BE OFFLINE(when we move or rename a datafile users should not access)
2)FROM OS LEVEL DATAFILE COPY TO NEW LOCATION
3)SQL LEVEL RENAME THE DATAFILE TO NEW LOCATION
4)MAKE THE TABLESPACE ONLINE

alter tablespace king offline;

os level move the file to new location(KING02.DBF)

alter tablespace king rename datafile
'E:\DATABASE\DATABASE\ORADATA\ORCL\KING01.DBF' to 'E:\DATABASE\DATABASE\ORADATA\ORCL\GOODKING01.DBF';

alter tablespace king rename datafile
'E:\DATABASE\DATABASE\ORADATA\ORCL\KING02.DBF' TO 'D:\ORADATA\KING02.DBF';

alter tablespace king online;

HOW TO CHECK DATAFILES INFO IN PARTICULAR TABLESPACE
=====================================================
COL FILE_NAME FOR A50
COL TABLESPACE_NAME FOR A20
select tablespace_name,file_name from dba_data_files where tablespace_name like '&tablespace_name';
Рекомендации по теме