A database consists of physical data storage characteristics, such as a root file and storage area specifications; metadata definitions, such as tables and domains; and user data. By default, a database contains a single schema and no catalogs. If you specify the multischema attribute when creating your database, you can group the data definitions within one or more schemas within one or more catalogs. See the CREATE DATABASE for information on how to create a multischema database. When you create a database, you name it by specifying a file name and an optional repository path name in the CREATE DATABASE statement. You can supply a complete file specification, a partial file specification, or use system-supplied default values. You must use ASCII alphanumeric characters for the database name. To perform operations on a database, the database name is referenced through an attachment to that database called an alias. When you first refer to a database in SQL, you must indicate the source of data definitions for the database and the location of database files by declaring an alias. You can declare an alias using one of three statements: o ATTACH o CONNECT o DECLARE ALIAS Choose a statement based on the interface that you are using (interactive SQL, SQL module language, or precompiled SQL) and your purpose (declaring a new alias or overriding the association between an alias and a database name). More information about aliases appears in Aliases. There are two ways to identify the source of data definitions: o With a file specification o With a repository path name (if the repository is installed on the system)
1 – Oracle Rdb Attach Specifications
When you first create a database, you give file specifications for the files that contain all database definitions (metadata) and user data stored in the database. You must use ASCII alphanumeric characters for the file specification name. You can also use a file specification whenever you refer to a database in the CONNECT and DECLARE ALIAS statements, although Oracle Rdb recommends that you always use a repository path name when the repository is installed. A full file specification includes: o Network node name o Device name o Directory name or list o File name o File extension o File version number Note that if you are specifying a database name for a remote database, all logical names/file specifications referenced will be evaluated on the remote node, not on the local node. Therefore, the necessary logical names/file specifications must exist on the remote node.
2 – Repository Path Names
Unless you use the PATHNAME argument in the CREATE DATABASE statement, SQL does not use the repository to store data definitions. If you specify the PATHNAME argument when you first create a database, SQL creates a path name that contains copies of data definitions for the database. Because SQL treats a path name like a string literal, you must enclose a path name in single quotation marks. You must use ASCII alphanumeric characters for the repository path name. When you issue an ATTACH or a DECLARE ALIAS statement, you can either specify the repository path name for that database (which in turn points to the physical database files) or directly name the physical database file specification. If you do not use the PATHNAME argument in the CREATE DATABASE statement, you cannot specify a path name in ATTACH or DECLARE ALIAS statements for that database unless you first issue an INTEGRATE statement. Oracle Rdb recommends that you always use a repository path name in CREATE DATABASE, ATTACH, and DECLARE ALIAS statements, and that you use the DICTIONARY IS REQUIRED clause to ensure that the two copies are the same. A repository path name can be a: o Full path name, such as CDD$TOP.ELLINGSWORTH.SQL.PERSONNEL o Relative path name A relative path name consists of the portion of the full path name that follows the current default repository node. For example, assume that you used the SET DICTIONARY command to set the current repository directory to CDD$TOP.ELLINGSWORTH.SQL. Now you can use the relative path name PERSONNEL in place of the full path name CDD$TOP.ELLINGSWORTH.SQL.PERSONNEL. By default, SQL sets the current repository node to the path name defined by the CDD$DEFAULT logical name. See the SET for the description of the SET DICTIONARY statement. See also Using Oracle CDD/Repository on OpenVMS Systems for more detail on repository path names. o Logical name for a full or relative path name Some Oracle Rdb features are not fully supported by all versions of the repository. If you attach by path name and attempt to create, modify, or delete objects not fully supported by the repository, you may receive an error or informational message. See the Oracle Rdb Release Notes for information about compatibility of Oracle Rdb features with the different versions of the repository.