In this article presents a brief explanation of how assorted Oracle data files can be renaming and moving to a new location.
Data files may need to be moved or renamed for the following reasons:
-To give names that comply with naming standards,
-To free up space on a full disk,
-To move a data file that was mistakenly created on the wrong disk, etc.
For this process, first the tablespace must be made offline or the database must be closed.
Process steps:
1. Tablespace is put into offline mode;
1 |
SQL> alter tablespace <tablespace_name> offline; |
2. The transfer process is carried out via the operating system.
1 |
# mv /konum1/tbs.dbf /konum2/tbs.dbf |
3. We are updating CONTROL FILE;
1 |
SQL> alter tablespace <tablespace_name> rename datafile '/konum1/tbs.dbf' to '/konum2/tbs.dbf'; |
Or;
1 |
SQL> alter database rename file '/konum1/tbs.dbf' to '/konum2/tbs.dbf'; |
4. Tablespace is done online.
1 |
SQL> alter tablespace <tablespace_name> online; |