Due to the rapid growth of data in the Oracle database, the disk space of the data file is insufficient. To clean up the space, I disabled oracle, then, the data files, control files, and redo log groups are moved directly to another disk, but this causes many problems and is difficult to clean up, so they are moved back again, then I can find the method for moving it through the query:
When moving the tablespace created by the user, when the database is opened:
1. First, set the tablespace to read-only.
Alter tablespace bfina read only;
2. Set the tablespace to offline.
Alter database datafile '/opt/app/oracle/oradata/orcl/bfina. dbf' offline;
3. copy the data file to a new location.
Host cp '/opt/app/oracle/oradata/orcl/bfina. dbf''/gisdata/orcl/bfina. dbf'
4. Rename the data file to a new location.
Alter database rename file '/opt/app/oracle/oradata/orcl/bfina. dbf' to'/gisdata/orcl/bfina. dbf'
5. Connect the data file
Alter database datafile '/gisdata/orcl/bfina. dbf' online
6. Set the tablespace to read and write permissions.
Alter tablespace bfina read write;
7. Delete the old data file.
To move the system tablespace
Then MOUNT the system to the MOUNT status.
Startup mount;
1. Take the system tablespace offline
Alter database datafile '/opt/app/oracle/oradata/orcl/system01.dbf' offline;
2. copy the file to the new directory.
Host cp ''''
3. Rename the system tablespace to the new location.
Alter database rename file '/opt/app/oracle/oradata/orcl/system01.dbf' to '/gisdata/orcl/system01.dbf'
4. Then online
Alter database'/opt/app/oracle/oradata/orcl/system01.dbf' online;
5. Open the database later