Alternate Locations
You can use alternate locations for a new database, but first you must create the area (directory structure) where the files will be stored, and then define their location.
You create a location's area using the facilities of the host operating system.
Each area must have a specific subdirectory structure, depending on the file types with which it is associated. This structure parallels that of the corresponding default location area, as summarized in
Default Locations.
Create an Area in Windows
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 Windows, follow these steps:
1. Change location to the drive and directory where you create the new directory structure. For example, to create the new directory structure on the D: drive under the \otherplace directory, issue the following commands at the command prompt:
D:
cd \otherplace
2. Create a new subdirectory. For example, to make a subdirectory named new_area, issue the following command at the command prompt:
mkdir new_area
3. 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 command 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 these commands.
In these steps, you created the area D:\otherplace\new_area, which you can now specify as the Area when defining a new location using the CREATE LOCATION operation. The subdirectories you created in Step 3 determine which Usage Types you can use in CREATE LOCATION and ALTER LOCATION statements (or equivalent dialogs in Director or VDBA). For example, creating ingres\data\default allows you to enable Database as a Usage Type, and creating ingres\work\default allows you to enable Work as a Usage Type.
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 that 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.
Create an Area in VMS
An area must be created before you can define an alternate location for a new database.
To create an area in VMS
1. Log into the VMS system account.
2. Create the top level [INGRES] directory on the new device with the protection mask set to equal (S:RWE,O:RWE,G,W:RE) and ownership set to [INGRES] by executing the following command at the operating system prompt:
CREATE/DIR device:[INGRES]/OWNER_UIC=[INGRES] ‑
/PROT=(S:RWE,O:RWE,G,W:RE)
Substitute the name of the new device for device in the command. Also, do not set the protections any more restrictive than recommended here, because doing so can result in errors later.
3. Make sure the master file directory [000000] on the new device has at least W:E protection by executing the following command at the operating system prompt:
DIR/PROT device:[0,0]000000.dir
If the protection is incorrect (for example, the WORLD has no access), correct this with the following command:
SET FILE/PROT=(S:RWE, O:RWE, G, W:E) ‑
device:[0,0]000000.dir
4. Define a logical name for the new area at the system level:
DEFINE/SYSTEM/EXEC/TRANS=CONCEALED ‑
logical_name device
Substitute the name of the new area for logical_name. This is useful if you ever reconfigure your system or move data between systems, because it is much easier to redefine one logical than to re-point all references to a device.
For example, the following command defines a new altarea1 for device DUA1 at the indicated subdirectory:
DEFINE/SYSTEM/EXEC/trans=concealed ‑
altarea1 dua1:[MYDIRECTORY.SUBDIRECTORY.]
@II_SYSTEM:[INGRES.UTILITY]INGDEFDEV.COM
5. The definition in Step 4 lasts until the next system boot. Add the same DEFINE statement to SYS$MANAGER:SYSTARTUP_V5.COM or II_SYSTEM:[INGRES]IISTARTUP1.COM so that it is executed on future boots.
6. Exit the VMS system account.
7. Log in to the system administrator’s account.
8. Create the subdirectories and set the appropriate protections on these directories by executing the INGDEFDEV command procedure at the operating system prompt:
9. When INGDEFDEV prompts you, provide the device name and the file type (data, journal, checkpoint, dump, or work) that resides in this area. Because you can specify only one file type each time you run INGDEFDEV, you must run INGDEFDEV once for each file type and device name pairing.
Depending on the type of file that resides in this area, INGDEFDEV creates one of the following directories, where device is the name of the new device from Step 2:
-device:[INGRES.DATA] (for data files)
-device:[INGRES.CKP] (for checkpoint files)
-device:[INGRES.JNL] (for journal files)
-device:[INGRES.DMP] (for dump files)
-device:[INGRES.WORK] (for work files)
In these steps, you created an area corresponding to the logical_name identified in Step 4, which you can now specify as the area name when defining a new location using the create location statement. The directories created by INGDEFDEV in Step 9 determine which usage types you can specify for both the create location and alter location statements. For example, creating [INGRES.DATA] allows you to specify usage = database, and creating [INGRES.WORK] allows you to specify usage = work.