- Benefits of Using Soft Links
- Using Symbolic Links to Set Up a Database
- Using Soft Links With VERITAS QIO
- Acknowledgements
Using Soft Links With VERITAS QIO
When you use VERITAS QIO, soft links show the simplicity and flexibility of managing database objects.
VERITAS QIO allows access to a regular VxFS file as a raw character device through a pseudo device by using the ::cdev:vsf: name extension. VERITAS suggests the following three-step procedure to accomplish this task: (1) change the directory to where the regular file is located, (2) moving (mv) the file to a dot file, and (3) establishing a symbolic link to that file:
# cd /fs01 # mv tablespace_1.dbf .tablespace_1.dbf # ln -s .tablespace_1.dbf::cdev:vxfs: tablespace_1.dbf
These three steps are replaced by the following script:
#!/bin/ksh ORACLE_BASE=/home/oracle; export $ORACLE_BASE rm -f $ORACLE_BASE/oradata/PROD/*.{dbf,ctl,log} ln -s /fs01/system.dbf::cdev:vxfs $ORACLE_BASE/oradata/system.dbf
Another advantage of using symbolic links is that they allow you to take database files out of QIO (for example, if you need to use Oracle's auto-extend feature to grow a tablespace). Normally, this requires you to use the following commands:
# cd /fs01 # rm tablespace_1.dbf # mv .tablespace_1.dbf tablespace_1.dbf
This confusing, risky, and error prone step is replaced by running the following script:
#!/bin/ksh ORACLE_BASE=/home/oracle; export $ORACLE_BASE rm -f $ORACLE_BASE/oradata/PROD/*.{dbf,ctl,log} ln -s /fs01/tablespace_1.dbf $ORACLE_BASE/oradata/tablespace_1.dbf
Moving Database Tablespace Example
In this example, a tablespace is found to be I/O bottlenecked and needs to be relocated to ease I/O contention.
To Relocate a Tablespace
Shut down the database.
Copy the data files that made up the tablespace to a new location:
# cp /fs03/datafile1.dbf /NEW-fs03/datafile1.dbf # cp /fs04/datafile2.dbf /NEW-fs04/datafile2.dbf
Remove the old database links:
# rm /oradata/datafile1.dbf # rm /oradata/datafile2.dbf
Re-establish the database links to the new locations:
# ln -s /NEW-fs03/datafile1.dbf /oradata/datafile1.dbf # ln -s /NEW-fs04/datafile2.dbf /oradata/datafile2.dbf
Restart the database and confirm the results.