Copyright © 1995, 2000, Oracle Corporation. All rights reserved. About the Sample Databases To help you learn and test Oracle Rdb features, Oracle Rdb provides online files that you can execute to create sample databases. You can create three sample databases: o The personnel database, a single-file database You can build it using the SQL or RDO interfaces, and you can choose to integrate the database with the repository. o The mf_personnel database, a multifile database You can build it using the SQL or RDO interfaces, and you can choose to integrate the database with the repository. o The corporate_data database, a single-file database that demonstrates the use of the multischema feature of SQL You can build it using only SQL. You cannot store the data definitions in the repository. The personnel and mf_personnel databases contain the same do- mains, tables, and columns. The corporate_data database con- tains slightly different domains, tables, and columns. This file explains how to create the sample databases and lists the command procedures and programs used to create them. Creating the Sample Databases You use a command procedure provided by Oracle Rdb to create the various forms of the sample databases. By default, the command procedure builds the single-file personnel database using SQL data definitions. Use the fol- lowing command to build this database: $ @RDM$DEMO:PERSONNEL You can specify parameters when you invoke the command proce- dure to create alternative versions of the sample databases. The following shows the format of the command you enter to create a sample database: @RDM$DEMO:PERSONNEL interface-lang database-form reposit multischema dir 1 The parameters specify the following choices: 1. Interface-lang: Enter SQL or RDO. Specifies SQL or RDO as the data definition language. SQL is the default. There are slight differences between the SQL and the RDO definitions of personnel and mf_personnel. 2. Database-form: Enter S or M. Specifies the creation of either a single-file (S) or multi- file (M) database. A single-file database is the default. 3. Reposit: Enter CDD or NOCDD. Specifies whether or not to store data definitions in the repository. The default is not to store data definitions in the repository. 4. Multischema: Enter MSDB or omit parameter. Specifies the creation of the multischema database, cor- porate_data. Note that for the first three parameters you must specify the SQL interface, the single-file database form, and that data definitions not be stored in the repos- itory. The following example demonstrates how to create the multischema database: @RDM$DEMO:PERSONNEL SQL S NOCDD MSDB 5. Dir: Enter a directory specification. This is the directory where you want the database created. If you do not specify this parameter, this procedure will prompt you for a directory specification. If you do not pro- vide a directory specification at the prompt, your default directory will be used. If you run this procedure in batch and this parameter is empty, your default directory will be used. To specify the second, third, fourth, or fifth parameters, you must include any previous parameters. You can use uppercase or lowercase to specify the parameters. For example, to build the multifile version using SQL data definitions and storing the data definitions in the repository, enter the following command: $ @RDM$DEMO:PERSONNEL SQL M CDD 2 When you build the single-file personnel database, the command procedure builds a database called PERSONNEL.RDB, regardless of the interface language used. When you build the multifile personnel database, the command procedure builds a database called MF_PERSONNEL.RDB (plus related storage area files), regardless of the interface language used. Note that you can use either the SQL or RDO interface to work with the resulting database or databases, regardless of whether the database was created using SQL or RDO command files. When you build the multischema database, the command procedure builds a database called CORPORATE_DATA.RDB. You can use only SQL to build the database. Although you can use RDO to work with the database, RDO does not allow you to take advantage of the multischema feature. NOTE When you create the personnel or mf_personnel database, the log of the database definition statements used in creating the database is placed in a file called personnel.log in the same directory as the database. When you create the corporate_data database, the log of the database definition statements used in creating the database is placed in a file called corporate_data.log in the same directory as the database. Online Files Used to Create the Sample Databases The personnel command procedure consists of several smaller command files, executable files, and data files. These files are located in the directory RDM$DEMO. You might want to use these files as models in creating your databases. Table 1 lists the command procedures used to create the sample databases with the SQL interface. 3 Table 1: Files to Create the Sample Databases with SQL ___________________________________________________________________ File Name Explanation ___________________________________________________________________ personnel.com Builds a single-file, multifile, or multischema sample database. When you build the single-file or multifile databases, you can use SQL or RDO defi- nitions and you can define the database by file name or repository path name. For the single-file database, the pro- cedure invokes SQL command files to create domains, tables, views, con- straints, indexes, and triggers. In addition, it invokes programs to store most of the data. For the multifile database, the pro- cedure invokes SQL command files to create domains, tables, views, con- straints, indexes (both sorted and hashed), and to spread tables and in- dexes across multiple files. In addi- tion, it invokes programs to store most of the data. For the multischema database, the pro- cedure invokes SQL command files to create catalogs, schemas, domains, ta- bles, views, constraints, indexes, and triggers. In addition, it invokes a command procedure that uses RMU Load commands to store the data. buildpers.sql Creates domains, tables, views, and constraints, and stores data for the single-file personnel database. mf_buildpers.sql Creates domains, tables, views, con- straints, hashed indexes, storage maps, and one sorted index, and stores data for the multifile personnel database. sql_create_storage.sql Creates storage areas for the multifile personnel database. msdb_create_database.sql Creates catalogs, schemas, domains, ta- bles, views, constraints, and triggers for the multischema database. 4 Table 1 (Cont.): Files to Create the Sample Databases with SQL ___________________________________________________________________ File Name Explanation ___________________________________________________________________ indexes.sql Creates the indexes (sorted) for the single-file personnel database. mf_indexes.sql Creates the remaining sorted indexes for the multifile personnel database. msdb_indexes Creates sorted indexes for the multi- schema database. triggers.sql Creates triggers for the single-file and multifile personnel databases. list.sql Loads rows of the RESUMES table for the single-file and multifile personnel databases. msdb_data_load.com Uses a series of RMU Load commands to load data from .unl files into the multischema database. ___________________________________________________________________ Table 2 lists the command files used to create the sample databases with the RDO interface. 5 Table 2: Files to Create Sample Databases with RDO _______________________________________________________________ File Name Explanation _______________________________________________________________ personnel.com Builds a single-file or multifile ver- sion of the sample personnel database; you can use RDO or SQL definitions, and you can define the database by file name or repository path name. For the RDO single-file version, the procedure invokes RDO command files to define global fields, relations, views, constraints, sorted indexes, and triggers. In addition, it invokes programs to store most of the data. For the RDO multifile version, the pro- cedure invokes RDO command files to define global fields, relations, views, constraints, indexes (both sorted and hashed), and to spread relations and indexes across multiple files. In addi- tion, it invokes programs to store most of the data. buildpers_rdo.rdo Defines global fields, relations, and views, and stores some data for the single-file personnel database. mf_buildpers_rdo.rdo Defines global fields, relations, hashed indexes, storage maps, views, and one sorted index, and stores some data for the multifile personnel database. rdo_define_ Defines storage areas for the multifile storage.rdo personnel database. personnel_indexes_ Defines the indexes (sorted) for the rdo.rdo single-file personnel database. mf_personnel_indexes_ Defines the remaining sorted indexes rdo.rdo for the multifile personnel database. constraints_rdo.rdo Defines constraints. triggers_rdo.rdo Defines triggers. _______________________________________________________________ 6