Previous
Topic:
Invoking and Using nconfig |
Next
Topic: Other Database Configuration Options |
Creating and Configuring a Database
Creating a SAND DatabaseThe nconfig tool is used to create and configure a SAND database. There are three ways to create a new database using nconfig:
When the first two of these three methods are employed, nconfig accesses and duplicates the SAND seed database. The seed database is the file ndb.n00 located in the SAND CDBMS SUPPORT directory as specified in the NUCLEUS environment variable. ndb.n00 is the prototype empty SAND database.
When the nserv program is used to start an instance of the database for the first time, the following information is displayed while the internal structure of the database is being set up:
Creating new database catalog structure
After this internal catalog generation is complete, users may connect to the database instance. The catalog creation step, which can take up to several minutes, is only necessary the first time a database instance is started.
Note:
A new SAND database can also be created using just the nserv utility. When nserv is invoked with an instance-name argument that specifies a non-existent database, the database will be created automatically with the default configuration. Note that in order to create a new database in this way, a corresponding [DATABASE instance-name] section must already be present in the nucleus.ini file, and the instance's RunMode setting must not be Virtual or Persistent.
The first task in configuring a new database is to specify where the database files will reside. After invoking nconfig, execute the File Configuration command by typing the letter 'F' at the command prompt and pressing <Enter>. nconfig displays a menu that has the following appearance:
a: add a database drive
m: modify a database drive
v: view the database drives
q: quit this menu
Select menu item:
View the Drive ConfigurationTo view the existing database drives, type the letter 'V' at the menu prompt and press <Enter>. nconfig will display information about the default drive (that is, drive 0) for the new database, reflecting the current drive and directory. Note that the primary database file must reside on drive 0: if your present working directory is not the same as that entered for drive 0, then move the primary database file to that location after quitting nconfig.
Note:
There should never be more than one primary database file in any given directory. New primary database files may not be created in the SAND CDBMS SUPPORT directory (that is, in the location of the ndb.n00 "seed database" file).
The View Configuration display has the following appearance for a new database:
UNIX:
drive filesize path 0 2147483648 .
Windows:
drive filesize path 0 524288 . On UNIX systems, the default maximum file size for drive 0 is initially equal to the maximum size for a SAND database (2 PB). On Windows, the default is the maximum supported file size, 32 GB.
UNIX
To modify a database drive, type the letter 'M' at the menu prompt and press <Enter>. nconfig will redisplay the file configuration followed by a prompt as follows:
drive filesize path 0 2147483648 . Enter drive number to modify:
Enter '0' (zero) at the prompt and press <Enter>. nconfig displays the following:0:2147483648 '.'
Enter file path (.): /usr/sand/db01
At the Enter file path prompt, type the full path name of the directory where the primary database file will be located, as shown in the example above (this practice is recommended, but not required). Press <Enter>. nconfig displays another prompt:Enter file size limit (in 1MB blocks) (2147483648)
<Enter 0 for maximal limit>: 2048
Enter the number of one-megabyte or 64-kilobyte blocks to establish the file size limit on drive 0, and press <Enter>. The value 2048 used in this example would correspond to file size of 2 GB.
WindowsTo modify a database drive, type the letter 'M' at the menu prompt and press <Enter>. nconfig will redisplay the file configuration followed by a prompt as follows:
drive filesize path 0 524288 . Enter drive number to modify:
Enter '0' (zero) at the prompt and press <Enter>. nconfig displays the following:0:524288 '.'
Enter file path (.): f:\nucleus\system
At the Enter file path prompt, type the full path name of the directory where the primary database file will be located, as shown in the example above (this practice is recommended, but not required). Press <Enter>. nconfig displays another prompt:Enter file size limit (in 64KB blocks) (0)
<Enter 0 for maximal limit>: 32768
Specify the number of 64-KB blocks to establish the file size limit on drive 0, and press <Enter>. The value 2048 used in this example would correspond to a file size of 2 GB (block size in the Windows version is 64 KB). Do not create file size limits that are too small, as the maximum number of database files that a SAND database can have is 4096. For example, specifying a file size limit of 2048 for all database files would limit maximum database size to 512 GB.What is referred to as a "drive" by nconfig is simply a defined location for database files. A database drive can be a directory path, local file system, or an NFS location. To add a database drive, type the letter 'A' at the file configuration menu prompt and press <Enter>. The prompts that follow will be identical to the sequence of prompts shown for the Modify function. A maximum of 32 database drives can be defined (that is, drives 0 through 31).
Take special care in specifying the drive letter and path. nconfig does not verify the existence of the drive and directory path. An error of this type will not surface until SAND CDBMS attempts to create a database file on the drive.
SAND CDBMS creates the primary database file on whatever drive and directory location corresponds to drive 0. As data is added to the database, SAND CDBMS grows this file until it reaches the file size limit for drive 0, and then creates a database file on the drive and directory path corresponding to the next drive in the list. SAND CDBMS continues to create files on drives in a round-robin fashion (for a detailed discussion, refer to the Database Configuration Overview section above).
How SAND CDBMS Uses the Drive/File Configuration
Changing the Drive ConfigurationTo change the location of existing database files, first use the File Configuration> Modify command to change the drive and directory path associated with a drive in the drive list, then use the operating system "copy" command to move existing files on that drive to the new location. Once a file has been created on a particular drive, the file size limit for that drive may not be changed. If no files have yet been created on a particular drive in the list, however, the file size limit for that drive may be changed using the Modify command.
Deleting a DatabaseWhen a database is no longer required, you may delete it from your system using the operating system "delete" command. Before doing so however, you should verify that the database is no longer needed, and consider first backing up the database to disk or to tape.
Previous
Topic:
Invoking and Using nconfig |
Next
Topic: Other Database Configuration Options |