- Shutdown the database.
- Rename the physical file on the OS.
- Start the database in mount mode.
- Issue the ALTER DATABASE RENAME FILE command to rename the file within the Oracle dictionary.
- Open the database.
Hereof, how do I move datafile to another tablespace?
To move or rename a datafile do the following.
- Shutdown the database.
- Rename the physical file on the OS.
- Start the database in mount mode.
- Issue the ALTER DATABASE RENAME FILE command to rename the file within the Oracle dictionary.
- Open the database.
Secondly, how do I move a table from one tablespace to another tablespace?
- SELECT 'ALTER TABLE <SCHEMA>.' || TABLE_NAME ||' MOVE TABLESPACE '||' <TABLESPACE_NAME> ' FROM dba_tables WHERE OWNER = '<SCHEMA>' AND TABLESPACE_NAME <> '<TABLESPACE_NAME>'; filter's tables already in desired tablespace – Barun Feb 22 '16 at 4:45.
- First query in the answer should be replaced with Barun`s query. –
Considering this, how do I move Datafile from one directory to another in Oracle 12c?
Below are examples of how the ALTER DATABASE MOVE DATAFILE command can be used to Rename, Relocate, Copy or Move data files to to ASM.
- Rename: ALTER DATABASE MOVE DATAFILE '/u01/app/oracle/oradata/PSTG/datafile/test.dbf' TO '/u01/app/oracle/oradata/PSTG/datafile/tester.dbf';
- Relocate:
- Copy:
- Move to ASM:
How do I move Datafile online in 19c?
Executed the command with the name obtain from query. ALTER DATABASE MOVE DATAFILE '/opt/oracle/product/19c/dbhome_1/dbs/ARPA_DATOS_F1.dbf' TO '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/ARPA_DATOS_F1. dbf';