How to move data files to other mounts ??
There are multiple ways.. here are the ones which I followed for PROD :)
1. Shut down your DB
2. At OS level move your datafiles/Tempfiles/Undo or any dbf files to your destination location i.e /u02
mv /u01/system10.dbf /u02/system10.dbf
3. Now start the db in mount so that it will update your control files
startup mount
4. Now use RENAME command as below:
alter database rename file '/u01/system10.dbf' to '/u02/system10.dbf'
..--> Do the same for all required files -->
5. Alter database open
Now for validation , you can check
select name from v$datafile where name like '%u02%'; - should point out new locations for datafiles
2nd Method:
From 12C onwards, there is an option to move datafile online
1. Simply use below command to move online datafile from /u01 to /u02
set echo on
set timing on
ALTER DATABASE MOVE DATAFILE '/U05/applfarm/farmdata/a_txn_ind12.dbf' to '/u01/a_txn_ind12.dbf';
ALTER DATABASE MOVE DATAFILE '/U05/applfarm/farmdata/a_txn_ind14.dbf' to '/u02/a_txn_ind14.dbf';
NOTE: Problem with online datafile move is .. It will not RELEASE space at OS level immediately
as some of your BG process are still accessing the space. After restart space gets released
No comments:
Post a Comment