Moving database dbf files
I was recently creating a database VM (Oracle Linux 6 Update 3 on Oracle VM) on my laptop and encountered this issue.
I have created a Virtual Disk for the database of 12 GB size and when I tried to install my schema using RCU I ran out of space. Solution was to create another Virtual Disk and move the database data files (.dbf) to this new drive. After few google search and looking at the blogs these are the steps I followed:
I have created a Virtual Disk for the database of 12 GB size and when I tried to install my schema using RCU I ran out of space. Solution was to create another Virtual Disk and move the database data files (.dbf) to this new drive. After few google search and looking at the blogs these are the steps I followed:
- Login to the database sqlplus / as sysdba
- Get the data file location select file_name from dba_data_files;
- Shutdown the database shutdown immediate
- Shutdown the listener lsnrctl stop
- Shutdown the VM Guest OS.
- Created a new Virtual Disk of 20 GB.
- Start the Guest OS.
- Mount the drive. My mount point is u02.
- Move the dbf files under oradata/SID folder to the new disk. You will find the oradata folder under your Oracle home. E.g. move DEV_soainfra.dbf from /u01/app/oradata/soa to /u02/app/oradata.
- Start the database using command startup mount
- Change the location of the dbf file using command alter database rename file '/media/u01/app/oradata/soa/DEV_soainfra.dbf' to '/media/u02/app/oradata/soa/DEV_soainfra.dbf';
- Start the database alter database open;
Comments