LESSON 21
How to move data file online
You can move a data file
from one location to another without offline the tablespace or data
file.
Check your CDB data
files using the V$DATAFILE view
SQL> SELECT
name FROM v$datafile;
NAME |
/oradata/mycdb/system01.dbf |
/oradata/mycdb/sysaux01.dbf |
/oradata/mycdb/undotabs01.dbf |
/oradata/mycdb/users01.dbf |
/oradata/mycdb/example01.dbf |
Assuming that you want
to move the datafile /oradata/mycdb/users01.dbf to /oradata/mycdb/newdevice/users01.dbf
SQL> ALTER
DATABASE MOVE DATAFILE
2 "/oradata/mycdb/users01.dbf"
TO "/oradata/mycdb/newdevice/users01.dbf";
Now, check your CDB data
files using the V$DATAFILE view again
SQL> SELECT
name FROM v$datafile;
NAME |
/oradata/mycdb/system01.dbf |
/oradata/mycdb/sysaux01.dbf |
/oradata/mycdb/undotabs01.dbf |
/oradata/mycdb/newdevice/users01.dbf |
/oradata/mycdb/example01.dbf |
Notice that you moved
your data file from one location to another without performing offline
on the tablespace or datafile.
If you go to the /oradata/mycdb
folder, you will not see the data file.
# cd /oradata/mycdb
# ls "al
/oradata/mycdb/system01.dbf |
/oradata/mycdb/sysaux01.dbf |
/oradata/mycdb/undotabs01.dbf |
/oradata/mycdb/example01.dbf |
Notice that the data
file user01.dbf was moved to the new location.
Good Luck!
|