The scenario is as follows:
[Email protected] ~]# df-h
Filesystem capacity used% mount point available
/dev/sda2 28G 26G 585M 98%/
/DEV/SDA1 190M 12M 169M 7%/boot
None 2.0G 0 2.0G 0%/dev/shm
/DEV/SDB3 99G 93M 94G 1%/u02
The root directory is full,
/U02 has a relatively large space,
Now to take the root directory of large space datafile, migrating to a large space/u02 up
The steps are as follows:
1. Migrate the data files to the/u02 corresponding directory
[Email protected] hsbop]$ MV/U01/APP/ORACLE/ORADATA/ORCL/ACPTDAT.DBF/U02/ORADATA/HSBOP/ACPTDAT.DBF
[Email protected] hsbop]$ MV/U01/APP/ORACLE/ORADATA/ORCL/ACPTIDX.DBF/U02/ORADATA/HSBOP/ACPTIDX.DBF
[Email protected] hsbop]$ MV/U01/APP/ORACLE/ORADATA/ORCL/ARCHDAT.DBF/U02/ORADATA/HSBOP/ARCHDAT.DBF
[Email protected] hsbop]$ MV/U01/APP/ORACLE/ORADATA/ORCL/ARCHIDX.DBF/U02/ORADATA/HSBOP/ARCHIDX.DBF
2. Database boot to Mount state
Sql> Startup Mount
ORACLE instance started.
Total System Global area 536870912 bytes
Fixed Size 1220408 bytes
Variable Size 171966664 bytes
Database buffers 356515840 bytes
Redo buffers 7168000 bytes
Database mounted.
3. Rename the data file
sql> ALTER DATABASE rename file '/u01/app/oracle/oradata/orcl/acptdat.dbf ' to '/u02/oradata/hsbop/acptdat.dbf ';
Database altered.
sql> ALTER DATABASE rename file '/u01/app/oracle/oradata/orcl/acptidx.dbf ' to '/u02/oradata/hsbop/acptidx.dbf ';
Database altered.
sql> ALTER DATABASE rename file '/u01/app/oracle/oradata/orcl/archdat.dbf ' to '/u02/oradata/hsbop/archdat.dbf ';
Database altered.
sql> ALTER DATABASE rename file '/u01/app/oracle/oradata/orcl/archidx.dbf ' to '/u02/oradata/hsbop/archidx.dbf ';
Database altered.
4. Open the Database
sql> ALTER DATABASE open;
Database altered.
###### if the MV when the Xshell disconnected, and re-MV a bit, will result in incomplete data files,
###### test environment can play a bit, by the data file construction to and control file record consistency to cheat Oracle, this time actually the data has lost a part of
sql> ALTER DATABASE open;
ALTER DATABASE Open
*
ERROR at line 1:
Ora-01122:database file failed verification check
Ora-01110:data file: '/u02/oradata/hsbop/ykhdat.dbf '
ora-01200:actual file size of 21087 is smaller than correct size of 64000
Blocks
Sql> Select 64000-21087 cnt from dual;
Cnt
----------
42913
sql>!dd if=/dev/zero of=/u02/oradata/hsbop/ykhdat.dbf bs=8192 count=42913 seek=21088
42913+0 Records in
42913+0 Records out
sql> ALTER DATABASE open;
Database altered.
Oracle Migration Data Files