When using path names in programs, you have a choice of using a hard link or a symbolic link (see Link). Each type of link has advantages and disadvantages. The conditions under which one type of link has an advantage over the other type is as follows:
Table 1. Comparison of Hard Link and Symbolic Link
Item | Hard Link | Symbolic Link |
---|---|---|
Name resolution | Faster. A hard link contains a direct reference to the object. | Slower. A symbolic link contains a path name to the object, which must be resolved to find the object. |
Object existence | Required. An object must exist in order to create a hard link to it. | Optional. A symbolic link can be created when the object it refers to does not exist. |
Object deletion | Restricted. All hard links to an object must be unlinked (removed) to delete the object. | Unrestricted. An object can be deleted even if there are symbolic links referring to it. |
Dynamic objects (attributes change) | Slower. Many of the attributes of an object are stored in each hard link. Changes to a dynamic object, therefore, are slower as the number of hard links to the object increases. | Faster. Changes to a dynamic object are not affected by symbolic links. |
Static objects (attributes do not change) | Faster. For a static object, name resolution is the primary performance concern. Name resolution is faster when hard links are used. | Slower. Name resolution is slower when symbolic links are used. |
Scope | Restricted. Hard links cannot cross file systems. | Unrestricted. Symbolic links can cross file systems. |
nwtgz:/opt/orahome/app/oracle92/product/9.2.0.1.0$ ls -li wwg
total 2
511459 drwxr-xr-x 30 oracle oinstall 1024 Jan 21 2005 admin
nwtgz:/opt/orahome/app/oracle92/product/9.2.0.1.0$ find . -inum 511459
./wwg/admin