3. Using Alternate Locations : Locations and Areas : Alternate Locations : Create an Area in UNIX
 
Share this page                  
Create an Area in UNIX
An area must be created before you can define an alternate location for a new database.
Note:  If you use the extenddb command with the –aarea_dir flag, the area is created for you. You do not have to create the directory path below the ingres root directory.
To create an area in UNIX, follow these steps:
1. Log in as the installation owner.
By using this account, this user becomes the owner of the subdirectories created in this procedure.
2. Change location to the directory where you create the new directory structure. For example, to create the new directory structure in the otherplace directory, issue the following command at the operating system prompt:
cd /otherplace
The installation owner account must be able to create a directory below this directory; this means permissions set to at least 755. If this number needs to be changed, see your system administrator. Top-level directories are usually managed by root.
3. Create a new subdirectory. For example, to make a subdirectory named new_area, issue the following command at the operating system prompt:
mkdir new_area
4. Create subdirectories for the types of database files that use the new area. For example, to create a subdirectory for data files in new_area, issue these commands at the operating system prompt:
mkdir new_area/ingres
mkdir new_area/ingres/data 
mkdir new_area/ingres/data/default
To make subdirectories for checkpoint, journal, dump, or work files, substitute ckp, jnl, dmp, or work for data when issuing the above commands.
5. Place the appropriate permissions on the new directories and subdirectories, as shown in the following example. Limit access to the data directory to the user account for the installation owner only:
chmod 755 new_area
chmod 755 new_area/ingres
chmod 700 new_area/ingres/data
chmod 777 new_area/ingres/data/default
To place permissions on new directories for checkpoint, journal, dump, or work files, substitute ckp, jnl, dmp, or work for data when issuing the above commands.
In these steps, you created the area /otherplace/new_area, which you can now specify as the Area when defining a new location using the CREATE LOCATION statement (or equivalent operation in Director or VDBA). The subdirectories you created in Step 4 determine which Usage Types you can specify. For example, creating ingres/data/default allows you to specify Database as a Usage Type, and creating ingres/work/default allows you to specify Work as a Usage Type.
Raw Area in UNIX
A raw area contains data from a single database only.
A raw location can be assigned a usage of database only, cannot be used as the root location of a database, and can contain data for one table only.
The maximum size of a table is bound by the smallest raw location to which it is assigned.
A raw area can contain many locations; each location can contain the data for one table. A raw location is the equivalent of a cooked database file, which contains data of one table only.
To set up a raw area file, use the mkrawarea utility. For more information, see the Command Reference Guide.
How to Change from Raw to Cooked (Non-raw) Transaction Log
If your installation uses a raw transaction log file and you want to change to a cooked transaction log file, follow this process:
1. Destroy the existing transaction logs, including dual logs if present.
2. Define the locations to be used for the new transaction logs.
3. Create the new transaction logs.
4. Test the new transaction logs by restarting Ingres.