This article mainly describes how to migrate data files in the file system form of an Oracle tablespace to an LV bare device.
Pre-conditions
1. Oracle is operating normally.
2. The LV file has been programmed with the LVM command. such as/dev/vgoracle/lvdatatbs.
3. Stop Oracle Monitoring.
Operation Steps
1. View the path and status of the data file corresponding to the current Datatbs table space.
Select tablespace_name,file_name,online_status from dba_data_files where Tablespace_name=' Datatbs'
2. Close the database and start the database to Mount state
sql> shutdown Immediate; SQLMount;
3. Use the Rman command to assign a file system data file to a bare device
Method One:
$ rman target/ nocatalogrman'/home/oracle/oradata/ora11g/datatbs.dbf' /dev/vgoracle/lvdatatbs'
Method Two:
$ Rman Target/nocatalog Cmdfile=copy_datafile.cmd
Copy_datafile.cmd content is as follows:
Run { allocate channel T1 type disk; ' /home/oracle/oradata/ora11g/datatbs.dbf ' ' /dev/vgoracle/lvdatatbs ' ;}
Description: You can use this method if you are manipulating multiple data files. Just add the Copy datafile command.
4, the switch table space corresponding data file for the bare device.
file ' /home/oracle/oradata/ora11g/datatbs.dbf ' ' /dev/vgoracle/lvdatatbs ';
5. Open the Database
sql> ALTER DATABASE open;
6. Delete the replaced DATATBS.DBF data file.
Oracle data files migrated to bare devices