1. Create table space and user, because the data file does not specify the path, so need to modify the data file path, the following requirements.
Create tablespace wo datafile ' wo.dbf ' size 20m;
Create user wo identified by "123abc" Default Tablespace wo;
Grant Connect,resource to Wo;
For non-system tablespaces, the same applies to sysaux,users table spaces
SELECT * from V$datafile;
Select Tablespace_name,file_name,online_status from Dba_data_files where tablespace_name= ' WO ';
Alter tablespace WO offline;
Host mv/u01/app/oracle/product/11.2/db_1/dbs/wo.dbf/u01/app/oracle/oradata/lcp1/datafile/
Alter tablespace WO rename datafile '/u01/app/oracle/product/11.2/db_1/dbs/wo.dbf ' to '/u01/app/oracle/oradata/lcp1/ DATAFILE/WO.DBF ';
Select Tablespace_name,file_name,online_status from Dba_data_files where tablespace_name= ' WO ';
Alter tablespace WO Online;
For the system table space, the UNDOTBS1 and temp table spaces are also applicable. This method requires the database to be in the Mount State
Shutdown immediate
Startup Mount
Host mv/u01/app/oracle/product/11.2/db_1/dbs/system01.dbf/u01/app/oracle/oradata/lcp1/datafile/
Alter tablespace WO rename datafile '/u01/app/oracle/product/11.2/db_1/dbs/system01.dbf ' to '/u01/app/oracle/oradata/ LCP1/DATAFILE/SYSTEM01.DBF ';
ALTER DATABASE open;
Select Tablespace_name,file_name,online_status from Dba_data_files where tablespace_name= ' SYSTEM ';
Task-based SQL