% Librarian T01-31J=   VVV;5g$>@r Access_rights ANALYZE0AT_ENDhBACKUPCHANGELCHANGE_DATABASEw CHANGE_FIELDZ CHANGE_INDEXCHANGE_PROTECTION2CHANGE_RELATIONCHANGE_STORAGE_MAP0Command_RecallhCOMMIT Cond_exprCONVERT8CREATE_SEGMENTrDATABASE DatatypesData_Distributor DCL_invokeDECLARE_STREAM'rDEFINE(DEFINE_COLLATING0DEFINE_CONSTRAINT<DEFINE_DATABASE DEFINE_FIELD^ DCL_invokeDECLARE_STREAM'rDEFINE(DEFINE_COLLATING0DEFINE_CONSTRAINT<DEFINE_DATABASE DEFINE_FIELDt DEFINE_INDEXDEFINE_PROTECTIONZDEFINE_RELATIONZDEFINE_STORAGE_MAP$DEFINE_TRIGGER?R DEFINE_VIEWKDELETELDELETE_COLLATINGNDELETE_CONSTRAINTRDELETE_DATABASEV& DELETE_FIELD] DELETE_INDEXaDELETE_PATHNAMEcDELETE_PROTECTIONi,DELETE_RELATIONqDELETE_STORAGE_MAPHData_DistributorDELETE_DATABASEGET Value_exprSACTIONn`V& DELETE_FIELD] DELETE_INDEXaDELETE_PATHNAMEcDELETE_PROTECTIONi,DELETE_RELATIONqDELETE_STORAGE_MAPtDELETE_TRIGGERv< DELETE_VIEWzDemo{EDIT END_SEGMENT END_STREAMERASEErrors6Execute.EXITEXPORTFETCH Field_attrFINISH:FORRGETHELPIMPORT= INTEGRATEF@INVOKEX& Logical_NamescMODIFYldON_ERRORrTPLACEy PreprocessorsPRINTHELPIMPORT= INTEGRATEF@INVOKEX& Logical_NamescMODIFYldON_ERRORrTPLACEy PreprocessorsPRINTHRDOINI\RDO_Foreign_CmdREADYT Release_NotesD Rel_operatorsReplication_Option ROLLBACK RSE  Segment_str SET fSHOW  START_SEGMENT  START_STREAM jSTART_TRANSACTIONJ >STOREk F Value_expr1 $ See DCL_invoke wwPz1 @ See Execute ww 1 Access_rightsD Oracle Rdb controls access rights that grant or deny users access to:$ o Data in an Oracle Rdb database+ o Oracle Rdb data definition statements# o Oracle Rdb utility statements7 When specifying access rights, remember these rules:A o Oracle Rdb denies all access rights not explicitly granted.A o Specify only tho se access rights to which you want to grant access.> o If you want to grant all access rights, you can do so byD specifying the keyword "ALL" instead of listing all the access rights.= o If you want to deny all access rights, you can do so by$ specifying the keyword "NONE".>For tables that define these access rights, ask for Additional'Information on DATA_ACCESS, DEF_ACCESS. 2 DATA_ACCESSB This table lists the access rights that control access  to data. Table 1:+ Access Right To Grant To Deny3 ------------------------------------------------, Read data READ NOREAD- Store data WRITE NOWRITE. Modify data MODIFY NOMODIFY- Erase data ERASE NOERASE3 ------------------------------------------------ 2 DEF_ACCESS< This table lists the access rights that control access to database definitions.7 Access  Right To Grant To DenyB ---------------------------------------------------------------9 Define global field, DEFINE NODEFINE relation, or storage map9 Change global field CHANGE NOCHANGE9 Delete global field DELETE NODELETE> Run two-phase commit DISTRIBTRAN NODISTRIBTRAN transaction on database: Define, change, delete CONTROL NOCONTROL database pr otection= [future versions] REFERENCES NOREFERENCES; Specify, show, and review SECURITY NOSECURITY the security audit trail7 [future versions] SHOW NOSHOW@ Open or close a database ADMINISTRATOR NOADMINISTRATOR@ Any CHANGE DATABASE ADMINISTRATOR NOADMINISTRATOR option@ Delete a database ADMINISTRATOR NOADMINISTRATORB ----------------------------------------------------- ----------< This table lists the access rights that control access to relation definitions.9 Access Right To Grant To DenyA --------------------------------------------------------------: Define index or storage DEFINE NODEFINE mapA Define trigger READ,DEFINE NOREAD,NODEFINEA Define view or constraint READ,DEFINE NOREAD,NODEFINE: Change relation CHANGE NOCHANGE: Delete relation, DELETE NODELETE index, view, constraint, or storage map; Define, change, delete CONTROL NOCONTROL protection for relation8 [Reserved for future SHOW NOSHOW versions]< [Reserved for future OPERATOR NOOPERATOR versions]A -------------------------------------------------------------- ww  1 ANALYZEC The RDO ANALYZE statement is available for single-file databases= only. Use the RMU/ANALYZE command for multifile databases.: Displays statistics on how the database is using space.@ ANALYZE works on the database most recently invoked, and uses a read/write transaction.> You can display statistics on pages, relations, indexes, or segments. Example:& RDO> ANALYZE RELATION EMPLOYEES 2 FormatL (B)0ANALYZE qwqq> PAGES qqqqqqqqqqqqqqqqqqqqqqqqqq wq>: tqq> RELATIONS qwqqqqqqqqqqqqqqqqqqqwqu5 x mq> relation-name qqj x: twq> INDEXES qqwwqqqqqqqqqqqqqqqqqqqwqu< xmq> INDICES qqjmq> index-name qqqqqj x: mqq> SEGMENTS qqqqqqqqqqqqqqqqqqqqqqqqj 3 PAGESG Oracle Rdb displays a bar chart showing page usage for the database.@ This chart indicates how many pages the database uses and the+ percentage to which each page is filled. 3 RELATIONSF Oracle Rdb displays a chart with the following information for each% relation defined for the database: o Total number of records o Total number of bytes5 o Average number of bytes occupied by each record@ o Percentage of records that are fragmented (split over more than one database page)@ o Percentage of total space available for a relation used to store users' dataB o Percentage of total space in a relation used to store users' data 3 SEGMENTSG Oracle Rdb displays a chart with the following information about the, segmented strings stored in the database:. o Total number of segmented string records9 o Total number of bytes occupied by segmented strings? o Average number of bytes occupied by each segmented string record@ o Percentage of segmented string records that are fragmented. (split over more than one database page)@ o Percentage of total space available for a relation that is used to store users' dataB o Percentage of total space in a relation used to store users' data 3 INDEXESB If you use the INDEXES or INDICES option, Oracle Rdb displays a, chart with five columns that consists of:@ o The number of levels in the B-tree needed to store all the index nodes.4 o The total number of B-tree nodes in the index.6 o The length (number of bytes) used for the index.@ o The number of duplicate values in the index. This value isA always zero in an index defined with the DUPLICATES ARE NOT ALLOWED clause. o Any duplicate length used. 2 MoreB You must have the Oracle Rdb ADMINISTRATOR privilege to use the ANALYZE statement. ww  1 AT_ENDB Specifies the statement a program performs if a FETCH statementD reaches the end of a record stream. You can use the AT END clause. only with the FETCH statement in a program. Example: &RDB& FETCH STREAM_X &RDB& AT END" GO TO END_OF_STREAM. &RDB& END_FETCH 2 Format. (B)0AT END qq> statement 3 statement3 Any valid host language or Oracle Rdb statement. 2 ExampleC The following lines from a COBOL program branch to a COBOL labelB elsewhere in the program to continue processing when Oracle Rdb1 reaches the end of the record stream STREAM_X: &RDB& FETCH STREAM_X &RDB& AT END" GO TO END_OF_STREAM. &RDB& END_FETCH ww  1 BACKUPB The RDO BACKUP statement is obsolete in Oracle Rdb. Use the RDO EXPORT statement instead. ww  1 CHANGED HELP is available for the following Oracle Rdb CHANGE statements: o CHANGE DATABASE o CHANGE FIELD o CHANGE INDEX o CHANGE PROTECTION o CHANGE RELATION o CHANGE STORAGE MAP@ However, to get HELP on any of these CHANGE statements at the@ "Topic?" prompt, include an underscore between CHANGE and theD item on which you want information displayed. For example, to getD HELP on the CHANGE FIELD statement, type either of the following: Topic? CHANGE_FIELD RDO> HELP CHANGE_FIELD ww 1 CHANGE_DATABASE@ Changes characteristics of the database root file and storageC area files. When this statement executes, Oracle Rdb updates theD characteristics named in the statement. All other characteristics remain the same. Example:> RDO> CHANGE DATABASE FILENAME 'DISK2:[USER.TEST]PERSONNEL'& cont> SNAPSHOT ALLOCATION IS 200. 2 MoreD You need the Oracle Rdb ADMINISTRATOR privilege to use the CHANGE DATABASE statement. Use CHANGE DATABASE to:; o Define, change, and delete storage areas in multifile databasesA o Enable or disable after-image journaling and change journal  file characteristicsA o Enable or disable snapshot transactions and change snapshot file characteristicsC o Change a read/write storage area to read-only, or a read-only storage area to read/writeD o Change a storage area that contains only a segmented string toC a format that can be stored on a write-once, read-many (WORM)* device, using the WRITE_ONCE option.+ o Change the number of recovery buffers= o Change physical parameters associated with the databaseA o Specify whether the database can be opened automatically or manually, o Require the use of the data dictionary& o Enable or disable global buffers. o Enable or disable fast commit processing4 o Enable or disable carry-over lock optimization* o Set a database-wide timeout intervalD You cannot delete a storage area that is referred to in a storage map. 2 Examples Example 1: Use the CHANGE DATABASE statement to enable after-image journaling:' CHANGE DATABASE PATHNAME 'PERSONNEL'0 JOURNAL FILE IS 'DEPT3:PERSONNEL.AIJ'. Example 2: You can also use CHANGE DATABASE to disable after-image journaling:, RDO> CHANGE DATABASE FILENAME 'PERSONNEL' cont> NOJOURNAL. Example 3B The database shutdown feature is designed to ensure that active? users on a single node or across a cluster cannot access the< database while you perform administrative and mainten ance? tasks. For instance, use this shutdown feature when you needA the database in a stable condition while performing backup and8 restore options, or when you are tuning the database.< In the following example, a complete database shutdown is= performed for all users of a database residing on a common< disk in a cluster. The CHANGE DATABASE ... OPEN IS MANUALD statement is used to prevent new users from automatically opening@ that database when the first DML statement is executed on the database. $ RDO = "$RDO"H $ RDO CHANGE DATABASE FILENAME "$222$DUA17:[DBS]PERS" OPEN IS MANUAL.B $ REPLY/ALL "PERS.RDB database will be shut down in 15 minutes"? $ REPLY/ALL "Please complete any work with PERS before then" $ WAIT 00:15:00.008 $ RMU/CLOSE/ABORT=FORCEX/CLUSTER $222$DUA17:[DBS]PERS@ At this point, you are assured that no unprivileged users can< invoke this database. After opening the database with the= RMU/OPEN/ACCESS=RESTRICTE D command (the /ACCESS=RESTRICTED> qualifier restricts database access to users with the DBADMD privilege), you can perform maintenance tasks like tuning withoutA interference from unprivileged users. For example, you can addD or delete indexes and compare the performance results in a stable testing environment.A When you are ready to make the database available again across# the cluster, enter RDO and type:3 RDO> CHANGE DATABASE FILE "$222$DUA17:[DBS]PERS" cont> OPEN IS AUTOMATIC. Example 4D The following example shuts down access to a clusterwide database5 and then reopens the database for a specific node: $ RDO = "$RDO"H $ RDO CHANGE DATABASE FILENAME "$222$DUA17:[DBS]PERS" OPEN IS MANUAL.B $ REPLY/ALL "PERS.RDB database will be shut down in 15 minutes"? $ REPLY/ALL "Please complete any work with PERS before then" $ WAIT 00:15:00.008 $ RMU/CLOSE/ABORT=FORCEX/CLUSTER $222$DUA17:[DBS]PERS $ ! $ SET HOST  MADABT . . . $ ! On node MADABT now" $ RMU/OPEN $222$DUA17:[DBS]PERS? The RMU/OPEN command opens the PERS database on MADABT only.A Users logged into other nodes in the cluster who normally have= access to the clusterwide database cannot access it until:@ o The RMU/OPEN command is executed by a user with sufficient# privilege on his or her node.@ o Or, the CHANGE DATABASE ... OPEN IS AUTOMATIC statement isC executed by a user with suffic!ient privilege from any node in the cluster. Example 5< The following example shows how to disable snapshots on a database:B RDO> CHANGE DATABASE FILENAME 'PERSONNEL' SNAPSHOT IS DISABLED. Example 6> The following example uses the CHANGE DATABASE statement to6 define a new storage area for a multifile database:0 RDO> CHANGE DATABASE FILENAME 'MF_PERSONNEL', cont> DEFINE STORAGE AREA ARCHIVED_EMPS( cont> FILENAME DISK3:ARCHIVED_EMPS" c"ont> ALLOCATION IS 50 PAGES cont> PAGE FORMAT IS MIXED4 cont> SNAPSHOT_FILENAME IS DISK4:ARCHIVED_EMPS* cont> END ARCHIVED_EMPS STORAGE AREA. Example 7A This example uses the DICTIONARY IS REQUIRED option to enforceC use of the data dictionary if metadata updates occur. Users must@ invoke the database with the PATHNAME argument to perform any metadata changes.@ Note that when you specify the DICTIONARY option, that is theA only option you can specify# in a CHANGE DATABASE statement. To@ specify other options, you must issue another CHANGE DATABASE statement., RDO> CHANGE DATABASE FILENAME 'PERSONNEL'# cont> DICTIONARY IS REQUIRED. Example 8A This example uses the READ_ONLY clause to change the ARCHIVED_1 EMPS storage area to a read-only storage area.0 RDO> CHANGE DATABASE FILENAME 'MF_PERSONNEL'* cont> CHANGE STORAGE AREA ARCHIVED_EMPS cont> READ_ONLY. Example 9? This example uses t$he GLOBAL BUFFERS clause to enable global) buffers for the MF_PERSONNEL database.- RDO> CHANGE DATABASE FILENAME MF_PERSONNEL# cont> GLOBAL BUFFERS ARE ENABLED cont> (NUMBER IS 50, cont> USER LIMIT IS 10).D In this example, 50 is the number of global buffers and 10 is the: maximum number (user limit) of global buffers per user. Example 10A This example enables fast commit processing with a transactionC interval of 10, and specifies checkpoint intervals %of 512 blocks and 12 seconds:& RDO> CHANGE DATABASE FILENAME TEST1$ cont> JOURNAL FAST COMMIT ENABLED, cont> (CHECKPOINT INTERVAL IS 512 BLOCKS,, cont> CHECKPOINT TIMED EVERY 12 SECONDS,& cont> TRANSACTION INTERVAL IS 10). Example 11: This example disables the carry-over lock optimization:& RDO> CHANGE DATABASE FILENAME TEST1' cont> CARRY OVER LOCKS ARE DISABLED. Example 12B This example sets the default database lock timeout interval to@ 2&5 seconds. This is the database wide timeout interval. It isD used as the default as well as the upper limit in determining theA timeout interval to use. For example, if LOCK TIMEOUT INTERVAL@ IS 25 SECONDS is specified with the CHANGE DATABASE or DEFINE? DATABASE statement, and a user specifies 30 seconds with theA SQL SET TRANSACTION WAIT 30 statement or sets the logical name@ RDM$BIND_LOCK_TIMEOUT_INTERVAL to 30, RDO would still use theB interval of 25 specified with the LOC'K TIMEOUT INTERVAL clause.D The maximum number of seconds that can be specified with the LOCK% TIMEOUT INTERVAL clause is 65,000:& RDO> CHANGE DATABASE FILENAME TEST1% cont> CARRY OVER LOCKS ARE ENABLED- cont> LOCK TIMEOUT INTERVAL IS 25 seconds. 2 FormatQ (B)0CHANGE DATABASE qqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwq> FILENAME qq> file-spec qwqkE m(q> db-handle qq> = qj mq> PATHNAME qq> path-name qj x: lqqqqqqqqqqqqqqqqqqqqqqqqqqqq change-database-options1 qqqqqqqqqqqqqqqqqqwqwq> .; x tq> change-database-options2 qqqqqqqqqqqqqqqqqqu x; x tq> change-journal-file-options qqqqqqqqqqqqqqqu x; x tq> add-storage-area-clause qqqqqqqqqqqqqqqqqqqu x; x tq> change-storage-area-clause qqqqqqqqqqqqqqqqu xP x mq> DELETE STORAGE AREA qq> storage-)area-name qj x9 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqqq>V x tqq> OPEN IS qqqqqqqqqqqqwqq> AUTOMATIC qwqqqqqqqqqqqqqqqqqqqqu xO x x mqq> MANUAL qqqqqj x x_ x tqq> NUMBER OF qqwq> CLUSTER qqqqwq> NODES IS number-nodes qqqqu xO x x mq> VAXCLUSTER qj x xH x x x xX x tqq> [+4mNUMBER OF BUFFERS IS qqqq> number-buffers qqqqqqqqqqqqqqqqu xX x tqq> NUMBER OF USERS IS qqqqqq> number-users qqqqqqqqqqqqqqqqqqu xd x tqq> ADJUSTABLE LOCK GRANULARITY IS qwqq> ENABLED qqqwqqqqqqqqqu xO x x mqq> DISABLED qqj x x_ x tqq> NUMBER OF RECOVERY BUFFERS IS qq> recovery buffers qqqqqqqu xJ x mqq> global-buffer-params qqqqqqqqqqqqqqqqqqqqqqq ,qqqqqqqqqqqqqqj xH mqqqqqqqqqqqqqqqqqqqqqqqqqqq specified 4).A Had the DBA specified 2032 users and 50 nodes, 50 would be theC maximum value for the number of nodes (specified 50 > calculated< 41) and 50 TSNBLKs would be allocated, one for each node.B As another example, if the DBA specifies 50 users and 1 30 nodes,B the maximum value is 10 nodes (specified 10 > calculated 1), so5 ten TSNBLKs would be allocated, one for each node.D This parameter can only be used with multifile databases. To makeD this change for a single-file database, first export the databaseD using the SQL EXPORT statement and then specify the change in the SQL IMPORT statement. 4 number-buffersD The number of buffers Oracle Rdb allocates per process using thisA database. Specify an unsigned integ4er between 2 and 32768. The default is 20 buffers. 4 number-usersD The maximum number of users allowed to access the database at one! time. The default is 50 users.D This parameter can only be used with multifile databases. To makeD this change for a single-file database, first export the databaseD using the SQL EXPORT statement and then specify the change in the SQL IMPORT statement. 4 ADJUSTABLE_LOCK> Enables or disables whether or not the database sys 5tem will> automatically maintain as few locks as possible on database@ resources. The default is ENABLED, and results in fewer locks< against the database. However, if contention for databaseD resources is high, the automatic adjustment of locks can become aC CPU drain. Such databases can trade more restrictive locking for; less CPU usage by disabling adjustable lock granularity.@ Disabling adjustable locking granularity may require that the4 OpenVMS SYSGEN parameters for l6ocks be increased. 4 recovery-buffersD The number of database buffers used during the automatic recovery? process that is initiated after a system or process failure.B Specify an unsigned integer between 2 and 32768. The default is 20 buffers. 4 global-buffer-params (B)0global-buffer-params= @ q> GLOBAL BUFFERS ARE qwq> ENABLED qqwqk2 mq> DISABLED qj x+ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq>@ mq> ( qq> NUMBER IS number-glo-buffers qq> , qk x7 lqqqqqqqqqqqqqqq USER LIMIT IS max-glo-buffers qq> ) qqqqqj 5 GLOBAL_BUFFERSB The GLOBAL BUFFERS ARE ENABLED clause specifies that Oracle RdbC maintain one global buffer pool per node in the cluster for eachE database. By default, Oracle Rdb maintains a local buffer pool for? each user 8. For more than one user to use the same page, each@ must read it from disk into their local buffer pool. When the? GLOBAL BUFFERS ARE ENABLED clause has been specified, a pageA in the global buffer pool may be read by more than one user atA the same time, although only one user reads the page from diskB into the global buffer pool. Global buffering provides improvedD performance because I/O is reduced and memory is better utilized.B The default is GLOBAL BUFFERS ARE DISABLE 9D, in which Oracle RdbB maintains a local buffer pool for each user, and global buffers are not enabled. 5 NUMBERC When global buffers are enabled, the NUMBER IS clause is used to9 specify the default number of global buffers per node.= The default number of global buffers is the maximum number< of users multiplied by 5. (In the RDO syntax for databaseA parameters, a user is the same as an attach.) You can overrideA the default by defining a value for the logic:al name RDM$BIND_ BUFFERS.> Although you can change the NUMBER IS parameter online, theB change will only take effect the next time that the database isC opened. By default, a database can be opened automatically (that? is, by any user who invokes the database and executes a dataA manipulation language statement). If the database was modifiedC so that it must be manually opened, the RMU/OPEN command must be used to open it. 5 USER_LIMIT? The USER LIMIT cl ;ause specifies the maximum number of global? buffers each user allocates. Because global buffer pools areB shared by all users, you must define an upper limit on how manyC global buffers a single user can allocate. This limit prevents aD user from defining the RDM$BIND_BUFFERS to use all the buffers inD the global buffer pool. The user limit cannot be greater then the4 total number of global buffers. The default is 5.B See the Oracle Rdb Guide to Database Performance and Tuni <ng forD information on determining the maximum number of global buffers a user can allocate.B Although you can change the USER LIMIT IS parameter online, theB change will only take effect the next time that the database isC opened. By default, a database can be opened automatically (that? is, by any user who invokes the database and executes a dataA manipulation language statement). If the database was modifiedC so that it must be manually opened, the RMU/OPEN command mu =st be used to open it. 3 change-database-options2$ (B)0change-database-options2 =D qwqwqq>qqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwq>P x tqq> SNAPSHOT IS qqwq> ENABLED qwqqqqqqq>qqqqqqwqwqqqqqqqu xI x x x tq> IMMEDIATE qu x x xI x x x mq> DEFERRED qqj x x xI x x mq> DISABLED qqqqqqqq>qqqqqqqqj x xR x tqq> SNAPSH>OT ALLOCATION IS q> snp-pages qq> PAGES qqqqqqu xR x twq> SNAPSHOT EXTENT IS qwqqwq> extent-pages q> PAGES qwqu xR x xmq> EXTENT IS qqqqqqqqqqj mq> (extension-options) qqqj x x^ x tqq> CARRY OVER LOCKS ARE qwq> ENABLED qqwqqqqqqqqqqqqqqqu xI x x mq> DISABLED qj x xY x tqq> LOCK TIMEOUT INTERVAL IS number-seconds SECONDS qqqqu xK x tqq> ?READ_ONLY qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xK x tqq> READ_WRITE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xP x tqq> DICTIONARY IS qqqqqqwq> REQUIRED qqqqqqqwqqqqqqqqqqqu xP x x mq> NOT REQUIRED qqqj x xD x mqq> journal-fast-commit-clause qqqqqqqqqqqqqqqqqqqqqqqqqj xB mqqqqqqqqqqqqqqqqqq records they modify to the snapshot file unless a read-only@ tra Ansaction is active. Read-only transactions that attempt toD start after an active read/write transaction begins must wait for> all active read/write users to complete their transactions.D You enable snapshot writing to all snapshot files for all storage9 areas when you specify the SNAPSHOT IS ENABLED clause. 4 DISABLED" Disables snapshot transactions.: If snapshots are disabled and a user starts a READ_ONLY? transaction, the user will not receive an error message, buBtC their transaction will be converted to a READ_WRITE transaction,& but they will not be able to write.B If you use the SNAPSHOT IS DISABLED clause to disable snapshotsA on a multifile database, writing to all snapshot files for all storage areas is disabled. 4 snp-pagesC The number of pages allocated for the snapshot file. The default is 100 pages. 4 extent-pages@ The number of pages of each extent. The default is 100 pages. 4 extension-optio CnsC Specifies the MIN, MAX, and percent growth of each database file5 extent. Enclose the parameter list in parentheses. (B)0extension-options = C qqq> ( qqq> MINIMUM OF qq> min-pages qqq> PAGES, qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjC mqq> MAXIMUM OF qq> max-pages qq> PAGES,qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjR mqq> PERCENT GROWTH IS qqq> growth qqqq> ) qDqq> 5 min-pages@ The minimum number of pages of each extent. The default is 99 pages. 5 max-pagesC The maximum number of pages of each extent. The default is 9,999 pages. 5 growth? The percent growth of each extent. The default is 20 percent growth. 4 CARRY_OVER_LOCKS? Enables or disables carry-over lock optimization. Carry-over locks are enabled by default.A While attached to the database, a process can have some active= lEocks (locks attached to the database) and some carry-over? locks (locks requested in earlier transactions that have not@ been demoted). If a transaction needs a lock it has currentlyC marked as carry-over, it can reuse the lock by changing it to anA active lock. The same lock can go from active to carry-over toD active multiple times without paying the cost of lock request andB demotion. This results in a substantial reduction in the number? of lock requests if a process acces Fses the same set of areas repeatedly.D As part of the carry-over lock optimization, a NOWAIT transactionB requests, acquires, and holds a NOWAIT lock. This signals otherD processes accessing the database that a NOWAIT transaction existsC and causes Oracle Rdb to release all carry-over locks. If NOWAITA transactions are noticeably slow in executing, you can specifyC CARRY OVER LOCKS ARE DISABLED with the CHANGE DATABASE or DEFINE DATABASE statement.@ This feature is G available as an online database modification. 4 LOCK_TIMEOUTA Specifies the number of seconds for processes to wait during a@ lock conflict before timing out. The number of seconds can be between one and 65,000.@ The lock timeout interval is database-wide: it is used as the@ default as well as the upper limit in determining the timeoutC interval. For example, if LOCK TIMEOUT INTERVAL IS 25 SECONDS isC specified with the CHANGE DATABASE or DEFINE DATABASE statement, H? and a user specifies SQL SET TRANSACTION WAIT 30 or sets the? logical name RDM$BIND_LOCK_TIMEOUT_INTERVAL to 30, RDO would< still use the interval 25 specified with the LOCK TIMEOUT INTERVAL clause. 4 READ_ONLYA The READ_ONLY option is used to change a read/write RDB$SYSTEMB storage area (and the Oracle Rdb system relations stored in the? area) to read-only. You might choose the READ_ONLY option if@ your database is never or rarely updated. When the RDB$SYSTEM@ I storage area is changed to read-only, locking conflicts occurD less frequently, and the automatic updating of index and relation cardinality is inhibited.D No write operation can be done in a read-only storage area exceptC a cardinality update. See the RMU/ANALYZE/CARDINALITY help topic@ in the RMU help file for more information and restrictions on updating cardinalities.B To change a storage area other than the RDB$SYSTEM storage areaD to read-only, or to change a da Jtabase to read-only, use the READ_1 ONLY option of the change-storage-area-clause. 4 READ_WRITEA The READ_WRITE option is used to change a read-only RDB$SYSTEMB storage area (and the Oracle Rdb system relations stored in the@ area) to read/write. Select the READ_WRITE option to change a3 read-only RDB$SYSTEM storage area to read/write.B To change a storage area other than the RDB$SYSTEM storage area@ to read/write, or to change a database to read/write, use the7 R KEAD_WRITE option of the change-storage-area-clause. 4 DICTIONARYC Determines whether the database must be invoked by path name forB data definition changes to occur. If you specify the DICTIONARYC IS REQUIRED option, the database must be invoked by path name toA change metadata and the data dictionary will be maintained. IfB you specify the DICTIONARY IS NOT REQUIRED option, the database< can be invoked by either file name or path name to change7 metadata. The defaultL is DICTIONARY IS NOT REQUIRED.? If you specify the DICTIONARY option, you cannot specify any7 other options in the same CHANGE DATABASE statement. 4 journal-fast-commit-clause% (B)0journal-fast-commit-clause= K qq> JOURNAL FAST COMMIT qwq> ENABLED qqwqqqk6 mq> DISABLED qj x/ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjB mwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>P m> ( qq Mwqwq> CHECKPOINT INTERVAL IS n BLOCKS qqqqqwqwq> ) qjI x tq> CHECKPOINT TIMED EVERY n SECONDS qqqqu xG x tq> COMMIT TO JOURNAL OPTIMIZATION qqqqqqu xN x tq> NO COMMIT TO JOURNAL OPTIMIZATIONqqqqu xP x mq> TRANSACTION INTERVAL IS number-txns qj x9 mqqqqqqqqqqqqqqqqqqq , each time a transaction executes the COMMIT statement. If a@ transaction fails before committing, Oracle Rdb only needs to? rollback (undo) the current failed transaction; it never has, to redo previous successful transactions.B You can change the commit processing method by enabling journalB fast commit processing (fast commit). With fast commit enabled,D Oracle Rdb keeps updated pages in the buffer pool (in memory) andC does not write the pages Oto disk when a transaction commits. The@ updated pages can remain in the buffer pool until the process? meets a condition specified by the database administrator or? applications programmer. At the moment the condition is met,D called the checkpoint, all the pages the process has updated, for. multiple transactions, are written to disk.2 You can set a checkpoint for your process when:C o A fixed number of transactions have been committed or aborted+ o A specified ti Pme interval has elapsedC o The after-image journal (AIJ) file has grown a certain amountC If a transaction fails, Oracle Rdb must undo the current, failed@ transaction and redo all the committed transactions since theA last checkpoint. Redoing updates involves reading the AIJ file9 and reapplying the changes to the relevant data pages.7 The checkpoint interval value is set by the database; administrator and applies to all processes attached to a? database. Users c Qan implement an alternate, process-specificA method of checkpointing by defining the logical name RDM$BIND_? CKPT_TRANS_INTERVAL. The mechanism uses transaction count as? the checkpoint. When fast commit processing is disabled, theA RDM$BIND_CKPT_TRANS_INTERVAL logical name is ignored. For moreC information about the RDM$BIND_CKPT_TRANS_INTERVAL logical name,? see the Oracle Rdb Guide to Database Performance and Tuning.< Fast commit processing applies only to data updatesR, that< is erase, modify, and store operations. Transactions thatB include data definition statements, such as DEFINE RELATION and@ DEFINE INDEX statements, force a checkpoint at the end of the transaction.C Note that in order to enable fast commit, you must enable after- image journaling. 5 CHECKPOINT_INTERVALD You can limit how many transactions the Database Recovery process> (DBR) must redo by setting a checkpoint interval. Setting aA checkpoint interval ins Structs Oracle Rdb to periodically flush. updated pages. This shortens recovery time.@ The value you assign to the checkpoint interval specifies theC number of blocks the .AIJ file is allowed to grow before updated< pages are flushed. For example, if you set the checkpoint@ interval value equal to 100, all processes will flush updatedC pages to disk when 100 blocks have been written to the .AIJ fileC since the last checkpoint. Thus all processes contribute to .AIJ growth. TC If no checkpoint interval is established and a process completesD 1000 transactions but fails during number 1001, the DBR must redo4 transactions 1 through 1000 and undo number 1001.? When a process binds to the database, it writes a checkpointC record to the .AIJ file and notes the virtual block number (VBN)A of the .AIJ file at which the checkpoint record is located. IfC the checkpoint is located at VBN 120 and the checkpoint intervalC is 100 blocks, the process wi Ull checkpoint again when VBN 220 is reached.B A process will never checkpoint in the middle of a transaction.@ Since all processes contribute to .AIJ file growth, a process? may be able to commit many transactions before checkpointingA if update activity by other processes is low. Conversely, if a? process' first transaction is long and if update activity byC other processes is high, the process may be forced to checkpoint) when it commits its first transaction.E V When the database checkpoint interval value is reached, Oracle Rdb executes the following steps:( o Updated pages are written to disk.6 o A checkpoint record is written to the .AIJ file.= o The root user process block (RTUPB) for each process isB updated to indicate where the checkpoint record is stored inB the .AIJ file. The RTUPB is a data structure in the databaseD root file that maintains information on each process accessing@ the database. The data Wbase recovery process (DBR) uses the@ RTUPB checkpoint entry to determine where in the .AIJ file recovery must start. 5 CHECKPOINT_TIMEDC Assigns a value to the checkpoint interval specifying the numberB of seconds that can pass before updated pages are written. WhenB the specified number of seconds elapse, Oracle Rdb executes theC checkpoint steps described in the CHECKPOINT_INTERVAL topic. YouD can set both a checkpoint based on time and a checkpoint based onF X AIJ file growth: Oracle Rdb will checkpoint at whichever checkpoint it reaches first.D For example, if you specify TIMED EVERY 100 SECONDS, each processA checkpoints when it completes a transaction after at least 1001 seconds have passed since its last checkpoint.; For example, the following statement enables fast commitB processing and specifies checkpoint intervals of 512 blocks and 12 seconds:& RDO> CHANGE DATABASE FILENAME TEST1" cont> JOURNAL FILE IS TEST1 Y_AIJ$ cont> JOURNAL FAST COMMIT ENABLED, cont> (CHECKPOINT INTERVAL IS 512 BLOCKS,, cont> CHECKPOINT TIMED EVERY 12 SECONDS). 5 COMMIT_TO_JOURNAL? If you enable COMMIT TO JOURNAL OPTIMIZATION when you enable? fast commit, Oracle Rdb does not write commit information to> the database root file. This option enhances performance in; database environments that are update intensive. Because= of the prerequisites for enabling the journal optimizationB option, general uZse databases or databases that have many read-@ only transactions may not benefit from this feature. For more@ information see the Oracle Rdb Guide to Database Maintenance.D Note that if you specify COMMIT TO JOURNAL OPTIMIZATION, you must disable or defer snapshots.> If you change snapshots to enabled immediate, then you must* disable COMMIT TO JOURNAL OPTIMIZATION. 5 TRANSACTION_INTERVAL= The TRANSACTION INTERVAL IS n clause specifies the size of? the TSN range[ where n equals the number of TSNs (transactionE sequence numbers). Oracle Rdb uses transaction sequence numbers toC ensure database integrity. When you specify NO COMMIT TO JOURNALC OPTIMIZATION, TSNs are assigned to users one at a time. When theD journal optimization option is enabled, each user is pre-assigned@ a range of TSNs. Assigning a range of TSNs avoids the single-C threading problem because commit information need not be writtenC to the database root for each trans \action. Oracle Rdb writes allB transaction information to the .AIJ file except for each user's4 allocated TSN range, which it writes to the root.B The transaction interval value (the TSN range) must be a numberC between 8 and 1024. The default value is 256. You need to decideC which constraint has precedence on your database: performance or running out of TSNs.? As a general guideline, if your database has few users or ifB all user sessions are long, select a high tra]nsaction interval.A If your database has many users or if user sessions are short,) select a smaller transaction interval.B You can specify a transaction interval with JOURNAL FAST COMMITB IS DISABLED, but the interval will not be used until you enable the fast commit protocol. 3 change-journal-file-options' (B)0change-journal-file-options = B qwqwqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwq>W x tq> JOURNAL FILE IS qq> a ^ij-journal-file-spec qqqqqqqqqu xG x tq> NOJOURNAL qqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqu xP x tq> JOURNAL ALLOCATION IS q> journal-blocks q> BLOCKS qu xP x mq> JOURNAL EXTENT IS qqq> extent-blocks qq> BLOCKS qqqj x@ mqqqqqqqqqqqqqqqqqqqqqqqqqqq DEFINE STORAGE AREA qqqqqqq> storage-area-name qqqqqqqqqqqkD lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq FILENAME qqqq> file-sapec qqqwqqqqqqqqqqqqqqq>qqqqqqqqqqqwqqqkI mqq> storage-area-options qqj xG lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq END qqqwqqqqqqqqq>qqqqqqqqqqqwq> STORAGE AREA qqqq>0 mq>storage-area-name qj 4 storage-area-name3 The name of the storage area you want to create. 4 file-spec@ The file specification for the storage area file. By default,+ this file has b the default file type RDA. 4 storage-area-options (B)0storage-area-options = G qwwqqqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwwq>N xtqq> ALLOCATION IS qqq> number-pages qqqq>qqqqqqqqq PAGES qqqquxU xtqq> PAGE SIZE IS qqqq> page-blocks qqqqq>qqqqqqqqq BLOCKS qqquxZ xtqq> PAGE FORMAT IS qqwqqqq> UNIFORM qqqqwqqqqqqqqqqqqqqqqqqqquxL xx mqqqq> MIXED qqqqqqj c xxN xtqq> THRESHOLDS ARE q> ( q> val1 wqqqqqqqqqqqqqqqqqqqqwq> ) qquxG xx m> ,val2 wqqqqqqqqqwqj xxG xx m> ,val3 qj xxN xtqq> INTERVAL IS qqqqqqq> number-data-pages qqqqqqqqqqqqqqqqqquxW xtqq> SNAPSHOT_FILENAME IS qqqq> file-spec qqqqqqqqqqqqqqqqqqqquxU xtqq> SNAPSHOT ALLOCATION IS qqq> snp-pages qqq> PAGES qqqqqqqquxU xtwq> [4 dmSNAPSHOT EXTENT IS qwqqwq> extent-pages qqqq> PAGES qwqqquxN xxmq> EXTENT IS qqqqqqqqqqj mq> extension-options qqqqqqqqj xxN xmqq> WRITE_ONCE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjxE mqqqqqqqqqqqqqqqqqqqqqqqqqqqq your largest record is larger than approximately 950 bytes,> allocate more blocks per page to prevent records from being fragmented. 5 PAGE_FORMATD Specifies whether a storage area contains UNIFORM or MIXED pages.> You can use the PAGE FORMAT option with multifile databases f@ only. In storage areas with uniform page format, all pages inB a specific logical area contain records from the same relation.B In storage areas with mixed page format, pages can hold records4 from different relations. The default is uniform. 5 THRESHOLDS? Specifies one, two, or three threshold values. The threshold< values represent a fullness percentage on a data page andA establish four possible ranges of guaranteed free space on theA data pages. When a data pag ge reaches the percentage defined by? a given threshold value, the SPAM entry for the data page isC updated to reflect the new fullness percentage and its remaining free space.C The default thresholds are 70,85, and 95 percent. If you specify< only one or two values, unspecified values default to 100C percent. You can specify the THRESHOLDS option only on a storageA area for a multifile database. Threshold values can be set forA storage areas with MIXED or UNIFORM stora hge area page formats. 5 number-data-pages? Specifies the number of data pages between SPAM pages in theA physical storage area file, and thus the maximum of data pages@ each SPAM page will manage. The default, and also the minimum> interval, is 256 data pages. The first page of each storageA area is a SPAM page. The interval you specify determines where? subsequent SPAM pages are to be inserted, provided there areD enough data pages in the storage file to require morei SPAM pages.C You can specify the INTERVAL option only on a storage area for aB multifile database. The storage area page format must be MIXED. 5 file-spec@ Provides a separate file specification for the snapshot file.= Do not specify a file extension other than SNP to the file specification. 5 snp-pagesA Specifies the number of pages allocated for the snapshot file.C The default is 100 pages. You can set the snapshot allocation toD 0 pages. In the follojwing cases, you may want to set the snapshot allocation to 0 pages:= o If you have disabled snapshots. By setting the snapshot* allocation to 0, you may save space.A o If you have changed a read/write storage area to read-only.> The snapshot file is not used, and you can save space by1 setting the snapshot allocation to 0 pages. 5 extent-pagesC Specifies the number of pages of each extent. The default is 100 pages. 5 extension-optionsC k Specifies the MIN, MAX, and percent growth of each database file5 extent. Enclose the parameter list in parentheses. (B)0extension-options = C qqq> ( qqq> MINIMUM OF qq> min-pages qqq> PAGES, qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjC mqq> MAXIMUM OF qq> max-pages qq> PAGES,qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjR mqq> PERCENT GROWTH IS qqq> growth qqqq> ) qqq>l o min-pages? Specifies the minimum number of pages of each extent. The default is 99 pages o max-pages? Specifies the maximum number of pages of each extent. The default is 9,999 pages. o growthD Specifies the percent growth of each extent. The default is 20 percent growth. 3 change-storage-area-clause= Allows you to modify the extent and snapshot allocation of? a storage area. You cannot specify RDB$SYSTEM in the mchange-B storage-area-clause. To change the EXTENT, SNAPSHOT ALLOCATION,A or SNAPSHOT EXTENT for RDB$SYSTEM, specify these qualifiers as> part of the change-database-options. When you specify these? options as part of the change-database-options, they will be> changed for RDB$SYSTEM but not for any other storage areas.& (B)0change-storage-area-clause = X qqqqqq> CHANGE STORAGE AREA qqqqqqqq> storage-area-name qqqqqkA lqqqqqqqqqqqqqqqqqqqqqqqqqqnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqwqq>M x x tq> READ_WRITE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x xM x x tq> EXTENT IS qw> extent-pages qqqqqqqq PAGES qwqqqqqu x xF x x x m> extension-options qqqqqqqqqqqj x x xT x x tq> SNAPSHOT ALLOCATION IS qq> snp-pages qqq> PAGES qu x xT x x mq> SNAPSHOT EXTENT IS qw> extent-pages qq> PAGES qowqj x xF x x m> (extension-options) qqqqj x xD x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq READ_ONLY qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquM mqqqqq> WRITE_ONCE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj 4 storage-area-name8 The name of the storage area that you want to modify. 4 READ_WRITEC Used to change any read-only storage area (except the RDB$SYSTEM. storage arepa) to a read/write storage area.C To change a read-only RDB$SYSTEM storage area to read/write, youA must use the READ_WRITE option of the change-database-options2 clause. 4 snp-pagesA Specifies the number of pages allocated for the snapshot file. The default is 100 pages. 4 extent-pagesC Specifies the number of pages of each extent. The default is 100 pages. 4 extension-optionsC Specifies the MIN, MAX, and percent growth of each database fileq5 extent. Enclose the parameter list in parentheses. (B)0extension-options = C qqq> ( qqq> MINIMUM OF qq> min-pages qqq> PAGES, qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjC mqq> MAXIMUM OF qq> max-pages qq> PAGES,qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjR mqq> PERCENT GROWTH IS qqq> growth qqqq> ) qqq> 5 min-pagesD Specifies the minimum number of pages of reach extent. The default is 99 pages. 5 max-pagesD Specifies the maximum number of pages of each extent. The default is 9,999 pages. 5 growthA Specifies the percent growth of each extent. The default is 20 percent growth. 4 READ_ONLYD Used to change any read/write storage area (except the RDB$SYSTEM- storage area) to a read-only storage area.C To change a read/write RDB$SYSTEM storage area to read-only, you@ must use the READ_ONLY option of sthe change-database-options2 clause.@ You cannot change the parameters of a read-only storage area.D You must first change the storage area to a read/write area, then change the parameters.C Also, no write operation can be done in a read-only storage areaD except a cardinality update. See the RMU/ANALYZE/CARDINALITY helpC topic in the RMU help file for more information and restrictions on updating cardinalities. 4 WRITE_ONCE= You can use the WRITE_ONCE op ttion to change a storage area? containing stable segmented string data to a format that canC be stored on a write-once, read-many (WORM) optical disk. A WORMD optical disk offers a relatively inexpensive way of storing largeA amounts of data for read-only access compared to other storage media.= The following restrictions apply to the WRITE_ONCE option:B o Note that you cannot write data other than segmented stringsF to a write-once storage area. Oracle Rdb issue us an error messageD if you try to create a storage map that stores data other thanB segmented strings in a write-once storage area. Storage mapsB for non-segmented-string data must be removed before you can) alter a storage area to WRITE_ONCE.D o When you create a storage area on WORM media, you must specify@ that the snapshot area remains on read/write media: do not4 give a snapshot file the WRITE_ONCE attribute.C o If you specify the WRITE_ONCE option v when storing a segmentedD string, database keys are not compressed. For more informationG on database key compression, see the Oracle Rdb Guide to Database Maintenance.@ o Write-once storage areas do not use SPAM pages to look for? storage space, but to assist moving data back to non-WORMC media in which SPAM pages must be built again, space is stillC allocated for them. Since SPAM pages are essential in uniformA areas, Write-once storage areas ca wnnot be of uniform format7 and therefore are required to be of mixed format.C o You can use the PAGE SIZE IS clause of CREATE STORAGE AREA toB change the default page size for a storage area. To optimize@ storage, always specify an even number of blocks per page.@ o Rdb does not support magnetic media for storing write-once storage areas.= o After you move a storage area to or from a WORM device,> Do a full and complete backup of your database with xthe @ RMU/BACKUP command and start a new after-image journaling C file. For more information on backup and recovery procedures A with write-once storage areas, see the Oracle Rdb Guide to  Database Maintenance. 3 DELETE_STORAGE_AREAC Deletes the named storage area. You cannot delete the RDB$SYSTEMB storage area. You cannot delete a storage area if a storage map+ refers to it, or if there is data in it. ww@1 CHANGE_FIELD@ Cyhanges an existing global field definition. When you use the> CHANGE FIELD statement to change the attributes of a globalC field, Oracle Rdb changes only the attributes you mention in the3 statement. All other attributes remain the same. Example:! RDO> CHANGE FIELD POSTAL_CODE2 cont> DATATYPE IS TEXT SIZE IS 9 CHARACTERS.; The CHANGE FIELD statement changes the field definition:3 o In all the relations that refer to that fieldA o In the data dictionaryz (if you use INVOKE with the PATHNAME qualifier)( o In the Oracle Rdb system relations 2 MoreC To change a field using the CHANGE FIELD statement, you need the- Oracle Rdb CHANGE privilege for the field.B When you use CHANGE FIELD, you should be aware of the following conditions:A o If an index is defined on a field that requires a collating< sequence change, the index must be deleted first, then4 redefined after the collating sequence change. {@ o If the database is created with the DICTIONARY IS REQUIREDD option, you must invoke the database by path name, rather than1 file name, before you issue this statement.B o You cannot issue a CHANGE FIELD statement to change the data? type or collating sequence for a field that is used in anF index or view definition. Oracle Rdb returns an error message inB these instances and does not change the field. To change theD data type or collating sequence |of a field used in an index orB view, first delete the index or view definition, then change9 the field, and finally, redefine the index or view.= o If you issue a CHANGE FIELD statement that results in a? conversion error when you attempt to retrieve the record,> do the following: change the domain back to the originalB data type; then remove or change the offending records; then? reissue the CHANGE FIELD statement to alter the domain to@ the new da }ta type. Do not attempt to correct these type ofB conversion errors by just deleting the record (without firstB changing the domain back to the orginal data type). Doing so@ results in a conversion error when RDO attempts the delete operation.B When you change a field definition, this change will be visible> to other users only after they invoke the database the nextA time. By default, a database can be opened automatically (that? is, by any user who invokes the ~ database and executes a dataA manipulation language statement). If the database was modifiedC so that it must be manually opened, the RMU/OPEN command must be used to open it.< Depending on the type of change you make, you may have to? reprocess the application programs that refer to the changed fields.A You can change a field definition only if you have invoked the@ database that includes the field definition. You must executeD this statement in a read/write transaction. If there is no activeA transaction, and you issue this statement, Oracle Rdb starts a% read/write transaction implicitly.B Other users are allowed to be attached to the database when you$ issue the CHANGE FIELD statement. 2 Format7 (B)0CHANGE FIELD qq> name qqk lqqqqqqqqqqqj7 mqqwqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqwqk@ mq> DESCRIPTION IS /* text */ qqj x7 lqqqqqqqqqqqqqqqqqq field-attributes qq> . 3 field-attributes (B)0field-attributes = * DATATYPE IS qqq> data-type qqk! lqqqqqqqqqqqqqqqqqqqqqqqqqj@ mqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqq>> mwqwqq> validity-clauseqqqqqqqqqqqqqqqqqqqqqqqwqwqj< x tqq> missing-value-clauseqqqqqqqqqqqqqqqqqqu x< x tqq> dtr-clauseqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xC x tqq> CO LLATING_SEQUENCE IS sequence-nameqqqu xJ x mqq> NO COLLATING_SEQUENCE qqqqqqqqqqqqqqqqj x: mqqqqqqqqqqqqqqqqq The following example expands the POSTAL_CODE field to nine: characters and adds DATATRIEVE support characteristics:0 RDO> INVOKE DATABASE FILENAME 'MF_PERSONNEL' RDO> SHOW FIELDS POSTAL_CODE7 POSTAL_CODE text size is 54 Description: Postal code (in US = ZIP) RDO> CHANGE FIELD POSTAL_CODE. cont> DATATYPE IS TEXT SIZE IS 9 CHARACTERS- cont> DEFAULT_VALUE FOR DTR IS "000000000"- cont> EDIT_STRING FOR DTR IS "XXXXX-XXXX". RDO> SHOW FIELD POSTAL_CODE8 POSTAL_CODE text size is 94 Description: Postal code (in US = ZIP)% Edit string: XXXXX-XXXX& Default value: "000000000" RDO> FOR E IN EMPLOYEES cont> PRINT E.POSTAL_CODE cont> END_FOR 03817 03817 03301 03456 . . . 03301 03809# RDO> STORE E IN EMPLOYEES USING" cont> E.LAST_NAME = "Forester";! cont> E.EMPLOYEE_ID = "00876";$ cont> E.POSTAL_CODE = "039875573" cont> END_STORE RDO> FOR E IN EMPLOYEES, cont> WITH E.LAST_NAME = "Forester" OR# cont> E.LAST_NAME = "Toliver" cont> PRINT cont> E.EMPLOYEE_ID, cont> E.POSTAL_CODE cont> END_FOR 00164 03817 00876 039875573> The field remains a text field, but the length is increased? to nine characters, and an edit string and default value are@ specified for DATATRIEVE. When you display the data, existing< field values are padded on the right with spaces. Thus an> existing postal code would appear as "03104 ". Newly stored# values can have nine characters. Example 2C The accounting department has decided that the BUDGET field will now include pennies: RDO> SHOW FIELDS BUDGET? BUDGET signed longword scale 0, Description: Generic budget data$ Edit string: $$$,$$$,$$$ RDO> FOR D IN DEPARTMENTS1 cont> WITH D.DEPARTMENT_NAME = 'Manufacturing' cont> PRINT D.BUDGET_ACTUAL cont> END_FOR BUDGET_ACTUAL 0 RDO> CHANGE FIELD BUDGET- cont> DATATYPE IS SIGNED LONGWORD SCALE -2. cont> EDIT_STRING FOR DTR IS "$$$$,$$9.99". RDO> SHOW FIELDS BUDGET@ BUDGET signed longword scale -2, Description: Generic budget data$ Edit string: $$$$,$$9.99 RDO> FOR D IN DEPARTMENTS1 cont> WITH D.DEPARTMENT_NAME = 'Manufacturing' cont> PRINT D.BUDGET_ACTUAL cont> END_FOR BUDGET_ACTUAL 0.00 Example 3C You can add or change a VALID IF clause for a field. However, ifA the databas e contains any data that violates the specification@ of the VALID IF clause, the clause is rejected. The following@ example shows two CHANGE FIELD... VALID IF statements. In theA first instance, the specification is rejected because existing? records contain EMPLOYEE_ID values less than "98765"; in the2 second instance, the specification is accepted.< RDO> CHANGE FIELD ID_NUMBER VALID IF ID_NUMBER > "98765".0 %RDB-E-NO_META_UPDATE, metadata update failedK -RDMS-E-NOT_VALID_FR, field ID in relation CURRENT_INFO fails validation< RDO> CHANGE FIELD ID_NUMBER VALID IF ID_NUMBER > "00050". RDO> SHOW FIELD ID_NUMBER8 ID_NUMBER text size is 5. Description: Generic employee ID Missing value:1 Valid: IF ID_NUMBER > "00050" ww@1 CHANGE_INDEX' Changes characteristics of an index. You can change the following: o The description text0 o Physical characteristics of a sorted index* o Storage map associated with an indexD You cannot change a sorted index to a hashed index or vice versa. Example:# RDO> CHANGE INDEX JH_EMPLOYEE_ID' cont> NODE SIZE 200 PERCENT FILL 80. 2 MoreC To change an index with the CHANGE INDEX statement, you need the0 Oracle Rdb CHANGE privilege for the relation.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you$ issue the CHANGE INDEX statement. 2 FormatP (B)0CHANGE INDEX name qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqkB mq> DESCRIPTION IS /* text */ qqj x9 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqq mwqqqqqqqqqqqqqq>qqqqqqqqqqqwqwqqqqqqqqqqqqq>qqqqqqqqqwq> .> m> sorted-index-param-list j m> index-storage-clause j 3 name, The name of the index you want to change. 3 text= A text string that adds a comment to the index definition. 3 sorted-index-param# (B)0sorted-index-param-list = F qqqqwqqqqwqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqwqqqwqqqqqqqqq>L x tq> NODE SIZE qqqqq> number-bytes qqqqqqqqu xL x tq> PERCENT FILL qqqqqq> percentage qqqqqqu xJ x mq> USAG E qqqqqqqqqwqqqqq> UPDATE qqqwqqqqj xC x mqqqqq> QUERY qqqqj x< x x< mqqqqqqqqqqqqqqqqqqqq index-within-clause qqqqqqqqqqqqqqqqqqqqqqqqqqwqkI m> USING qw> field-name qw> index-within-clause qj x> mqqqqq , lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq>& m> default-threshold-clause qjD Allows you to specify a storage map definition for th e index. YouA can use the index-storage-clause only in a multifile database.B This clause allows you to specify which storage area files will& be used to store the index entries:? o All index entries can be associated with a single storage area.9 o Index entries can be systematically distributed, orB partitioned, among several storage areas by specifying upperB limits on the values for a key in a particular storage area.B If you omit the storage map def inition, the default is to storeD all the entries for an index in the main RDB$SYSTEM storage area.A You should define a storage area for an index that matches the? storage map for the relation with which it is associated. InB particular, under the following conditions, the database system@ will store the index entry for a row on or near the same data% page that contains the actual row:@ o The storage areas for a relation have a mixed page format.> o You specify an i dentical storage clause for the index as1 exists in the storage map for the relation.B o The storage map for the relation also names the index in the! PLACEMENT VIA INDEX clause.> Such coincidental clustering of indexes and rows can reduce@ input/output operations. With hashed indexes and coincidentalD clustering, the database system can retrieve rows for exact match) queries in one input/output operation.B For sorted indexes, specifying an identical storage map reduces* input/output contention on index nodes. 4 index-within-clause (B)0index-within-clause = E WITHIN qwq> area-name qwqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqwqkL x m> WITH LIMIT OF qw> literal qwj x< x mqqqq , qqqqqqqqqqwqqwqqqqqqqqq>+ x mq> threshold-clause qj x)  mqqqqqqqqqqqqq ; DATABASE statement or the DEFINE STORAGE AREA clause of the? CHANGE DATABASE statement before you refer to it in the map- storage-clause clause.? If the index is a hashed index, the storage area must have a MIXED page format. 5 WITH_LIMIT_OF> The maximum value for the index k ey that will reside in theA specified storage area. For multisegmented index keys, specify" a literal value for each field.C The number of literals in this clause must be less than or equalB to the number of fields in the USING clause. Repeat this clause? to partition the index entries among multiple storage areas.6 When you are modifying a multisegmented index usingD multisegmented keys and use the STORE USING...WITH LIMITS clause,A if the values for the first key are all the same, then set theC limit for the first key at that value. By doing this, you ensureB that the value of the second key determines the storage area inD which each record will be stored. Note that the last storage areaA you specify CANNOT have a WITH LIMIT OF clause associated with it. 5 threshold-clause (B)0threshold-clause= ( qq> THRESHOLDS ARE qqqqqqqqqqk! lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq >. mq> ,val2 qqwqqqqq>qqqqu. mq> ,val3 qjC Specifies associated threshold values for each storage area withB uniform format that is specified in the index-within-clause. ByG setting threshold values, you can make sure that Oracle Rdb does notB overlook a page with sufficient space to store compressed data.? The threshold values specify when the page is marked as FULL< in the SPAM page free space inventory lists. For exam ple,> if you set default values of 70, 85, and 95 percent, ranges? of guaranteed free space on each data page are 30, 15, and 5? percent, respectively. If you do not set default values, theF values are (0,0,0). With values of (0,0,0), Oracle Rdb will use theF record length when setting the SPAM fullness. Oracle Rdb will neverA store a record on a page at threshold 3. The value you set forA the highest threshold can be used to reserve space on the page for future record growth.D If you specify a value of 40 for the "val1" parameter, but do notD specify values for the "val2" or "val3" parameters, the threshold& values will be set at (40,100,100).; If you use data compression, you should use logical area4 thresholds to obtain optimum storage performance. 4 field-name@ The name of the field whose value will be used as a limit for8 partitioning the index across multiple storage areas. 4 default-threshold-clause$ (B)0defaul t-threshold-clause = / qq> DEFAULT THRESHOLDS ARE qqk! lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq>. mq> ,val2 qqwqqqqq>qqqqu. mq> ,val3 qjC Specifies associated threshold values for each storage area withC uniform format that is NOT specified in the index-within-clause.F By setting threshold values, you can make sure that Oracle Rdb does@ not overlook a page with sufficient space to store compressed data.? The threshold values specify when the page is marked as FULL< in the SPAM page free space inventory lists. For example,> if you set default values of 70, 85, and 95 percent, ranges? of guaranteed free space on each data page are 30, 15, and 5? percent, respectively. If you do not set default values, theF values are (0,0,0). With values of (0,0,0), Oracle Rdb will use theF record length when setting the SPAM fullness. Oracle Rdb will neverA store a record on a page at threshold 3. The value you set forA the highest threshold can be used to reserve space on the page for future record growth.D If you specify a value of 40 for the "val1" parameter, but do notD specify values for the "val2" or "val3" parameters, the threshold& values will be set at (40,100,100).; If you use data compression, you should use logical area4 thresholds to obtain optimum storage performance. 2 Examples Example 1B The following example changes the index node size to 100 bytes,A and sets the initial fullness percentage from 70 percent to 95 percent:# RDO> CHANGE INDEX JH_EMPLOYEE_ID cont> NODE SIZE 100 cont> PERCENT FILL 95.@ Note that JH_EMPLOYEE_ID is a sorted index. You cannot changeC node size, percent fill, or the USAGE clause for a hashed index. Example 2; The following example changes how the index is stored by7 specifying a new index-storage-clause for the index:& RDO> CHANGE INDEX EMPLOYEES_HASH; cont> DESCRIPTION IS /* Hashed index for employees */# cont> STORE USING EMPLOYEE_ID cont> WITHIN. cont> EMPIDS_LOW WITH LIMIT OF "00400";. cont> EMPIDS_MID WITH LIMIT OF "00800"; cont> EMPIDS_OVER. Example 3@ The following example changes the size of each index node and< sets the initial fullness percentage for each node in theA index structure being changed. It also specifies a storage map definition for the index.* RDO> CHANGE INDEX COLL_COLLEGE_CODE+ cont> NODE SIZE 1250 PERCENT FILL 100" cont> STORE WITHIN EMP_INFO. wwQ!1 CHANGE_PROTECTIOND Changes protection for a single entry within the specified access control list. Example:& RDO> CHANGE PROTECTION FOR DATABASE cont> [ADMIN,JONES]& cont> ACCESS "WRITE+MODIFY+ERASE". 2 Format5 (B)0CHANGE PROTECTION FOR qqqqk x lqqqqqqqqqqqqqqqqqqqqjA mqqqqwqqq> DATABASE qqqqqqqqqqq>qqqqqqqqqqqqqqqqqkC tqqq> RELATION qq> relation-name qqqqqqqqqqquC tqqq> VIEW qqqqqq> view-name qqqqqqqqqqqqqqquJ mqqq> FIELD q> field-name IN relation-name qu: lqqqqqqqqqqqqqqqqqqqqqqqqqqwqk* tqq> sequence-number qqqu x*  mwq> identifier qqqwqqqqj x( mqqqqqqq + ACCESS qqwq> access-right qqwqqqqqqqqqq> .- mqqqqq + An OpenVMS user identifier that identifies the entry withinA the specified access control list whose protection you want to5 change. An identifier can be any of the following: o UIC identifierA You cannot specify more than one UIC identifier in a CHANGE PROTECTION statement. o General identifier o System-defined identifier 3 access-rightA An access right to be granted or denied to the user identified? by UIC. The new version of the ACL entry you create with theC CHANGE PROTECTION statement does not inherit any characteristicsA from the old version. When you change protection on a databaseC element, you need to specify the entire entry, including all the" access rights you want to deny.F Request HELP on Access_rights to see a complete table of Oracle Rdb access rights. 2 MoreB You must have the CONTROL privilege to modify the access rights7 of other users with the CHANGE PROTECTION statement.@ An access control list (ACL) is attached to each database andD relation. Each list consists of entries that specify two items of information:: o An ide ntifier that specifies a user or set of users.B o A set of access rights. These rights specify what operations> that user or set of users can perform on the database or relation.> The new version of the ACL entry you create with the CHANGE< PROTECTION statement does not inherit any characteristicsA from the old version. When you change protection on a databaseC element, you need to specify the entire entry, including all the" access rights you want to deny.9 When changing protection, observe the following rules:C o To change protection, you must first invoke the database that includes the protection.@ o If you specify two or more access rights, separate each byB a plus sign (+), but do not include any spaces. For example, READ+WRITE.D o If the list of access rights exceeds one line in length, placeD the list in quotation marks and use the continuation characterF (hyphen). Otherwise, Oracle Rdb reads the carriage return as the, end of the list, and an error results:* cont> ACCESS "DEFINE+CHANGE+DELETE -, cont> +CONTROL+OPERATOR+ADMINISTRATOR"? Granting or revoking a privilege takes effect after the user/ detaches and attaches to the database again.C You must execute the CHANGE PROTECTION statement in a read/writeD transaction. If there is no active transaction and you issue thisD statement, Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you) issue the CHANGE PROTECTION statement. 2 Examples Example 1C You can change the protection in an access control list entry by specifying an identifier:& RDO> CHANGE PROTECTION FOR DATABASE cont> [GROUP1,SMITH]6 cont> ACCESS NOCONTROL+NOOPERATOR+NOADMINISTRATOR.1 This statement performs the following actions:D o Identifies the user whose protection you want to change. Here,/ the user is identified by [GROUP1,SMITH].C o Changes the access rights to deny the user CONTROL, OPERATOR,B and ADMINISTRATOR privileges. All other privileges remain asA you defined them in the previous version of this ACL entry. Example 27 You can identify the ACL entry by a sequence number:& RDO> CHANGE PROTECTION FOR DATABASE cont> 4& cont> ACCESS WRITE+MODIFY+ERASE.1 This statement performs the following actions:B o Identifies the entry by specifying a sequence number 4. ThisC means that this statement will change the fourth entry in the5 access control list for the database PERSONNEL.D o Changes the access rights by granting WRITE, MODIFY, and ERASE: access. All other rights remain as they were before. wwQ!1 CHANGE_RELATION= Changes the definition of the fields and relation-specific? constraints that make up a relation. You can add, delete, orA change fields and relation-specific constraints in an existingE relation. When you execute this statement, Oracle Rdb modifies theD named field and relation-specific constraint definition(s) withinB the relation definition. All the fields that you do not mention remain the same. Example:" RDO> CHANGE RELATION EMPLOYEES. cont> DEFINE SALARY. cont> END EMPLOYEES RELATION. RDO> !$ RDO> CHANGE RELATION DEPARTMENTS." cont> CHANGE DEPARTMENT_NAME4 cont> QUERY_NAME FOR DATATRIEVE IS "DEPT"." cont> END DEPARTMENTS RELATION. 2 MoreD To change a relation with the CHANGE RELATION statement, you need4 the Oracle Rdb CHANGE privilege for the relation.A When you execute this statement, Oracle Rdb modifies the namedB field and relation-specific constraint definition(s) within theB relation definition. All the fields and constraints that you do not mention remain the same.= When you change a relation definition, other users see theB rev ised definition only after they invoke the database the nextA time. By default, a database can be opened automatically (that? is, by any user who invokes the database and executes a dataA manipulation language statement). If the database was modifiedC so that it must be manually opened, the RMU/OPEN command must be used to open it.A You must execute the CHANGE RELATION statement in a read/writeC transaction. If you issue this statement when there is no activeF transac tion, Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you' issue the CHANGE RELATION statement. 2 FormatV (B)0CHANGE RELATION qq> name qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk= lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqwqkM x tq> DELETE CONSTRAINT w> constraint-name qwj x x x= x x mqqqqqqqq , relation-constraint-def qqqqqqqqqqqqqqqqqj x x= mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqq> . qqqkE mq> DESCRIPTION IS /* text */ qqqqj x< lqqqqqqqqqqqqqqqqqqqqqqqqq mqwqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqwqkG mqqwqqwqq> DEFINE qq> define-clause qqqwq> . qwqj xG x tqq> CHANGE qq> change-clause qqqu x xG x mqq> DELETE qq> field-name qqqqqqj x x> mqqqqqqqqqqqqqqqqqqqqq lqqqqqqqqqqqqqqqqqqqqqqqqqq END qqwqqqqq>qqqqwqq> RELATION qqqqqqq> .# mq> name qqj 3 name4 The name of the relation that you want to modify. 3 constraint-name8 The name of an existing relation-specific constraint. 3 relation-constraint-defC Using the relation-constraint-def clause you can name or specify@ the type of relation-level constraints to be defined within a specific relation definition.# (B)0relation-constraint-def =4 qwq> CONSTRAINT constraint-name IS qqwqk+ mqqqqqqqqqqqqqqqqqqqqq UNIQUE qqqqqqw>qqw> unique-field-name qqqwqqwqqqkG xmq> PRIMARY KEY qj mqqqqqqqqq , qqqq FOREIGN KEY qw> referencing-field-name qwqk x x9 x mqqqqqqqqqqqqq , qqqq REFERENCES referenced-relation-nameqqqqqqqkx x9 x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjx x9 x mqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqu x; x mw> referenced-field-name wj x x9 x mqqqqqqqqqq , qqqq USING rse REQUIRE conditional-expr qqqqqqqqj x9 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq- m> CHECK ON qwqq> COMMIT qu& mqq> UPDATE qj 4 Arguments: Constraint-name must be unique within the database. TheA constraint name can be referred to in other statements such as; DEFINE RELATION, SHOW CONSTRAINT, and START_TRANSACTION.A The phrase 'CONSTRAINT constraint-name is' is optional. If youC specify the keyword CONSTRAINT, you must also provide a name for the constraint. 3 textC A text string that adds a comment. You can apply the descriptionC to the entire relation definition using the DESCRIPTION keyword.D You can also apply a separate description to each field using the3 text markers before the D EFINE or CHANGE clause. 3 DEFINE< Using the DEFINE option of CHANGE RELATION, you can add aA globally defined field to a relation. You can also use a localB field name to refer to that global field. You can also define a3 relation-specific constraint at the field level.4 (B)0define-clause = qqwqqqqqqqqqqqqqqqwqqqk- mq> /* text */ qj x+ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjE mqqwq> global-field-name qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqkN tq> local-field-name qq> BASED ON q> global-field-name qj xC x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjC x mwqqqqqqqqqqqqqqqqqwqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkG x mqw> dtr-clause qwj mqqw> field-constraint-def qwqqquC x mqqqqqq local-field-name qq> COMPUTED BY q> value-expr qk xC lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj xE mqqqwqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqvq>$ mqw> dtr-clause qwqj mqqqqqq CONSTRAINT constraint-name IS qqj x+ lqqqqqqqqqqqqqqqqqq NOT MISSING[m qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqkQ tq> UNIQUE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xX tq> PRIMARY KEY qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xS mw> REFERENCES referenced-relation-name qwqqqqqqqqqqqqqqqqqqqqqqqqwu xL x m> referenced-field-name jx xJ x x xZ mq> USING rse RE QUIRE conditional-expr qqqqqqqqqqqq>qqqqqqqqqqqqqqj xJ xJ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/ mqq> CHECK ON qwqq> COMMIT qu( mqq> UPDATE qj 5 Arguments: Constraint-name must be unique within the database. TheA constraint name can be referred to in other statements such as; DEFINE RELATION, SHOW CONSTRAINT, and START_TRANSACTION.A The phrase 'CONSTRAINT constraint-name is' is optional. If youC specify the keyword CONSTRAINT, you must also provide a name for the constraint.C A field constraint definition differs from a relation constraintC definition in that you cannot repeat referenced field names. SeeA the "relation-constraint-def" help subtopic of CHANGE_RELATION for more information. 3 CHANGED The CHANGE RELATION statement with the CHANGE option modifies theA local attributes of an existing field. Only the attributes you@ specify in the statement change; all others stay as they are.' For more details, see the Arguments.@ You can change relation-specific constraints using the DELETE? CONSTRAINT clause of the CHANGE option. Any constraint to beB changed must be first specifically deleted by name and then re- declared. (B)0change-clause = qwqqqqqqqqq>qqqqqqqqwqqqqk mqq> /* text */ qqq j x lqqqqqqqqqq global-field-name qqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqwqkF tqq> local-field-name qqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqu xO mqq> local-field-name qqqqq> BASED ON global-field-name qqqqqj xD lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqwqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqwqwq>Z mw> dtr-clause qwj x tq> DELETE CONSTRAINT qw> constraint-name qwu xH mqqqqq field-constraint-def qqqqqqqqqqqqqqqqqqqj xH mqqqqqqqqqqqqqqqqqqqqqqqq The action of the CHANGE RELATION statement with the CHANGE2 option depends on the change-clause as follows:< o CHANGE field-name BASED ON global-field-name-gives the5 specified field the attributes of another field= o CHANGE field-name dtr-clause-changes DATATRIEVE support characteristicsC o DELETE CONSTRAINT constraint-name-deletes a relation-specific- constraint from the relation definitionC You can specify local DATATRIEVE support clauses on any of theseB fields. For more information on the DATATRIEVE clauses, ask for HELP on Field_attr. 3 DELETE? Deletes the field from the relation. This option deletes the< field only from the relation definition. The global fieldA definition by this name is still defined for the database as a4 whole, and other relations can still refer to it.C If an existing view, index, constraint, or computed field refersG to the field, Oracle Rdb returns an error when you try to delete it.H (B)0DELETE FIELD qqqwqqq> field-name qqqqwqqq> .) mqqqq definition becomes part of the definition for the relation. Example 2= The BASED ON clause adds a local field name to a relation: CHANGE RELATION EMPLOYEES.. DEFINE CURRENT_SALARY BASED ON SALARY. END EMPLOYEES RELATION.? This statement performs the same function as in the previousD example, but uses the BASED ON clause to give a local name to theB field. The statement assumes that SALARY is defined globally in the database. Example 3= You can change the local attributes for a field definitionC inside the CHANGE RELATION statement without changing the globalD attributes of the field for other relations that refer to it. TheD DATATRIEVE support clauses defined locally override those defined globally. CHANGE RELATION DEPARTMENTS. CHANGE DEPARTMENT_NAME/ QUERY_NAME FOR DATATRIEVE IS "DEPT". END DEPARTMENTS RELATION.< This statement changes QUERY_NAME for the DEPARTMENT_NAME? field, but only for the DEPARTMENTS relation. The definitionC of DEPARTMENT_NAME remains the same for any other relations that use it. Example 4B You can change a local field so that it is based on a differentA global field without changing the the name of the local field: DEFINE FIELD SALARY' DATATYPE SIGNED LONGWORD SCALE -2 VALID IF SALARY > 8000 MISSING_VALUE IS 0. EDIT_STRING FOR DATATRIEVE "$$$$$$9.99". DEFINE FIELD MONEY DATATYPE TEXT SIZE 8 VALID IF SALARY > 8000 MISSING_VALUE IS 0. EDIT_STRING FOR DATATRIEVE "$$$$$$9.99". CHANGE RELATION EMPLOYEES. DEFINE SALARY. END. CHANGE RELATION EMPLOYEES." CHANGE SALARY BASED ON MONEY. END.= This example assumes two fields, SALARY and MONEY, defined, globally. They have different data types.C o The first CHANGE RELATION statement adds a field to EMPLOYEES. using the global SALARY field definitionC o The second CHANGE RELATION statement uses the BASED ON clauseC to substitute the MONEY definition for the global SALARY. The@ local name remains the same, but that name now points to aA different global definition. There are now two fields named7 SALARY in the database, one local and one global. Example 5> A COMPUTED BY field is calculated from another field in the relation:" CHANGE RELATION SALARY_HISTORY. DEFINE SS_DEDUCTION- COMPUTED BY (SALARY_AMOUNT * 0.0625). END SALARY_HISTORY RELATION.A This statement adds a "virtual" field, whose value is computed from other fields. Example 6) The following example deletes a field: CHANGE RELATION COLLEGES. DELETE CONTACT_NAME. END COLLEGES RELATION.= This example changes the COLLEGES relation by removing the B CONTACT_NAME field from it. A global field is still defined forB the database as a whole, and other relations can still refer to@ it. It may have some other name, if CONTACT_NAME were definedB with the BASED ON qualifier. This statement also makes the data( associated with that field invisible. Example 7B This example changes the field-level primary key constraint for: the field DEPT_CODE to a field-level unique constraint.# RDO> CHANGE RELATION JOB_HISTORY0 cont> DELETE CONSTRAINT JOB_HISTORY_FOREIGN3. cont> END.# RDO> CHANGE RELATION DEPARTMENTS/ cont> DELETE CONSTRAINT DEPARTMENTS_PRIMARY1> cont> CONSTRAINT DEPARTMENTS_UNIQUE UNIQUE DEPARTMENT_CODE. cont> END.C The example illustrates how constraints can refer to each other.@ Before the primary key constraint DEPARTMENTS_PRIMARY1 can beC deleted, you must delete the foreign key constraint JOB_HISTORY_ FOREIGN3. Example 8B The following example shows that objects in the database with aB dependency on the EMPLOYEES relation must be deleted before the% EMPLOYEES relation can be deleted:$ RDO> START_TRANSACTION READ_WRITE# RDO> CHANGE RELATION JOB_HISTORY3 cont> DELETE CONSTRAINT JOB_HISTORY_FOREIGN1. cont> END.& RDO> CHANGE RELATION SALARY_HISTORY6 cont> DELETE CONSTRAINT SALARY_HISTORY_FOREIGN1. cont> END. RDO> CHANGE RELATION DEGREES/ cont> DELETE CONSTRAINT DEGREES_FOREIGN1. cont> END. RDO> CHANGE RELATION RESUMES. cont> DELETE CONSTRAINT RESUMES_FOREIGN1. cont> END. RDO> CHANGE RELATION RESUMES9 cont> DELETE CONSTRAINT RESUMES_UNIQUE_EMPLOYEE_ID. cont> END.N RDO> DELETE TRIGGER EMPLOYEE_ID_CASCADE_DELETE, STATUS_CODE_CASCADE_UPDATE.> RDO> DELETE VIEW CURRENT_INFO, CURRENT_SALARY, CURRENT_JOB. RDO>" RDO> DELETE RELATION EMPLOYEES. RDO> ROLLBACK wwbI1 CHANGE_STORAGE_MAPB Changes the storage map definition for a relation. You can also@ change which index Oracle Rdb uses when it stores new records= whether records will be stored in a compressed format, and$ whether data will be reorganized. 2 FormatC (B)0CHANGE STORAGE MAP map-name qq>qqk% lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj> mwqqqqqqqqqqq>qqqqqqqqqqwqwqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqwkB m> map-storage-clause qj m> change-relation-map-clause qjx> lqqqqqqqqqqqqqqqqqqqqqqqqqqq END qqqqqwqqqqqqqq>qqqqqqwqqqqq> STORAGE MAP qqqq> .# mq> map-name qqqj 3 map-name2 The name of the storage map you want to modify. 3 map-storage-clause (B)0map-storage-clause = E STORE qw> map-within-clause qqqqqqqqqqqqqqqqqqqqqqqqqqwqkG m> USING qw> field-name qw> map-within-clause qj x< mqqqqq , qqqqqqqqqqqqqqwqq>& m> default-threshold-clause qjC Used to define a storage map. This clause lets you specify whichC storage area files will be used to store rows from the relation:D o All rows of a relation can be associated with a single storage area.B o Rows of a relation can be randomly distributed among several storage areas.> o Rows of a relation can be systematically distributed, orB partitioned, among several storage areas by specifying upper? limits on the values for a column in a particular storage3 area. This is called horizontal partitioning.B If you omit the storage map definition, the default is to storeC all the rows for a relation in the main RDB$SYSTEM storage area. 4 map-within-clause (B)0map-within-clause = E WITHIN qwq> area-name qwqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqwqkL x m> WITH LIMIT O F qw> literal qwj x< x mqqqq , qqqqqqqqqqqqqqqqqqwqwqkE x mq> FOR qwqwqw> rel-name qwqqqqqqqqqqqqqqqu x x< x x x mqqqq , x x mw> relation-name.field-name qwj x x< x x mqqqqqqqqqqqq , qqqqqqqqqqwqqwqqqqqqqqq>+ x mq> threshold-clause qj x) mqqqqqqqqqqqqq ; DATABASE statement or the DEFINE STORAGE AREA clause of the@ CHANGE DATABASE statement before you refer to it in the store clause. 5 WITH_LIMIT_OF> The maximum value for the index key that will reside in the specified storage area.A The number of literals in this clause must be the less than orA equal to the number of fields in the USING clause. Repeat this? clause to partition the index entries among multiple storage areas.A When you define a multisegmented index using multiple keys andC use the STORE USING...WITH LIMITS clauses, if the values for theC first key a re all the same, then set the limit for the first keyA at that value. By doing this, you ensure that the value of theC second key determines the storage area in which each record will be stored.A Note that the last storage area you specify CANNOT have a WITH& LIMIT OF clause associated with it.A If you change the limits for a storage area, records that were@ already stored in the area are not moved according to the new= limit clause. However, new records will be stored into the4 relation according to the new limits you specify. 5 rel-name? The name of the relation whose segmented strings you want to@ store in the specified storage area. If you want to store theC segmented strings of more than one relation in the storage area,3 separate the names of the relations with commas. 5 relation-name.field-nameD The name of the relation and segmented string field that you wantD to store in the specified storage area. If you want to store moreD than one segmented string field in the storage area, separate the list items with commas. 5 threshold-clause (B)0threshold-clause= ( qq> THRESHOLDS ARE qqqqqqqqqqk! lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq>. mq> ,val2 qqwqqqqq>qqqqu. mq> ,val3 qjC Specifies associated threshold values for each storage area with@ uniform format that is sp ecified in the map-within-clause. ByG setting threshold values, you can make sure that Oracle Rdb does notB overlook a page with sufficient space to store compressed data.? The threshold values specify when the page is marked as FULL< in the SPAM page free space inventory lists. For example,> if you set default values of 70, 85, and 95 percent, ranges? of guaranteed free space on each data page are 30, 15, and 5? percent, respectively. If you do not set default values, theF values are (0,0,0). With values of (0,0,0), Oracle Rdb will use theF record length when setting the SPAM fullness. Oracle Rdb will neverA store a record on a page at threshold 3. The value you set forA the highest threshold can be used to reserve space on the page for future record growth.D If you specify a value of 40 for the "val1" parameter, but do notD specify values for the "val2" or "val3" parameters, the threshold& values will be set at (40,100,100).; If you use data compression, you should use logical area4 thresholds to obtain optimum storage performance. 4 USING_field-nameB The names of the fields whose values will be used as limits forF partitioning the relation across multiple storage areas. Oracle RdbC compares values in the fields to the values in the WITH LIMIT OF; clause to determine where to initially store the record. 4 default-threshold-clause$ (B)0default-threshold-clause = / qq> DEFAULT  [4mTHRESHOLDS ARE qqk! lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq>. mq> ,val2 qqwqqqqq>qqqqu. mq> ,val3 qjC Specifies associated threshold values for each storage area withD uniform format that is NOT specified in the map-within-clause. ByG setting threshold values, you can make sure that Oracle Rdb does notB overlook a page with sufficient space to store compressed data.? The threshold values specify when the page is marked as FULL< in the SPAM page free space inventory lists. For example,> if you set default values of 70, 85, and 95 percent, ranges? of guaranteed free space on each data page are 30, 15, and 5? percent, respectively. If you do not set default values, theF values are (0,0,0). With values of (0,0,0), Oracle Rdb will use theF record length when setting the SPAM fullness. Oracle Rdb will neverA store a record on a page at threshold 3. The value you set forA the highest threshold can be used to reserve space on the page for future record growth.D If you specify a value of 40 for the "val1" parameter, but do notD specify values for the "val2" or "val3" parameters, the threshold& values will be set at (40,100,100).; If you use data compression, you should use logical area4 thresholds to obtain optimum storage performance. 3 change-relation-map-clause& (B)0change-relation-map-clause = O qqwwq> NO PLACEMENT VIA INDEX qqqqqqqqqqqqqqqwq>H xmq> PLACEMENT VIA INDEX qq> index-name qqu? twq> DISABLE qqwq> COMPRESSION qqqqqqqqqqqqu8 xmq> ENABLE qqqj x8 mqq> REORGANIZE qqqqqwqqqqqq>qqqqwqqqqqqqqqj. tq> AREAS qqu. mq> PAGES qqj 4 PLACEMENT_VIA_INDEXB Indicates that Oracle Rdb should at tempt to store a record in aC way that optimizes access to that record via the indicated path.B Oracle Rdb chooses a target page for any record being stored byD rules that take into account the type of index defined (sorted orB hashed), the type of storage areas involved (uniform or mixed),< and how indexes and relations are assigned to each other.D The index named in the PLACEMENT VIA INDEX clause must be definedC for the same relation that the storage map is being defined for . 4 NO_PLACEMENT_VIA_INDEX= Negates the PLACEMENT VIA INDEX clause, so that subsequent; records stored are not stored via the index named in theC PLACEMENT VIA INDEX clause. This option is only available on theB CHANGE STORAGE MAP statement. If you specify the CHANGE STORAGEA MAP statement without the PLACEMENT VIA INDEX option or the NO? PLACEMENT VIA INDEX option, the statement executes as if the? clause specified on the DEFINE STORAGE MAP statement or last. CHANGE STORAGE MAP statement had been used. 4 COMPRESSION_clauseA Specifies whether data compression will be enabled or disabledB for the records when they are stored. ENABLE COMPRESSION is the default. 4 REORGANIZE_clauseC Causes rows previously stored in specified relations to be movedB according to the partitions specified in the CHANGE STORAGE MAP statement. 2 MoreA To change a storage map for a relation with the CHANGE STORAGEB MAP statement , you need the Oracle Rdb CHANGE privilege for the relation.= If the database is created with the DICTIONARY IS REQUIREDA option, you must invoke the database by path name, rather than. file name, before you issue this statement.D You must specify either a store-clause, a [NO]PLACEMENT VIA INDEXC clause, a REORGANIZE clause, or a COMPRESSION clause in a CHANGE STORAGE MAP statement.C In the change-relation-map-clause, you can select one or more of@ the three cla uses ([NO]PLACEMENT VIA INDEX clause, REORGANIZE> clause, or COMPRESSION clause) in any order, but you cannotA repeat a clause. Note that when the REORGANIZE clause is used,0 records are moved and assigned to new dbkeys.D If you omit the store-clause in the CHANGE STORAGE MAP statement,, you can create a second index by mistake.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you@ issue the CHANGE STORAGE MAP statement. However, they are not? allowed to be using the relation whose map is being changed. 2 Examples Example 1D The following example disables compression for the CANDIDATES_MAP storage map:* RDO> CHANGE STORAGE MAP CANDIDATES_MAP cont> DISABLE COMPRESSION( cont> END CANDIDATES_MAP STORAGE MAP. Example 2>  The following example assigns new limits for storage areas:) RDO> CHANGE STORAGE MAP EMPLOYEES_MAP! cont> STORE USING EMPLOYEE_ID4 cont> WITHIN EMPIDS_LOW WITH LIMIT OF "00300";4 cont> EMPIDS_MID WITH LIMIT OF "00600"; cont> EMPIDS_OVER' cont> END EMPLOYEES_MAP STORAGE MAP.> Current data will not be moved according to the new limits.@ However, when new data is stored, it will be stored according( to the new limits in the storage map. E xample 3B The following example defines a new storage area EMPIDS_MID2 toC handle the employee IDs 600-900, and to reorganize the data fromA one existing storage area, EMPIDS_OVER. The current data whichD is stored within the limits of employee IDs 601-900 will be moved? according to the new limits. When the new data is stored, itD will be stored according to the new limits set in the storage map definition.( RDO> CHANGE STORAGE MAP EMPLOYEES_MAP! cont> STORE USING EMPLOYEE_ID8 cont> WITHIN EMPIDS_LOW WITH LIMIT of "00300";4 cont> EMPIDS_MID WITH LIMIT OF "00600";5 cont> EMPIDS_MID2 WITH LIMIT OF "00900"; cont> EMPIDS_OVER cont> REORGANIZE' cont> END EMPLOYEES_MAP STORAGE MAP. ww1 Command_RecallB Oracle Rdb saves and allows you to access up to 20 of your mostA recently entered RDO commands. Use the UP-ARROW or CTRL/B keys@ to recall previously entered commands. Use the DOWN-ARROW keyC to reexamine a command that you had retrieved using the UP-ARROW key.@ This feature is designed for the convenience of RDO users. It> greatly reduces the need to enter the RDO editing buffer toA rerun one or more of your last 20 commands. The EDIT statementC continues to be a useful tool for created RDO procedures in that@ it lets you take advantage of your editor's text manipulation0 features and it lets you edit multiple lines.  2 More? Any string entered at the RDO> prompt is saved in the recall@ buffer. This includes all DCL commands prefaced by the dollar< sign ($), commented text that begins with the exclamationB point (!), and any RDO statements. The carriage return delimitsA each line written to the recall buffer. Thus, in the followingC example, four separate entries are written to the recall buffer: RDO> FOR E IN EMPLOYEES7 cont> WITH E.EMPLOYEE_ID BETWEEN "00164" AND "00175") cont> PRINT E.LAST_NAME, E.EMPLOYEE_ID cont> END_FOR> The most recently typed command is at the top of the recall? buffer. If the user enters CTRL/B at this point, the END_FOR statement would appear first.? There are no parameters or logicals available to control the6 maximum number of lines saved in the recall buffer. wwsq 1 COMMITA Ends a transaction by writing to the database any changes made> during that transaction. COMMIT also releases all locks and closes open streams.? The COMMIT statement affects all open databases, all changesE to data made with Oracle Rdb data manipulation statements, and allC changes to data definitions made with Oracle Rdb data definition statements. Example:& RDO> START_TRANSACTION READ_WRITE0 RDO> FOR J IN JOBS WITH J.JOB_CODE = "PLMR" cont> ERASE J cont> END_FOR RDO> COMMIT 2 MoreD If you have invoked a database, you have the necessary privileges to use the COMMIT statement.C Because the COMMIT statement closes open streams, you should notD use an explicit END_STREAM statement after a COMMIT statement. If/ you do, Oracle Rdb returns an error message. 2 FormatQ (B)0COMMIT qwqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqwwqqqqqqq>qqqqqqwq>L mq> (TRANSACTION_HANDLE qq> var) qjmq> on-error qqj 3 TRANSACTION_HANDLE@ A keyword followed by a host language variable. A t ransactionB handle identifies each instance of a transaction. If you do notD declare the transaction handle explicitly, Oracle Rdb attaches an* internal identifier to the transaction.: In Callable RDO, use !VAL as a marker for host language variables.B You can put parentheses around the host language variable name.A Normally, you do not need to use this argument. The ability toB declare a transaction handle is provided for compatibility with= other database products and future releases of Oracle Rdb. 3 on-errorE Specifies host language statements or Oracle Rdb data manipulationE statements to be performed if an Oracle Rdb error occurs. For more% details, request HELP on ON_ERROR. 2 Examples The examples show:; o How to use COMMIT when modifying data in the database6 o How to use COMMIT when creating data definitions 3 ModifyingC This example makes a change to a relation and writes that change to the database:9 DISPLAY "Enter employee's ID number: " <-- 1 WITH NO ADVANCING. ACCEPT ID.9 DISPLAY "Percentage increase: " <-------- 2 WITH NO ADVANCING. ACCEPT PERC.' CALL "SYS$GETTIM" USING TODAY0 GIVING RETURN_VALUE.9 &RDB& START_TRANSACTION READ_WRITE <---------- 3) &RDB& RESERVING SALARY_HISTORY FOR &RDB& PROTECTED WRITE! &RDB& FOR S IN SALARY_HISTORY9 &RDB& WITH S.EMPLOYEE_ID = ID AND <---------- 4" &RDB& S.SALARY_END MISSING9 &RDB& MODIFY S USING <---------- 5 &RDB& ON ERROR" GO TO ERROR-PAR &RDB& END_ERROR &RDB& S.SALARY_END = TODAY &RDB& END_MODIFY9 &RDB& STORE NEW IN SALARY_HISTORY USING <----- 6 &RDB& ON ERROR! GO TO ERROR-PAR &RDB& END_ERROR. &RDB& NEW.EMPLOYEE_ID = S.EMPLOYEE_ID;! &RDB& NEW.SALARY_AMOUNT =# &RDB& ( S.SALARY_AMOUNT *) &RDB& ( 1 + ( PERC / 100 ) ) );& &RDB& NEW.SALARY_START = TODAY &RDB& END_STORE &RDB& END_FOR9 &RDB& COMMIT <------------------------ 7D This program fragment gives a raise to an employee. To maintain a= consistent database, it performs the following operations:9 1. Prompts for an employee identification number (ID).C 2. Prompts for a percentage incre ase, which is used to calculate INCREASE.> 3. Starts a read/write transaction. This statement uses theC RESERVING clause to protect the SALARY_HISTORY record againstA conflicting updates, while allowing users access to all the& other relations in the database.C 4. Establishes a record stream consisting of the current SALARY_0 HISTORY record for the specified employee.B 5. Uses MODIFY to change the current salary record, by changing8 its date fro m missing to the current date (TODAY).@ 6. Uses STORE to create a new SALARY_HISTORY record. Although> this statement executes within the record stream defined@ by the FOR loop, it must declare a new context variable to? identify the new record. All the fields of the new recordA can be derived from fields of the old one, except the startF date, which must be calculated from the current date. Oracle RdbB calculates NEW.SALARY_AMOUNT from the S.SALARY_AMOUNT, using/ the specified percentage increase (PERC).@ 7. Uses COMMIT to make the changes permanent to the database.B Note that each data manipulation statement provides an ON ERROR> clause. If an error occurs at any point in the transaction,D control transfers to another paragraph, which contains a ROLLBACKB statement. Therefore, this set of operations is never partially completed. 3 DefiningA This example shows how to use COMMIT to make a data definition permanent:$ RDO> DEFINE DATABASE 'INVENTORY'. RDO> SHOW DATABASES6 Database with db_handle INVENTORY in file INVENTORY0 RDO> DEFINE FIELD PART DATATYPE TEXT SIZE 10. RDO> DEFINE RELATION TEST. cont> PART. cont> END TEST RELATION. RDO> RDO> COMMIT RDO> SHOW RELATIONS6 User Relations in Database with db_handle INVENTORY TEST RDO> SHOW FIELDS3 User Fields in Database with db_handle INVENTORY9 PART text size is 10 RDO> EXIT> This example shows how to define a database, a field, and a> relation. These statements would normally be in an indirectB command file. After you define the database and its components,C the COMMIT statement makes the database permanent. If you do not8 issue the COMMIT statement, RDO returns this message:: There are uncommitted changes to a database or the dataC dictionary Would you like a chance to COMMIT these changes [NO]? ww0 1 Cond_expr= An expression, sometimes called a Boolean expression, thatA represents the relationship between two value expressions. TheD value of a conditional expression is either true, false, or null.= Conditional expressions can be combined with AND and OR or@ qualified with NOT. The AND, OR, and NOT operators are called logical operators. 2 Format (B)0conditional-expr = K qqwqqq> conditional-expr qq> AND qq> conditional-expr qqqwq q>H tqqq> conditional-expr qq> OR qqq> conditional-expr qqquF tqqqqqqqqqqqqqqqqqqqqqqqq> NOT qq> conditional-expr qqquC tqqq> value-expr qq> operator qq> value-expr qqqqqqqqu? tqqq> any-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu? tqqq> between-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu? tqqq> containing-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu? tqqq> matching-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu? tqqq> missing-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu? tqqq> starting-with-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqu? mqqq> unique-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj 3 value-exprF For a complete description of Oracle Rdb value expressions, ask for HELP on Value_expr. 3 ANY (B)0any-clause = 3 qqqqwqqq>qqqqqqqqwqq> ANY qqq> rse qqq> mqqq> NOT qqqj< The condition containing ANY is true if the record streamA specified by the record selection expression (RSE) includes atC least one record. If you add NOT, the condition is true if there' are no records in the record stream. 3 BETWEEN (B)0between-clause = @ qqqq> value-expr qqqqwqqq>qqqqqqwqqq> BETWEEN qqqqk> mqq> NOT qqj x7 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj@ mqqq> value-expr qqq> AND qqq> value-expr qqqqqqq>> The condition containing BETWEEN is true if the first valueC expression is between the second and the third value expressions or equal to one of them. 3 CONTAINING (B)0containing-clause = P qqq> value-expr qqqwqqqqq>qqqqwqq> CONTAINING qqq> value-expr qqq>) mqq> NOT qqj= With CONTAINING, the condition is true if the second valueA expression is found within the first. In most cases, the valueC expressions in a CONTAINING clause evaluate to text strings, but2 CONTAINING also operates on numeric data types.& NOTEB CONTAINING is not case sensitive; it considers uppercase and7 lowercase forms of the same letter to be a match.? If either of the value expressions in a CONTAINING clause is null, the result is null. 3 MATCHING (B)0matching-clause = N qqq> value-expr qqqwqqqqq>qqqqwq> MATCHING qqq> match-expr qqqq>) mqq> NOT qqj? With MATCHING, the condition is true if the match expression< matches the value expression. MATCHING uses the following symbols:2 * Matches any string of zero or more characters! % Matches any single character& NOTE@ MATCHING is not case sensitive; it considers uppercase and7 lowercase forms of the same letter to be a match.< If either of the expressions is null, the result is null. 3 MISSING (B)0missing-clause = ? qqq> db-field qqqqqqqqwqqqq>qqqqqwqq> MISSING qqq>- mqq> NOT qqj? This condition is true if the value specified by db-field is missing. 3 STARTING_WITH (B)0starting-with-clause = Z qqq> value-expr qqqwqqqqq>qqqqqwqq> STARTING WITH qqq> value-expr qq>* mqq> NOT qqqjB If a condition contains STARTING WITH, the condition is true if@ the first chara cters of the first string expression match theA second string expression. In most cases, the value expressionsC in a STARTING WITH clause evaluate to text strings, but STARTING, WITH also operates on numeric data types.& NOTEA STARTING WITH is case sensitive; it considers uppercase and9 lowercase forms of the same letter to be different.C If either of the string expressions in a STARTING WITH clause is null, the result is null. 3 UNIQUE (B)0unique-clause = 6 qqqqqqwqqq>qqqqqwq> UNIQUE qqq> rse qqq> mqq> NOT qj? The condition containing UNIQUE is true if the record streamA specified by the RSE includes only one record. If you add NOT,@ the condition is true if there is more than one record in the/ record stream or the record stream is empty. ww[ 1 CONVERTC The RDO CONVERT statement is obsolete in Oracle Rdb. It has been'  replaced by the RMU/CONVERT command. ww1 CREATE_SEGMENT6 Allows you to store segments in a segmented string.< Storing into a segmented string field requires two steps:* o Storing the segments into the string0 o Storing the string field into the relationD See the Examples subtopic for an example of storing segments in a segmented string. 2 MoreD If you have invoked a database, you have the necessary privileges0 to use the CR EATE_SEGMENTED_STRING statement.( You cannot modify a segmented string.A When using the RDML and RDBPRE precompilers, be sure to defineA a sufficiently large value for the RDMS$BIND_SEGMENTED_STRING_B BUFFER logical name. An adequate buffer size is needed to store@ large segmented strings (using segmented string storage maps)C in storage areas other than the default RDB$SYSTEM storage area.C The minimum acceptable value for the RDMS$BIND_SEGMENTED_STRING_@ BUFFER logica l name must be equal to the sum of the length ofA the segments of the segmented string. For example, if you knowC that the sum of the length of the segments is one megabyte, then@ 1,048,576 bytes is an acceptable value for this logical name.@ You must specify the logical name value because when RDML andC RDBPRE precompilers store segmented strings, Oracle Rdb does not> know which table contains the string until after the entireD string is stored. Oracle Rdb buffers the entire  segmented string,? if possible, and does not store it until the STORE statement executes.@ If the segmented string remains buffered, it is stored in theC appropriate storage area. If the string is not buffered (becauseB it is larger than the defined value for the logical name or theB default value of 10,000 bytes), it is not stored in the defaultA storage area and the following exception message is displayed:3 %RDB-F-IMP_EXC, facility-specific limit exceededC -RD MS-E-SEGSTR_AREA_INC, segmented string was stored incorrectlyA To avoid this error, set the value of the RDMS$BIND_SEGMENTED_A STRING_BUFFER logical name to a sufficiently large value. NoteA that a value of up to 500 MB can be specified for this logical name.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.@ In order to store the seg ments into the segmented string, theA string must have a name. The CREATE_SEGMENTED_STRING statementC initializes a segmented string and gives it a handle, so you can@ store segments into the field. After you are finished storingD segments, you store the entire field into the relation, using theC handle to relate the newly built string to the field in which itB belongs. Finally, you use the END_SEGMENTED_STRING statement to$ close the block. See the example. 2 FormatC (B)0CREATE_SEGMENTED_STRING qqwqqqqqqqq>qqqqqqqqwqk5 mq> db-handle . qqj x3 lqqqqqqqqqqqqqqqqqqqq ss-handle qqqwqqqqqqq>qqqqqqwqqqqqq>& mq> on-error qqj 3 on-errorE Specifies host language statements or Oracle Rdb data manipulationE statements to be performed if an Oracle Rdb error occurs. For more) information, ask for HELP on ON_ERROR. 3 ss-handleB A h ost language variable or name used to refer to the segmented string. 3 db-handleB A host language variable or name used to refer to the database.D You can specify a database handle as part of the segmented string5 handle if you have invoked more than one database. 2 Examples Example 1:3 The following example stores a segmented string:) START_TRANSACTION READ_WRITE RESERVING RESUMES FOR EXCLUSIVE WRITE !9 ! Start a stream of segments. Give  the stream a name. !( CREATE_SEGMENTED_STRING RESUME_HANDLE !% ! Store the segments in the field. !# STORE SEG IN RESUME_HANDLE USING SEG.RDB$VALUE =7 "This is the first line of an employee's resume." END_STORE !# STORE SEG IN RESUME_HANDLE USING SEG.RDB$VALUE =8 "This is the second line of an employee's resume." END_STORE !# STORE SEG IN RESUME_HANDLE USING SEG.RDB$VALUE =7 "This is the third line of an employ ee's resume." END_STORE !# STORE SEG IN RESUME_HANDLE USING SEG.RDB$VALUE =8 "This is the fourth line of an employee's resume." END_STORE !6 ! Store the segmented string field in the relation. ! STORE R IN RESUMES USING R.EMPLOYEE_ID = "00164"; R.RESUME = RESUME_HANDLE END_STORE !% END_SEGMENTED_STRING RESUME_HANDLE COMMITA This sequence of statements demonstrates the steps required to store a segmented string: ? o CREATE_SEGMENTED_STRING starts a "stream" so that you canD store the segments into the field. The segmented string handle gives the stream a name.C o Each segmented string STORE statement stores a text string inB a segment. The context variable SEG relates the values being stored to the stream.A o The final STORE statement stores the segmented string fieldD into the relation, along with the other field, ID_NUMBER. NoteC that this STORE us es the segmented string handle as the value) expression in the STORE assignment.C In most cases, this set of statements would be part of a program> that reads lines from a text file and stores each line in a) segment of the segmented string field. Example 2; The following program reads a file and loads it into theA specified employee's RESUMES record in the PERSONNEL database. program STORE_RESUME ! ! STORE RESUME> ! This program reads a file a nd loads it into the specified8 ! employee's RESUMES record in the PERSONNEL database !! option type = EXPLICIT7 declare long constant TRUE = -1%, FALSE = 0%D declare &D string &D employee_id, resume_file, text_line, &D last_name, first_name, &D long  &$ found, line_count5 &RDB& INVOKE DATABASE FILENAME "DB$:PERSONNEL31". print "** Personnel RESUME Load **" when error in5 input "Enter EMPLOYEE_ID"; employee_id use) print "Program terminated"# continue END_PROGRAM end when' &RDB& START_TRANSACTION READ_WRITE> &RDB& FOR E IN EMPLOYEES WITH E.EMPLOYEE_ID = employee_id &RDB& GET+ &RDB& last_name = E.LAST_NAME;- &RDB& first_name = E.FIRST_NAME; &RDB& END_GET found = TRUE &RDB& END_FOR if not found thenE print "Error - employee " + employee_id + " not found" exit program else !+ ! Display the employees name !D print "Loading RESUME for employee " + &> TRM$(first_name) + ", " + TRM$(last_name) !8 ! Read the name of the resume source file ! GET_NAME: when error inB input "Enter the resume file name"; resume_fileD open resume_file for input as file #1, &> organization sequential, recordtype ANY use$ if err = 11% then1 print "Program terminated"+  continue END_PROGRAM else= print "Error - " + RIGHT(ERT$(err),2%)( continue GET_NAME end if end when* &RDB& CREATE_SEGMENTED_STRING RES !C ! Loop and read each line from the resume, and store+ ! it in the segmented string ! line_count = 0%, while TRUE ! indefinite loop  when error in+ linput #1, text_line use# continue EOF end when. text_line = TRM$(text_line)/ line_count = line_count + 1%' &RDB& STORE R IN RES USING/ &RDB& R.RDB$VALUE = text_line;4 &RDB& R.RDB$LENGTH = LEN(text_line) &RDB& END_STORE next EOF: close #1:  print line_count; "lines stored in resume."( &RDB& STORE RS IN RESUMES USING0 &RDB& RS.EMPLOYEE_ID = employee_id;" &RDB& RS.RESUME = RES &RDB& END_STORE' &RDB& END_SEGMENTED_STRING RES end if &RDB& commit &RDB& finish END_PROGRAM: end program wwr 1 DATABASE Request HELP on INVOKE. wwX 1 DatatypesC This table summarizes the charact eristics of the Oracle Rdb data types." Table 1 : Oracle Rdb Data TypesB Oracle Rdb Corresponding Size Range OtherD Data Type CPU Data Type Precision ParametersE SIGNED Signed byte 8 bits -128 to n = scaleB BYTE integer 127 factorE SIGNED Signed word 16 bits -32768 to n = scaleB WORD integer 32767 factor E SIGNED Signed 32 bits -2**31 to n = scaleB LONGWORD longword (2**31)-1 factor integerE SIGNED Signed 64 bits -2**63 to n = scaleB QUADWORD quadword (2**63)-1 factor integer)C F_FLOATING F_floating 32 bits 0.29 x 10**(-38) None: Single to 1.7 x 10**388 precision  Approximately8 floating seven decimal1 point number digitsC G_FLOATING G_floating 64 bits 0.56 x 10**(-308) None; Extended to 0.9 x 10**3088 precision Approximately5 floating 15 decimal1 point number digitsC DATE Absolute date 64 bits Not None5  and time applicableJ TEXT ASCII text n bytes 0 to 32767 n = number ofG characters charactersF (unsignedE integer)H VARYING Varying Varies 0 to 32765 n = maximumF STRING length ASCII characters number ofG  text charactersF (unsignedE integer)C SEGMENTED None Varies 0 to 64k None4 STRING bytes per2 segmentH Note: For more information on SEGMENTED STRINGS, request HELP on Segment_str.  2 More: When defining fields using the F_FLOATING data type andD subsequently comparing a literal value (for example, 99.999) in aB query with the field values, you must specify the literal valueB in scientific notation (for example, 99.999E0) for the query toC work. In this way, Oracle Rdb can compare the F_FLOATING literalB value in the query with the F_FLOATING values for the field forC each record. This is a clarification of information described in the RDO documentati on.@ For example, if you try to compare field values defined as F_D FLOATING data type with the literal 99.999, Oracle Rdb interpretsC the literal 99.999 as a LONGWORD scale -3, and converts both theC literal and the F_FLOATING field values to G_FLOATING values forB the comparison. This is required because the precision of an F_B FLOATING data type is insufficient for all LONGWORD values. TheA problem arises in the conversion from F_FLOATING to G_FLOATINGA data type values. Because the precision of the F_FLOATING dataC type is smaller than that of the G_FLOATING data type, the rules@ for the conversion do not assure that an F_FLOATING data type@ value of 99.999 and a LONGWORD data type value of 99.999 will> be the same when both are converted to G_FLOATING data typeG values. If you do a comparison with the literal 99.999E0, Oracle RdbA interprets this value as an F_FLOATING data type value and the@ comparison works as expected. The following query returns theC desired result when the field COUPON is defined as an F_FLOATING data type. FOR A IN SECURITY# WITH A.COUPON = 99.999E0 PRINT A.ID END_FOR ww1 Data_DistributorC The Data Distributor product was recently purchased from DigitalB Equipment Corporation by Oracle Corporation. The Product is nowC called Replication Option. For help, enter REPLICATION_OPTION at the prompt.; Note that because the sale of this product was concludedB recently, the software and documentation may still contain some references to the old name. ww 1 DCL_invoke' Gives access to DCL from inside RDO.> The dollar sign ($) instructs RDO to spawn a subprocess andC pass the next keyword to DCL for processing. You must follow theC dollar sign with a DCL command. After DCL processes the command,< it logs out of the subprocess and returns control to RDO. Example:$ RDO> $ MAIL MAIL> Format $ dcl-command 2 MoreC You need no special Oracle Rdb privileges to use this statement. 2 Example* Show current default OpenVMS directory: RDO> $ DIRECTORY Directory DISK2:[DEPT3.ACCT]A DEFPRO.RDO;6 NOTEQUAL.RDO;1 QUERY.RDO;1 REFEXAM.RDO;12 STORE.RDO;1 UPDATE.RDO;2 Total of 6 files. RDO> ww1 DECLARE_STREAMC Declares a stream and is thereby  able to associate a stream nameA with its RSE. This provides Oracle Rdb with the context neededA to place the elements of the START_STREAM...FETCH...END_STREAM6 construct across a programming module in any order. Example:+ DECLARE_STREAM CURRENT_INFO_STREAM USING6 CI IN CURRENT_INFO SORTED BY DESCENDING CI.SALARY 2 MoreD If you have invoked a database, you have the necessary privileges' to use the DECLARE_STREAM statement.D Use the DECLARE_STREAM stat !ement in conjunction with the declared@ START_STREAM statement. The DECLARE_STREAM statement will notB work in conjunction with the undeclared START_STREAM statement.E Rdb recommends that all programs use the DECLARE_STREAM statement H (with the declared START_STREAM statement) instead of the undeclared H START_STREAM statement. The declared START_STREAM statement provides B all the functions of the undeclared START_STREAM statement and @ provides more flexibility in programmin "g than the undeclared  START_STREAM statement.B Put the DECLARE_STREAM statement before the associated declared2 START_STREAM, FETCH, and END_STREAM statements.? The DECLARE_STREAM statement allows the use of fewer or more@ END_STREAM statements than START_STREAM statements within theC same module, as long as at execution time exactly one END_STREAM9 statement is executed for each START_STREAM statement.F RDO does not allow a record stream from which data values canno #t beJ fetched by DBKEY (views that retrieve values from streams defined usingE the SQL GROUP BY or UNION clauses) to be declared or started. Such, attempts produce the following exception:A VWNOFETCH view 'view-name' cannot be fetched within a stream 2 FormatW (B)0DECLARE_STREAM qwqqqqqqqqqqq>qqqqqqqqqwq> declared-stream-name qkG mqq> handle-options qqj xE lqqqqqqqqqqqqqqqqqqqqqqqqqq USING qqqqqqqqqq> rse qqqqqqqqqqqqqqqqqqqqqq> 3 handle-options (B)0handle-options = U qq> ( qwq> REQUEST_HANDLE qqq> var qqqqqqqqqqqqqqqqqqqqqqqqqqqwq> ) qq>M tq> TRANSACTION_HANDLE qqq> var qqqqqqqqqqqqqqqqqqqqqqquV mq> REQUEST_HANDLE q> var , TRANSACTION_HANDLE q> var qj 4 REQUEST_HANDLEC A keyword followed by a host language variable. A request% handleB points to the location of a compiled Oracle Rdb request. If youE do not supply a request handle explicitly, Oracle Rdb associates aA default request handle with the compiled request. You must useC a request handle when you want to make an identical query to two different databases.: In Callable RDO, use !VAL as a marker for host language variables.B You can put parentheses around the host language variable name. 4 TRANSACTION_HANDLE@ A keyword f &ollowed by a host language variable. A transactionB handle identifies each instance of a transaction. If you do notD declare the transaction handle explicitly, Oracle Rdb attaches an* internal identifier to the transaction.: In Callable RDO, use !VAL as a marker for host language variables.B You can put parentheses around the host language variable name.A Normally, you do not need to use this argument. The ability toB declare a transaction handle is provided for compat'ibility with= other database products and future releases of Oracle Rdb. 3 declared-stream-nameB A name you give to the stream you declare. The stream name must be a valid OpenVMS name. 3 rseD A record selection expression. A phrase that defines the specificA conditions that individual records must meet before Oracle Rdb$ includes them in a record stream. 2 ExampleB The following example declares a record stream named EMP_STREAM in RDO:( RDO> ( DECLARE_STREAM EMP_STREAM USING= cont> E IN EMPLOYEES SORTED BY E.LAST_NAME, E.FIRST_NAME ww 1 DEFINED HELP is available for the following Oracle Rdb DEFINE statements:7 o DEFINE COLLATING_SEQUENCE (type DEFINE_COLLATING) o DEFINE CONSTRAINT o DEFINE DATABASE o DEFINE FIELD o DEFINE INDEX o DEFINE PROTECTION o DEFINE RELATION o DEFINE STORAGE MAP o DEFINE TRIGGER o DEFINE VIEW@ How)ever, to get HELP on any of these DEFINE statements at the@ "Topic?" prompt, include an underscore between DEFINE and theD item on which you want information displayed. For example, to getD HELP on the DEFINE FIELD statement, type either of the following: Topic? DEFINE_FIELD RDO> HELP DEFINE_FIELD? To get HELP on the Replication Option DEFINE statements, see7 the entries under the main topic Replication_Option. ww1 DEFINE_COLLATINGA * The DEFINE COLLATING_SEQUENCE statement identifies a collating< sequence that has been defined using the OpenVMS NationalA Character Set (NCS) Utility. Use the DEFINE COLLATING_SEQUENCED statement to identify collating sequences other than the database? default collating sequence that you plan to use with certain@ global fields. (The default collating sequence for a database< is established by the COLLATING_SEQUENCE IS clause in theA DEFINE DATABASE statement; if you omit that+ clause at database3 definition time, the default sequence is ASCII.)D You must enter a DEFINE COLLATING_SEQUENCE statement specifying aC collating sequence before you enter the name of that sequence in# any of the following statements:' o DEFINE FIELD...COLLATING_SEQUENCE' o CHANGE FIELD...COLLATING_SEQUENCE? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a rea,d/write transaction implicitly.B Other users are allowed to be attached to the database when you1 issue the DEFINE COLLATING_SEQUENCE statement. 2 FormatE (B)0DEFINE COLLATING_SEQUENCE sequence-name qqk. lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqk? mq> DESCRIPTION IS qq> /* text */ qj x/ lqqqqqqqqqqqqqqqq ncs-name qwqqqqqqqqqqqq>qqq-qqqqqqqwqq> .< mq> FROM library-name qqj 3 sequence-nameB Specifies the name by which the collating sequence named in theA ncs-name argument will be known to the database. The sequence-/ name and ncs-name arguments can be the same. 3 text@ Adds a comment about the collating sequence. RDO displays the= text when it executes a SHOW COLLATING_SEQUENCE statement. 3 ncs-name@ Specifies the name of a collating sequence in t.he default NCSD library, SYS$LIBRARY:NCS$LIBRARY, or in the NCS library specifiedD by the argument library-name. You can view the collating sequence4 names by using the command NCS/LIST at DCL level.B The collating sequence can be either one of the pre-defined NCSB collating sequences or one that you have defined yourself using NCS. 3 library-nameC Specifies the name of an NCS library other than the default. The2 default NCS library is SYS$LIBRARY:NCS$LIBRARY. /2 More= To define a collating sequence using the DEFINE COLLATING_D SEQUENCE statement, you must have the Oracle Rdb DEFINE privilege for the database.? The DEFINE COLLATING_SEQUENCE statement is the first step in? specifying an alternate collating sequence. After you define> the collating sequence, you must specify that it will apply> to a particular field or database. The following list shows> abbreviated forms of the statements that will associate the: collati0ng sequence with a particular field or database:8 o DEFINE FIELD ... COLLATING_SEQUENCE sequence-name;; o DEFINE DATABASE ... COLLATING_SEQUENCE sequence-name;2 o IMPORT ... COLLATING_SEQUENCE sequence-name;> Use the complete form of the following statement to alter a@ collating sequence after you have associated it with a field:8 o CHANGE FIELD ... COLLATING_SEQUENCE sequence-name; 2 Examples; The following example creates a collating sequence using? 1 the pre-defined collating sequence FRENCH. It then shows theB defined collating sequence by using the SHOW COLLATING_SEQUENCE statement:/ RDO> INVOKE DATABASE FILENAME 'MF_PERSONNEL'0 RDO> DEFINE COLLATING_SEQUENCE FRENCH FRENCH.S %RDO-W-NOCDDUPDAT, database invoked by filename, the data dictionary will not be updated RDO> ! RDO> SHOW COLLATING_SEQUENCEB User Collating Sequences in Database with filename mf_personnel FRENCH ww21 DEFINE_CONSTRAINTA Creates a constraint for a relation or relations. A constraintA defines a set of conditions that restrict the values stored inD relations. When you store and modify field values, the constraintC checks the validity of the values and generates an error message! if the constraint is violated. Example:2 RDO> DEFINE CONSTRAINT EMPLOYEE_ID_REQUIRED cont> FOR E IN EMPLOYEES/ cont> REQUIRE E.EMPLOYEE_ID NOT MISSING. 2 MoreF 3 To define a constraint, you must have Oracle Rdb READ access to theE database and Oracle Rdb READ and DEFINE access to all relations to which the constraint refers.@ When the DEFINE CONSTRAINT statement executes, the constraint< definition is added to the physical database. If you haveC invoked the database using the PATHNAME argument, the constraint4 definition is also stored in the data dictionary.> The DEFINE CONSTRAINT statement includes a record selectionA expre 4ssion. Therefore, it is more flexible for checking values2 on input than the VALID IF clause. For example:C o VALID IF must be part of a DEFINE FIELD statement. Therefore,A a VALID IF criterion applies to all the fields that use theA definition. You can define a constraint that refers to onlyB one of several relations that use a global field definition.C o VALID IF refers only to a range of literal values. You cannotC use VALID IF to check a value against va 5lues of fields storedC in the database. With DEFINE CONSTRAINT, you can check valuesD from one relation against other database values, either in the same or another relation.C o You can use DEFINE CONSTRAINT to check for such conditions as. existence, uniqueness, and nonexistence.G Oracle Rdb evaluates constraints by validating existing data againstD the RSE specified by the constraint. If there is no existing dataE for Oracle Rdb to validate, the constra 6int will be defined without being evaluated.B Oracle Rdb evaluates constraints at definition time; therefore,? you cannot define a new constraint that violates an existing constraint.= You can also specify that a constraint be checked when the? STORE or MODIFY statement executes (CHECK ON UPDATE) or when@ the COMMIT statement executes (CHECK ON COMMIT). In this way,C you can include interlocking constraints. For example, you mightB define two constraints to ensur 7e that a department cannot existA without employees and an employee must belong to a department.B However, if these two constraints were checked on UPDATE, thereC would be no way to create a new department. Instead, they shouldB be checked on COMMIT. You can then create a department and giveD it members inside a single transaction, and check the constraints2 when the COMMIT statement ends the transaction.> You can define a constraint only after you have invoked the& databas8e. See the INVOKE statement.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you) issue the DEFINE CONSTRAINT statement. 2 Format? (B)0DEFINE CONSTRAINT qqqqq> name qqqqk& lqqqqqqqqqqqqqqqqqqqqqqqqqqqj6 mqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqq 9qqqqqqqwqqqqk? mq> DESCRIPTION IS /* text */ qqqqj x6 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj( mqqq FOR qqq> rse qqqk lqqqqqqqqqqqqqqqqqqqqj< mqq> REQUIRE qqq> conditional-expr qqqqqqk3 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj7 mqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqq> .> mq> CHECK ON qqwqqq> COMMIT qqwqqj4 mqqq> UPDATE qqj: 3 name< The name of the constraint that you can refer to in other8 statements. When choosing a name, follow these rules:; o Use a name that is unique among all constraint names.C o Use any valid OpenVMS name. However, the name cannot end in a( dollar sign ($) or underscore (_)./ o Do not use any Oracle Rdb reserved words. 3 textA A text string that adds a comment to the field definition. You> can apply the description to the entire relation de;finition? using the DESCRIPTION keyword. You can also apply a separate> description to each field using the text markers before the$ DEFINE, CHANGE, or DELETE clause. 3 rseD A record selection expression that defines which records of which' relations the constraint applies to. 3 conditional-expression? A conditional expression that describes the constraint to beC placed on the records and relations defined by the RSE. For moreE information on Oracle Rdb con<ditional expressions, ask for HELP on Cond_expr. 3 CHECK? Specifies whether the constraint is to be evaluated when you= issue a statement such as STORE or MODIFY that updates the? relation (UPDATE), or when you issue the COMMIT statement toC write the change to the database (COMMIT). You can override this@ qualifier with the EVALUATING clause of the START_TRANSACTION$ statement. The default is UPDATE. 2 Example@ Check for the existence of a field value in= another relation:% DEFINE CONSTRAINT DEPT_CODE_EXISTS FOR JH IN JOB_HISTORY( REQUIRE ANY D IN DEPARTMENTS WITH. D.DEPARTMENT_CODE = JH.DEPARTMENT_CODE.@ The ANY operator is equivalent to saying "there exists". This? constraint therefore means "For every record in JOB_HISTORY,> require that there exists a record in DEPARTMENTS where the! DEPARTMENT_CODE values match." ww1 DEFINE_DATABASEB Creates a database file, specifies its >name, and determines itsD physical characteristics. This statement also creates a directory= in the data dictionary where definitions of other database elements can be stored." Example (single-file database):$ RDO> DEFINE DATABASE 'PERSONNEL'. 2 MoreD By using the RDBVMS$CREATE_DB logical name and the RDBVMS$CREATE_: DB identifier, you can restrict the ability of users to? create databases on your system. For more information on the@ RDBVMS$CREATE_DB logica?l name and identifier, see the chapterF on defining database protection in the Oracle Rdb Guide to Database Design and Definition manual.D If your system does not use the RDBVMS$CREATE_DB logical name andA identifier, all users on the system have the ability to create databases.; When the DEFINE DATABASE statement executes, Oracle Rdb:D o Creates a database file, a snapshot file, and, if the database' is multifile, storage area files.B o Creates a data dic@tionary entity for the database, including? all the system fields and relations, if the dictionary is installed.: o Assigns database parameters, and, if the database is) multifile, storage area parameters., o Creates a default access control list.A o Invokes the newly created database, using the database file" name as the database handle.D You cannot issue the DEFINE DATABASE statement when a transactionA is active. Do not issue an INVOKE DATABASE Astatement after youE use DEFINE DATABASE. Oracle Rdb automatically invokes the database$ after creating the database file.B Other users are not allowed to be attached to the database when+ you issue the DEFINE DATABASE statement.I For Oracle Rdb for OpenVMS Alpha, RDO generates an error if you defineD the CDDSHR logical name as NL: as shown in the following example:  $ DEFINE CDDSHR NL: $ RDO RDO> DEFINE DATABASE RENTALS.H -RDO-F-CDDERR, error occurred durin Bg CDD signin, CDD will not be used$ -LIB-E-READERR, error reading !ASJ If CDDSHR is defined as NL:, use the DCL command SHOW LOGICAL CDDSHR_TVK to check that the CDDSHR_TV logical name is also defined as NL:. OracleG Rdb recommends that you do not define CDDSHR as NL:. If you want toK avoid using the dictionary, specify the DICTIONARY IS NOT USED clause on. the RDO IMPORT or DEFINE DATABASE commands. 2 FormatT (B)0DEFINE DATABASE qq> file-spec q Cqwqqqqqqqqqqq>qqqqqqqqwqk= mq> invoke-options qqj x; lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqwqqqqqqqqqqqq>qqqqqqqqqqqqwqqkF x tqq> db-wide-options-1 qu x mq> storage-area-options qj xD x mqq> db-wide-options-2 qqj x xB mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqwqwq> .D xtq> define-storage-area-clause qqqqqqqqqqqqqqqq>qqqqqqqqqqu x` xmq> SEGMENTED STRING STORAGE AREA IS q> storage-area-name j xB mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq default directory. In a single-file database, the file name1 specified becomes the file name for two files:6 o The database file. The default file type is RDB.B o The snapshot file. This file is used as a temporary file for; read-only transactions. The default file type is SNP.? Type the name of the file-spec in uppercase letters when you= define your database if you use the d Fata dictionary or mayA use it in the future. If you type the name of the file-spec inA lowercase letters and try to use the DEFINE GENERIC command ofB the dictionary's CDO utility to create a directory name for the5 database in the dictionary, the command will fail.D In a multifile database, the file name specified becomes the file name for three files:; o The database root file. The default file type is RDB.B o The default storage area file. The default file typeG is RDA.4 o A snapshot file. The default file type is SNP. 3 invoke-options (B)0invoke-options = G qqwqqqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqq>@ tqqqqq> DB_HANDLE IS qqqqqqq> db-handle qqqqqqquJ mqqqqq> DBKEY SCOPE IS qqwqq> COMMIT qqqwqqqqqqj5 mqq> FINISH qqqj 4 db-handleB The name of the variable you will use to refer to the database., Do not use a fiHle name for the db-handle. 4 COMMIT< When the DBKEY SCOPE IS COMMIT clause is specified with a> DEFINE DATABASE statement, this means that the database keyA (dbkey) of each record used is guaranteed not to change duringA each transaction. That is, if a record is erased, its dbkey isC guaranteed not to be reused by another database user until after" a COMMIT statement is executed. 4 FINISHC When the DBKEY SCOPE IS FINISH clause is specified with a DEFINE? D IATABASE statement, this means that the database key (dbkey)< of each record used is guaranteed not to change until the@ user detaches from the database (usually, by using the FINISH statement). 3 db-wide-options-1 (B)0db-wide-options-1 = Q qqwq> IN qqqqqq> path-name qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqP tq> COLLATING_SEQUENCE IS sequence-name qqk xG x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj J xI x mqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq> ncs-name qqk xP x mq> DESCRIPTION IS qq> /* text */ qqj x xG x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj xG x mqwqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquP x mq> FROM library-name qqj xP tq> DESCRIPTION IS qqqqqqq> /* text */ qqqqqqqqqqqqqqqqqqqqqqqqqquW tq> NUMBER OF U KSERS IS qq> number-users qqqqqqqqqqqqqqqqqqqqqqqqquW tq> NUMBER OF BUFFERS IS qqqqq> number-buffers qqqqqqqqqqqqqqqqqqu^ tq> NUMBER OF qqwqq> CLUSTER qqqqwq> NODES IS qq> number-nodes qquN x mqq> VAXCLUSTER qj x^ tq> NUMBER OF RECOVERY BUFFERS IS qqq> recovery-buffers qqqqqqqqquI mq> global-buffer-params qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj L4 path-name= The data dictionary path name for the dictionary path nameA where the database definition is stored. Use this qualifier toC store the data dictionary definitions for the database in a dataB dictionary entity other than the default path, which is defined$ by the name of the database file. 4 COLLATING_SEQUENCEB Specifies a collating sequence to be used for all fields in the? database. Sequence-name is a name of your choosing; use this@ sequence-name in Many subsequent statements that refer to this collating sequence.< The OpenVMS National Character Set (NCS) Utility provides= a set of pre-defined collating sequences and also lets youA define collating sequences of your own. The COLLATING_SEQUENCEA clause accepts both pre-defined and user-defined NCS collating sequences.C If you do not specify a collating sequence, the default is ASCII7 (shown as "no collating sequence" in some displays). 4 ncs-name@ Spe Ncifies the name of a collating sequence in the default NCSD library, SYS$LIBRARY:NCS$LIBRARY, or in the NCS library specified? by the argument library-name. (In most cases, it is probablyC simplest to make the sequence-name the same as the ncs-name: forB example, COLLATING_SEQUENCE IS FRENCH FRENCH.) You can view the@ collating sequence names by using the command NCS/LIST at DCL level.B The collating sequence can be either one of the pre-defined NCSB collating sequences oOr one that you have defined yourself using NCS. 4 text@ Provides a comment for a collating sequence or database being defined. 4 library-nameC Specifies the name of an NCS library other than the default. The2 default NCS library is SYS$LIBRARY:NCS$LIBRARY. 4 number-usersD The maximum number of users allowed to access the database at oneA time. The default is 50 users. The largest number of users you< can specify is 2032, and the fewest number ofP users is 1. 4 number-buffersD The number of buffers Oracle Rdb allocates per process using thisA database. Specify an unsigned integer between 2 and 32768. The default is 20 buffers. 4 number-nodes: The NUMBER OF CLUSTER NODES is clause and the NUMBER OF? VAXCLUSTER NODES is clause have exactly the same effect. TheD option of using NUMBER OF CLUSTER NODES has been added to reflectG the fact that Oracle Rdb can run on different hardware platforms (in add Qition to VAXclusters).= Sets the upper limit on the maximum number of nodes in the? cluster from which users can access the shared database. TheC default is 16 nodes. The range is 1 node to 96 nodes. The actual. maximum limit is the current cluster limit.A In some cases, after you have specified a particular number of? users and nodes, doing a dump of the database root file willB display a different number of nodes than the value you set. The0 following paragraphs expl Rain why this occurs.A The relationship between the number of users and the number ofB nodes supported on a database can be seen when you specify 2032A users and 4 nodes in a SQL CREATE/ALTER DATABASE or RDO DEFINEC /CHANGE DATABASE statement and then dump the database root file.7 The dump displays values of 2032 users and 41 nodes.D To understand this relationship, Oracle Rdb uses a data structure: called a TSN Block (TSNBLK). A TSN Block keeps track ofA transaction actSivity on a node and transaction information for? each user on a particular node. Each TSN Block is owned by aC particular node and can handle up to 50 users. For each group ofA 50 users one TSNBLK is allocated per node to cover the maximumA number of users and nodes the database is expected to support,C which is determined as either one TSNBLK per node, or one TSNBLK? per 50 users, whichever is larger. The maximum number of TSN@ blocks is equal to the value of the current m Taximum number of+ nodes that are supported for a database.A For example, if the DBA specifies 2032 users and 4 nodes, this> is calculated as 2032/50 for a total of 41 TSNBLKs and this? equates to 41 nodes. The algorithm selects the maximum valueD of (number of nodes specified, number of nodes calculated). So inD this example, 41 is the maximum calculated value (calculated 41 > specified 4).A Had the DBA specified 2032 users and 50 nodes, 50 would be theC maximum val Uue for the number of nodes (specified 50 > calculated< 41) and 50 TSNBLKs would be allocated, one for each node.B As another example, if the DBA specifies 50 users and 10 nodes,B the maximum value is 10 nodes (specified 10 > calculated 1), so5 ten TSNBLKs would be allocated, one for each node. 4 recovery-buffersD The number of database buffers used during the automatic recoveryD process that is initiated after a system or process failure. ThisC recovery process uses tVhe recovery-unit journal file. Specify anC unsigned integer between 2 and 32768. The default is 20 buffers. 4 global-buffer-params (B)0global-buffer-params= @ q> GLOBAL BUFFERS ARE qwq> ENABLED qqwqk2 mq> DISABLED qj x+ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq>@ mq> ( qq> NUMBER IS number-glo-buffers qq> , qk x7 lqqqqqqqqqqqqqqq USER LIMIT IS max-glo-buffers qq> ) qqqqqj 5 GLOBAL_BUFFERSB The GLOBAL BUFFERS ARE ENABLED clause specifies that Oracle RdbC maintain one global buffer pool per node in the cluster for eachE database. By default, Oracle Rdb maintains a local buffer pool for? each user. For more than one user to use the same page, each@ must read it from disk into their local buffer pool. When the? GLOBAL BUFFERS ARE ENABLED clau Xse has been specified, a pageA in the global buffer pool may be read by more than one user atA the same time, although only one user reads the page from diskB into the global buffer pool. Global buffering provides improvedD performance because I/O is reduced and memory is better utilized.B The default is GLOBAL BUFFERS ARE DISABLED, in which Oracle RdbB maintains a local buffer pool for each user, and global buffers are not enabled. 5 NUMBERC When global buffers Y are enabled, the NUMBER IS clause is used to9 specify the default number of global buffers per node.C In database parameter syntax, a user designates an attach to the0 database, not a person who uses the database.= The default number of global buffers is the maximum number< of users multiplied by 5. (In the RDO syntax for databaseA parameters, a user is the same as an attach.) You can overrideA the default by defining a value for the logical name RDM$BIND_ BUFFERS. Z> Although you can change the NUMBER IS parameter online, theB change will only take effect the next time that the database isC opened. By default, a database can be opened automatically (that? is, by any user who invokes the database and executes a dataA manipulation language statement). If the database was modifiedC so that it must be manually opened, the RMU/OPEN command must be used to open it. 5 USER_LIMIT? The USER LIMIT clause specifies the maximum numbe [r of global? buffers each user allocates. Because global buffer pools areB shared by all users, you must define an upper limit on how manyC global buffers a single user can allocate. This limit prevents aD user from defining the RDM$BIND_BUFFERS to use all the buffers inD the global buffer pool. The user limit cannot be greater then the4 total number of global buffers. The default is 5.B See the Oracle Rdb Guide to Database Performance and Tuning forD information on determ \ining the maximum number of global buffers a user can allocate.B Although you can change the USER LIMIT IS parameter online, theB change will only take effect the next time that the database isC opened. By default, a database can be opened automatically (that? is, by any user who invokes the database and executes a dataA manipulation language statement). If the database was modifiedC so that it must be manually opened, the RMU/OPEN command must be used to open it. ]3 db-wide-options-2 (B)0db-wide-options-2 = W qwq> BUFFER SIZE IS qqqqq> buffer-blocks qq> BLOCKS qqqqqqwq>Z tq> ADJUSTABLE LOCK GRANULARITY IS qwqqq> ENABLED qqqwqqquE x mqqq> DISABLED qqj xS tq> SNAPSHOT IS qqqqwqqqqq> ENABLED qwqq> IMMEDIATE qwqwquE x x mqq> DEFERRED qqj x xE x mqqqqq>^ DISABLED qqqqqqqqqqq>qqqqqqj xL tq> DICTIONARY IS qqqwqqq> REQUIRED qqqqqqqwqqqqqqqqqqqqquL x tqqq> NOT REQUIRED qqqu xE x tqqq> USED qqqqqqqqqqqu xL x mqqq> NOT USED qqqqqqqj xZ tq> CARRY OVER LOCKS ARE qqwq> ENABLED qwqqqqqqqqqqqqqqqquE x mq> DISABLED j _ xU mq> LOCK TIMEOUT INTERVAL IS number-seconds SECONDS qqqqqj 4 buffer-blocksC The number of blocks Oracle Rdb allocates per buffer. Specify anA unsigned integer greater than zero. If you do not specify thisC parameter, Oracle Rdb uses a buffer size that is three times the PAGE SIZE value.A Buffer size is a global parameter and the number of blocks perC page (or buffer) is constrained to less than 64 blocks per page.B The page size ` can vary by storage area for multifile databases,C so you should determine the page size of each storage area basedD on the sizes of records that will be stored in each storage area.C When you choose the number of blocks per buffer, choose a number= that is wholly divisible by all page sizes for all storageB areas in your multifile database. For example, if your database@ has three storage areas with page sizes of 2, 3, and 4 blocks@ respectively, choosing a buffer size of 1 a2 blocks will ensureD optimal buffer utilization. If you choose a buffer size of 8, theD storage area with a page size of 3 blocks will waste 2 blocks perF buffer. Oracle Rdb reads as many pages as will fit into the buffer.G In this case, Oracle Rdb reads two pages of 3 blocks apiece into the buffer, wasting 2 blocks. 4 ADJUSTABLE_LOCK> Enables or disables whether or not the database system will> automatically maintain as few locks as possible on database@ resources. bThe default is ENABLED, and results in fewer locks< against the database. However, if contention for databaseD resources is high, the automatic adjustment of locks can become aC CPU drain. Such databases can trade more restrictive locking for; less CPU usage by disabling adjustable lock granularity.@ Disabling adjustable locking granularity may require that theB LOCKIDTBL, LOCKIDTBL_MAX, PQL_DENQLM, PQL_MENQLM OpenVMS SYSGEN% parameters for locks be increased. 4 ENABLcED-IMMEDIATE@ The default, ENABLED IMMEDIATE causes read/write transactions= to write copies of records to the the snapshot file before@ those records are modified, regardless of whether a read-only transaction is active.@ If you use the SNAPSHOT IS ENABLED clause to enable snapshotsA on a multifile database, writing to all snapshot files for all storage areas is enabled. 4 ENABLED-DEFERRED= Specifies that read/write transactions not write copies of> records d they modify to the snapshot file unless a read-only@ transaction is active. Read-only transactions that attempt toD start after an active read/write transaction begins must wait for> all active read/write users to complete their transactions.@ If you use the SNAPSHOT IS ENABLED clause to enable snapshotsA on a multifile database, writing to all snapshot files for all storage areas is enabled. 4 DISABLED= Disables snapshot transactions. If you use the SNAPSHOT IS@ e DISABLED clause to disable snapshots on a multifile database,C writing to all snapshot files for all storage areas is disabled. 4 DICTIONARYA The DICTIONARY IS [NOT] REQUIRED clause determines whether theD database must be invoked by path name for data definition changes> to occur. If you specify the DICTIONARY IS REQUIRED option,? the database must be invoked by path name to change metadataA and the data dictionary will be maintained. If you specify theD DICTIONARY fIS NOT REQUIRED option, the database can be invoked byC either file name or path name to change metadata. The default is DICTIONARY IS NOT REQUIRED.= The DICTIONARY IS [NOT] USED clause determines whether theB definition of the database and definitions of database elements< will be stored in the data dictionary. If you specify the@ DICTIONARY IS USED option, the definition of the database and> definitions of database elements will be stored in the data@ dictionary. If you gspecify the DICTIONARY IS NOT USED option,D no definitions will be stored in the data dictionary. The default is DICTIONARY IS USED.D You receive an error message if you specify incompatible options,B such as the DICTIONARY IS REQUIRED option and the DICTIONARY IS NOT USED option. 4 CARRY_OVER_LOCKS; The carry-over locks option is a database-wide parameter@ that allows you to disable carry-over lock optimization. ThisD optimization is enabled by default. Althoug hh this is an advantageA in more environments, it can result in false lock conflicts in some applications.@ The carry-over locks optimization holds area and record locksD across transactions and depends on NOWAIT transactions asking forC and acquiring the NOWAIT lock. This can result in long delays ifA concurrent users are executing long verbs. You should consider> disabling the carry-over locks optimization if transactions@ experience noticeable delays in acquiring the N iOWAIT lock (asD seen in the output of the RMU/SHOW STATISTICS command). Note thatC if you do disable the carry-over locks option, there may be some@ performance degradation because transactions will acquire and> release area and top level ALG locks for every transaction. 4 LOCK_TIMEOUTA Specifies the number of seconds for processes to wait during a@ lock conflict before timing out. The number of seconds can be between one and 65,000.? Sets the default database locjk timeout interval. This is theD database wide timeout interval. It is used as the default as wellA as the upper limit in determining the timeout interval to use.C For example, if LOCK TIMEOUT INTERVAL IS 25 SECONDS is specified? with the CHANGE DATABASE or DEFINE DATABASE statement, and aA user specifies 30 seconds with the SQL SET TRANSACTION WAIT 30D statement or sets the logical name RDM$BIND_LOCK_TIMEOUT_INTERVALC to 30, RDO would still use the interval of 25 specified w kith the LOCK TIMEOUT INTERVAL clause. 3 storage-area-options (B)0storage-area-options = G qwwqqqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwwq>N xtqq> ALLOCATION IS qqq> number-pages qqqq>qqqqqqqqq PAGES qqqquxU xtqq> PAGE SIZE IS qqqq> page-blocks qqqqq>qqqqqqqqq BLOCKS qqquxZ xtqq> PAGE FORMAT IS qqwqqqq> UNIFORM qqqqwqqqqqqqqqqqqqqqqqqqquxL xx mqqqq> MIXED qqqqqqj l xxN xtqq> THRESHOLDS ARE q> ( q> val1 wqqqqqqqqqqqqqqqqqqqqwq> ) qquxG xx m> ,val2 wqqqqqqqqqwqj xxG xx m> ,val3 qj xxN xtqq> INTERVAL IS qqqqqqq> number-data-pages qqqqqqqqqqqqqqqqqquxW xtqq> SNAPSHOT_FILENAME IS qqqq> file-spec qqqqqqqqqqqqqqqqqqqquxU xtqq> SNAPSHOT ALLOCATION IS qqq> snp-pages qqq> PAGES qqqqqqqqux mU xtwq> SNAPSHOT EXTENT IS qwqqwq> extent-pages qqqq> PAGES qwqqquxN xxmq> EXTENT IS qqqqqqqqqqj mq> extension-options qqqqqqqqj xxN xmqq> WRITE_ONCE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjxE mqqqqqqqqqqqqqqqqqqqqqqqqqqqq your largest record is larger than approximately 950 bytes,> allocate more blocks per page to prevent records from being fragmented. 4 PAGE_FORMATD Specifies whether a storage area contains uniform or mixed pages.> You can use the PAGE FORMAT option with multifile d oatabases@ only. In storage areas with uniform page format, all pages inB a specific logical area contain records from the same relation.B In storage areas with mixed page format, pages can hold records4 from different relations. The default is UNIFORM. 4 THRESHOLDS? Specifies one, two, or three threshold values. The threshold< values represent a fullness percentage on a data page andA establish four possible ranges of guaranteed free space on theA data pages. When a pdata page reaches the percentage defined by? a given threshold value, the SPAM entry for the data page isC updated to reflect the new fullness percentage and its remaining free space.: The default thresholds are 70, 85, and 95 percent. WhenA THRESHOLDS ARE is used, the first threshold value is required.D If you specify only one or two values, unspecified values defaultB to 100 percent. You can specify the THRESHOLDS option only on aA storage area for a multifile database q. Threshold values can be@ set for storage areas with MIXED or UNIFORM storage area page formats. 4 number-data-pages? Specifies the number of data pages between SPAM pages in theA physical storage area file, and thus the maximum of data pages@ each SPAM page will manage. The default, and also the minimum> interval, is 256 data pages. The first page of each storageA area is a SPAM page. The interval you specify determines where? subsequent SPAM pages are to be ins rerted, provided there areD enough data pages in the storage file to require more SPAM pages.C You can specify the INTERVAL option only on a storage area for aB multifile database. The storage area page format must be MIXED. 4 file-spec@ Provides a separate file specification for the snapshot file.= Do not specify a file extension other than SNP to the file= specification. You cannot specify a global default for theB SNAPSHOT_FILENAME. Thus, in a multifile database, tshe SNAPSHOT_C FILENAME option must be within a DEFINE STORAGE AREA definition.A The SNAPSHOT_FILENAME option cannot be specified for a single- file database. 4 snp-pagesA Specifies the number of pages allocated for the snapshot file. The default is 100 pages. 4 extent-pagesC Specifies the number of pages of each extent. The default is 100 pages. 4 extension-optionsC Specifies the MIN, MAX, and percent growth of each database file5 extent.t Enclose the parameter list in parentheses. (B)0extension-options = C qqq> ( qqq> MINIMUM OF qq> min-pages qqq> PAGES, qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjC mqq> MAXIMUM OF qq> max-pages qq> PAGES,qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjR mqq> PERCENT GROWTH IS qqq> growth qqqq> ) qqq> 5 min-pagesD Specifies the minimum number of pages of each extent.u The default is 99 pages. 5 max-pagesD Specifies the maximum number of pages of each extent. The default is 9,999 pages. 5 growthA Specifies the percent growth of each extent. The default is 20 percent growth. 4 WRITE_ONCE= You can use the WRITE_ONCE option to change a storage area? containing stable segmented string data to a format that canC be stored on a write-once, read-many (WORM) optical disk. A WORMD optical disk offers a relatively vinexpensive way of storing largeA amounts of data for read-only access compared to other storage media.= The following restrictions apply to the WRITE_ONCE option:B o Note that you cannot write data other than segmented stringsF to a write-once storage area. Oracle Rdb issues an error messageD if you try to create a storage map that stores data other thanB segmented strings in a write-once storage area. Storage mapsB for non-segmented-string data must be re wmoved before you can) alter a storage area to WRITE_ONCE.D o When you create a storage area on WORM media, you must specify@ that the snapshot area remains on read/write media: do not4 give a snapshot file the WRITE_ONCE attribute.C o If you specify the WRITE_ONCE option when storing a segmentedD string, database keys are not compressed. For more informationG on database key compression, see the Oracle Rdb Guide to Database Maintenance.@ o Writ xe-once storage areas do not use SPAM pages to look for? storage space, but to assist moving data back to non-WORMC media in which SPAM pages must be built again, space is stillC allocated for them. Since SPAM pages are essential in uniformA areas, Write-once storage areas cannot be of uniform format7 and therefore are required to be of mixed format.C o You can use the PAGE SIZE IS clause of CREATE STORAGE AREA toA change the default page size for a stora yge area. You shouldD specify an even number of blocks per page. The smallest amountD of space used in a write operation to WORM media is 1024 bytesC (2 blocks). Therefore, by specifying an even number of blocksD per page, you minimize the space wasted when writing segmented strings to WORM media.@ o Rdb does not support magnetic media for storing write-once storage areas.= o After you move a storage area to or from a WORM device,> Do a full an zd complete backup of your database with the @ RMU/BACKUP command and start a new after-image journaling C file. For more information on backup and recovery procedures A with write-once storage areas, see the Oracle Rdb Guide to  Database Maintenance. 3 define-storage-area-clause& (B)0define-storage-area-clause = [ qqqq> DEFINE STORAGE AREA qqwqqqq> storage-area-name qqqqwqqqqqqkD mqqqq> RDB$SYSTEM {qqqqqqqqqqqj xD lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq FILENAME qqqqq> file-spec qqwqqqqqqqqqqqq>qqqqqqqqqqqqqwqqqkI mq> storage-area-options qqj xG lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq END qqqqqqqwqqqqqqqqqq>qqqqqqqqqqqwq> STORAGE AREA qqqq>0 tq> storage-area-name qu. mq> RDB$SYSTEM qqqqqqqqj |4 storage-area-name3 The name of the storage area you want to create. 4 file-specB The storage area file that is associated with the named storageF area. If you use a simple file name, Oracle Rdb creates the storageA area file in the current default directory. Use a name that is@ unique among all storage area files defined for the database. 4 RDB$SYSTEM? The default storage area. If you directly specify RDB$SYSTEMB in the DEFINE STORAGE AREA clause, you can ov}erride the default- characteristics for the main storage area. 4 storage-area-optionsD Ask for HELP on "DEFINE_DATABASE Format storage-area-options" for' information on storage area options. 3 SEGMENTED_STRING< The name of the storage area that will hold all segmentedD strings. For a single file database or multifile database, if youA do not explicitly define a storage area for segmented strings,@ segmented strings will be stored in the default storage area,A~ RDB$SYSTEM. If your database is a single-file database and you? specify a storage area other than RDB$SYSTEM, you receive anA error message because RDB$SYSTEM is the only storage area in a single-file database.< The page format for the segmented string storage area can< be UNIFORM or MIXED. However, Rdb recommends that if you > store segmented strings in a MIXED storage area, that area " contain only segmented strings. 2 Examples Example 1@ Use the default DEFINE DATABASE statement. If you specify theA DICTIONARY IS NOT USED clause, the data dictionary will not beD used to store the database definition and definitions of database elements.# RDO> DEFINE DATABASE 'PERSONNEL' cont> DICTIONARY IS NOT USED. Example 2' Use DEFINE DATABASE with qualifiers:# RDO> DEFINE DATABASE 'PERSONNEL' cont> NUMBER OF BUFFERS IS 10! cont> BUFFER SIZE IS 10 BLOCKS cont> DICTIONARY IS NOT USED.1 This statement performs the following actions: o Names the database.C o Specifies a number of buffers, and the length of each buffer.1 o Commits the database definition implicitly.B o Specifies that the data dictionary will not be used to storeC the database definition and definitions of database elements.? o Invokes the database, using the file name as the database handle. Example 3B The scope of each record's database key is set to FINISH during; the RDO session of the user who entered DEFINE DATABASE:/ RDO> DEFINE DATABASE DISK2:[USER.DBS]PERS2" cont> DBKEY SCOPE IS FINISH.> Note that this command does NOT set a "default" DBKEY SCOPEA characteristic for the database. For each user, the default isB COMMIT unless that user specifies INVOKE DATABASE...DBKEY SCOPE FINISH. Example 4> The upper limit on the number of nodes from which users can8 access the common, cluster-wide database is set to 8:9 RDO> DEFINE DATABASE ACCTING NUMBER CLUSTER NODES IS 8 cont> DICTIONARY IS NOT USED.@ If you attempt to access the shared database from a node and,? in doing so, exceed the maximum nodes parameter, an error is+ signaled to your RDO session or program.< The DICTIONARY IS NOT USED clause specifies that the data? dictionary will not be used to store the database definition( and definitions of database elements. Example 5C The following RDO command procedure defines a multifile database" called MULTI_PERS. The example:+ o Defines database wide characteristics* o Defines global storage area defaultsD o Specifies local attributes for RDB$SYSTEM, the default storage area2 o Defines a storage area for segmented strings! o Defines other storage areas' DEFINE DATABASE 'DB_DISK:MULTI_PERS'+ ! Define database-wide characteristics8 DESCRIPTION IS /* Sample multifile definition */ NUMBER OF USERS IS 60%  NUMBER OF CLUSTER NODES IS 22) NUMBER OF RECOVERY BUFFERS IS 200 DICTIONARY IS NOT USED1 ! Define global storage area characteristics ALLOCATION IS 500 PAGES PAGE FORMAT IS MIXED< ! Specify local attributes for the default storage area7 ! Override the global default of MIXED page format& DEFINE STORAGE AREA RDB$SYSTEM' FILENAME 'DISK1:PERS_DEFAULT' PAGE FORMAT IS UNIFORM! ALLOCATION IS 300 PAGES3  SNAPSHOT_FILENAME IS 'DISK2:PERS_DEFAULT'# END RDB$SYSTEM STORAGE AREA0 ! Define storage area for segmented strings' DEFINE STORAGE AREA PERS_SEGSTR& FILENAME 'DISK1:PERS_SEGSTR' PAGE FORMAT IS UNIFORM$ END PERS_SEGSTR STORAGE AREA4 SEGMENTED STRING STORAGE AREA IS PERS_SEGSTR. ! Definition of some sample storage areas& DEFINE STORAGE AREA CANDIDATES% FILENAME 'DISK3:CANDIDATES' PAGE FORMAT IS UNIFORM1 SNAPSHOT_FILENAME IS 'DISK4:CANDIDATES'# END CANDIDATES STORAGE AREA& DEFINE STORAGE AREA EMPIDS_LOW% FILENAME 'DISK5:EMPIDS_LOW'1 SNAPSHOT_FILENAME IS 'DISK6:EMPIDS_LOW'# END EMPIDS_LOW STORAGE AREA& DEFINE STORAGE AREA EMPIDS_MID% FILENAME 'DISK7:EMPIDS_MID'1 SNAPSHOT_FILENAME IS 'DISK8:EMPIDS_MID'$ END EMPIDS_MID STORAGE AREA. ww1 DEFINE_FIELD% Creates a global field definition.F When the DEFINE FIELD statement executes, Oracle Rdb adds the fieldC definition to the physical database. A field definition includes6 a name, a data type, and a set of optional clauses. Example: DEFINE FIELD LABEL+ DATATYPE IS TEXT SIZE IS 8 CHARACTERS! MISSING_VALUE IS "Not here"' VALID IF LABEL = "Good" OR' LABEL = "Bad" OR' LABEL = "Mediocre" OR LABEL MISSING6 QUERY_HEADER FOR DATATRIEVE IS "Column"/"Label". 2 MoreD To define a field using the DEFINE FIELD statement, you must have4 the Oracle Rdb DEFINE privilege for the database.D If you have invoked the database with the PATHNAME specification,B the field definition is also added to the data dictionary. Once> you have defined a field globally, any relation can use theC field definition by using the field name in the DEFINE or CHANGE RELATION statement.: You can copy a shareable field definition from the data dictionary into the database.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you$ issue the DEFINE FIELD statement. 2 Formatc (B)0DEFINE FIELD qqqqqqqqq> name qqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqkJ  xJ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq FROM PATHNAME qqqqqqqqqqqqqqq> path-name qqqqqq>qqqqqqqwqqqq> .D x xF mqwqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqwqqq> field-attributes qqqqqj1 mq> DESCRIPTION IS /* text */ qqj 3 nameB Name of the field you want to create. You must use a field name/ that conforms to OpenVMS naming conventions. 3 path-name> A full or relative data dictionary path name specifying theB source of the field definition. You must invoke the database byB path name if you plan to copy a shareable field definition from the data dictionary.B The name you give to the field must match the name of the field? in the data dictionary. You cannot rename a shareable field. 3 text= A text string that adds a comment to the field definition. 3 field-attributes@ A list of definitions that indicate what type of data you canB store in the field and how Oracle Rdb uses that data. The field> attributes include the data type and the following optional clauses: o VALID IF o MISSING_VALUE o DATATRIEVE support clauses?Do not use multiple, conflicting clauses in a field definition.B For a complete description of field attributes, ask for HELP on Field_attr. 2 Examples Example 1: Using DEFINE FIELD" DEFINE FIELD STANDARD_ID_NUMBER# DATATYPE IS SIGNED LONGWORD.B This statement gives a name to the field and specifies its data type.. Example 2: Using DEFINE FIELD with VALID IF DEFINE FIELD SEX DATATYPE IS TEXT SIZE IS 1& VALID IF SEX = "M" OR SEX = "F".B This definition provides validation criteria. When a user triesC to enter a value other than "M" or "F" in a field that refers to8 this definition, Oracle Rdb returns an error message.8 Example 3: Using DEFINE FIELD with DATATRIEVE Support DEFINE FIELD SALARY_AMOUNT" DATATYPE IS SIGNED LONGWORD( DEFAULT_VALUE FOR DATATRIEVE IS 03 EDIT_STRING FOR DATATRIEVE IS "$$$$,$$9.99".B This example adds a DATATRIEVE edit string and default value to the name and data type.6 Example 4: Copying a Field from the data dictionary DEFINE FIELD SALARY_AMOUNT< FROM PATHNAME 'DISK1:[CDDPLUS.DEFS]PERS.SALARY_AMOUNT'.C This example copies the shareable field, SALARY_AMOUNT, from the dictionary. ww1 DEFINE_INDEXE Creates an index for a relation. An index allows Oracle Rdb direct= access to the records in the relation, to avoid sequential@ searching. You can define a sorted index or a hashed index. AC sorted index uses the B-tree method of retrieval. A hashed index3 uses hash addressing for exact match retrievals. Example5 RDO> DEFINE INDEX EMP_EMPLOYEE_ID FOR EMPLOYEES' cont> DUPLICATES ARE NOT ALLOWED cont> TYPE IS SORTED. cont> EMPLOYEE_ID.& cont> END EMP_EMPLOYEE_ID INDEX. 2 More; To define an index for a relation using the DEFINE INDEX> statement, you need the Oracle Rdb DEFINE privilege for the relation.F When the DEFINE INDEX statement executes, Oracle Rdb adds the index? definition to the physical database. If you have invoked theC database with the PATHNAM E specification, the definition is also added to the data dictionary.D If you define a sorted index for a relation that contain no data,D the root node for the index is not created until the first recordD is stored. When an RMU/VERIFY operation encounters a sorted index4 with no root node, it reports the index as empty.B You must execute this statement in a read/write transaction. If@ you issue this statement when there is no active transaction,9 Oracle Rdb starts a read/ write transaction implicitly.> You cannot define a hashed index in a single-file database.C If you define a hashed index, you must specify a storage map forD it with the index-store-clause. The storage area that you specify! must have a MIXED page format.A An optional keyword that causes Oracle Rdb to create ascending= or descending index segments. If you omit the ASCENDING orA DESCENDING keywords, ASCENDING is the default. To sort recordsC in a particular way in th e result of a particular query, specify* the sort order in the SORTED BY clause.B Other users are allowed to be attached to the database when you$ issue the DEFINE INDEX statement. 2 Format\ (B)0DEFINE_INDEX name wqqqqqqqqqqqqqqq>qqqqqqqqqqqqwq> FOR relation-name qkS m> DESCRIPTION IS /* text */ j xJ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqwqqqqqqqqqqq>qqqqqqqqqqqqwqqqqqqqkG m> duplicates-clause j m> index-storage-clause qj xC lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqkQ tq> TYPE IS qqwqqq> HASHED qqqj x xL x mqqq> SORTED qq> sorted-index-param-list qqqu xE mqqqqqqqqqqqqqq> sorted-index-param-list qqqqqqqqqqqqqqqqqj xC lqqqqqqqqqqqqqqqqqqqqqqqqq . field-name qqwqwqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqwqwqqwqkJ x x t> ASCENDING qqqqqqqqqqqqqqqqqqqqqqqu x x xJ x x t> DESCENDING qqqqqqqqqqqqqqqqqqqqqqu x x xS x x t> SIZE IS n qqqqqqqqqqqqqqqqqqqqqqqu x x xZ x x m> MAPPING VALUES lo-val TO hi-val qj x x xC x mqqqqqqqqqqqqqqqqqqqq END wqqq>qqqqw> INDEX q> . mq> name j 3 name? The name of the index. You can use this name to refer to the@ index in other statements. When choosing a name, follow these rules:< o Use a name that is unique among all index names in the database.C o Use any valid OpenVMS name. However, the name cannot end in a( dollar sign ($) or underscore (_)./ o Do not use any Oracle Rdb reserved words. 3 text= A text string that adds a comment to the index definition. 3 relation-name4 The name of the relation that includes the index. 3 duplicates-clause (B)0duplicates-clause = A qqq> DUPLICATES ARE qqwqqqqqqq>qwqq> ALLOWED qq>+ mq> NOT qqj> A clause specifying whether each value of the index must beA unique. If you try to store the same value twice in an indexedG field defined as DUPLICATES NOT ALLOWED, Oracle Rdb returns an error3 message and does not store or modify the record. 3 index-storage-clause (B)0index-storage-clause = G STORE qw> index-within-clause qqqqqqqqqqqqqqqqqqqqqqqqqqwqkI m> USING qw> field-name qw> index-within-clause qj x> mqqqqq , lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq>& m> default-threshold-clause qjD The index-storage-clause creates a storage map definition for theB index. It allows you to choose which storage area files will beC used to store index entries. You can store all index entries forB one relation in a single storage area, or you can partition the' entries over multiple storage areas. 4 index-within-clause (B)0index-within-clause = E WITHIN qwq> area-name qwqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqwqkL x m> WITH LIMIT OF qw> literal qwj x< x mqqqq , qqqqqqqqqqwqqwqqqqqqqqq>+ x mq> threshold-clause qj x) mqqqqqqqqqqqqq ; DATABASE statement or the DEFINE STORAGE AREA clause of the@ CHANGE DATABASE statement before you refer to it in the store clause.? If the index is a hashed index, the storage area must have a MIXED page format. 5 WITH_LIMIT_OF> The maximum value for the index key that will reside in the specified storage area.A The number of literals in this clause must be the l ess than orA equal to the number of fields in the USING clause. Repeat this? clause to partition the index entries among multiple storage areas.A When you define a multisegmented index using multiple keys andC use the STORE USING...WITH LIMITS clauses, if the values for theC first key are all the same, then set the limit for the first keyA at that value. By doing this, you ensure that the value of theC second key determines the storage area in which each record will be stored.A Note that the last storage area you specify CANNOT have a WITH& LIMIT OF clause associated with it. 5 threshold-clause (B)0threshold-clause= ( qq> THRESHOLDS ARE qqqqqqqqqqk! lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq>. mq> ,val2 qqwqqqqq>qqqqu. mq> ,val3 qjC Specifies associated threshold values for each storage area withB uniform f ormat that is specified in the index-within-clause. ByG setting threshold values, you can make sure that Oracle Rdb does notB overlook a page with sufficient space to store compressed data.? The threshold values specify when the page is marked as FULL< in the SPAM page free space inventory lists. For example,> if you set default values of 70, 85, and 95 percent, ranges? of guaranteed free space on each data page are 30, 15, and 5? percent, respectively. If you do not set defa ult values, theF values are (0,0,0). With values of (0,0,0), Oracle Rdb will use theF record length when setting the SPAM fullness. Oracle Rdb will neverA store a record on a page at threshold 3. The value you set forA the highest threshold can be used to reserve space on the page for future record growth.D If you specify a value of 40 for the "val1" parameter, but do notD specify values for the "val2" or "val3" parameters, the threshold& values will be set at (40,100,100).; If you use data compression, you should use logical area4 thresholds to obtain optimum storage performance. 4 field-nameD The name of the field that specifies what value will be used as aB limit for partitioning the index across multiple storage areas.B If the index key is multisegmented, you can include some or all@ of the fields that are joined to form the index key. Separate$ multiple field names with commas. 4 default-threshold-clause$ (B)0de fault-threshold-clause = / qq> DEFAULT THRESHOLDS ARE qqk! lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq>. mq> ,val2 qqwqqqqq>qqqqu. mq> ,val3 qjC Specifies associated threshold values for each storage area withC uniform format that is NOT specified in the index-within-clause.F By setting threshold values, you can make sure that Oracle Rdb does@ not overlook a page w ith sufficient space to store compressed data.? The threshold values specify when the page is marked as FULL< in the SPAM page free space inventory lists. For example,> if you set default values of 70, 85, and 95 percent, ranges? of guaranteed free space on each data page are 30, 15, and 5? percent, respectively. If you do not set default values, theF values are (0,0,0). With values of (0,0,0), Oracle Rdb will use theF record length when setting the SPAM fullness. Oracle Rdb will neverA store a record on a page at threshold 3. The value you set forA the highest threshold can be used to reserve space on the page for future record growth.D If you specify a value of 40 for the "val1" parameter, but do notD specify values for the "val2" or "val3" parameters, the threshold& values will be set at (40,100,100).; If you use data compression, you should use logical area4 thresholds to obtain optimum storage performance. 3 TYPE_IS@ Spe cifies whether Oracle Rdb creates a B-tree index structureA (SORTED), or a hashed index structure (HASHED). If you specify; HASHED, you cannot choose options from the sorted-index-@ param-list. Hashed indexes are effective only for exact matchA retrievals. Sorted indexes are effective for range retrievals. 3 sorted-index-param# (B)0sorted-index-param-list = F qqqqwqqqqwqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqwqqqwqqqqqqqqq>L x tq> NODE SIZE  qqqqq> number-bytes qqqqqqqqu xL x tq> PERCENT FILL qqqqqq> percentage qqqqqqu xJ x mq> USAGE qqqqqqqqqwqqqqq> UPDATE qqqwqqqqj xC x mqqqqq> QUERY qqqqj x< x x< mqqqqqqqqqqqqqqqqqqqq with the DUPLICATES ARE ALLOWED clause. For example, if youA wanted to place an index on a 100 byte field that is generally? unique to the first 20 bytes, you could specify the first 200 bytes and save as much as 80 bytes per entry. 3 MAPPING_VALUES> A com pression clause for all-numeric fields that translates? the field values into a more compactly encoded form. You can@ mix mapped and unmapped fields, but the most storage space isB gained by building indexes of multiple fields of data type WORDD or LONGWORD. Oracle Rdb attempts to pack all such fields into the smallest possible space.D The "lo-val" (low value) through "hi-val" (high value) parameters? specify the range of integers as the value of the index key.) The valid range of the compressed key: o Cannot be zeroD o The range "high-val" through "low-val" is limited to (2**31) - 4 x (10**scale)? If the value of the key is less than zero or greater thanA (2**31) - 4 x (10**scale), Oracle Rdb signals an exception.3 The following notes refer to compressed indexes:A All text compressed indexes require the DUPLICATES ARE ALLOWEDB clause, which is the default for the DEFINE INDEX statement. If@ the SIZE IS claus e is specified, the field referred to by theB clause must be of the TEXT or VARYING TEXT data type. The fieldC must also be the same length or greater in length than the value# specified in the SIZE IS clause.@ For integer field compressed indexes, the index field must beA of data type WORD or LONGWORD. You can mix mapped and unmappedC fields, but the most storage space is gained by building indexes? of multiple fields of data type WORD or LONGWORD. Oracle Rdb> attempts to pack all such fields into the smallest possible space.D Compressed key suffixes also enable the user to use fields longer% than 254 characters as index keys.> If any data values already stored are less than "lo-val" or? greater than "hi-val", the DEFINE INDEX statement will fail.B A subsequent STORE or MODIFY operation that attempts to store a? value less than "lo-val" or greater than "hi-val" will fail. 2 Examples Example 19 The following example creates a simple relation index:- DEFINE INDEX EMP_EMPLOYEE_ID FOR EMPLOYEES DUPLICATES ARE NOT ALLOWED. EMPLOYEE_ID. END EMP_EMPLOYEE_ID INDEX.A This statement names the index and names the field to serve as the index key.F The clause, DUPLICATES ARE NOT ALLOWED, causes Oracle Rdb to returnA an error message if a user attempts to store an identification# number that is already assigned. Example 2C The following example defines a hashed index, and uses the store> clause to partition the index into different storage areas: DEFINE INDEX EMPLOYEES_HASH2 DESCRIPTION IS /* Hash index for employees */ FOR EMPLOYEES DUPLICATES ARE NOT ALLOWED STORE USING EMPLOYEE_ID WITHIN( EMPIDS_LOW WITH LIMIT OF "00200";( EMPIDS_MID WITH LIMIT OF "00400"; EMPIDS_OVER TYPE IS HASHED. EMPLOYEE_ID. END EMPLOYEES_HASH. Example 36 The following example creates a multisegment index:+ DEFINE INDEX EMP_FULL_NAME FOR EMPLOYEES DUPLICATES ARE ALLOWED. LAST_NAME. FIRST_NAME. MIDDLE_INITIAL. END EMP_FULL_NAME INDEX.C This statement names three fields. Oracle Rdb concatenates these3 three fields to make the multisegment index key. Example 4> The following example defines the EMP_EMPLOYEE_ID index andB causes the LAST_NAME segment to be defined in DESCENDING order., DEFINE INDEX EMP_FULL_NAME FOR EMPLOYEES. LAST_NAME DESCENDING. FIRST_NAME ASCENDING. MIDDLE_INITIAL. END EMP_FULL_NAME INDEX.> Having defined such an index on a particular field does notF guarantee that Oracle Rdb will use that index in a particular query@ retrieval. To ensure a particular sort order is returned by a? particular query, you have to specify that order in the RSE: FOR E IN EMPLOYEES* SORTED BY DESCENDING E.STATUS_CODE,' ASCENDING E.LAST_NAME,)  DESCENDING E.EMPLOYEE_ID . . . Example 5B The following example defines the JH_EMPLOYEE_ID index and setsD each node size to 350 bytes and the initial fullness of each node to 50 percent:. DEFINE INDEX JH_EMPLOYEE_ID FOR JOB_HISTORY DUPLICATES ARE ALLOWED NODE SIZE 350 PERCENT FILL 50. EMPLOYEE_ID. END JH_EMPLOYEE_ID INDEX. Example 6@ The following example def ines three new uniform storage areasD (EMPIDS_LOW_UNIFORM, EMPIDS_MID_UNIFORM, and EMPIDS_OVER_UNIFORM)D for the MF_PERSONNEL database. It also defines a sorted index for1 the LAST_NAME field of the EMPLOYEES relation.- RDO> CHANGE DATABASE FILENAME MF_PERSONNEL0 cont> DEFINE STORAGE AREA EMPIDS_LOW_UNIFORM- cont> FILENAME EMPIDS_LOW_UNIFORM.RDA1 cont> END EMPIDS_LOW_UNIFORM STORAGE AREA0 cont> DEFINE STORAGE AREA EMPIDS_MID_UNIFORM- cont> FILENAME EMPIDS_MID_UNIFORM.RDA1 cont> END EMPIDS_MID_UNIFORM STORAGE AREA1 cont> DEFINE STORAGE AREA EMPIDS_OVER_UNIFORM. cont> FILENAME EMPIDS_OVER_UNIFORM.RDA3 cont> END EMPIDS_OVER_UNIFORM STORAGE AREA. RDO> !- RDO> INVOKE DATABASE FILENAME MF_PERSONNEL RDO> !* RDO> DEFINE INDEX EMP_FIRST_NAME_SORTED cont> FOR EMPLOYEES cont> DUPLICATES ARE ALLOWED cont> STORE USING FIRST_NAME< cont> WITHIN EMPIDS_LOW_UNIFORM WITH LIMIT OF "HOWARD"* cont> THRESHOLDS ARE (70,80,95);9 cont> EMPIDS_MID_UNIFORM WITH LIMIT OF "PETER";# cont> EMPIDS_OVER_UNIFORM- cont> DEFAULT THRESHOLDS ARE (60,70,80) cont> TYPE IS SORTED. cont> FIRST_NAME.) cont> END EMP_FIRST_NAME_SORTED INDEX.C The EMP_FIRST_NAME_SORTED index stores index entries into one ofB the three storage areas based on the values stored in the LAST_ NAME field.= Note that the EMPIDS_LOW_UNIFORM storage area receives the? thresho ld values of (70,80,95) specified with the THRESHOLDS= clause, and the EMPIDS_MID_UNIFORM and EMPIDS_OVER_UNIFORMC storage areas receive the default threshold values of (60,70,80)0 specified with the DEFAULT THRESHOLDS clause. Example 7@ To create a compressed index for fields that use SIGNED BYTE,? SIGNED WORD, and SIGNED LONGWORD data types, use the MAPPING? VALUES clause of the DEFINE INDEX statement for the field orB fields being indexed, as shown in the examples. You can use the? DUPLICATES ARE NOT ALLOWED clause with an integer compressed@ index. In the examples, PRODUCT_ID, YEAR_NUMBER, and PRODUCT_B DESCR are the three fields that are defined with the DUPLICATES ARE NOT ALLOWED clause.. DEFINE INDEX PS_DATE_2 FOR PRODUCT_SCHEDULE DUPLICATES ARE NOT ALLOWED. PRODUCT_ID.5 YEAR_NUMBER MAPPING VALUES 1970 to 2070.$ PRODUCT_DESCR SIZE IS 20. END.A Note that you can mix mapped and unmapped fields, but the mostD storage space is gained by building indexes of multiple fields ofF data type of SIGNED WORD or SIGNED LONGWORD. Oracle Rdb attempts to9 pack all such fields into the smallest possible space. Example 8D The following examples define several text and integer compressed indexes. !H ! Define the integer compressed index PORT_NUM_CINDEX on the PORT_NUM ! field of the PORT relation: !@ DEFINE INDEX PORT_NUM_CINDEX FOR PORT DUPLICATES NOT ALLOWED.& PORT_NUM MAPPING VALUES 90 TO 1000. END. !D ! Define the text compressed index PORT_COUNTRY_CITY_INDEX on the2 ! COUNTRY and CITY fields of the PORT relation: !2 DEFINE INDEX PORT_COUNTRY_CITY_CINDEX FOR PORT. COUNTRY SIZE 10. CITY SIZE 5. END. !A ! Produce a list of ports sorted by COUNTRY and CITY name from ! the PORT relation: !> FOR P IN PORT SORTED BY P.COUNTRY, P.CITY PRINT P.* END_FOR !D ! Define the integer compressed index CHANNEL_DEPTH_CINDEX on the. ! CHANNEL_DEPTH field of the PORT relation: !. DEFINE INDEX CHANNEL_DEPTH_CINDEX FOR PORT.* CHANNEL_DEPTH MAPPING VALUES 20 TO 100. END. !? ! Define the integer compressed index DISTANCE_CINDEX on the) ! DISTANCE field of the PORT relation: !) DEFINE INDEX DISTANCE_CINDEX FOR PORT.& DISTANCE MAPPING VALUES 0 TO 30000. END. !A ! Define the integer compressed index TRANS_COST_CINDEX on the+ ! TRANS_COST field of the PORT relation: !+ DEFINE INDEX TRANS_COST_CINDEX FOR PORT.( TRANS_COST MAPPING VALUES 0 TO 10000. END. !D ! Define the integer compressed index PNUM_CDEP_DIST_TCOST_CINDEXD ! on the PORT_NUM, CHANNEL_DEPTH, DISTANCE, and TRANS_COST fields ! of the PORT relation: !4 DEFINE INDEX PNUM_CDEP_DIST_TCOST_CINDEX FOR PORT DUPLICATES NOT ALLOWED.' PORT_NUM MAPPING VALUES 100 TO 1000.* CHANNEL_DEPTH MAPPING VALUES 20 TO 100.& DISTANCE MAPPING VALUES 0 TO 30000.(  TRANS_COST MAPPING VALUES 0 TO 10000. END. !D ! Define the CHANNEL_DEPTH_DESC_CINDEX index on the CHANNEL_DEPTHI ! field of the PORT relation. The DESCENDING keyword causes descending> ! index segments to be created for the CHANNEL_DEPTH field. !3 DEFINE INDEX CHANNEL_DEPTH_DESC_CINDEX FOR PORT.5 CHANNEL_DEPTH DESCENDING MAPPING VALUES 20 TO 100. END. wwa1 DEFINE_PROTECTIONA Adds an entry to the access control list (ACL) for a database,C relation, view or view. To define protection for a database, you" must first invoke the database. Example:' RDO> DEFINE PROTECTION FOR DATABASE cont> POSITION 3 cont> IDENTIFIER [25,235], cont> ACCESS "READ+WRITE+MODIFY+ERASE". 2 Format5 (B)0DEFINE PROTECTION FOR qqqqk x lqqqqqq DATABASE qqqqqqqqqqq>qqqqqqqqqqqqqqqqqkC tqqq> RE LATION qq> relation-name qqqqqqqqqqquC tqqq> VIEW qqqqqq> view-name qqqqqqqqqqqqqqquJ mqqq> FIELD q> field-name IN relation-name qu: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqk8 tq> AFTER qqq> identifier qqqqqu x8 mq> POSITION qq> n qqqqqqqqqqqqj x/ lqqqqqqqqqqqqqqq IDENTIFIER qqwqq> identifier qqwqk3 mqq ACCESS qqqwqqq>qqqqqqqqqqqqqqqqqwqqqqqqqqqq> .4 mqwq> access-right qwqj0 mq SHOW PROTECTION FOR RELATION RELATION1L (IDENTIFIER=[DBS,RICK],ACCESS=READ+WRITE+MODIFY+ERASE+SHOW+DEFINE+D CHANGE+DELETE+CONTROL+OPERATOR+ADMINISTRATOR+REFERENCES)( (IDENTIFIER=[*,*],ACCESS=NONE)C 2. If you want other users to have some access to new relations,? you can define an iden tifier called DEFAULT in the system? rights database. Then you can define an identifier calledG DEFAULT for your Oracle Rdb database. The access rights specifiedC in the DEFAULT identifier will be granted to all users exceptA the owner of any new relations created in the database. For example:) RDO> DEFINE PROTECTION FOR DATABASE cont> IDENTIFIER DEFAULT cont> ACCESS READ+MODIFY.@ 3. You need to detach from the database to make the change in protection occur: RDO> COMMIT RDO> FINISHA 4. The protection on existing relations in the database is not= changed, but any new relations that are defined receiveA the protection specified by the DEFAULT identifier. In thisD example, the creator receives all the access rights to the newA relation RELATION2 and all other users receive the READ and? MODIFY access rights specified by the DEFAULT identifier.) RDO> INVOKE DATABASE FILENAME TEST1 RDO>% RDO> DEFINE RELATION RELATION2. cont> FIELD1. cont> FIELD2. cont> END RELATION. RDO>1 RDO> SHOW PROTECTION FOR RELATION RELATION2L (IDENTIFIER=[DBS,RICK],ACCESS=READ+WRITE+MODIFY+ERASE+SHOW+DEFINE+D CHANGE+DELETE+CONTROL+OPERATOR+ADMINISTRATOR+REFERENCES)/ (IDENTIFIER=[*,*],ACCESS=READ+MODIFY)E Oracle Rdb determines the rights for a user by matching the user'sA user identification cod e (UIC) with the identifier in each ACLE entry. The first time Oracle Rdb finds a match, it grants the userD the rights in that entry. If there is no match, Oracle Rdb grantsB no rights. Therefore, if the creator deletes the second default? entry whose identifier is [*,*], all access is denied to all users but the creator.A Use the DEFINE PROTECTION statement to add more entries to theD list. When the statement executes, Oracle Rdb creates a new entryD in the position s pecified. This entry grants the specified rightsB to the user or group of users determined by the identifier. All4 rights not specified in the statement are denied.@ For a particular user, Oracle Rdb grants an access right to aA relation only if that right is granted in the ACL for both theA database and the relation. That is, a user has WRITE privilegeB to the EMPLOYEES relation only if that user has WRITE privilegeB to both the PERSONNEL database and the EMPLOYEES relation. ThisC means that protection at the database level should grant to eachB user or group of users all the privileges they may need for any? relation. You can then deny these privileges at the relation level.? Granting or revoking a privilege takes effect after the user/ detaches and attaches to the database again.A To define protection for a database, you must first invoke theB database. You must execute the DEFINE PROTECTION statement in aA read/write transaction. I f you issue this statement when thereG is no active transaction, Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you) issue the DEFINE PROTECTION statement.; You must have the READ database privilege to attach to a database.@ The ADMINISTRATOR, OPERATOR, and SECURITY database privilegesF are the three Oracle Rdb role-oriented privileges. Users with these@ privileges have the ability to override A CLs for some objects@ to perform database operations. Similarly, users with certain@ OpenVMS privileges also have the ability to override ACLs forA some database objects. The Oracle Rdb role-oriented privilegesA are limited to the database in which they are granted, but the7 OpenVMS privileges span all databases on the system.D Users with the Oracle Rdb or the OpenVMS role-oriented privilegesC are implicitly granted other Oracle Rdb privileges. When you are? granted impli cit privileges to a database object as a result> of an ACL override, you operate as if you actually hold theC privilege, although you are not explicitly granted the privilege# and it is not stored in the ACL.A Users with the ADMINISTRATOR database privilege or the OpenVMS; SYSPRV privilege can perform any data definition or data< manipulation operation on any named object, including theD database, regardless of the ACL for the object. The ADMINISTRATORC privilege is the most powerful privilege in Oracle Rdb, since itD can override most privilege checks performed by Oracle Rdb. UsersB with the ADMINISTRATOR database privilege or the OpenVMS SYSPRV? privilege implicitly receive ALL privileges for all objects,8 except the SECURITY and OPERATOR database privileges.A Users with the OPERATOR database privilege or the OpenVMS OPERG privilege implicitly receive the Oracle Rdb READ, WRITE, MODIFY, and ERASE database privileges.< Users with th e SECURITY database privilege or the OpenVMSD SECURITY privilege implicitly receive the Oracle Rdb READ, WRITE,) MODIFY, and ERASE database privileges.= Users with the OpenVMS BYPASS privilege implicitly receiveD ALL privileges except the Oracle Rdb ADMINISTRATOR, OPERATOR, andC SECURITY database privileges and the CONTROL relation privilege.A Users with the OpenVMS READALL privilege receive implicit READ- and SHOW database and relation privileges.D You must have the DISTRIBTRAN database access right to a database: to run a two-phase commit transaction on that database. 2 Examples Example 1? The following example grants access rights to a single user:' RDO> DEFINE PROTECTION FOR DATABASE cont> POSITION 3# cont> IDENTIFIER [CLERKS,DAVIES]* cont> ACCESS "READ+WRITE+MODIFY+ERASE".1 This statement performs the following actions:; o Specifies the location of the entry within the accessB control list. The new entry is in the third position and all? subsequent entries are moved to the next higher position.D o Uses an identifier to designate the user who is granted access rights.E o Grants the specified access rights. Oracle Rdb denies all other rights. Example 2B The following example grants access rights to a group of users:6 RDO> DEFINE PROTECTION FOR RELATION SALARY_HISTORY& cont> AFTER [ANALYSTS,JOHNSON]% cont> IDENTIFIER [ANALYSTS,*] cont> ACCESS( cont> "READ+WRITE+MODIFY+ERASE -% cont> +DEFINE+CHANGE+DELETE".1 This statement performs the following actions:B o Names the relation SALARY_HISTORY. The new ACL entry will be applied to this relation.@ o Uses the AFTER clause to specify the location of the entryC within the ACL. In this case, the new ACL entry appears after7 the entry for user identifier [ANALYSTS,JOHNSON].D o Identifies the set of users ([ANALYSTS ,*]) who are granted theD listed access rights. In this case, the new identifier has theA same group identifier as the identifier that precedes it inC the list. This means that for user JOHNSON in group ANALYSTS,@ Oracle Rdb will grant the privileges listed in the earlier@ entry. All other users in group ANALYSTS will fall throughF to the entry identified by [ANALYSTS,*]. Oracle Rdb grants theseB other members of group PROGRAMMERS the rights listed in this@ statement. In this way, the system gives general rights to@ a group and more specific rights to a single member of the group. Example 3C The following example grants access rights on the specific field to a group of users:D RDO> DEFINE PROTECTION FOR FIELD SALARY_AMOUNT IN SALARY_HISTORY$ cont> AFTER [MANAGERS,SMITH]% cont> IDENTIFIER [MANAGERS,*] cont> ACCESS MODIFY.B The following examples show how to specify the identifiers in a DEFINE PROTECTION statement. Example 4> In this example, all users with the UIC matching [25,*] and< running a batch job are granted the access rights listed.' RDO> DEFINE PROTECTION FOR DATABASE cont> POSITION 4 cont> IDENTIFIER [25,*]+BATCH* cont> ACCESS READ+DEFINE+CHANGE+DELETE. 2 Example 5A All users associated with the general identifier DATAENTRY and< using RDO interactively are granted update access rights.' RDO> DEFINE PROTECTION FOR DATABASE cont> POSITION 5) cont> IDENTIFIER DATAENTRY+INTERACTIVE( cont> ACCESS READ+WRITE+MODIFY+STORE. Example 6/ User JONES gets the specified access rights.& RDO> DEFINE PROTECTION FOR DATABASE cont> POSITION 6 cont> IDENTIFIER [RDB,JONES]( cont> ACCESS READ+WRITE+MODIFY+ERASE. wwa1 DEFINE_RELATION@ Creates a relation definition. A relation definition consistsB of a list of fields that make up an Oracle Rdb record. When theF DEFINE RELATION statement executes, Oracle Rdb adds any constraintsD associated with the relation definition to the physical database. Example:$ RDO> DEFINE RELATION DEPARTMENTS. cont> DEPARTMENT_CODE cont> PRIMARY KEY. cont> DEPARTMENT_NAME. cont> MANAGER_ID" cont> BASED ON ID_NUMBER. cont> BUDGET_PROJECTED cont> BASED ON BUDGET. cont> BUDGET_ACTUAL cont> BASED ON BUDGET." cont> END DEPARTMENTS RELATION. 2 MoreF You need the Oracle Rdb DEFINE privilege for the database to define> a relation. If you are defining a constraint as part of the@ relation definition, you must also have the Oracle Rdb DEFINE; privilege for the relation referenced by the constraint.= You can copy a shareable relation definition from the dataA dictionary into the database using the FROM PATHNAME clause of! the DEFINE RELATION statement.; When the DEFINE RELATION statement execut es, Oracle Rdb:C o Adds the relation definition to the physical database. If youD have invoked the database with the PATHNAME specification, the6 definition is also added to the data dictionary.C o Creates a default access control list (ACL) for the relation.A There are several ways to use the DEFINE RELATION statement to$ specify the attributes of fields:B o When you define a relation, you can simply list the names ofA fields defined globally for the da tabase, or you can define fields explicitly.? o You can also base the local field definitions on existing= global definitions, but give them local attributes. ForC example, when you use the BASED ON qualifier, the field takesB the local name you give it in the DEFINE RELATION statement,B but it derives its other attributes from the global field on which it is based.? o You can also use the DATATRIEVE clauses both globally and= locally. When you use the DATATRIEVE clauses within the= DEFINE RELATION statement, they override the DATATRIEVE: characteristics specified for the global definition.B You must execute this statement in a read/write transaction. If@ you issue this statement when there is no active transaction,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you' issue the DEFINE RELATION statement.7 You can have a maximum of 2000 fields in a relation.I If you define a relation using an Oracle CDD/Repository path name, theH relation name must match the record name. For example, the followingF statement contains an error. (The statement can be processed, but problems will occur later.)B RDO> DEFINE RELATION AAAA FROM PATHNAME 'CDD$TOP.TEST.XXXX'.3 The correct form of the statement is as follows:B RDO> DEFINE RELATION AAAA FROM PATHNAME 'CDD$TOP.TEST.AAAA'. 2 Format` (B)0DEFINE RELATION qq> name qqwqwqqqqqqqqqqqqqq>qqqqqqqqqqqqqqwqqqqqqqkW x mq> FROM PATHNAME path-name qqj xG mqwqqqqqqqqqqqqqq>qqqqqqqqqqqqqqwqqk xU tq> ENABLE qqwq> COMPRESSION qj x xN mq> DISABLE qj x xG lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwwwqqqqqqqqqqqqqq>qqqqqqqqqqqwq> . k xY xmq relation-constraint-def qjxmqDESCRIPTION IS /* text */j x xG mqqqqqqqqqqqqqqqqqqqwq field-def qqqqqw> END qwqqqqq>qqqqw> RELATION qqvq> .= x m> /*text*/ qj x mqq> name qj& mqqqqqqqqqqqqqqqq . A full or relative data dictionary path name specifying the< source of the shareable relation defini tion. If you use aA relative path name, the current default directory must includeB all the path name segments that precede the relative path name.@ You must invoke the database by path name if you plan to copy; a shareable relation definition from the dictionary. You@ must specify a CDO path name and refer to a relation that was? created with CDO. The relation definition that you copy from@ the dictionary must be a simple definition, that is, one that< contains no nested records, no repeating groups (arrays),@ and no variants. Also, the data types of the individual fieldC definitions that make up the dictionary record being copied must6 be compatible with supported Oracle Rdb data types. 3 textB A text string that adds a comment to the relation definition or the field definition. 3 COMPRESSION_clause? The ENABLE/DISABLE COMPRESSION option in the DEFINE RELATION? statement is obsolete. Use the DEFINE STORAGE MAP and CHANGE:  STORAGE MAP statements to control data compression. TheD COMPRESSION option in the DEFINE RELATION statement is maintainedB for compatibility with applications that used previous versionsE of Oracle Rdb. However, Rdb recommends you use the DEFINE STORAGE F MAP statement rather than the DEFINE RELATION statement to control  data compression. 3 field-def? The name of a field that is part of the set of generic field definitions for the database. (B)0field-def=I  qwq> global-field-name qqqqqqqqqqwqwwqqqqqqqqqq>qqqqqqqqqqqqqqqwqwq>I tq> global-field-def qqqqqqqqqqqu xmq> field-constraint-def qu xG tq> local-based-on-def qqqqqqqqqj mqqqqqqqqqqqqqqqqqqqqqqqqqqqj xG mq> local-computed-by-def qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjB You can use a field name in any one of three ways in the DEFINE RELATION statement:B o Refer to an existing global field by name. This includes the( global definition in the relatio n.= o Refer to a new global field name and include a complete@ definition, including a DATATYPE clause. This includes the@ field definition in the relation and also enters the fieldC definition in the global set of definitions for the database.B o Refer to an existing global field in a BASED ON clause. ThisD causes the field to have a local name and a global definition. 4 field-constraint-defD Using the field-constraint-def clause you can name or speci fy theB type of field-level constraints to be defined within a specific relation definition. (B)0field-constraint-def =+ qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqk4 mq> CONSTRAINT constraint-name IS qqj x+ lqqqqqqqqqqqqqqqqqq NOT MISSING qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqkQ tq> UNIQUE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xX tq> PRIMARY KEY qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xS mw> REFERENCES referenced-relation-name qwqqqqqqqqqqqqqqqqqqqqqqqqwu xL x m> referenced-field-name jx xJ x x xZ mq> USING rse REQUIRE conditional-expr qqqqqqqqqqqq>qqqqqqqqqqqqqqj xJ xJ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/ mqq> CHECK ON qwqq> COMMIT qu( mqq> UPDATE qj 5 constraint-nameC The name of a field constraint associated with the relation thatB is being defined. This name must be unique within the database.B The constraint name can be referred to in other statements such> as CHANGE RELATION, SHOW CONSTRAINT, and START_TRANSACTION.A The clause 'CONSTRAINT constraint-name IS' is optiona l. If youD do not specify the keyword CONSTRAINT, Oracle Rdb provides a name? for the constraint. However, Rdb recommends that you always C name field and relation constraints. The alternative is to have ? constraints named by the database system with names such as  LAST_NAME_REQUIRE_0001. 5 NOT_MISSING> Restricts field values such that none of the values for theC specified field can assume either the defined or default missing@ value for that field. You can only explicitly declare the NOT% MISSING clause at the field level. 5 UNIQUE? This clause names a field in the relation which is a part of@ a unique key. This field name can appear only once in the key definition.A The UNIQUE clause limits field values such that no two rows inC the associated relation can have the same non-missing values for! the specified field or fields. 5 PRIMARYA This clause names a field in the relation which is a part of a@ primary  key. This field name can appear only once in the baseA relation. Oracle Rdb requires that the values in a primary keyA be unique and not missing; therefore, you need not specify the@ UNIQUE and NOT MISSING field constraints for a field that youD designate a primary key. Only one primary key can be declared for a relation. 5 referenced-relation-name> The name of the relation that defines the unique or primary? key definition which is referred to by a foreign key of thi sB relation. If there are no referenced-field-names specified with@ this relation-name, then the referenced-relation must have an@ associated constraint which specifies a primary key. If thereB are referenced-field-names, the referenced-relation must have aB unique or primary key constraint defined which specifies a listB of unique-field-names. These names have to be the same names as in the referenced-relation. 5 referenced-field-nameA Specifies the name of a field in the foreign key relation thatA corresponds to the field with the same ordinal position within> the list of fields referred to by the primary key relation. 5 rseD A record selection expression that defines which records of whichD relations will be tested against the conditional expression. This* rse cannot refer to any host variables. 5 conditional-expressionD An expression that describes the optional conditions that must be= satisfied before the record can be stored in the database. 5 CHECK: Declares the time when the constraint is evaluated. TheA referential constraint can be evaluated when the update occursB (CHECK ON UPDATE) or when a COMMIT is issued (CHECK ON COMMIT).? The EVALUATING clause of the START_TRANSACTION statement can override the CHECK ON clause. 3 relation-constraint-defC Using the relation-constraint-def clause you can name or specify@ the type of relation-level constraints to be defined within a  specific relation definition.# (B)0relation-constraint-def =4 qwq> CONSTRAINT constraint-name IS qqwqk+ mqqqqqqqqqqqqqqqqqqqqq UNIQUE qqqqqqw>qqw> unique-field-name qqqwqqwqqqkG xmq> PRIMARY KEY qj mqqqqqqqqq , qqqq FOREIGN KEY qw> referencing-field-name qwqk x x9 x mqqqqqqqqqqqqq , qqqq REFERENCES referenced-relation-nameqqqqqqqkx x9 x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjx x9 x mqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqu x; x mw> referenced-field-name wj x x9 x mqqqqqqqqqq , qqqq USING rse REQUIRE conditional-expr qqqqqqqqj x9 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq- m> CHECK ON qwqq> COMMIT qu& mqq> UPDATE qj 4 constraint-nameA The name of a relation or field constraint associated with theB relation that is being defined. This name must be unique within@ the database. The constraint name can be referred to in otherB statements such as CHANGE RELATION, SHOW CONSTRAINT, and START_ TRANSACTION.A The clause 'CONSTRAINT constraint-name IS' is optional. If youD  do not specify the keyword CONSTRAINT, Oracle Rdb provides a nameD for the constraint. However, Rdb recommends that you always name ? field and relation constraints. The alternative is to have ? constraints named by the database system with names such as  LAST_NAME_REQUIRE_0001. 4 UNIQUE? This clause names a field in the relation which is a part of@ a unique key. This field name can appear only once in the key definition.D A UNIQUE clause or a PRIMARY KEY clau se appearing at the relationC level declares one or more fields to comprise a single unique or primary key.A The UNIQUE clause limits field values such that no two rows inC the associated relation can have the same non-missing values for! the specified field or fields. 4 PRIMARYA This clause names a field in the relation which is a part of a@ primary key. This field name can appear only once in the baseA relation. Oracle Rdb requires that the values in a primary keyA be unique and not missing; therefore, you need not specify the@ UNIQUE and NOT MISSING field constraints for a field that youD designate a primary key. Only one primary key can be declared for a relation. 4 FOREIGNC This clause names one or more fields that you want to declare as2 a foreign key in the relation you are defining. 4 referencing-field-nameA The name of a field in the relation which is part of a foreign9 key. This name can appear only once in the referencing= definition, and must correspond to a field having the same? ordinal position in any list of referenced-fields. The namesA can be different but the fields must be of the same data type, length, and scale.; At the relation level, a constraint can have one or more@ referencing-field-names that correspond to a matching list of referenced-field-names. 4 referenced-relation-name> The name of the relation that defines the unique or primary?  key definition which is referred to by a foreign key of thisB relation. If there are no referenced-field-names specified with@ this relation-name, then the referenced-relation must have an@ associated constraint which specifies a primary key. If thereB are referenced-field-names, the referenced-relation must have aB unique or primary key constraint defined which specifies a listB of unique-field-names. These names have to be the same names as in the referenced-relation.  4 referenced-field-nameA Specifies the name of a field in the foreign key relation thatA corresponds to the field with the same ordinal position within> the list of fields referred to by the primary key relation.@ In a relation constraint definition you can repeat referenced field names. 4 rseD A record selection expression that defines which records of whichD relations will be tested against the conditional expression. This* rse cannot refer to any host variables. 4 conditional-exprD An expression that describes the optional conditions that must be= satisfied before the record can be stored in the database. 4 CHECK: Declares the time when the constraint is evaluated. TheA referential constraint can be evaluated when the update occursB (CHECK ON UPDATE) or when a COMMIT is issued (CHECK ON COMMIT).? The EVALUATING clause of the START_TRANSACTION statement can override the CHECK ON clause. 2 Examples Example 1C The following example uses DEFINE RELATION to create a relation: DEFINE RELATION DEPARTMENTS. DEPARTMENT_CODE. DEPARTMENT_NAME.$ MANAGER_ID BASED ON ID_NUMBER. END DEPARTMENTS RELATION.D This statement names the new relation, DEPARTMENTS, and specifies its fields.B o DEPARTMENT_CODE and DEPARTMENT_NAME are already defined. The2 relation definition simply uses their names.> o MANAGER_ID is a local name, but it points to an existing= global field definition. If the definition of ID_NUMBER' changes, MANAGER_ID changes also. Example 2< The following example defines global fields in the DEFINE RELATION statement: DEFINE RELATION FAMILY1 DESCRIPTION IS /* Family information */. /* Employee ID * /* EMPLOYEE_ID BASED ON ID_NUMBER( QUERY_NAME FOR DTR IS "EMP". /* Married? M or S */ MARITAL_STATUS& DATATYPE TEXT SIZE 12  VALID IF MARITAL_STATUS = "M" OR0 MARITAL_STATUS = "S". /* Number of dependents */ NUMBER_DEPENDENTS/ DATATYPE SIGNED WORD SCALE 0.$ /* Amount of IRS withholding */ WITHHOLDING7 COMPUTED BY 0.20 / NUMBER_DEPENDENTS. END FAMILY RELATION.= This DEFINE RELATION statement defines several new fields:> o The DESCRIPTION clause and the other text fields provide@ commen tary for the relation definition and for each field.A o EMPLOYEE_ID is a local name for the global ID_NUMBER field.B The QUERY_NAME clause overrides any QUERY_NAME clause on ID_ NUMBER.B o MARITAL_STATUS uses the DATATYPE clause. Therefore, MARITAL_A STATUS becomes a global field definition. MARITAL_STATUS is@ entered in the list of global fields for the database, and) other relations can use it by name.? o NUMBER_DEPENDENTS also becomes a global field definition.? o WITHHOLDING is a local field, defined in terms of NUMBER_ DEPENDENTS. Example 3D The following example copies a shareable relation definition from) the data dictionary into the database: DEFINE RELATION EMP_INFO: FROM PATHNAME 'DISK1:[DICTIONARY]CORP.PERS.EMP_INFO'. ww1 DEFINE_STORAGE_MAPA Creates a storage map for a relation. A storage map associatesA a relation with a particular storage area or areas. The DEFINE/ STORAGE MAP statement allows you to specify:B o Which storage areas the records in a relation will be stored inC o Whether an index will be used to choose a target location for storing the recordC o Whether data compression will be enabled when the records are stored= o Which storage areas segmented strings will be stored in Example:. RDO> DEFINE STORAGE MAP JOBS_MAP FOR JOBS cont> STORE WITHIN JOBS# cont> END JOBS_MAP STORAGE MAP. 2 FormatV (B)0DEFINE STORAGE MAP qqqqqqqqqqq> map-name qqqqqqqqqk6 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqk? mq> DESCRIPTION IS /* text */ qqj x6 lqqqqqqqqqqqqqqqqqqqqqqqq FOR qqqqq> relation-map-clause qqqqqqqqqqqqqqqk6 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq END qqwqqqqqqq>qqqqqqwqqwqqqqqqqq>qqqqqqqwq> .B mq> map-name qqj mq> STORAGE MAP qj 3 map-name8 Specifies the name for the storage map being defined. 3 textC A text string that adds a comment to the storage map definition. 3 relation-map-clause (B)0relation-map-clause = 3 qqwq> relation-name qqqq> RELATION qqwqqqqqqqk? mq> SEGMENTED STRINGS qqqqqqqqqqqqqj x1 lqqqqqqqqqqqqqqqqqqqq map-storage-clause qqqqqqqqqqqqqqqqqqwqwq>M x tqq> PLACEMENT VIA INDEX qq> index-name qqu xD x mwqq> DISABLE qqwq> COMPRESSION qqqqqqqqqqj x= x mqq> ENABLE qqqj x6 mqqqqqqqqqqqqqqqqqqqqqqqqq map-within-clause qqqqqqqqqqqqqqqqqqqqqqqqqqwqkG m> USING qw> field-name qw> map-within-clause qj x< mqqqqq , qqqqqqqqqqqqqqwqq>& m> default-threshold-clause qj 5 map-within-clause (B)0map-within-clause = E WITHIN qwq> area-name qwqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqwqkL x m> WITH LIMIT OF qw> literal qwj x< x mqqqq , qqqqqqqqqqqqqqqqqqwqwqkE x mq> FOR qwqwqw> rel-name qwqqqqqqqqqqqqqqqu x x< x x x mqqqq , x x mw> relation-name.field-name qwj x x< x x mqqqqqqqqqqqq , qqqqqqqqqqwqqwqqqqqqqqq>+  x mq> threshold-clause qj x) mqqqqqqqqqqqqq ; DATABASE statement or the DEFINE STORAGE AREA clause of the? CHANGE DATABASE statement before you refer to it in the map- within-clause. 6 WITH_LIMIT_OF> The maximum value for the index key that will reside in the specified storage area.A The  number of literals in this clause must be the less than orA equal to the number of fields in the USING clause. Repeat this? clause to partition the index entries among multiple storage areas.A When you define a multisegmented index using multiple keys andC use the STORE USING...WITH LIMITS clauses, if the values for theC first key are all the same, then set the limit for the first keyA at that value. By doing this, you ensure that the value of theC second key determ ines the storage area in which each record will be stored.A Note that the last storage area you specify CANNOT have a WITH& LIMIT OF clause associated with it. 6 rel-name? The name of the relation whose segmented strings you want to@ store in the specified storage area. If you want to store theC segmented strings of more than one relation in the storage area,3 separate the names of the relations with commas. 6 relation-name.field-nameD The name of the relation and segmented string field that you wantD to store in the specified storage area. If you want to store moreD than one segmented string field in the storage area, separate the list items with commas. 6 threshold-clause (B)0threshold-clause= ( qq> THRESHOLDS ARE qqqqqqqqqqk! lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq>. mq> ,val2 qqwqqqqq>qqqqu. mq> ,val 3 qjC Specifies associated threshold values for each storage area with@ uniform format that is specified in the map-within-clause. ByG setting threshold values, you can make sure that Oracle Rdb does notB overlook a page with sufficient space to store compressed data.? The threshold values specify when the page is marked as FULL< in the SPAM page free space inventory lists. For example,> if you set default values of 70, 85, and 95 percent, ranges? of guaranteed free sp ace on each data page are 30, 15, and 5? percent, respectively. If you do not set default values, theF values are (0,0,0). With values of (0,0,0), Oracle Rdb will use theF record length when setting the SPAM fullness. Oracle Rdb will neverA store a record on a page at threshold 3. The value you set forA the highest threshold can be used to reserve space on the page for future record growth.D If you specify a value of 40 for the "val1" parameter, but do notD specify value s for the "val2" or "val3" parameters, the threshold& values will be set at (40,100,100).; If you use data compression, you should use logical area4 thresholds to obtain optimum storage performance. 5 USING_field-nameB The names of the fields whose values will be used as limits forF partitioning the relation across multiple storage areas. Oracle RdbC compares values in the fields to the values in the WITH LIMIT OF; clause to determine where to initially store the record. 5 default-threshold-clause$ (B)0default-threshold-clause = / qq> DEFAULT THRESHOLDS ARE qqk! lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq>. mq> ,val2 qqwqqqqq>qqqqu. mq> ,val3 qjC Specifies associated threshold values for each storage area withD uniform format that is NOT specified in the map-within-clause. ByG setting threshold values, you can mak e sure that Oracle Rdb does notB overlook a page with sufficient space to store compressed data.? The threshold values specify when the page is marked as FULL< in the SPAM page free space inventory lists. For example,> if you set default values of 70, 85, and 95 percent, ranges? of guaranteed free space on each data page are 30, 15, and 5? percent, respectively. If you do not set default values, theF values are (0,0,0). With values of (0,0,0), Oracle Rdb will use theF rec ord length when setting the SPAM fullness. Oracle Rdb will neverA store a record on a page at threshold 3. The value you set forA the highest threshold can be used to reserve space on the page for future record growth.D If you specify a value of 40 for the "val1" parameter, but do notD specify values for the "val2" or "val3" parameters, the threshold& values will be set at (40,100,100).; If you use data compression, you should use logical area4 thresholds to obtain opti mum storage performance. 4 PLACEMENT_VIA_INDEXF Indicates that Oracle Rdb should attempt to store a record in a way? that optimizes access to that record via the indicated path.D If the index named is a hashed index, the storage area named mustC have a MIXED page format. If the hashed index definition and the@ storage map for the relation designate the same storage area,A then the record is stored on the same page as the hashed indexE node. Otherwise, Oracle Rdb uses the same relative page within the( data storage area as the target page.F If the index named is a sorted index, Oracle Rdb finds the dbkey ofC the next lowest record to the one being stored and uses the page* number in the dbkey as the target page. 4 COMPRESSION_clauseA Specifies whether data compression will be enabled or disabledB when the records are stored. ENABLE COMPRESSION is the default. 2 MoreB To define a storage map for a relation, you need the Oracle Rdb$ DEFINE privilege to the relation.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.> Other users are allowed to be attached to the database when@ you issue the DEFINE STORAGE MAP statement. However, they areB not allowed to be using the relation whose storage map is being defined. 2 Examples Example 1B The following statement defines a storage map for the employees relation in MF_PERSONNEL.# DEFINE STORAGE MAP EMPLOYEES_MAP? DESCRIPTION IS /* EMPLOYEES partitioned by EMPLOYEE_ID */ FOR EMPLOYEES RELATION STORE USING EMPLOYEE_ID WITHIN' EMPIDS_LOW WITH LIMIT OF "00200";' EMPIDS_MID WITH LIMIT OF "00400"; EMPIDS_OVER! END EMPLOYEES_MAP STORAGE MAP. Example 2? The following example shows how to define a storage map that@ stores all re cords from a relation in the named storage area:. RDO> DEFINE STORAGE MAP SALARY_HISTORY_MAP= cont> DESCRIPTION IS /* Map for salary history records */% cont> FOR SALARY_HISTORY RELATION& cont> STORE WITHIN SALARY_HISTORY, cont> END SALARY_HISTORY_MAP STORAGE MAP.@ This statement stores all the records from the SALARY_HISTORYA relation into the storage area, SALARY_HISTORY. SALARY_HISTORYA is the name of a storage area that was created with the DEFINE DATABASE statement. Example 3? The following example uses the PLACEMENT VIA INDEX clause to? store records in a storage area according to a hashed index:, RDO> DEFINE STORAGE MAP DEPARTMENTS_MAP$ cont> FOR DEPARTMENTS RELATION$ cont> STORE WITHIN DEPARTMENTS1 cont> PLACEMENT VIA INDEX DEPARTMENTS_INDEX* cont> END DEPARTMENTS_MAP STORAGE MAP. Example 4B The following example defines a database and two relations that@ contain segmented strings. The two relations are mapped along: with their segmented strings to separate storage areas. DEFINE DATABASE SEGSTR_0 DESCRIPTION IS /*1 This database is used to show the Oracle Rdb: segmented string support. Two relations that contain< segmented strings are mapped along with their segmented+ string data to separate storage areas. */ DICTIONARY IS NOT USED# DEFINE STORAGE AREA RDB$SYSTEM FILENAME 'SEGSTR_0' END! DEFINE STORAGE AREA SEGSTR_1 FILENAME 'SEGSTR_1' END! DEFINE STORAGE AREA SEGSTR_2 FILENAME 'SEGSTR_2' END# DEFINE STORAGE AREA SEGSTR_SS1 FILENAME 'SEGSTR_SS1' END# DEFINE STORAGE AREA SEGSTR_SS2 FILENAME 'SEGSTR_SS2' END1 SEGMENTED STRING STORAGE AREA IS SEGSTR_SS2. DEFINE FIELD STANDARD_DATE DATATYPE DATE. DEFINE FIELD TITLE DATATYPE TEXT SIZE 50. DEFINE FIELD DIARY_ENTRY DATATYPE SEGMENTED STRING SUB_TYPE TEXT SEGMENT_LENGTH 200. DEFINE RELATION DAILY_DIARY$ DESCRIPTION /* Simple diary */.0 ENTRY_DATE BASED ON STANDARD_DATE. TITLE. DIARY_ENTRY. END.! DEFINE RELATION SPECIAL_EVENTS DESCRIPTION IS; /* Special events - birthdays, anniversaries, etc. */.1 EVENT_DATE BASED ON STANDARD_DATE.) EVENT_NAME BASED ON TITLE./ EVENT_DESCRIPTION BASED ON DIARY_ENTRY./ SPECIAL_INSTRUCTIONS BASED ON DIARY_ENTRY. END.% DEFINE STORAGE MAP DAILY_DIARY_MAP DESCRIPTION IS@ /* Diary entries are randomly partitioned over two areas */ FOR DAILY_DIARY$ STORE WITHIN SEGSTR_1; SEGSTR_2 END.( DEFINE STORAGE MAP SPECIAL_EVENTS_MAP DESCRIPTION IS8 /* Special events entries are stored in one area */ FOR SPECIAL_EVENTS STORE WITHIN SEGSTR_1 END. DEFINE STORAGE MAP DIARY_TEXT DESCRIPTION IS3 /* Keep segmented strings in separate areas */ FOR SEGMENTED STRINGS STORE WITHIND SEGSTR_SS1 FOR DAILY_DIARY, SPECIAL_EVENTS.EVENT_DESCRIPTION;" SEGSTR_SS2 FOR DAILY_DIARY;8 SEGSTR_1 FOR SPECIAL_EVENTS.SPECIAL_INSTRUCTIONS;B RDB$SYSTEM ! RDB$SYSTEM stores other segmented strings END. Example 5A In the following example, three new storage areas (EMPIDS_LOW_B UNIFORM, EMPIDS_MID_UNIFORM, and EMPIDS_OVER_UNIFORM) and a newB relation (EMPLOYE ES2) are defined in the MF_PERSONNEL database.C Then a storage map is defined so that new EMPLOYEES2 records areB stored in either the EMPIDS_LOW_UNIFORM, EMPIDS_MID_UNIFORM, orC EMPIDS_OVER_UNIFORM storage areas, depending on the value stored in the LAST_NAME field.- RDO> CHANGE DATABASE FILENAME MF_PERSONNEL0 cont> DEFINE STORAGE AREA EMPIDS_LOW_UNIFORM- cont> FILENAME EMPIDS_LOW_UNIFORM.RDA1 cont> END EMPIDS_LOW_UNIFORM STORAGE AREA0 cont> DEFINE STORA !GE AREA EMPIDS_MID_UNIFORM- cont> FILENAME EMPIDS_MID_UNIFORM.RDA1 cont> END EMPIDS_MID_UNIFORM STORAGE AREA1 cont> DEFINE STORAGE AREA EMPIDS_OVER_UNIFORM. cont> FILENAME EMPIDS_OVER_UNIFORM.RDA3 cont> END EMPIDS_OVER_UNIFORM STORAGE AREA. RDO> !- RDO> INVOKE DATABASE FILENAME MF_PERSONNEL RDO> !" RDO> DEFINE RELATION EMPLOYEES27 cont> DESCRIPTION IS /* new relation for testing */.) cont> EMPLOYEE_ID BASED ON ID_NUMBER.! cont> /* G "eneric last name */3 cont> LAST_NAME DATATYPE IS TEXT SIZE IS 14." cont> /* Generic first name */4 cont> FIRST_NAME DATATYPE IS TEXT SIZE IS 10.& cont> /* Generic middle initial */7 cont> MIDDLE_INITIAL DATATYPE IS TEXT SIZE IS 1. cont> /* Street name */8 cont> ADDRESS_DATA_1 DATATYPE IS TEXT SIZE IS 25.A cont> /* Mail stops, suite addresses, street numbers, etc. */8 cont> ADDRESS_DATA_2 DATATYPE IS TEXT SIZE IS 25. cont> /* City name */. # cont> CITY DATATYPE IS TEXT SIZE IS 20.0 cont> /* State abbreviation (or DISTRICT) */. cont> STATE DATATYPE IS TEXT SIZE IS 2.) cont> /* Postal code (in US = ZIP) */4 cont> POSTAL_CODE DATATYPE IS TEXT SIZE IS 5. cont> /* M, F */, cont> SEX DATATYPE IS TEXT SIZE IS 1.- cont> BIRTHDAY BASED ON STANDARD_DATE. cont> /* A number */4 cont> STATUS_CODE DATATYPE IS TEXT SIZE IS 1.! cont> END EMPLOYEES2 RELATION. RDO> !- RDO> DEFINE STO $RAGE MAP EMP2_LAST_NAME_MAP cont> FOR EMPLOYEES2 RELATION cont> STORE USING LAST_NAME8 cont> WITHIN EMPIDS_LOW_UNIFORM WITH LIMIT OF "IRONS"* cont> THRESHOLDS ARE (70,80,95);9 cont> EMPIDS_MID_UNIFORM WITH LIMIT OF "QUIST";# cont> EMPIDS_OVER_UNIFORM* cont> DEFAULT THRESHOLDS ARE (60,70,80), cont> END EMP2_LAST_NAME_MAP STORAGE MAP.= Note that the EMPIDS_LOW_UNIFORM storage area receives the? threshold values of (70,80,95) specified with the T%HRESHOLDS= clause, and the EMPIDS_MID_UNIFORM and EMPIDS_OVER_UNIFORMC storage areas receive the default threshold values of (60,70,80)0 specified with the DEFAULT THRESHOLDS clause. ww1 DEFINE_TRIGGER= Creates a trigger for the specified relation. A trigger is= a mechanism which associates a set of rules with an update operation. Example:D RDO> DEFINE TRIGGER EMPLOYEE_ID_CASCADE_DELETE <--- trigger nameC cont> BEFORE ERASE & <--- action timeC cont> FOR E IN EMPLOYEES <--- subject relation cont> EXECUTEG cont> FOR D IN DEGREES WITH <--- triggered action rse7 cont> D.EMPLOYEE_ID = E.EMPLOYEE_IDC cont> ERASE D <--- triggered action cont> END_FORC cont> FOR EACH RECORD. <--- frequency clause 2 More? To define a trigger, you need the Oracl 'e Rdb READ and DEFINEA privileges to the subject relation. If any triggered statement@ specifies some form of update operation, then CONTROL and the@ appropriate update privilege (ERASE, MODIFY, or WRITE) to theB relations specified by the triggered action statements are also required.B Each trigger is associated with a single subject relation, willB be evaluated at a specific time for a particular type of updateC on that relation, and specifies a series of 'triggered' act (ions.B Each triggered action consists of an optional condition and oneB or more statements to be evaluated either once only or for each( record of the relation being updated.@ By defining combinations of relation-specific constraints and? triggers, you can help to preserve integrity for a database.C However, the relation-specific constraints and triggers that youC define only preserve data integrity for the fields and relations@ specified in the constraints and triggers, )not for the entire database.; You can define a trigger only after you have invoked the/ database. See the DEFINE_RELATION statement.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you& issue the DEFINE TRIGGER statement.C Triggers that update rows of the trigger subjec *t relation or add@ rows to the trigger subject relation can cause infinite loopsB or inconsistent results to be returned, as in the following two conditions:C o A BEFORE MODIFY trigger on relation X that inserts a row into relation X= o A MODIFY statement affecting all the rows in relation XC Considering these two conditions, the MODIFY statement will loopA until all resources are consumed because for each row updated,A a new row will be added, which in tur +n will be updated, and so forth.A When subject relation rows are being retrieved using an index,@ there is the possibility that a triggered action operating onB the same relation could affect the index (by changing index key@ values or adding new keys) such that the triggering statement> behaves in a different manner than when there is no trigger involved.> Currently, only avoidance methods can be suggested for this> problem. The best way to avoid this problem is to , construct@ any such triggers to operate only on rows that are either theB current subject relation row, or that will never be selected byA the triggering statement. A more difficult avoidance method isB to restructure triggering statements such that they could neverB select a row that could have been updated or added by a triggerA action. Some circumstances will require a combination of these methods. 2 Formate (B)0DEFINE TRIGGER q> name wqqq-qqqqqqqqqqq>qqqqqqqqqqqqqwwq> BEFORE wkU m> DESCRIPTION IS /* text */ jmq> AFTER qjxE lqqqqqqqqqqqqqqqqqqqqqqqqqqqqq STORE qqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwkL t> ERASE qqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquxL m> MODIFY wqqqqqqqqqq>qqqqqqqqqqwwqqqqqqqqqqqqqq>qqqqqqqqqqqqwqjxP m> OF qw> field-name wjm> context-varia.ble-clause qj xE mqqqqq , FOR context-var IN relation-name w> triggered-action-clause w> .C mqqqqqqqqqqqqqq of the operation if no value change occurs. The conditional? expression, which compares the old value with the new value,? should appear as part of the triggered action's WITH clause. 3 context-var-clause# (B)0context-variable-clause =) qqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>0 tq> OLD CONTEXT old-context-var qu0 mq> NEW CONTEXT new-context-var qj> 3 An optional clause that can contain aliases for old and new> states of the context variable of the triggering statement. 4 old-context-var> A temporary name used to refer to the record values as they> existed before a modify operation occurred. You use an old-: context-var only when the trigger occurs after a modifyA operation, and must be a different name than the one given for context_var. 4 new-context-varA A temporary name used to reference the new record v4alues aboutD to be applied by modify operation. You use a new-context-var onlyC when the trigger occurs before a modify operation, and must be a5 different name than the one given for context-var. 3 context-varA A temporary name defining the relation on which the trigger is@ defined. The context variable name is an alias for the recordC stream context of the triggering statement which has caused this trigger to be executed. 3 relation-name= The name of the5 relation for which this trigger is defined (subject relation). 3 triggered-action-clause# (B)0triggered-action-clause = # qwqqqqqqqqqqqq>qqqqqqqqqqqqqqwqk, mq> WITH conditional-expr qqj x# lqqqqqqqqqqqqq EXECUTE qw> triggered-statement qwqqwqqqqqqqqqq>qqqqqqqqwq>V mqqqqqqqqqqq ; qqqq FOR EACH RECORD j (B)0triggered-statement = 0 qwq> store-statement q 6qqqqqqqqqqqqqqqqqqwq>< tq> FOR rse store-statement END_FOR qqu< tq> FOR rse erase-statement END_FOR qqu< tq> FOR rse modify-statement END_FOR qqu3 mq> ERROR qqqqqqqqqqqqqqqqqqqqqqqqqqqqqjA A triggered action clause consists of a conditional expression@ (optional), one or more triggered statements, and a frequency= clause (FOR EACH RECORD). The EXECUTE keyword precedes the triggered action clause. 4 rse7D A record selection expression that defines which records of whichB relations will be affected by the triggered update action. This* rse cannot refer to any host variables. 4 store-statement4 A STORE statement to be initiated by the trigger. 4 erase-statement5 An ERASE statement to be initiated by the trigger. 4 modify-statement5 A MODIFY statement to be initiated by the trigger. 4 WITHA A conditional expression that describes the optional cond 8itionD that must be satisfied before the associated triggered statementsD are executed. This expression cannot refer to any host variables.F For more information on Oracle Rdb conditional expressions, ask for) HELP on the top level topic Cond_expr. 4 FOR_EACH_RECORDC A frequency clause, FOR EACH RECORD (no underscores), determinesC whether an action is evaluated once per triggering statement, orD for each record of the subject relation updated by the triggeringA sta 9tement. If the FOR EACH RECORD clause is not specified, theA triggered action is evaluated only once, and record values are) not available to the triggered action. 2 ExamplesD The following example defines a trigger that performs a cascadingA delete triggered by the deletion of an employee record. Such aB trigger can be used to maintain referential integrity among theA EMPLOYEES, JOB_HISTORY, RESUMES, and SALARY_HISTORY relations.A Each associated employee record (:from the relations which have= foreign keys referring to the primary key in the EMPLOYEES relation) is deleted.1 RDO> DEFINE TRIGGER EMPLOYEE_ID_CASCADE_DELETE cont> BEFORE ERASE" cont> FOR E IN EMPLOYEES cont> EXECUTE- cont> FOR D IN DEGREES WITH7 cont> D.EMPLOYEE_ID = E.EMPLOYEE_ID! cont> ERASE D cont> END_FOR;2 cont> FOR JH IN JOB_HISTORY WITH8 con ;t> JH.EMPLOYEE_ID = E.EMPLOYEE_ID" cont> ERASE JH cont> END_FOR;- cont> FOR R IN RESUMES WITH7 cont> R.EMPLOYEE_ID = E.EMPLOYEE_ID! cont> ERASE R cont> END_FOR;5 cont> FOR SH IN SALARY_HISTORY WITH8 cont> SH.EMPLOYEE_ID = E.EMPLOYEE_ID" cont> ERASE SH cont> END_FOR$ cont> FOR <EACH RECORD.? The following RDO command procedure example defines a MODIFYC trigger with two actions. The first action is defined to accountB for the situation where the triggering MODIFY statement has not@ actually changed the value for the pertinent field (EMPLOYEE_? ID). This trigger causes a cascading update of the EMPLOYEESB relation's EMPLOYEE_ID value to the JOB_HISTORY table. The WITHC clause stipulates that the cascading update will occur only when@ the EMPLOYEE_=ID value actually changes. The example also logs- each MODIFY operation to the LOG relation. ! ! Invoke the database:' INVOKE DATABASE FILENAME 'PERSONNEL' !3 ! Define the global fields for the LOG relation: START_TRANSACTION READ_WRITE ! DEFINE FIELD TYPE DATATYPE IS TEXT 10.S %RDO-W-NOCDDUPDAT, database invoked by filename, the data dictionary will not be updated ! DEFINE FIELD REL_NAME DATATYPE IS TEXT 31. ! ! Define the LOG >relation: DEFINE RELATION LOG. TYPE. REL_NAME. END LOG RELATION. ! ! Define trigger TRIG1: DEFINE TRIGGER TRIG14 AFTER MODIFY OF EMPLOYEE_ID OLD CONTEXT OLD_EMP FOR NEW_EMP IN EMPLOYEES< WITH NEW_EMP.EMPLOYEE_ID <> OLD_EMP.EMPLOYEE_ID EXECUTE FOR JH IN JOB_HISTORY1 WITH JH.EMPLOYEE_ID = OLD_EMP.EMPLOYEE_ID? MODIFY JH USING JH.EMPLOYEE_ID = NEW_EMP.EMPLOYEE_ID END_MODIFY END_FOR FOR EACH RECORD ? EXECUTE STORE L IN LOG USING L.TYPE = "Modify";# L.REL_NAME = "EMPLOYEES" END_STORE FOR EACH RECORD. !H ! Test the trigger by changing the EMPLOYEE_ID of "00164" to "98765":2 FOR E IN EMPLOYEES WITH E.EMPLOYEE_ID = "00164"+ MODIFY E USING E.EMPLOYEE_ID = "98765" END_MODIFY END_FOR !B ! The trigger causes a record to be stored in the LOG relation: FOR L IN LOG PRINT L.TYPE, L.REL_NAME END_F@OR TYPE REL_NAME Modify EMPLOYEES ! ww 1 DEFINE_VIEW> Creates a view definition. A view is a relation that is notC physically stored. Rather, it is a virtual structure that pointsD to records from other relations. You define a view by specifying:< o A record selection expression to name the criteria for) selecting the relations and records* o A set of fields from those relations Example:* DEFINE VIEW EMPA_NAME OF E IN EMPLOYEES. E.FIRST_NAME. E.MIDDLE_INITIAL. E.LAST_NAME. END EMP_NAME VIEW. 2 MoreG You need the Oracle Rdb READ and DEFINE privileges to the referenced. relations to use the DEFINE VIEW statement.D When the DEFINE VIEW statement executes, Oracle Rdb adds the view? definition to the physical database. If you have invoked the> database with the PATHNAME argument, the definition is also! stored in the data dictionary.B You musBt execute this statement in a read/write transaction. If@ you issue this statement when there is no active transaction,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you# issue the DEFINE VIEW statement. 2 Format8 (B)0DEFINE VIEW qqq> name qqqqqk lqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqk> mqq> DESCRIPTION IS /* text C */ qqqj x5 lqqqqqqqqqqqqqqqqqqq OF qqq> rse qqqq> . qqqqqqqk) lqqqqqqqqqqqqqqq name-clause qqq> . qwqkA x mqq> /* text */ qqqqj x x? mqqqqqqqqqqqqqqqqqqqqqqqq END qqqqwqqqqq>qqqqqqwqqq> VIEW qqqq> .% D mqq> name qqqj 3 nameB Name of the view definition you want to create. When choosing a name, follow these rules:D o Use a name that is unique among all view and relation names in the database.C o Use any valid OpenVMS name. However, the name cannot end in a( dollar sign ($) or underscore (_)./ o Do not use any Oracle Rdb reserved words. 3 rseA A record selection expression that defines which rows of whichG relations O Eracle Rdb includes in the view. Ask for HELP on RSE for a8 complete description of record selection expressions. 3 name-clause: Specifies a field that you want to include in the view. (B)0name-clause = I qqwqqq> context-var . field-name qqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqwqkR tqqq> local-field-name qq> FROM qq> context-var . field-name qqu xY mqqq> local-field-name qq> COMPUTED BY qqqq> value-expr qqqqqqqj xG lqqqqqqqqqqqqqqqqqFqqqqqqqqqqq# mwq> dtr-clause qqqqwqj mqqqqqqq HELP DELETE_FIELD? To get HELP on the Replication Option DELETE statements, see7 the entries under the main topic Replication_Option. ww1 DEL NETE_COLLATING< The DELETE COLLATING_SEQUENCE statement deletes the named collating sequence.A If you have defined a global field or database using the named@ collating sequence, you cannot delete the collating sequence.F (B)0DELETE COLLATING_SEQUENCE qq> sequence-name.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.OB Other users are allowed to be attached to the database when you1 issue the DELETE COLLATING_SEQUENCE statement. 2 More@ You must have the DELETE privilege to the database to use the' DELETE COLLATING_SEQUENCE statement. ww1 DELETE_CONSTRAINT> Deletes one or more constraint definitions. When the DELETEC CONSTRAINT statement executes, Oracle Rdb deletes the constraintA definition from the physical database. If you use the PATHNAME@ a Prgument when you invoke the database, DELETE CONSTRAINT also> deletes the constraint definition from the data dictionary.D You cannot delete a constraint when there are active transactions2 that access the relation or relations involved.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.D You cannot delete a constraint definition unless you haQve invoked= the database that includes the constraint. Other users areC allowed to be attached to the database when you issue the DELETE CONSTRAINT statement. Example:( DELETE CONSTRAINT EMPLOYEE_ID_EXISTS. 2 FormatM (B)0DELETE CONSTRAINT qqwqq> constraint-name qqwqq> ./ mqqqqq PATHNAME qqq> path-name qqwqq> .@ mqqq> FILENAME qqq> file-spec qqj 3 path-nameB The full or relative data dictionary path-name for the databaseA directory in which the definitions reside for the database you want to delete. 3 file-specB The OpenVMS file specification for the database file containing> the database you want to delete. If you use this qualifier,D Oracle Rdb does not delete Vthe database definitions from the data dictionary. 2 MoreC You must have the ADMINISTRATOR privilege to the database to use! the DELETE DATABASE statement. 2 Examples Example 1@ Delete a database root file, storage area files, and snapshot files:= DELETE DATABASE FILENAME 'DISK2:[ACCOUNTING]MF_PERSONNEL'. Example 29 Delete a database and its data dictionary definitions:H RDO> DELETE DATABASE PATHNAME 'DISK1:[DICTIONARY]CORP.MIS.PERSONNWEL'. This statement deletes:; o The RDB file and the SNP file referred to in the data> dictionary definition for the database (specified in the DEFINE DATABASE statement) o The data dictionary entity* DISK1:[DICTIONARY]CORP.MIS.PERSONNEL ww1 DELETE_FIELD? Deletes one or more field definitions. When the DELETE FIELDG statement executes, Oracle Rdb deletes the field definition from theC physical database. If you invoke the Xdatabase using the PATHNAMEB argument, Oracle Rdb also deletes the field definition from theB CDD$DATABASE definition of the database in the data dictionary.@ You can delete any named field, whether it was defined with a> DEFINE FIELD statement or with a DEFINE RELATION statement.@ However, you cannot delete a field that is referred to in the2 definition of a relation, index, or constraint: Example: DELETE FIELD POSTAL_CODE. 2 MoreB o You must have the Or Yacle Rdb DELETE privilege for a field to7 delete the field with the DELETE FIELD statement.> o If you want to delete a field that is part of a relation? definition, you must use the CHANGE RELATION statement to@ delete the field from the relation definition, or you must! delete the entire relation.< o If you want to delete a field that is referred to in a? constraint or index definition, you must first delete the constraint or index.B o You ca Znnot delete a field definition unless you have invoked+ the database that includes the field.; o You can delete a field definition even when there are? active users. Deleting a field definition will not affect? active users until they exit their session and invoke theB database the next time. By default, a database can be openedB automatically (that is, by any user who invokes the databaseB and executes a data manipulation language statement). If theC [ database was modified so that it must be manually opened, the/ RMU/OPEN command must be used to open it.B o You must execute this statement in a read/write transaction.: If there is no active transaction and you issue thisG statement, Oracle Rdb starts a read/write transaction implicitly. 2 FormatH (B)0DELETE FIELD qqqwqqq> field-name qqqqwqqq> .) mqqqq INVOKE DATABASE PATHNAME 'PERSONNEL'$ RDO> START_TRANSACTION READ_WRITE RDO> DELETE FIELD TEMP_NUM. RDO> COMMIT? This sequence deletes the field definition from the physical$ database and the data dictionary. Example 2) Delete more than one field definition:, RDO> INVOKE DATABASE PATHNAME 'PERSONNEL'$ RDO> START_TRANSACT]ION READ_WRITE% RDO> DELETE FIELD TEMP_NUM, MONEY. RDO> COMMITC This sequence deletes the definitions for the TEMP_NUM and MONEY= fields from the physical database and the data dictionary. Example 3" Delete a field from a relation:, RDO> INVOKE DATABASE PATHNAME 'PERSONNEL'$ RDO> START_TRANSACTION READ_WRITE! RDO> DELETE FIELD STATUS_NAME.[ %RDO-W-NOCDDUPDAT, database invoked by filename, the data dictionary will not be updated0 %RDB-E-NO_META_UPDATE, me^tadata update failedE %RDMS-F-RELEXI, field STATUS_NAME is used in relation, WORK_STATUS< -RDMS-F-FLDNOTDEL, field STATUS_NAME has not been deleted$ RDO> CHANGE RELATION WORK_STATUS. cont> DELETE STATUS_NAME. cont> END.! RDO> DELETE FIELD STATUS_NAME. RDO> COMMIT< If a field is used in a relation, you need to perform two operations to delete it:0 o Change the relation by deleting the field.) o Delete the global field definition. ww_1 DELETE_INDEX? Deletes one or more index definitions. When the DELETE INDEXG statement executes, Oracle Rdb deletes the index definition from theC physical database. If you invoke the database using the PATHNAMEG argument, Oracle Rdb also deletes the index definition from the data dictionary. Example: DELETE INDEX EMP_LAST_NAME. 2 MoreD To delete an index for a relation, you need the Oracle Rdb DELETE privilege to the relation.B You c`annot delete an index definition if there is a storage map6 that specifies the index in a PLACEMENT VIA clause.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you$ issue the DELETE INDEX statement. 2 FormatG (B)0DELETE INDEX qqqwqqq> index-name qqqqwqaq> .) mqqqq INVOKE DATABASE PERSONNEL = PATHNAME "PERSONNEL"& RDO> DELETE INDEX DEG_COLLEGE_CODE. RDO> COMMITB This statement deletes the index from the physical database and+ the definition from the data dictionary. Example 2) Delete more than one index definition:8 RDO> INVObKE DATABASE PERSONNEL = PATHNAME "PERSONNEL"3 RDO> DELETE INDEX EMP_LAST_NAME, SH_EMPLOYEE_ID. RDO> COMMITD This statement deletes the indexes from the physical database and. their definitions from the data dictionary. ww1 DELETE_PATHNAME@ Deletes the data dictionary entity that contains the databaseA definitions. The DELETE PATHNAME statement does not delete the- database, snapshot, or storage area files. Example:@ RDO> DELETE PATHcNAME 'DISK1:[DICTIONARY]CORP.MIS.PERSONNEL'. 2 FormatD (B)0DELETE PATHNAME qqqqq> path-name qqqq> . 3 path-name@ The data dictionary path name for the dictionary entity whereB the database definitions are stored. Specify either a full data@ dictionary path name or a relative data dictionary path name. 2 ExamplesB RDO> DELETE PATHNAME 'DISK1:[DICTIONARY]ACCOUNTING.PERSONNEL'.2 This example deletes the data dictionary entityA DdISK1:[DICTIONARY]ACCOUNTING.PERSONNEL. It does not delete the RDB, SNP, or RDA files. 2 MoreE To use the DELETE PATHNAME statement, you must have the Oracle Rdb@ DELETE privilege for the CDD dictionary database in which the? data dictionary entity specified by the path name is stored.F You must also have the Oracle Rdb READ privilege for the Oracle Rdb/ database that you have invoked by path name. ww.*1 DELETE_PROTECTION< Deletes an entry efrom the access control list (ACL) for aC database or relation. An access control list entry specifies theD operations a user may perform on the associated database element.C Oracle Rdb access control lists are stored in the database file. Example:B RDO> DELETE PROTECTION FOR RELATION JOB_HISTORY [CLERKS,SMITH]. 2 Format5 (B)0DELETE PROTECTION FOR qqqqk x lqqqqqqqqqqqqqqqqqqqqjA mqqqqwqqq> DATABA fSE qqqqqqqqqqq>qqqqqqqqqqqqqqqqqkC tqqq> RELATION qq> relation-name qqqqqqqqqqquC tqqq> VIEW qqqqqq> view-name qqqqqqqqqqqqqqquJ mqqq> FIELD q> field-name IN relation-name qu: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq> .* tqqq> sequence-number qqqu* mqwq> identifier qqqqqqwqj& mqqqqqqqq + An OpenVMS user identifier that designates the entry withinA the specified access control list whose protection you want to delete. 2 Examples Example 17 Delete an ACL entry identified by a sequence number:) RDO> DELETE PROTECTION FOR DATABASE 3.A This statement deletes an entry identified by sequence number.A All the entries following the deletied entry are given the next lower sequence number. Example 2+ Delete an ACL entry identified by a UIC:B RDO> DELETE PROTECTION FOR RELATION JOB_HISTORY [CLERKS,SMITH].A This statement deletes the entry identified by [CLERKS,SMITH]. 2 MoreC You must have the Oracle Rdb CONTROL privilege to use the DELETE PROTECTION statement.A Revoking a privilege takes effect after the users detaches and" attaches to the database again.? You must execute thisj statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you) issue the DELETE PROTECTION statement. ww.*1 DELETE_RELATION> Deletes one or more relation definitions and all associatedD relation-specific constraints. When the DELETE RELATION statementD executes, Oracle Rdb deletes the reklation definition, the storageD map (if one exists), the constraints associated with the relation< definition, and the data stored in that relation from theC physical database. If you invoke the database using the PATHNAMEE argument, Oracle Rdb also deletes the relation definition from theB CDD$DATABASE definition of the database in the data dictionary. Example: DELETE RELATION COLLEGES. 2 FormatQ (B)0DELETE RELATION qqqwqqqq> relation-namle qqqqwqqqqq> .0 mqqqqq transactions involving the relation. That is, you must have$ EXCLUSIVE access to the relation.D If a view definition refers to a relation you want to delete, youC must delete that view definition before you delete the relation.= If a constraint in the database references a relation, youC cannot delete that relation until you delete the constraint that references the relation.? You must execute this statement inn a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you' issue the DELETE RELATION statement. 2 Examples Example 1' Delete a single relation definition:, RDO> INVOKE DATABASE PATHNAME "PERSONNEL"! RDO> DELETE RELATION COLLEGES. RDO> COMMIT> This statement deletes the definition for COLLEGES froom the< database file for PERSONNEL and from the data dictionary. Example 2, Delete more than one relation definition:, RDO> INVOKE DATABASE PATHNAME "PERSONNEL"* RDO> DELETE RELATION DEGREES, COLLEGES. RDO> COMMIT< This statement deletes both DEGREES and COLLEGES from the< database file for PERSONNEL and from the data dictionary. Example 3@ Delete a single relation and its associated relation-specific= constraints from the database. In this case, to del pete theA COLLEGES relation, it is necessary first to delete the DEGREESC relation and the COLLEGE_CODE_CASCADE_UPDATE trigger because the9 COLLEGES relation has constraints that depend on them., RDO> INVOKE DATABASE PATHNAME "PERSONNEL"! RDO> DELETE RELATION COLLEGES.0 %RDB-E-NO_META_UPDATE, metadata update failed@ -RDMS-F-CONEXI, relation COLLEGES is referenced in constraint DEGREES_FOREIGN2< -RDMS-F-RELNOTDEL, relation COLLEGES has not been deleted+ RDO> DELETE q CONSTRAINT DEGREES_FOREIGN2.0 %RDB-E-NO_META_UPDATE, metadata update failed@ -RDMS-F-CONDELVIAREL, constraint DEGREES_FOREIGN2 can only be3 deleted by changing or deleting relation DEGREES RDO> DELETE RELATION DEGREES.! RDO> delete relation colleges.0 %RDB-E-NO_META_UPDATE, metadata update failed5 -RDMS-F-TRGEXI, relation COLLEGES is referenced in& trigger COLLEGE_CODE_CASCADE_UPDATE< -RDMS-F-RELNOTDEL, relation COLLEGES has not been deleted3 RDO> DELETE TRIGGER COLrLEGE_CODE_CASCADE_UPDATE.! RDO> DELETE RELATION COLLEGES. RDO> COMMIT> This statement deletes the definition for COLLEGES from the< database file for PERSONNEL and from the data dictionary. ww.*1 DELETE_STORAGE_MAP? Deletes a storage map. You cannot delete a storage map for aB relation that has data in it. If you attempt to do so, you will receive an error message. Example:( RDO> DELETE STORAGE MAP DEGREES_MAP. 2 Format_s (B)0DELETE STORAGE MAP qqqqqqqqqqqqqq> map-name qqqqqqqqqqqqq> . 3 map-name= The name of the storage map definition you want to delete. 2 MoreB To use the DELETE STORAGE MAP statement to delete a storage mapG for a relation, you must have the Oracle Rdb DELETE privilege to the relation.A You cannot delete a storage map that refers to a relation thatD contains data. If you attempt to do so, you will receive an errorC messaget. If a relation is deleted, the underlying storage map is also deleted.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.B Other users are allowed to be attached to the database when you* issue the DELETE STORAGE MAP statement. 2 Example: The following example deletes the storage map TEST_MAP:& RDO> DELETE STORAGE MAP TEST_MAP.u ww.*1 DELETE_TRIGGERA Deletes one or more trigger definitions the physical database. Example:. RDO> DELETE TRIGGER CURRENT_SALARY_TRIGGER. 2 FormatF (B)0DELETE TRIGGER qwq trigger-name qqwqq> .( mqqqqqq , DELETE TRIGGER EMPLOYEE_ID_CASCADE_DELETE.= This example shows the deletion of a wtrigger, EMPLOYEE_ID_ CASCADE_DELETE. ww.*1 DELETE_VIEW= Deletes one or more view definitions. When the DELETE VIEWF statement executes, Oracle Rdb deletes the view definition from theA physical database and the data dictionary. You cannot delete aD view if other views refer to it. You can delete a view definition7 when there are other users attached to the database. Example:# RDO> DELETE VIEW CURRENT_SALARY. 2 FormatH (B)0x[mDELETE VIEW qqqqwqqq> view-name qqqqqwqqq> .) mqqqqqqqqq , INVOKE DATABASE PATHNAME "PERSONNEL"$ RDO> START_TRANSACTION READ_WRITE! RDO> DELETE VIEW CURRENT_INFO. RDO> COMMIT? This statement deletes the view definition from the physical$ database and the data dictionary.y Example 2( Delete more than one view definition:, RDO> INVOKE DATABASE PATHNAME "PERSONNEL" RDO> START_TRANS READ_WRITE RDO> DELETE VIEW CURRENT_JOB.M %RDMS-F-VIEWINVIEW, view, CURRENT_JOB, is referenced by view, CURRENT_INFO> -RDMS-F-VIEWNOTDEL, view, CURRENT_JOB, has not been deleted! RDO> DELETE VIEW CURRENT_INFO.# RDO> DELETE VIEW CURRENT_SALARY. RDO> DELETE VIEW CURRENT_JOB. RDO> SHOW RELATIONS5 User Relations in Database with filename PERSONNELz COLLEGES DEGREES DEPARTMENTS EMPLOYEES JOBS JOB_HISTORY RESUMES SALARY_HISTORY WORK_STATUS RDO> COMMITB This sequence shows how to delete a set of views, some of whichC depend on others. In this case CURRENT_INFO is a view definition= that combines fields from two other views, CURRENT_JOB and CURRENT_SALARY. 2 MoreA To delete a view with the DEFINE VIEW statement, you must have/ t{he Oracle Rdb DELETE privilege to the view.? You must execute this statement in a read/write transaction.B If there is no active transaction and you issue this statement,9 Oracle Rdb starts a read/write transaction implicitly.D Deleting a view does not affect other users until you commit yourD transaction, and users detach from the database and attach again. ww 1 DemoD To see an online demonstration of Oracle Rdb, type the following: $ @RDM$|DEMO:RDBDEMO ww.*1 EDITA Calls an editor that lets you edit the RDO statements you haveD issued within a terminal session. By default, Oracle Rdb uses theA EDT editor. You can use the editor to modify your previous RDOD statements, construct your next statement or group of statements,+ or include a file with other statements.. Example using EDT to edit an RDO statement:/ RDO> FOR J IN JOSB PRINT J.JOB_TITLE END_FOR= %RDO-F-RELNOTDEF, Relatio}n JOSB is not defined in database RDO> EDIT* FOR J IN JOSB PRINT J.JOB_TITLE END_FOR [EOB] 2 MoreD If you have invoked a database, you have the necessary privileges to use the EDIT statement.D If you have the VAX Text Processing Utility (VAXTPU) installed onC your system, you can invoke VAXTPU with the EDIT statement in anC RDO session. To use VAXTPU in an RDO session, define the logical& name RDO$EDIT in the following way: $ DEFINE RDO$EDIT "TPU" ~D Then, when you type EDIT in an RDO session, VAXTPU is invoked. IfD RDO$EDIT is not defined, or is defined to be something other thanA VAXTPU, then the EDT editor will be invoked when you issue theA EDIT statement. If RDO cannot find the VAXTPU shareable image,@ EDT will be invoked. To use your personal VAXTPU section fileD with RDO EDIT, you must define the logical name TPU$SECTION to be your personal section file.C You can use the editor you choose with your usual initializationC file to modify your previous RDO statements, construct your nextA statement or group of statements, or include a file with other statements. 2 Format/ (B)0EDIT qqqqwqqqqq>qqqqqqqwqqq> tqq> number qqu mqq> * qqqqqqqj 3 numberC The number of previous statements you want to edit. This must beC an integer. If you specify 0, RDO calls the editor with an empty) main editing buffer. The default is 1.  3 asterisk= The wild card character (*). If you use the wild card, RDO@ includes in the editing buffer n previous statements, where n@ is the number specified in SET EDIT KEEP n. The default is 20 statements. 2 Example: The following sequence demonstrates the correction of a misspelled statement: 1. Make a mistake: RDO> FOR J IN JOSB% cont> PRINT J.JOB_TITLE END_FOR@ %RDO-F-RELNOTDEF, Relation JOSB is not defined in database RDO> 2. Invoke the EDT editor: RDO> EDIT2 3. When in the editor, change "JOSB" to "JOBS".C 4. Exit from the editor. RDO automatically executes the contents of the editing buffer. * EXIT Associate Programmer Clerk Deputy Gopher Department Manager Dept. Supervisor . . . ww?R1 END_SEGMENT@ Marks the end of a block that starts with a CREATE_SEGMENTED_: STRING statement or a START_SEGMENTED_STRING statement. 2 Format9 (B)0END_SEGMENTED_STRING qqqqq> ss-handle 3 ss-handleD The handle given to the segmented string in the CREATE_SEGMENTED_. STRING or START_SEGMENTED_STRING statement. 2 MoreD If you have invoked a database, you have the necessary privileges- to use the END_SEGMENTED_STRING statement. 2 Examples4 Ask for HELP on CREATE_SEGMENT and START_SEGMENT. ww?R 1 END_STREAM Ends a stream.= If you close a record stream, you can use the START_STREAMA statement to establish a new record stream with the same name. Example:$ RDO> END_STREAM EMPLOYEES_STREAM 2 FormatE (B)0END_STREAM q> stream-name qwqqqqqqqq>qqqqqqqwq>3 mqq> on-error qqqj 3 stream-name< Names the stream that you want to close. If you are using@ declared streams, this name must be the same name used in theC associated DECLARE_STREAM statement. If you are using undeclaredB streams, this name must be the same name used in the associated START_STREAM statement. 3 on-errorG Specifies a host language or Oracle Rdb statement to be performed if an error occurs. 2 MoreD If you have invoked a database, you have the necessary privileges# to use the END_STREAM statement.@ If you are using declared streams, you can have more or fewerA END _STREAM statements than declared START_STREAM statements in@ your program, as long as the structure of the program ensuresD that exactly one END_STREAM statement is executed for each START_% STREAM statement that is executed.@ If you are using declared streams, you can issue several END_= STREAM statements in a module. As long as you use the sameD declared stream name in each END_STREAM statement, the END_STREAM0 statements will all refer to the same stream. 2 Examples Example 10 Close an open stream, named STREAM_X, in RDO: RDO> END_STREAM STREAM_X Example 2> Close an open stream, named OLD_STREAM, in a COBOL program: &RDB& END_STREAM OLD_STREAM ww?R1 ERASED Erases records from a relation. Before using the ERASE statement,A you must start a read/write transaction and establish a recordC stream using a context variable with a FOR statement or a START_B STREAM statement. You cannot erase records from a view that was@ formed with a WITH, REDUCED, or CROSS clause of an RDO recordC selection expression. Also, you cannot erase records from a viewC that was formed with a UNION clause of an SQL select expression. Example:. RDO> START_TRANSACTION READ_WRITE RESERVING& cont> COLLEGES FOR EXCLUSIVE WRITE RDO> FOR C IN COLLEGES cont> ERASE C cont> END_FOR RDO> COMMIT 2 Format< (B)0ERASE q> context-var qwqqqqqqq>qqqqqwq>* mq> on-error qj 3 context-varA A temporary name specified in an RSE for name recognition. YouB must define the context variable in a START_STREAM statement or; in a FOR loop. Request HELP on RSE for more information. 3 on-errorD The ON ERROR clause, which specifies a host language statement orJ Oracle Rdb data manipulation statement to be performed if an Oracle Rdb? error occurs. Request HELP on ON_ERROR for more information. 2 MoreD You need the Oracle Rdb READ and ERASE privileges to the relationF and the Oracle Rdb ERASE privilege to the database to use the ERASE statement.C You cannot erase records from a view that was formed with one of the following clauses:7 o WITH clause of an RDO record selection expression= o REDUCED TO clause of an RDO record selection expression8 o CROSS clause of an RDO record selection expression. o UNION clause of an SQL select expres sionD Prior to Version 4.1, Oracle Rdb allowed you to erase rows from aC table that was directly joined with other tables. Beginning withG Version 4.1, Oracle Rdb returns an error message if you try to eraseD a row under these conditions. For example, Oracle Rdb will returnA the error, $RDMS-E-JOIN_CTX_UPD, relation EMPLOYEES is part ofC a join, cannot be updated, when you try to execute the following query:9 FOR E IN EMPLOYEES CROSS D IN DEGREES OVER EMPLOYEE_ID  WITH D.DEGREE= 'MA' ERASE E END_FORA In the preceding query, if an employee has two MA degrees, theA same employee row will be joined to two different degree rows.C Therefore, Oracle Rdb will try to delete the same row twice. TheC previous update query can be reworded into an equivalent form to* achieve the desired results as follows: FOR E IN EMPLOYEES WITH; (ANY D IN DEGREES WITH D.EMPLOYEE_ID = E.EMPLOYEE_ID) ERASE E END_FOR? The rows can now be erased because the EMPLOYEES table is no? longer directly joined to the DEGREES table. The use of thisA query guarantees that an employee row will not be deleted more than once.A Note that some examples in the Guide to Using RDO, RDBPRE, andG RDML will no longer work with the update rules created in Oracle RdbA Version 4.1. To run these examples, rewrite them using the ANY! subquery mentioned previously. 2 Examples Example 1; Assume you wish to erase all the records in the COLLEGES relation:. RDO> START_TRANSACTION READ_WRITE RESERVING& cont> COLLEGES FOR EXCLUSIVE WRITE) RDO> FOR C IN COLLEGES ERASE C END-FOR$ RDO> PRINT COUNT OF C IN COLLEGES 0 RDO> COMMITD This statement uses the loop established by the FOR statement and5 erases all the records from the COLLEGES relation. ww[ 1 Errors> Help is available on the following types of error messages:E o RDMS f acility error messages-Specific to Oracle Rdb. Select the8 RDMS_ERRORS help topic for help on these messages.? o RDO facility error messages-Seen when you are running theD interactive RDO utility. Select the RDMS_ERRORS help topic for help on these messages.D o COSI facility error messages-Common Operating System InterfaceB (COSI) error messages. Select the COSI_ERRORS help topic for help on these messages.? You can also print or type the SYS$HELP:R DB_MSG.DOC file for< information on messages returned by the RDB facility. The> RDB facility is common code shared by all Database Standard: Relational Interface (DSRI) compliant database systems.: The SYS$HELP:RDB_MSG.DOC file contains the RDB facility9 messages from the most recently installed version of a: database product system or cluster. (Installation of a : new version of Oracle Rdb upgrades the RDB_MSG.DOC file= whenever the RDB message image, RDBMSGS.EXE, includes new  or revised error messages.) wwPz 1 ExecuteA The 'at' sign (@) means "execute" in RDO, just as in DCL. WhenD you type @ and the name of an indirect command file, RDO executesD the statements in the file as if you had typed them one at a timeC at the RDO prompt. The default file type for an indirect command@ file is RDO. You can use the SET VERIFY statement to have the@ commands in the file displayed on the screen as they execute. Example: $ TYPE ACCOUNTING.RDO. INVOKE DATABASE FILENAME "DEPT3:ACCOUNTING" SHOW DATABASES $ RDO RDO> @ACCOUNTING$ Database with filename ACCOUNTING 2 Format @file-spec file-specB The name of an indirect command file. You can use either a fullA OpenVMS file specification, a file name, or a logical name. If@ you use a file name, RDO looks in the current default OpenVMSA directory for a file by that name. The file must contain valid RDO statements. 2 MoreG You do not need any special Oracle Rdb privileges to use the EXECUTE statement.C You can use the SET VERIFY statement to have the commands in the0 file displayed on the screen as they execute.? RDO recognizes a special RDO command file called RDOINI.RDO,A which contains RDO statements to be issued before RDO displaysB the RDO> prompt. If this file exists, RDO executes the commandsA in that file first, before displaying the prompt and acceptingC your input. If you have defined the logical name RDOINI to pointC to a general initialization file, RDO uses this file. Otherwise,< it looks for RDOINI.RDO in the current default directory. 2 Examples Example 1C Use an indirect command file to execute a frequently used query: $ TY EMPADDR.RDO !@ ! This command file generates information for a mailing list. !< INVOKE DATABASE FILENAME 'DISK2:[DEPT32]MF_PERSONNEL.RDB'* SET OUTPUT 'DISK2:[DEPT32]MAILLIST.DOC' FOR E IN EMPLOYEES6 PRINT E.FIRST_NAME, E.MIDDLE_INITIAL, E.LAST_NAME,L E.ADDRESS_DATA_1, E.ADDRESS_DATA_2, E.CITY, E.STATE, E.POSTAL_CODE END_FOR $ RDO:== $RDO $ RDO RDO> @EMPADDR Example 24 You can use a logical name to run a command file:! $ SET DEFAULT DISK1:[FORESTER]* $ DEFINE COUNT "DISK2:[DEPT3]COUNT.RDO" $ TYPE DISK2:[DEPT3]COUNT.RDO !, ! This command file counts the records in0 ! each relation in the MF_PERSONNEL database. ! SET NOVERIFY SET OUTPUT COUNT.LOG; INVOKE DATABASE FILENAME 'DISK2:[DEPT3]MF_PERSONNEL.RDB' PRINT " "< PRINT "Statistics for the MF_PERSONNEL database follow: " PRINT " "@ PRINT "Count of Employees -------> ", COUNT OF X IN EMPLOYEES; PRINT "Count of Jobs ------------> ", COUNT OF J IN JOBS> PRINT "Count of Degrees ---------> ", COUNT OF D IN DEGREESF PRINT "Count of Salary_History --> ", COUNT OF SH IN SALARY_HISTORYC PRINT "Count of Job_History -----> ", COUNT OF JH IN JOB_HISTORYB PRINT "Count of Work_Status -----> ", COUNT OF W IN WORK_STATUSB PRINT "Count of Departments -----> ", COUNT OF D IN DEPARTMENTS? PRINT "Count of Colleges --------> ", COUNT OF C IN COLLEGES> PRINT "Count of Resumes ---------> ", COUNT OF R IN RESUMES PRINT " "B PRINT "Statistics Complete for Database - written to COUNT.LOG" PRINT " " PRINT " " $ ! $ RDO:== $RDO $ RDO RDO> @COUNT0 Statistics for the PERS ONNEL database follow:. Count of Employees -------> 100. Count of Jobs ------------> 15. Count of Degrees ---------> 166. Count of Salary_History --> 729. Count of Job_History -----> 274. Count of Work_Status -----> 3. Count of Departments -----> 26. Count of Colleges --------> 16. Count of Resumes ---------> 0: Statistics Complete for Database - written to COUNT.LOG RDO>C Notice that the default OpenVMS directory is not the same as the@ directory containing the command file. You define the processB logical name to point to the correct command file. Then you use3 the logical name as the object of the @ command. ww?R1 EXITB Ends an RDO session and returns you to the DCL prompt. The EXIT" statement is valid in RDO only. For example: RDO> EXIT $ 2 Format (B)0EXIT 2 MoreD You do not need any special Oracle Rdb privileges to use the EXIT statement. ww?R 1 EXPORTB Makes a copy of a database in an intermediate, compressed form.B Use the RDO IMPORT statement on this export file to rebuild the Oracle Rdb database. Example:7 RDO> EXPORT 'DEPT3:PERS' INTO 'DISK2:PERSONNEL.RBR' 2 More Use EXPORT and IMPORT to:> You must have the Oracle Rdb READ privilege to the database) relations to use the EXPORT statement.E o Restructure an Oracle Rdb single-file database into a multifile database& o Restructure a multifile databaseD o Migrate a database from one DSRI-compliant database management system to another; o Create a version-independent copy of the database for archiving purposes= o Create an empty target database that uses the same data? definitions as a source database by copying the metadata,. but not the data, to the target database? o Change database and storage area characteristics that you6 cannot change with the CHANGE DATABASE statement@ The IMPORT and EXPORT statements are not intended for regularC backups of the database. For regular backups and restorations ofE Oracle Rdb databases, use the RMU/BACKUP and RMU/RESTORE commands. 2 FormatV (B)0EXPORT q> database-file-spec q>INTO q> interchange-file-spec qkB lqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj6 mqqwqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqwqqqqqqq>< mq> WITH qqqqqwqqq> EXTENSIONS qqqqqqqu5 tqqq> NOEXTENSIONS qqqqqu5 tqqq> DATA qqqqqqqqqqqqqu5 mqqq> NODATA qqqqqqqqqqqj 3 database-file-specB The file specification for the database you want to export. UseA either a full or partial file specification or a logical name.F If you use a simple file name, Oracle Rdb looks for the database inD the current default directory. If you do not specify a file type, Oracle Rdb uses RDB. 3 interchange-file-spec> The file specification for a file in which EXPORT places an= intermediate version of the database. Use either a full orD partial file specification or a logical name. If you use a simpleC file name, Oracle Rdb places the interchange file in the current3 default directory. The default file type is RBR. 3 WITH_EXTENSIONS; Specifies whether the exported format of the database is> compatible with a pre-Version 3.0 Oracle Rdb database (WITHE NOEXTENSIONS), or with an Oracle Rdb database created with VersionF 3.0 Oracle Rdb software or higher (WITH EXTENSIONS). The default isF WITH EXTENSIONS. The WITH EXTENSIONS option also directs Oracle Rdb? to preserve other parameters about the physical structure of? the exported database. Use WITH NOEXTENSIONS when you expor tC a database that you plan to import on pre-Version 3.0 Oracle Rdb software.@ When you specify the WITH NOEXTENSIONS option, null flags forC missing value fields are not exported, therefore numeric missing@ values are replaced by zeros and character missing values are replaced by blanks.@ Note also that when you specify the WITH NOEXTENSIONS option,B features of Version 3.0 and higher Oracle Rdb databases are notA exported. Storage maps, triggers, and collating sequences, forD example, are not backed up when you specify the WITH NOEXTENSIONS option.; The WITH NOEXTENSIONS option is not compatible with dataD dictionary databases (CDD$DATABASE.RDB). If you attempt to exportC a CDD$DATABASE.RDB database, RDO issues an error message stating@ that the NOEXTENSIONS option is not valid for data dictionary databases. 3 WITH_DATA@ Specifies whether the RBR file includes the data and metadataD contained in the database (WITH DAT A), or the metadata only (WITH% NODATA). The default is WITH DATA.@ When you specify the WITH NODATA option, the EXPORT statementC copies metadata from the source database to an RBR file. Use theC IMPORT statement to generate an empty database whose metadata is, identical to that of the source database.@ The WITH NODATA option is not compatible with data dictionary; databases (CDD$DATABASE.RDB). If you attempt to export aA CDD$DATABASE.RDB database, RDO issues an error message stating: that the NODATA option is not valid for data dictionary databases. 2 Example Example 1A The following example shows how to export a database to a disk file: RDO> EXPORT$ cont> 'DEPT3:PERSONNEL.RDB' INTO- cont> 'EXPORT$DISK:[EXPORT]PERSONNEL.RBR'5 This statement creates an interchange file for the: PERSONNEL database from the database file identified by@ DEPT3:PERSONNEL.RDB. DEPT3 in this case is a logical name forC the device and directory where the database is located. The copyB is stored on EXPORT$DISK in the directory [EXPORT]. By default,: the database is exported WITH EXTENSIONS and WITH DATA. Example 2< The following example shows how to export a database to a magnetic tape volume: $ INITIALIZE MUA0: _Label: PERS $ $ MOUNT MUA0: _Label: PERS _Log name: $ RDO> RDO> EXPORT 'DEPT3:PERSONNEL.RDB' INTO 'MUA0:PERSONNEL.RBR'A This statement creates an intermediate copy of the database onB the magnetic tape volume labeled PERS, mounted on device MUA0:. Example 3> The following example shows how to export the metadata in a database without its data: RDO> EXPORT$ cont> 'DEPT3:PERSONNEL.RDB' INTO- cont> 'EXPORT$DISK:[EXPORT]PERSONNEL.RBR' cont> WITH NODATA5 This statement creates an interchange file for the: PERSONNEL database from the database file identified byA DEPT3:PERSONNEL.RDB. The WITH NODATA option  specifies that theC interchange file, PERSONNEL.RBR, contains only the metadata that* defines the structure of PERSONNEL.RDB. wwPz1 FETCHA Advances the pointer for a record stream to the next record ofA a relation. Once you have established and opened a stream withC the START_STREAM statement, use the FETCH statement to establishD the first record in a relation as the current record. After that,? each FETCH statement makes the next record in the s tream theB current one. The FETCH statement only advances the pointer in aA record stream. You must use other data manipulation statementsB to manipulate each record. For instance, you might use FETCH toB advance the pointer and the GET statement to assign values from* that record to host language variables. Example:6 RDO> START_STREAM EMPS USING JH IN JOB_HISTORY WITH8 cont> JH.EMPLOYEE_ID = "00164" SORTED BY JH.JOB_START RDO> FETCH EMPS7 RDO> PRINT JH.EMPLOYEE_ID, JH.JOB_CODE, JH.JOB_START 2 FormatA (B)0FETCH qqq> stream-name qqwqqqqqq>qqqqqqwqqqk1 mq> on-error qj x/ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>H tq> AT END qq> statement qqq> END_FETCH qqu8 mq> END_FETCH qqqqqqqqqqqqqq>qqqqqqqqqqqqqj 3 stream-nameD Names the stream in which you want to advance the stream pointer.F Oracle Rdb moves the pointer to the next record that it can return.> Because the FETCH statement defines the current record in aA record stream, you must use a FETCH statement before any otherE Oracle Rdb data manipulation statement when you are using streams. 3 on-errorD The ON ERROR clause. This clause specifies the action to be takenE if an Oracle Rdb error occurs during the FETCH operation. For more) information, request HELP on ON_ERROR. 3 statement? Any valid host language or Oracle Rdb statement. The program@ executes the statement specified in the AT END clause when noB records remain to be processed in the record stream. If you use6 the AT END clause, you must also include END_FETCH. 2 MoreD If you have invoked a database, you have the necessary privileges to use the FETCH statement. 2 ExampleA Advance a stream pointer in an open stream in a COBOL program: CONTROL-PAR.$ PERFORM INIT THRU INIT-END.' PERFORM LOOP UNTIL DONE = "Y". PERFORM GET-OUT. STOP RUN. INIT.% &RDB& START_TRANSACTION READ_WRITE7 &RDB& START_STREAM WORKERS USING C IN CURRENT_INFO. INIT-END. EXIT. LOOP. &RDB& FETCH WORKERS &RDB& ON ERROR" GO TO STREAM_ERROR &RDB& END_ERROR &RDB& AT END" MOVE "Y" TO DONE GO TO GET-OUT &RDB& END_FETCH &RDB& GET &RDB& LAST = C.LAST;( &RDB& DEPARTMENT = C.DEPARTMENT; &RDB& SALARY = C.SALARY &RDB& END_GET( DISPLAY LAST, DEPARTMENT, SALARY. STREAM_ERROR.) DISPLAY "Error in START_STREAM". STOP RUN. GET-OUT. &RDB& END_STREAM WORKERS &RDB& COMMIT &RDB& FINISH., This program fragment does the following:< o Starts a stream and gives it the name WORKERS. The RSEA specifies a set of records, in this case the whole CURRENT_ INFO view.@ o Uses COBOL statements to set up a loop and give the ending condition for the loop.D o Uses FETCH and GET to retrieve one record on each pass through@ the loop and place three fields from that record into host language variables.@ o Uses AT END and ON ERROR to handle end-of-stream and error conditions.D o Uses the COBOL DISPLAY statement to display the variables each time through the loop. ww 1 Field_attr" The characteristics of a field. (B)0field-attributes = * DATATYPE IS qqq> data-type qqk! lqqqqqqqqqqqqqqqqqqqqqqqqqj@ mqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqq>> mwqwqq> validity-clauseqqqqqqqqqqqqqqqqqqqqqqqwqwqj< x tqq> missing-value-clauseqqqqqqqqqqqqqqqqqqu x< x tqq> dtr-clauseqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xC x tqq> COLLATING_SEQUENCE IS sequence-nameqqqu xJ x mqq> NO COLLATING_SEQUENCE qqqqqqqqqqqqqqqqj x: mqqqqqqqqqqqqqqqqq SEGMENT_LENGTH IS qqq> n qqq> BYTES qqwqwq>G x mqqq> SUB_TYPE IS qqqqwqqqq> BLR qqqqqqwqqqqj x> x tqqqq> TEXT qqqqqu x9 x mqqqq> n qqqqqqqqj x7 mqqqqqqqqqqqqqqqqqqqqqq VALID IF qqq> conditional-expr qwq>> mq> NO VALID IF qq qqqqqqqqqqqqqqqqqqjD conditional-expr Specifies a valid conditional expression. ThisC conditional expression must refer only to the@ field being defined. Ask for HELP on Cond_C expr for a complete description of Oracle Rdb. conditional expressions. 3 Example? In the following example, the SHOW FIELD statement shows the@ SEX field, which contains a VALID IF clause. The CHANGE FIELD< statement removes the VALID_IF clause from the SEX field: RDO> DATA FILE DB$:PERSONNEL RDO> SHOW FIELD SEX9 SEX text size is 1 Description: M, F Missing value: "?"7 Valid: IF SEX = 'M' OR SEX = 'F' OR. SEX MISSING% RDO> CHANGE FIELD SEX NO VALID IF. RDO> SHOW FIELD SEX9 SEX text size is 1 Description: M, F  Missing value: "?" RDO> ROLLBACK 2 missing-value-clauseD Specifies a numeric or character string literal that denotes thatD no value is stored in the field. When you retrieve or display theE value, Oracle Rdb returns the contents of the MISSING_VALUE string or number. (B)0missing-value-clause = G qqqqq> MISSING_VALUE IS qqqwqqq> fxd-pnt-num qqqqqwqqq>: mqqq> quoted-string qqqj 3 fxd-pnt-numC  A fixed-point number that Oracle Rdb uses to replace a retrieved null value.B A fixed-point number always includes a decimal point, even when9 there are no digits to the right of the decimal point.? For example, if a field contains dollar and cent values, youB may want to use 0.00 as the missing value to preserve the valueF context when Oracle Rdb retrieves and displays null values. In thisB particular case, if you do not allow null values and you do notE specify a m issing value, Oracle Rdb fills the retrieved field with zeros.A Specify a number that does not exceed the defined field length and include a decimal point. 3 quoted-stringD A character string that Oracle Rdb uses to replace retrieved nullC values. For example, you could specify a missing value of "Value@ not found" to replace null values. Specify a character string@ whose length does not exceed the length of the field. Enclose> the string in single or double quotation marks ("string" orC 'string'). Ask for HELP on Value_expr for a complete description% of the use of literal expressions. 3 Examples Example 1" Define missing value for dates: DEFINE FIELD STANDARD_DATE1 DESCRIPTION /* Universal date field */ DATATYPE IS DATE5 MISSING_VALUE IS "17-NOV-1858 00:00:00.00"7 EDIT_STRING FOR DATATRIEVE IS 'DD-MMM-YYYY'.D This definition defines a missing value for date fields to be the. same as the base date and time for OpenVMS. Example 2, Define missing values for numeric fields: DEFINE FIELD SALARY/ DATATYPE IS SIGNED LONGWORD SCALE -2 MISSING_VALUE IS 0.007 EDIT_STRING FOR DATATRIEVE IS '$$$$,$$9.99'.B This statement specifies "0.00" as the missing value for SALARY fields. Example 3) Define missing values for text fields: DEFINE FIELD ADDRESS_DATA# DATATYPE IS TEXT SIZE 20, MISSING_VALUE IS "Not available".? When you retrieve a field whose value is missing, Oracle Rdb' displays the string "Not available". 2 dtr-clause@ Oracle Rdb provides support for DATATRIEVE, the Digital queryB language. You can specify one or more of the following clauses: Query header Query name Default value Edit stringC If you specify a DATATRIEVE attribute on a global field, you can@ cancel that attribute for a particular relation, using the NOB qualifier. The NO qualifier of the dtr-clause is available when@ you are changing a definition with the CHANGE FIELD or CHANGEA RELATION statement. The NO qualifier is not used with the dtr-< clause of DEFINE FIELD, DEFINE RELATION, and DEFINE VIEW. 3 Format (B)0dtr-clause = ^ qwq> QUERY_HEADER FOR qqwq> DTR qqqqqqqqwqq> IS qw> quoted-string qqwqwq>J x mq> DATATRIEVE qj mqqqqqq / NO QUERY_HEADER FOR qqwqq DTR qqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqquJ x mq> DATATRIEVE qqqj xU tq> QUERY_NAME FOR qqqqwq> DTR qqqqqqqqqwq> IS qq> quoted-string qqqquJ x mq> DATATRIEVE qqj xZ tq> NO QUERY_NAME FOR qqqqwqq DTR qqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqquJ x mq> DATATRIEVE qqj xU tq> DEFAULT_VALUE FOR qwq> DTR qqqqqqqqqwq> IS qw> fxd-pnt-num qqqqwquL x mq> DATATRIEVE qqj m> quoted-string qqj xZ tq> NO DEFAULT_VALUE FOR qwq> DTR qqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqquJ x mq> DATATRIEVE qqj xU tq> EDIT_STRING FOR qqqwq> DTR qqqqqqqqqwq> IS qq> quoted-string qqqquJ x mq> DATATRIEVE qqj xZ mq>  NO EDIT_STRING FOR wq> DTR qqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqj- mq> DATATRIEVE qqjA fxd-pnt-num The default value returned to DATATRIEVE whenC Oracle Rdb retrieves null values. A fixed-point= number is a number that always includes a@ decimal point, even when there are no digits6 to the right of the decimal point.C quoted-string A literal expression that Oracle Rdb returns to DATATRIEVE. 3 Examples Example 1C The following example defines a field and specifies a DATATRIEVE edit string for that field: DEFINE FIELD MIDDLE_INITIAL" DATATYPE IS TEXT SIZE 1. EDIT_STRING FOR DATATRIEVE IS 'X.'.? The X represents any alphanumeric character. When you accessB this field through DATATRIEVE, the field value is followed by aD period. The DATATRIEVE documentation set contains a complete list of editing characters. Example 2@ The following example defines a DATATRIEVE query name for one3 field and a DATATRIEVE query header for another: DEFINE FIELD STATE" DATATYPE IS TEXT SIZE 2- QUERY_NAME FOR DATATRIEVE IS "ST". DEFINE FIELD SEX" DATATYPE IS TEXT SIZE 1* VALID IF SEX = 'M' OR SEX = 'F'6 QUERY_HEADER FOR DATATRIEVE IS "S"/"E"/"X".C These statements define DATATRIEVE query names and query headersB for the STATE and SEX fields. The header for the SEX field will0 be one character wide, like the field itself. 2 COLLATINGD The COLLATING_SEQUENCE clause specifies the collating sequence to) be used in the field you are defining.A The NO COLLATING_SEQUENCE clause specifies that the field willC use the standard default collating sequence (the ASCII collating sequence). wwPz 1 FINISHB Explicitly declares a database closed when you are done working< with it. FINISH with no parameter also commits all active= transactions. It is recommended that you use FINISH before exiting from a program. Example: 999-EOJ. IF BAD-FLAG = 1 THEN &RDB& ROLLBACK ELSE &RDB& COMMIT &RDB& FINISH CLOSE JOBHST-FILE. STOP RUN. 2 MoreD If you have invoked a database, you have the necessary privileges to use the FINISH statement.C When you use INVOKE to declare databases and then use the START_D TRANSACTION statement, the Oracle Rdb preprocessors automatically= attach your process to all the databases you have invoked.@ This involves some overhead and record locking. If the FINISHC statement occurs explicitly in the run-time flow of the program,A Oracle Rdb detaches from the database mentioned in the FINISH.B If another START_TRANSACTION occurs, Oracle Rdb attaches to the= databases again. Therefore, if your program uses databasesA sequentially, you can use FINISH to close each database as youF are finished working with it. In this way, Oracle Rdb attaches only* the databases you need at any one time. 2 FormatH (B)0FINISH qqqwqqqqqqqqqqqqqqqqqqqwqwqqqqqqqqqqqqqqqqwqq>9 mqwq> db-handle qwqqj mqq> on-error qqqj mqqqqq , A host language variable that identifies the database to beD accessed. Use the db-handle that you associated with the database in the INVOKE statement. 3 on-errorE Specifies host language statements or Oracle Rdb data manipulationE statements to be performed if an Oracle Rdb error occurs. For more% details, request HELP on ON_ERROR. 2 ExampleD The following fragment shows how to use INVOKE and FINISH to work with two databases:# &RDB& INVOKE DATABASE WORKERS =- &RDB& FILENAME 'DISK2:[DEPT4]EMPLOYEES'! &RDB& INVOKE DATABASE PARTS =) &RDB& FILENAME 'DISK2:[DEPT4]PARTS' . . .6 ! [This part of the program can combine data from both databases] . . . &RDB& FINISH WORKERS . . .* ! [This part of the program uses only the PARTS database] . . . &RDB& FINISH PARTSD Between the second INVOKE statement and the first FINISH, you can! access both databases at once. wwPz1 FORC Executes a statement or group of statements once for each recordD in a record stream formed by a record selection expression (RSE).C Oracle Rdb evaluates all variables when the RSE is compiled, not@ when the statements within the FOR loop execute. For detailed/ information on the RSE, request HELP on RSE. Example:9 RDO> FOR E IN EMPLOYEES WITH E.EMPLOYEE_ID = "00164"1 cont> MODIFY E USING E.MIDDLE_INITIAL = "M" cont> END_MODIFY cont> END_FOR 2 FormatM (B)0FOR qwqqqqqqqqqq>qqqqqqqqwqq> rse qqwqqqqqqq>qqqqqqqwqqk? mq> handle-options qj mqq> on-error qqj x; lqqqqqqqqqqqqqqqqqqqqqqq statement qwqqqqqq> END_FOR qqqqqqqqq> mqqqqqqqq statement qwq> END_ERROR mqqqqqqqq ( qwq> REQUEST_HANDLE qqq> var qqqqqqqqqqqqqqqqqqqqqqqqqqqwq> ) qq>M tq> TRANSACTION_HANDLE qqq> var qqqqqqqqqqqqqqqqqqqqqqquV mq> REQUEST_HANDLE q> var , TRANSACTION_HANDLE q> var qj 4 REQUEST_HANDLEC A keyword followed by a host language variable. A request handleB points to the location of a compiled Oracle Rdb request. If youE do not supply a request handle explicitly, Oracle Rdb associates aB default request handle with the compiled request. Your must useC a request handle when you want to make an identical query to two different databases.: In Callable RDO, use !VAL as a marker for host language variables.B You can put parentheses around the host language variable name. 4 TRANSACTION_HANDLE@ A keyword f ollowed by a host language variable. A transactionB handle identifies each instance of a transaction. If you do notD declare the transaction handle explicitly, Oracle Rdb attaches an* internal identifier to the transaction.: In Callable RDO, use !VAL as a marker for host language variables.B You can put parentheses around the host language variable name.A Normally, you do not need to use this argument. The ability toB declare a transaction handle is provided for compatibility with= other database products and future releases of Oracle Rdb. 2 MoreD You need the Oracle Rdb READ privilege to the records in a record# stream to use the FOR statement.B You can nest FOR loops as an alternative to the CROSS clause toB perform a join operation. However, the performance of the CROSS clause is usually faster.E However, the interactive RDO utility unbundles loops when an innerE loop does not reference the context of an outer loop, such as that# shown in the following example:! FOR F1 IN F1 WITH F1.F11 = "1" PRINT F1.*% FOR F2 IN F2 WITH F2.F21 = "1" PRINT F2.* ERASE F2 END_FOR ERASE F1 END_FORI This loop will be executed as two discrete loops because RDO considers them independent.! FOR F1 IN F1 WITH F1.F11 = "1" PRINT F1.* ERASE F1 END_FOR! FOR F2 IN F2 WITH F2.F21 = "1" PRINT F2.* ERASE F2 E ND_FORJ This simplifies the internal processing performed by RDO and in general7 will result in the desired action upon the database.J However, if there is a FOREIGN KEY (or similar constraint) relationshipH from F2 to F1 and the constraint is evaluated at verb time, then thisE loop unbundling will result in an unexpected constraint violation.E %RDB-E-INTEG_FAIL, violation of constraint F2_FOREIGN_0001 caused  operation to fail@ -RDB-F-ON_DB, on database DISK1:[SMITH.WORK]FORKEY_TEST.RDB;1G To avoid such problems, you should either evaluate the constraint atI commit time, or modify the nested loop so that there is a reference inK the inner loop to context of the outer loop. See the underlined portion of the following example.! FOR F1 IN F1 WITH F1.F11 = "1" PRINT F1.*( FOR F2 IN F2 WITH F2.F21 = F1.F11( _______________ PRINT F2.* ERASE F2 END_FOR ERASE F1  END_FOR 2 Examples Example 16 Create a record stream with a FOR statement in RDO:# RDO> START_TRANSACTION READ_ONLY RDO>< RDO> FOR D IN DEPARTMENTS WITH D.DEPARTMENT_CODE = "SEUR"" cont> PRINT D.DEPARTMENT_CODE," cont> D.DEPARTMENT_NAME, cont> D.MANAGER_ID cont> END_FOR RDO> RDO> COMMIT These statements:: o Create a record stream defined by a record selection expressionA o Retrieve three field values from each record in that stream Example 2: Create a record stream with the FOR statement in BASIC:% &RDB& START_TRANSACTION READ_ONLY" &RDB& FOR E IN EMPLOYEES CROSS. &RDB& S IN SALARY_HISTORY OVER EMPLOYEE_ID/ &RDB& WITH E.EMPLOYEE_ID = EMPLOYEE_ID' &RDB& AND S.SALARY_END MISSING &RDB& ON ERROR GOTO 3000 &RDB& END_ERROR &RDB& GET' &RDB& LAST_NAME = E.LAST_NAME;) &RDB& FIRST_NAME = E.FIRST_NAME;' &RDB& SALARY = S.SALARY_AMOUNT &RDB& END_GET &RDB& END_FOR &RDB& COMMIT< This program fragment retrieves the current salary for an? employee specified by the value of the EMPLOYEE_ID variable. The example:A o Establishes a record stream consisting of the record in theB EMPLOYEES relation with the ID number that the user supplies@ in the host language variable EMPLOYEE_ID, joined with the1 corresponding current SALARY_HISTORY recordD o Points to an error-handling subroutine, in case of errors from Oracle RdbA o Assigns the values from the FIRST_NAME and LAST_NAME fieldsC of EMPLOYEES and the SALARY_AMOUNT field of SALARY_HISTORY to host variables 2 segmented_string_FOR> A special form of the FOR statement sets up a record stream@ consisting of segments from a segmented string field. Because? a single segmented string field value is made up of multipleC segments, a record stream that includes a segmented string fieldA is "nested." The outer loop retrieves records that include the@ field and the inner loop retrieves the segments of each fieldA value one at a time. Therefore, a FOR statement that retrieves? segmented strings looks like a set of nested FOR statements. Example: RDO> FOR R IN RESUMES cont> FOR S IN R.RESUME+ cont> PRINT S.RDB$LENGTH, S.RDB$VALUE cont> END_FOR cont> END_FOR 3 FormatT (B)0FOR qq> context-var qqq> IN qq> ss-field qqwqqqqqqq>qqqqqqwqkB mq> on-error qqj x@ lqqqqqqqqqqqqqqqqqqqqqqqq get-statement qwqqq> END_FOR qqq> mqqqqqqqq The ON ERROR clause. This clause specifies the action to beH taken if an Oracle Rdb error occurs while Oracle Rdb is trying to set? up retrieval of the next segmented string. For more details, request HELP on ON_ERROR. 4 get-statementC Any  valid Oracle Rdb data manipulation language or host languageB statement except INVOKE, COMMIT, or ROLLBACK. The GET statement: can reference only the RDB$VALUE and RDB$LENGTH fields. 3 MoreD If you have invoked a database, you have the necessary privileges3 to use the FOR Statement with Segmented Strings.B Oracle Rdb defines a special name to refer to the segments of a= segmented string. This value expression is equivalent to a? field name; it names the "fields" or segments of the string.D Furthermore, because segments can vary in length, Oracle Rdb alsoC defines a name for the length of a segment. The statement insideA the segmented string FOR loop must use these names to refer to/ the segments of the string. These names are:B RDB$VALUE The value stored in a segment of a segmented string6 RDB$LENGTH The length in bytes of a segment G Within a single context, such as the context of a single request, ifH an arithmetic expression contains the MISSING operator, the resultingA expression will evaluate to MISSING. In the following example,G A.FIELD_1 contains missing (unknown) values, and the query correctlyG interprets the values in A.FIELD_1 as missing (unknown), causing theF expression A.FIELD_3 = VARIABLE + A.FIELD_1 to evaluate to MISSING: RDO> FOR A IN RELATION_A cont> MODIFY A USING* cont> A.FIELD_3 = VARIABLE + A.FIELD_1 cont> END_MODIFY con t> END_FORG However, in nested queries that use multiple database requests, suchD as the following example, if B.FIELD_2 contains missing (unknown)B values, the expression A.FIELD_3 = VARIABLE + B.FIELD_2 returnsA different results. The second query (which begins with FOR A)C retrieves a value, in this case the value defined as the field'sE MISSING_VALUE, from B.FIELD_2 for its record selection expressionI (RSE). However, because of RDO language limitations, the second qu eryH cannot use the fact that the field B.FIELD_2 has an unknown value andG instead uses the missing value defined for the field with the DEFINEJ FIELD or CHANGE FIELD statement. Using this value for B.FIELD_2 insteadI of treating the value as unknown means that the A.FIELD_3 = VARIABLE +5 B.FIELD_2 expression does not evaluate to MISSING. RDO> FOR B IN RELATION_B7 cont> FOR A IN RELATION_A WITH A.FIELD_1 = B.FIELD_1 cont> MODIFY A USING+ cont> A.FIELD_3 = VARIABLE + B.FIELD_2 cont> END_MODIFY cont> END_FOR cont> END_FORH The workaround is to use the SQL interface to Oracle Rdb. You can useI the SQL indicator variables to detect the NULL attribute of the columnB (field) and therefore set the appropriate value for the column. 3 ExampleA Create a stream whose records contain segmented string fields: RDO> FOR R IN RECORD cont> FOR S IN R.SS_FIELD+ cont> PRINT S.RDB$LENGTH, S.RDB$VALUE cont> END_FOR cont> END_FOR/ This statement looks like a nested FOR loop.> o The outer loop sets up a record stream using the context? variable R. The same context variable qualifies the field0 name, SS_FIELD, as in every FOR statement.C o The inner loop retrieves the segments of the string field one at a time.5 o The context variable S identifies the segments.C o The special segmented string value expressions, RDB$VALUE andD RDB$LENGTH are qualified by S, the context variable associated with the field. wwa1 GET> Assigns values from data records in a record stream to host@ language variables in a program using the RDBPRE preprocessor> (for BASIC, COBOL, and FORTRAN). You cannot use GET in RDO. Example: &RDB& FOR E IN EMPLOYEES &RDB& GET( &RDB& LAST-NAME = E.LAST_NAME;* &RDB& FIRST-NAME = E.FIRST_NAME;1 &RDB& MIDDLE-INITIAL = E.MIDDLE_INITIAL &RDB& END_GET &RDB& END_FOR 2 MoreD If you have invoked a database, you have the necessary privileges to use the GET statement.C In RDBPRE programs, you can use the GET statement in three ways:? o When you establish a record stream with the FOR or START_B STREAM statement, you use the GET statement to assign values@ from the current record in the stream to variables in yourB program. In the case of START_STREAM, you also need FETCH to0 indicate  the current record in the stream.A o You can use GET alone, without a FOR or FETCH statement, to? retrieve the result of a statistical function. The recordD stream is formed by the record selection expression within the statistical expression.B o Or you can use GET...RDB$DB_KEY in a STORE...END_STORE block= to retrieve the database key of the record just stored. Example:? &RDB& STORE E IN EMPLOYEES USING E.EMPLOYEE_ID = 15231;? &RDB&  E.LAST_NAME = "Smith";3 &RDB& GET MY_DB_KEY = E.RDB$DB_KEY; &RDB& END_GET &RDB& END_STORE; (MY_DB_KEY is a user-defined host language variable.)A You cannot use the concatenation operation in a GET statement.& NOTEA Use the GET statement only in RDBPRE programs. RDO uses the8 PRINT statement to display values on the terminal. 2 FormatF (B)0GET [m qwqqqqqqqqq>qqqqqqqqqwqqqqwqqqqqqqq>qqqqqqwqqqk: mq> handle-options qj mq> on-error qqj x6 lqqqqqqqqqqqqqqqqqqqqqqqqqq get-item qqwqq> END_GET qq> mqqqqq ; ( qwq> REQUEST_HANDLE qqq> var qqqqqqqqqqqqqqqqqqqqqqqqqqqwq> ) qq>M tq> TRANSACTION_HANDLE qqq> var qqqqqqqqqqqqqqqqqqqqqqquV mq> REQUEST_HANDLE q> var , TRANSACTION_HANDLE q> var qj 4 REQUEST_HANDLEC A keyword followed by a host language variable. A request handleB points to the location of a compiled Oracle Rdb request. If youE do not supply a request handle explicitly, Oracle Rdb associates aB default request handle with the compiled request. Your must useC a request handle when you want to make an identical query to two different databases.: In Callable RDO, use !VAL as a marker for host language variables.B You can put parentheses around the host language variable name.  4 TRANSACTION_HANDLE@ A keyword followed by a host language variable. A transactionB handle identifies each instance of a transaction. If you do notD declare the transaction handle explicitly, Oracle Rdb attaches an* internal identifier to the transaction.: In Callable RDO, use !VAL as a marker for host language variables.B You can put parentheses around the host language variable name.A Normally, you do not need to use this argument. The ability toB declare a transaction handle is provided for compatibility with= other database products and future releases of Oracle Rdb. 3 on-errorI (B)0ON ERROR qwq> statement qwq> END_ERROR mqqqqqqqq host-variable = value-expr qqqqqqqqqqqqqqqqwqqq>> tq> host-variable = statistical-expr qqqqqqqqqqu> mq> record-descr = context-var . * qqqqqqqqqqqj> Includes an assignment statement specifying a host language> variable and a database value. The value is assigned to theA host language variable from the Oracle Rdb value expression or statistical expression. 4 host-variableC A valid variable name declared in the host language program. Ask/ for HELP on Value_expr for more information. 4 statistical-expr@ A statistical expression. A statistical expression calculatesB values based on a value expression for every record in a record; stream. Ask for HELP on Value_expr for more information. 4 value-exprF A valid Oracle Rdb value expression. Ask for HELP on Value_expr for more information. 2 Examples Example 1D The following COBOL example retrieves values from named fields in a relation:% &RDB& START_TRANSACTION READ_WRITE &RDB& FOR E IN EMPLOYEES &RDB& GET( &RDB& LAST-NAME = E.LAST_NAME;* &RDB& FIRST-NAME = E.FIRST_NAME;1 &RDB& MIDDLE-INITIAL = E.MIDDLE_INITIAL &RDB& END_GET &RDB& END_FOR &RDB& COMMIT@ This code fragment retrieves field values from each record inC the EMPLOYEES relation. It assumes that the program has declared@ the three host language variables, LAST-NAME, FIRST-NAME, and3 MIDDLE-INITIAL, with the appropriate data types. Example 2C The following set of statements performs a join of two relations. and uses GET to retrieve a value from each:% &RDB& START_TRANSACTION READ_WRITE5 &RDB& FOR JH IN JOB_HISTORY CROSS D IN DEPARTMENTS# &RDB& OVER DEPARTMENT_CODE& &RDB& WITH JH.JOB_END MISSING &RDB& GET1 &RDB& ID_NUMBER = JH.EMPLOYEE_ID;3 &RDB& DEPT-NAME = D.DEPARTMENT_NAME &RDB& END_GET &RDB& END_FOR &RDB& COMMIT Example 3> The following BASIC code fragment retrieves the result of a statistical function:! INPUT "State: ", STATE$ &RDB& START_TRANSACTION READ_ONLY &RDB& GET8 &RDB& NUMBER-EMPLOYEES = COUNT OF E IN EMPLOYEES5 &RDB& WITH E.STATE = STATE &RDB& END_GET: PRINT "Number of employees in "; &3 STATE; " is "; NUMBER-EMPLOYEES &RDB& COMMITC This statement retrieves the number of employees who live in theB specified state and assigns that number to the variable NUMBER- EMPLOYEES. Example 4:D The following RDBPRE program segment uses GET...RDB$DB_KEY within= a STORE...END_STORE block to retrieve into a host language@ variable the database key of the record about to be stored by the STORE statement.< &RDB& STORE E IN EMPLOYEES USING E.EMPLOYEE_ID = 15231;< &RDB&  E.LAST_NAME = "Smith";0 &RDB& GET MY_DB_KEY = E.RDB$DB_KEY; &RDB& END_GET &RDB& END_STORE8 (MY_DB_KEY is a user-defined host language variable.) wwr1 HELP? Gives you access to assistance on all Oracle Rdb statements,B components, and concepts. You can type HELP alone to get a menuB of help topics, or you can type HELP and specify a topic to get help on that topic. Format- (B)0HELP qqqwqqqqq>qqqqqqqwqq> mqq> topic qqqj topic> The Oracle Rdb statement or concept on which you need help. 2 More> You can use the HELP statement without invoking a database,B so you do not need any special Oracle Rdb privileges to use the statement. When you type HELP:D o A menu of topics on which assistance is available replaces the RDO> prompt.A o After the menu scrolls by, the cursor remains at a "Topic?"D prompt. Typing any o f the menu items yields assistance on thatB topic. Many of the topics have further levels of assistance,( indicated by a "Subtopic?" prompt.? o To move back to the next higher level, press the carriageA return key. For example, pressing RETURN at the "Subtopic?"C prompt brings you to the "Topic?" prompt, and pressing RETURN+ again returns you to the RDO> prompt.? o To see the list of additional topics at any level, type a) question mark (?) and press RETURN.B o To leave HELP, hold down the CTRL key and press the Z key at< the same time, or press RETURN at the "Topic?" prompt. 2 Example5 If you are here, you already know how to use HELP! wwr 1 IMPORTE ___________________________ Note _________________________________E The RDO IMPORT command does not support new features introduced inC Oracle Rdb V6.0 and higher. The RDO IMPORT command displays the following warning:F  %RDO-W-UNSIMPORT, RDO IMPORT does not support all DEC Rdb features, please use SQL IMPORTE __________________________________________________________________? The RDO IMPORT statement replaces the RDO RESTORE statement.B The IMPORT statement restructures an intermediate (RBR) file toA a database (RDB) file according to the parameters you specify.? An EXPORT statement translates the definitions and data in a> database into an intermediate form in a special type of RMSC sequential file called an interchange file. The IMPORT statementD reads the records in the interchange file and uses them to create an Oracle Rdb database.B The RMU/DUMP/EXPORT command can be used to view the contents of an interchange file. 2 MoreB You must have the Oracle Rdb ADMINISTRATOR privilege to use the IMPORT statement.+ Use the EXPORT and IMPORT statements to:E o Restructure an Oracle Rdb single-file database into a multifile database& o Restructure a multifile databaseD o Migrate a database from one DSRI-compliant database management system to another; o Create a version-independent copy of the database for archiving purposes= o Create an empty target database that uses the same data? definitions as a source database by copying the metadata,. but not the data, to the target database? o Change database and storage area characteristics that you6 cannot change with the CHANGE DATABASE statement@ The IMPORT and EXPORT statements are not intended for regularC backups of the database. For regular backups and restorations ofE Oracle Rdb databases, use the RMU/BACKUP and RMU/RESTORE commands.C The IMPORT operation leaves you attached to the database, with a5 database handle equal to the name of the database. 2 FormatZ (B)0IMPORT q> interchange-file-spec q> INTO qqq> database-file-spec qqkF lqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqwqqwqqqqqqqq>qqqqqqwq> .P x tq> invoke-options qqqqqqqqqqqqqqqu x mq> END IMPORT qj/ x tqwqwq> db-wide-options-1 qwqwqqqqu x/ x x x mq> db-wide-options-2 qj x x x- x x mqqqqqqqqqq storage-area-options qqqqqqqqqu x/ x tq> import-options qqqqqqqqqqqqqqqu x/ x mq> metadata-options qqqqqqqqqqqqqj x- mq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqq>@ tqqqqq> DB_HANDLE IS qqqqqqq> db-handle qqqqqqquJ mqqqqq> DBKEY SCOPE IS qqwqq> COMMIT qqqwqqqqqqj5 mqq> FINISH qqqj 4 db-handle? A host language variable or name that you associate with theC database. Use a database handle when you are accessing more than one database at a time. 4 COMMITD During the session of the user who entered IMPORT, specifies thatC  the database key of each record used is guaranteed not to change1 during each transaction this user may execute. 4 FINISH@ During the session of this user who entered IMPORT, specifiesA that the database key of each record used is guaranteed not toC change until this user ends the RDO session or executes a FINISH statement. 3 db-wide-options-1< These options are the same database wide options that are0 available with the DEFINE DATABASE statement. (B) 0db-wide-options-1 = Q qqwq> IN qqqqqq> path-name qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqP tq> COLLATING_SEQUENCE IS sequence-name qqk xG x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj xI x mqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq> ncs-name qqk xP x mq> DESCRIPTION IS qq> /* text */ qqj x xG x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj xG x mqwqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquP x mq> FROM library-name qqj xP tq> DESCRIPTION IS qqqqqqq> /* text */ qqqqqqqqqqqqqqqqqqqqqqqqqquW tq> NUMBER OF USERS IS qq> number-users qqqqqqqqqqqqqqqqqqqqqqqqquW tq> NUMBER OF BUFFERS IS qqqqq> number-buffers qqqqqqqqqqqqqqqqqqu^ tq> NUMBER OF qqwqq> CLUSTER qqqqwq> NODES IS qq> number-nodes qq uN x mqq> VAXCLUSTER qj x^ tq> NUMBER OF RECOVERY BUFFERS IS qqq> recovery-buffers qqqqqqqqquI mq> global-buffer-params qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj 4 path-name= The data dictionary path name for the dictionary path nameA where the database definition is stored. Use this qualifier toC store the data dictionary definitions for the database in a dataB dictionary entity other  than the default path, which is defined$ by the name of the database file. 4 COLLATING_SEQUENCEB Specifies a collating sequence to be used for all fields in the? database. Sequence-name is a name of your choosing; use this@ sequence-name in any subsequent statements that refer to this collating sequence.< The OpenVMS National Character Set (NCS) Utility provides= a set of pre-defined collating sequences and also lets youA define collating sequences of your own. T he COLLATING_SEQUENCEA clause accepts both pre-defined and user-defined NCS collating sequences.C If you do not specify a collating sequence, the default is ASCII7 (shown as "no collating sequence" in some displays). 4 ncs-name@ Specifies the name of a collating sequence in the default NCSD library, SYS$LIBRARY:NCS$LIBRARY, or in the NCS library specified? by the argument library-name. (In most cases, it is probablyC simplest to make the sequence-name the same as the ncs-name: forB example, COLLATING_SEQUENCE IS FRENCH FRENCH.) You can view the@ collating sequence names by using the command NCS/LIST at DCL level.B The collating sequence can be either one of the pre-defined NCSB collating sequences or one that you have defined yourself using NCS. 4 text@ Provides a comment for a collating sequence or database being defined. 4 library-nameC Specifies the name of an NCS library other than the default. The2 default NCS library is SYS$LIBRARY:NCS$LIBRARY. 4 number-usersD The maximum number of users allowed to access the database at oneA time. The default is 50 users. The largest number of users you< can specify is 2032, and the fewest number of users is 1. 4 number-buffersD The number of buffers Oracle Rdb allocates per process using thisA database. Specify an unsigned integer between 2 and 32768. The default is 20 buffers. 4 number-nodes: The NUMBE R OF CLUSTER NODES is clause and the NUMBER OF? VAXCLUSTER NODES is clause have exactly the same effect. TheD option of using NUMBER OF CLUSTER NODES has been added to reflectG the fact that Oracle Rdb can run on different hardware platforms (in addition to VAXclusters).= Sets the upper limit on the maximum number of nodes in the? cluster from which users can access the shared database. TheC default is 16 nodes. The range is 1 node to 96 nodes. The actual. maximum limit is the current cluster limit. 4 recovery-buffersD The number of database buffers used during the automatic recoveryD process that is initiated after a system or process failure. ThisC recovery process uses the recovery-unit journal file. Specify anC unsigned integer between 2 and 32768. The default is 20 buffers. 4 global-buffer-params (B)0global-buffer-params= @ q> GLOBAL BUFFERS ARE qwq> ENABLED qqwqk2 mq>  DISABLED qj x+ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq>@ mq> ( qq> NUMBER IS number-glo-buffers qq> , qk x7 lqqqqqqqqqqqqqqq USER LIMIT IS max-glo-buffers qq> ) qqqqqj 5 GLOBAL_BUFFERSB The GLOBAL BUFFERS ARE ENABLED clause specifies that Oracle RdbC maintain one global buffer pool per node in the cluster for eachE database. By default, Oracle Rdb maintains a local buffer pool for? each user. For more than one user to use the same page, each@ must read it from disk into their local buffer pool. When the? GLOBAL BUFFERS ARE ENABLED clause has been specified, a pageA in the global buffer pool may be read by more than one user atA the same time, although only one user reads the page from diskB into the global buffer pool. Global buffering provides improvedD performance because I/O is reduced and memory is better utilized.B The default is GLOBAL BUFFERS ARE DISABLED, in which Oracle RdbB maintains a local buffer pool for each user, and global buffers are not enabled. 5 NUMBERC When global buffers are enabled, the NUMBER IS clause is used to9 specify the default number of global buffers per node.C In database parameter syntax, a user designates an attach to the0 database, not a person who uses the database.= The default number of global buffers is the m aximum number< of users multiplied by 5. (In the RDO syntax for databaseA parameters, a user is the same as an attach.) You can overrideA the default by defining a value for the logical name RDM$BIND_ BUFFERS.> Although you can change the NUMBER IS parameter online, theB change will only take effect the next time that the database isC opened. By default, a database can be opened automatically (that? is, by any user who invokes the database and executes a dataA manip ulation language statement). If the database was modifiedC so that it must be manually opened, the RMU/OPEN command must be used to open it. 5 USER_LIMIT? The USER LIMIT clause specifies the maximum number of global? buffers each user allocates. Because global buffer pools areB shared by all users, you must define an upper limit on how manyC global buffers a single user can allocate. This limit prevents aD user from defining the RDM$BIND_BUFFERS to use all the buff ers inD the global buffer pool. The user limit cannot be greater then the4 total number of global buffers. The default is 5.B See the Oracle Rdb Guide to Database Performance and Tuning forD information on determining the maximum number of global buffers a user can allocate.B Although you can change the USER LIMIT IS parameter online, theB change will only take effect the next time that the database isC opened. By default, a database can be opened automatically (that?  is, by any user who invokes the database and executes a dataA manipulation language statement). If the database was modifiedC so that it must be manually opened, the RMU/OPEN command must be used to open it. 3 db-wide-options-2< These options are the same database wide options that are0 available with the DEFINE DATABASE statement. (B)0db-wide-options-2 = W qwq> BUFFER SIZE IS qqqqq> buffer-blocks qq> BLOCKS qqqqqqwq>Z tq> ADJUSTABLE LOCK GRANULARITY IS qwqqq> ENABLED qqqwqqquE x mqqq> DISABLED qqj xS tq> SNAPSHOT IS qqqqwqqqqq> ENABLED qwqq> IMMEDIATE qwqwquE x x mqq> DEFERRED qqj x xE x mqqqqq> DISABLED qqqqqqqqqqq>qqqqqqj xL tq> DICTIONARY IS qqqwqqq> REQUIRED qqqqqqqwqqqqqqqqqqqqquL x tqqq> NOT REQ UIRED qqqu xE x tqqq> USED qqqqqqqqqqqu xL x mqqq> NOT USED qqqqqqqj xZ tq> CARRY OVER LOCKS ARE qqwq> ENABLED qwqqqqqqqqqqqqqqqquE x mq> DISABLED j xU mq> LOCK TIMEOUT INTERVAL IS number-seconds SECONDS qqqqqj 4 buffer-blocksC The number of blocks Oracle Rdb allocates per  buffer. Specify anA unsigned integer greater than zero. If you do not specify thisC parameter, Oracle Rdb uses a buffer size that is three times the PAGE SIZE value. 4 ADJUSTABLE_LOCK= The ADJUSTABLE LOCK GRANULARITY clause enables or disablesA adjustable locking granularity. Generally, enabling adjustableB locking granularity results in fewer locks being used. However,A when contention for database pages is high, performance may beC impaired as locking granula rity is adjusted to a lower level. IfA your application is query intensive, enable adjustable lockingB granularity. If your application processes specific records and@ performs a substantial number of update operations, you might2 want to disable adjustable locking granularity.@ Disabling adjustable locking granularity may require that the4 OpenVMS SYSGEN parameters for locks be increased. 4 ENABLED-IMMEDIATE@ The default, ENABLED IMMEDIATE causes read/write transactio ns= to write copies of records to the the snapshot file before@ those records are modified, regardless of whether a read-only transaction is active.@ If you use the SNAPSHOT IS ENABLED clause to enable snapshotsA on a multifile database, writing to all snapshot files for all storage areas is enabled. 4 ENABLED-DEFERRED= Specifies that read/write transactions not write copies of> records they modify to the snapshot file unless a read-only@ transaction is acti ve. Read-only transactions that attempt toD start after an active read/write transaction begins must wait for> all active read/write users to complete their transactions.@ If you use the SNAPSHOT IS ENABLED clause to enable snapshotsA on a multifile database, writing to all snapshot files for all storage areas is enabled. 4 DISABLED= Disables snapshot transactions. If you use the SNAPSHOT IS@ DISABLED clause to disable snapshots on a multifile database,C writing t o all snapshot files for all storage areas is disabled. 4 DICTIONARYA The DICTIONARY IS [NOT] REQUIRED clause determines whether theD database must be invoked by path name for data definition changes> to occur. If you specify the DICTIONARY IS REQUIRED option,? the database must be invoked by path name to change metadataA and the data dictionary will be maintained. If you specify theD DICTIONARY IS NOT REQUIRED option, the database can be invoked byC either file name or path name to change metadata. The default is DICTIONARY IS NOT REQUIRED.= The DICTIONARY IS [NOT] USED clause determines whether theB definition of the database and definitions of database elements< will be stored in the data dictionary. If you specify the@ DICTIONARY IS USED option, the definition of the database and> definitions of database elements will be stored in the data@ dictionary. If you specify the DICTIONARY IS NOT USED option,D no definitions will be stored  in the data dictionary. The default is DICTIONARY IS USED.D You receive an error message if you specify incompatible options,B such as the DICTIONARY IS REQUIRED option and the DICTIONARY IS NOT USED option. 4 CARRY_OVER_LOCKS; The carry-over locks option is a database-wide parameter@ that allows you to disable carry-over lock optimization. ThisD optimization is enabled by default. Although this is an advantageA in more environments, it can result in false lock  conflicts in some applications.@ The carry-over locks optimization holds area and record locksD across transactions and depends on NOWAIT transactions asking forC and acquiring the NOWAIT lock. This can result in long delays ifA concurrent users are executing long verbs. You should consider> disabling the carry-over locks optimization if transactions@ experience noticeable delays in acquiring the NOWAIT lock (asD seen in the output of the RMU/SHOW STATISTICS command). N ote thatC if you do disable the carry-over locks option, there may be some@ performance degradation because transactions will acquire and> release area and top level ALG locks for every transaction. 4 LOCK_TIMEOUTA Specifies the number of seconds for processes to wait during a@ lock conflict before timing out. The number of seconds can be between one and 65,000.? Sets the default database lock timeout interval. This is theD database wide timeout interval. It is u sed as the default as wellA as the upper limit in determining the timeout interval to use.C For example, if LOCK TIMEOUT INTERVAL IS 25 SECONDS is specified? with the CHANGE DATABASE or DEFINE DATABASE statement, and aA user specifies 30 seconds with the SQL SET TRANSACTION WAIT 30D statement or sets the logical name RDM$BIND_LOCK_TIMEOUT_INTERVALC to 30, RDO would still use the interval of 25 specified with the LOCK TIMEOUT INTERVAL clause. 3 storage-area-options;  These options are the same storage-area-options that are0 available with the DEFINE DATABASE statement. (B)0storage-area-options = G qwwqqqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwwq>N xtqq> ALLOCATION IS qqq> number-pages qqqq>qqqqqqqqq PAGES qqqquxU xtqq> PAGE SIZE IS qqqq> page-blocks qqqqq>qqqqqqqqq BLOCKS qqquxZ xtqq> PAGE FORMAT IS qqwqqqq> UNIFORM qqqqwqqqqqqqqqqqqqqqqqqqquxL xx  mqqqq> MIXED qqqqqqj xxN xtqq> THRESHOLDS ARE q> ( q> val1 wqqqqqqqqqqqqqqqqqqqqwq> ) qquxG xx m> ,val2 wqqqqqqqqqwqj xxG xx m> ,val3 qj xxN xtqq> INTERVAL IS qqqqqqq> number-data-pages qqqqqqqqqqqqqqqqqquxW xtqq> SNAPSHOT_FILENAME IS qqqq> file-spec qqqqqqqqqqqqqqqqqqqquxU xtqq> SNAPSHOT ALLOCATION IS qqq>  snp-pages qqq> PAGES qqqqqqqquxU xtwq> SNAPSHOT EXTENT IS qwqqwq> extent-pages qqqq> PAGES qwqqquxN xxmq> EXTENT IS qqqqqqqqqqj mq> extension-options qqqqqqqqj xxN xmqq> WRITE_ONCE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjxE mqqqqqqqqqqqqqqqqqqqqqqqqqqqq your largest record is larger than approximately 950 bytes,> allocate more blocks per page to prevent records from being fragmented. 4 PAGE_FORMATD Specifies whether a storage area contains uniform or mixed pages.> You can use the  PAGE FORMAT option with multifile databases@ only. In storage areas with uniform page format, all pages inB a specific logical area contain records from the same relation.B In storage areas with mixed page format, pages can hold records4 from different relations. The default is uniform. 4 THRESHOLDS? Specifies one, two, or three threshold values. The threshold< values represent a fullness percentage on a data page andA establish four possible ranges of guaranteed free s pace on theA data pages. When a data page reaches the percentage defined by? a given threshold value, the SPAM entry for the data page isC updated to reflect the new fullness percentage and its remaining free space.C The default thresholds are 70,85, and 95 percent. If you specify< only one or two values, unspecified values default to 100C percent. You can specify the THRESHOLDS option only on a storageA area for a multifile database. Threshold values can be set forA  storage areas with MIXED or UNIFORM storage area page formats. 4 number-data-pages? Specifies the number of data pages between SPAM pages in theA physical storage area file, and thus the maximum of data pages@ each SPAM page will manage. The default, and also the minimum> interval, is 256 data pages. The first page of each storageA area is a SPAM page. The interval you specify determines where? subsequent SPAM pages are to be inserted, provided there areD enough da ta pages in the storage file to require more SPAM pages.C You can specify the INTERVAL option only on a storage area for aB multifile database. The storage area page format must be MIXED. 4 file-spec@ Provides a separate file specification for the snapshot file.= Do not specify a file extension other than SNP to the file= specification. You cannot specify a global default for theA SNAPSHOT FILENAME. Thus, in a multifile database, the SNAPSHOTC FILENAME option must be within a DEFINE STORAGE AREA definition. 4 snp-pagesA Specifies the number of pages allocated for the snapshot file. The default is 100 pages. 4 extent-pagesC Specifies the number of pages of each extent. The default is 100 pages. 4 extension-optionsC Specifies the MIN, MAX, and percent growth of each database file5 extent. Enclose the parameter list in parentheses. (B)0extension-options = C qqq> ( qqq> MINIMUM OF qq> min-pages qqq> PAGES, qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjC mqq> MAXIMUM OF qq> max-pages qq> PAGES,qk: lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjR mqq> PERCENT GROWTH IS qqq> growth qqqq> ) qqq> 5 min-pagesD Specifies the minimum number of pages of each extent. The default is 99 pages. 5 max-pagesD Specifies the maximum number of pages of each extent. The default is 9,999 pages. 5 growthA Specifies the percent growth of each extent. The default is 20 percent growth. 3 import-options (B)0import-options = & qwqwqqqqqqqqqqqqq>qqqqqqqqqqqwqwqq>* x tqwqq> ACL qqqqqqqqqqqqwqqu x* x x mqq> NOACL qqqqqqqqqqj x x, x tqwqq> BATCH_UPDATE qqqwqqu x, x x mqq> NOBATCH_UPDATE qj x x, x tqwqq> CDD_LINKS qqqqqqwqqu x, x x mqq> NOCDD_LINKS qqqqj x x* x tqwqq> DATA qqqqqqqqqqqwqqu x* x x mqq> NODATA qqqqqqqqqj x x* x mqwqq> TRACE qqqqqqqqqqwqqj x* x mqq> NOTRACE qqqqqqqqj x# mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqq>G x tq> define-storage-map-statement qqqqqqqqqqqqqqqqqqqqqqqqqqqu xG x tq> delete-storage-map-statement qqqqqqqqqqqqqqqqqqqqqqqqqqqu xG x tq> define-storage-area-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x\ x tq> DELETE STORAGE AREA qqqqqqqqqqqqqq> storage-area-name qqu xc x tq> SEGMENTED STRING STORAGE AREA' IS q> storage-area-name qqu xG x tq> define-index-statement qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu xG x mq> delete-index-statement qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj xE mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq map-name qqqqqqqqk5 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq (qqwqqqqqqqqqqqqk> mq> DESCRIPTION IS /* text */ qqj x5 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj> mqqq> FOR qqq> relation-map-clause qqqqqqqqqqqqqqk5 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq END qwqqqqqqq>qqqqqqqwqq> STORAGE MAP qq>! mq> map-name qqqjC This statement defines a new storage map replaces the definition@ of an existing storage map contained in the interchange file.D For mor)e information on the DEFINE_STORAGE_MAP statement, see the+ top-level help topic DEFINE_STORAGE_MAP. 4 delete-storage-map( (B)0delete-storage-map-statement = C DELETE STORAGE MAP qqqqq> map-name qqqqq>C This statement prevents use of a storage map definition from theB interchange file. The relation that would have used the storage? map definition is placed in the system default storage area.D For more information on the DELETE_STORAG *E_MAP statement, see the+ top-level help topic DELETE_STORAGE_MAP. 4 define-storage-area& (B)0define-storage-area-clause = [ qqqq> DEFINE STORAGE AREA qqwqqqq> storage-area-name qqqqwqqqqqqkD mqqqq> RDB$SYSTEM qqqqqqqqqqqj xD lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq FILENAME qqqqq> file-spec qqwqqqqqqqqqqqq>qqqqqqqqqqqqqwqqqkI mq> +storage-area-options qqj xG lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq END qqqqqqqwqqqqqqqqqq>qqqqqqqqqqqwq> STORAGE AREA qqqq>0 tq> storage-area-name qu. mq> RDB$SYSTEM qqqqqqqqj< The define-storage-area-clause adds a new storage area or@ replaces the definition of an existing storage area contained in the interchange file.B For more information on the define-storage-area-clause, see, the= help topic for DEFINE_DATABASE Format define-storage-area. 4 DELETE_STORAGE_AREAC Prevents a storage area that was defined in the interchange fileB from being created in the new database. You must also delete orC redefine all storage maps and indexes that refer to this storage7 area. You cannot delete the RDB$SYSTEM storage area. 4 SEGMENTED_STRING< The name of the storage area that will hold all segmentedB strings. You can only specify the SEGMENTED STR-ING STORAGE AREAB clause in a multifile database. In a multifile database, if youA do not explicitly define a storage area for segmented strings,@ they will be stored in the default storage area (RDB$SYSTEM).< The page format for the segmented string storage area can< be UNIFORM or MIXED. However, Rdb recommends that if you @ store segmented strings in a MIXED storage area, the storage ' area contain only segmented strings. 4 define-index\ (B)0DEFINE_INDEX. name wqqqqqqqqqqqqqqq>qqqqqqqqqqqqwq> FOR relation-name qkS m> DESCRIPTION IS /* text */ j xJ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqwqqqqqqqqqqq>qqqqqqqqqqqqwqqqqqqqkG m> duplicates-clause j m> index-storage-clause qj xC lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqq/wqqkQ tq> TYPE IS qqwqqq> HASHED qqqj x xL x mqqq> SORTED qq> sorted-index-param-list qqqu xE mqqqqqqqqqqqqqq> sorted-index-param-list qqqqqqqqqqqqqqqqqj xC lqqqqqqqqqqqqqqqqqqqqqqqqq . field-name qqwqwqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqwqwqqwqkJ x x t> ASCENDING qqqqqqqqqqqqqqqqqqqqqqqu x x xJ x x t> DESCENDING qqq 0qqqqqqqqqqqqqqqqqqqu x x xS x x t> SIZE IS n qqqqqqqqqqqqqqqqqqqqqqqu x x xZ x x m> MAPPING VALUES lo-val TO hi-val qj x x xC x mqqqqqqqqqqqqqqqqqqqq END wqqq>qqqqw> INDEX q> mq> name jC This statement de1fines a new index or replaces an existing index0 definition contained in the interchange file.B For more information on the DEFINE INDEX statement, see the top! level help topic DEFINE_INDEX. 4 delete-index" (B)0delete-index-statement = 2 DELETE INDEX qq> index-name qq>> This statement prevents creation of an index defined in the interchange file.C For more information on the DELETE INDEX statement, see the top-! level help topic DE2LETE_INDEX. 2 Examples Example 1B The following example imports a database. It also specifies theB number of buffers and the length of each buffer in the imported database: RDO> IMPORT cont> 'DISK1:PERSONNEL.RBR'% cont> INTO 'DEPT3:NEW_PERSONNEL'" cont> NUMBER OF BUFFERS IS 10# cont> BUFFER SIZE IS 10 BLOCKS cont> END IMPORT. Example 2A The following example imports a database without including its? data. The NODATA option with 3the IMPORT statement creates anB Oracle Rdb database whose metadata is identical to the metadata in the intermediate RBR file. RDO> IMPORT cont> 'DISK1:PERSONNEL.RBR'% cont> INTO 'DEPT3:NEW_PERSONNEL' cont> NODATA cont> END IMPORT. Example 3A The following example imports a database from a magnetic tape. $ MOUNT MUA0: _Label: PERS _Log name: $ RDO RDO> IMPORT cont> 'MUA0:PERSONNEL' INTO cont> 'DEPT3:PERSONNEL' con 4t> END IMPORT.@ This statement reads the export copy of the database from theA magnetic tape volume labeled PERS, mounted on device MUA0:. ItB creates a new database in DEPT3:PERSONNEL.RDB, where DEPT3 is a+ logical name for a device and directory. Example 4? The following example uses the RMU/DUMP command to check the< current value of the node count, and then uses the IMPORTC statement with the NUMBER CLUSTER NODES clause to lower the nodeD count parameter. In t5his case, the Local Area cluster contains 22D nodes; the default maximum for the CLUSTER NODES parameter is 16.B This example sets the upper limit of user access from VAX nodes at 20. $ RMU/DUMP ACCTING . . . Maximum node count is 22 . . . $ RDO3 RDO> EXPORT ACCTING.RDB INTO ACCOUNTING_TEST.RBR; RDO> IMPORT ACCOUNTING_TEST.RBR INTO ACCOUNTING_TEST.RDB& cont> NUMBER OF CLUST6ER NODES IS 20 cont> END IMPORT. Example 5C The following example uses the IMPORT statement to restructure aD single-file database into a multifile database. This example doesA not include all the storage areas and storage maps that are in. the sample multifile MF_PERSONNEL database. $ RDO !> ! Invoke a command file that has the IMPORT statement in it ! RDO> @IMPORT_PERS.RDO ! !F IMPORT 'DISK$BACK:PERSONNEL.RBR' INTO 'DB_DISK:MULTI_PERSONNE7L.RDB' !* ! Specify database-wide characteristics ! NUMBER OF USERS IS 40 NUMBER CLUSTER NODES 12% SNAPSHOT IS ENABLED IMMEDIATE DICTIONARY IS REQUIRED# NUMBER RECOVERY BUFFERS 200 ! !< ! Specify global defaults to override Oracle Rdb defaults ! for all storage areas ! ALLOCATION IS 500 PAGES PAGE FORMAT IS MIXED! THRESHOLDS ARE (55,65,75) INTERVAL IS 300 ! !$ ! Define the de8fault storage area !! DEFINE STORAGE AREA RDB$SYSTEM# FILENAME IS DISK1:PERS_DEFAULT PAGE FORMAT IS UNIFORM, SNAPSHOT_FILENAME IS DISK2:PERS_DEFAULT END RDB$SYSTEM STORAGE AREA ! !. ! Define storage area for segmented strings !" DEFINE STORAGE AREA PERS_SEGSTR" FILENAME IS DISK1:PERS_SEGSTR PAGE FORMAT IS MIXED+ SNAPSHOT_FILENAME IS DISK2:PERS_SEGSTR END PERS_SEGSTR STORAGE AREA !8 ! Put the segmented strings in the named st9orage area !/ SEGMENTED STRING STORAGE AREA IS PERS_SEGSTR ! ! ! Define other storage areasF ! Storage area parameters specified within the DEFINE STORAGE AREAF ! clause override the global defaults, and the Oracle Rdb defaults !! DEFINE STORAGE AREA EMPIDS_LOW! FILENAME IS DISK3:EMPIDS_LOW* SNAPSHOT_FILENAME IS DISK4:EMPIDS_LOW END EMPIDS_LOW STORAGE AREA ! !! DEFINE STORAGE AREA EMPIDS_MID! FILENAME IS DISK5:EMPIDS_MID* SNAPS:HOT_FILENAME IS DISK6:EMPIDS_MID END EMPIDS_MID STORAGE AREA ! !" DEFINE STORAGE AREA EMPIDS_OVER" FILENAME IS DISK7:EMPIDS_OVER+ SNAPSHOT_FILENAME IS DISK8:EMPIDS_OVER END EMPIDS_OVER STORAGE AREA ! ! DEFINE STORAGE AREA EMP_INFO FILENAME IS DISK1:EMP_INFO3 ! Local definition overrides the global default THRESHOLDS ARE (65,75,85) INTERVAL IS 400( SNAPSHOT_FILENAME IS DISK2:EMP_INFO END EMP_INFO STORAGE AREA ! ! !; DEFINE INDEX EMPLOYEES_HASH= DESCRIPTION IS /* hashed index for employees relation */ FOR EMPLOYEES STORE USING EMPLOYEE_ID WITHIN' EMPIDS_LOW WITH LIMIT OF "00200";' EMPIDS_MID WITH LIMIT OF "00500"; EMPIDS_OVER TYPE IS HASHED. EMPLOYEE_ID. END EMPLOYEES_HASH INDEX ! ! DEFINE STORAGE MAP EMP_MAPF DESCRIPTION IS /* Employees records partitioned by EMPLOYEE_ID */ FOR EMPLOYEES RELATION STORE USING EMPLO<YEE_ID WITHIN' EMPIDS_LOW WITH LIMIT OF "00200";' EMPIDS_MID WITH LIMIT OF "00500"; EMPIDS_OVER' PLACEMENT VIA INDEX EMPLOYEES_HASH END EMP_MAP STORAGE MAP ! ! ! End the IMPORT statement ! END IMPORT. Example 6? The following example shows how to use the DICTIONARY IS NOTA USED clause to prevent metadata from being written to the data= dictionary. The IMPORT statement creates a database called? RALLY$COMMERCE. Because t=he DICTIONARY IS NOT USED clause isB specified, no metadata is written to the data dictionary during the IMPORT operation.5 RDO> IMPORT RALLY$COMMERCE.RBR INTO RALLY$COMMERCE cont> NOCDD LINKS cont> NOACL' cont> DICTIONARY IS NOT REQUIRED# cont> DICTIONARY IS NOT USED cont> END IMPORT. Example 7D If you use the IMPORT statement to restructure a data dictionary,B be sure to use the DICTIONARY IS NOT USED clause to prevent RDO( from usin>g the dictionary in any way:, RDO> IMPORT CDDPLUS.RBR INTO CDD$DATABASE cont> DICTIONARY IS NOT USED . . . cont> END IMPORT. ww[ 1 INTEGRATEE Moves data definitions between an Oracle Rdb database and the data> dictionary. You can use the INTEGRATE DATABASE statement in either of these ways:C o To copy the data definitions from an existing database into a= data dictionary entity (INTEGRATE DATABA?SE IN PATHNAME)C o To copy the data definitions from a data dictionary entity to3 a database (INTEGRATE DATABASE FROM PATHNAME) Example:6 RDO> INTEGRATE DATABASE 'DISK2:[DEPT3]PERSONNEL'; cont> IN PATHNAME 'DISK1:[DICTIONARY]CORP.PERSONNEL' RDO> COMMIT 2 MoreD You must have the Oracle Rdb READ privilege for a database to use$ the INTEGRATE DATABASE statement.= If the data dictionary was not installed when a particular? database was cr@eated, you can use the INTEGRATE statement to6 build the dictionary definitions from the database.; You can also periodically use the INTEGRATE statement toB ensure that the database and data dictionary definitions remain synchronized with each other.D INTEGRATE starts a transaction which can be completed by a COMMIT' or canceled by a ROLLBACK statement. 2 FormatA (B)0INTEGRATE DATABASE qqqqqqqqqqqqqqqqqqqk* lqqqqqqqqqqqqqqq source-db-filespec q> IN PATHNAME qq> target-dict-pathname qqqkX mq> target-db-filespec q> FROM PATHNAME qq> source-dict-pathname quF lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq>2 mq> DB_HANDLE IS qqq> db-handle qj 3 source-db-filespec< A full or partial OpenVMS file specification, enclosed in9 quotation marks, specifying the source of the databBase definitions. 3 target-dict-pathnameC The data dictionary path name for the dictionary entity in whichC the database definition will be created again. You can specify aD full data dictionary path name or a relative data dictionary path name. 3 target-db-filespec< A full or partial OpenVMS file specification, enclosed inC quotation marks, specifying where the data dictionary definition will be created. 3 source-dict-pathname? The data diCctionary path name for the dictionary entity fromB which the database definition will be copied. You can specify aD full data dictionary path name or a relative data dictionary path name. 3 db-handle* A name that you assign to the database. 2 Examples Example 1B The following statement creates the data dictionary definitionsD for the PERSONNEL database in 'DISK1:[DICTIONARY]CORP.PERSONNEL': RDO> INTEGRATE DATABASE" cont> 'DISK2:[DEPT3]PERSONNEL'9 D cont> IN PATHNAME 'DISK1:[DICTIONARY]CORP.PERSONNEL' RDO> COMMIT Example 2< This example shows how to specify a database handle for a> database. Because one database is already invoked, you mustC specify a database handle with the INTEGRATE DATABASE statement. RDO> SHOW DATABASES# Database with filename personnel. RDO> INTEGRATE DATABASE 'DISK2:[DEPT3]ACCT' cont> IN PATHNAME: cont> 'DISK1:[DICTIONARY]CORP.ACCT' DB_HANDLE IS CHECKS RDO> COMMIT E RDO> SHOW DATABASES# Database with filename personnel. Database with db_handle CHECKS in file acct Example 33 The following example shows the steps you use to5 create the definitions in the same data dictionary: entity. Assume the corrupt data dictionary entity is inC 'DISK1:[DICTIONARY]CORP.PERSONNEL'. In the example, the RMU/DUMP; /USERS command displays no active users of the database. $ RMU/DUMP/USERS PERSONNEL No active users $ RDO:== $RDO F $ RDO' RDO> INTEGRATE DATABASE 'PERSONNEL'8 cont> IN PATHNAME 'DISK1:[DICTIONARY]CORP.PERSONNEL' RDO> COMMIT Example 42 This example shows how to override the database< definitions with the data dictionary definitions. In this9 example, the definitions stored in the data dictionary? DISK1:[DICTIONARY]CORP.NEW.PERSONNEL replace the definitions% in the target database, PERSONNEL.' RDO> INTEGRATE DATABASE 'PERSONNEL'> cont> FROM PATHNAME 'DISK1:[DIGCTIONARY]CORP.NEW.PERSONNEL' RDO> COMMIT ww 1 INVOKEA Specifies the name of the database to be accessed in a programD or by RDO. You must issue an INVOKE DATABASE statement before youB can use any other statement to reference data in that database.B Using INVOKE is equivalent to declaring an external subroutine;+ it declares the database to the program. Example:: RDO> INVOKE DATABASE FILENAME 'DISK2:[DEPT4]PERSONNEL' 2 FormatHW (B)0INVOKE DATABASE qwqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqwqqkI tqqqqqqqqqqqq>qqqqqqqqqqqqqqwq> db-handle q> = j xI mq> db-handle-scope-optionsqj xG lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqwqq> PATHNAME qqq> path-name qqwqkT mqq> COMPILETIME qqqj mqq> FILENAME qqq> file-spec qqj xD lqqqqqqqqqqqqqqIqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqkP mqq> RUNTIME FILENAME qqqqwqqqq> file-spec qqqqqqqqwqqqj xI mqqqq> host-variable qqqqj xG lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqkV mqq> DBKEY SCOPE IS qqqwqqq> COMMIT qqqqqqwqqqqqqqj JxH mqqq> FINISH qqqqqqj xA lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqkX mqq> REQUEST_HANDLE SCOPE IS qwq> DEFAULT qqwqj xH mq> FINISH qqqj xA lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Kqqqwqqq>] mqq> PRESTARTED TRANSACTIONS ARE qqwqq> ON qqqqqqqqquH mqq> OFF qqqqqqqqqj 3 db-handleC A host language variable that you associate with the name of theB database. Use database handles when you are accessing more thanB one database at a time. Do not declare a host language variableC explicitly for the database handle. The Oracle Rdb preprocessors declare the variable foLr you.D You can make a handle local to the module in which it is declared> (LOCAL), or global to all modules that declare the database (GLOBAL, EXTERNAL). The default is GLOBAL. 3 path-name> A full or relative data dictionary path name specifying the& source of the database definitions. 3 file-spec> A full or partial OpenVMS file specification specifying the& source of the database definitions. 3 host-variableA A valid host language variable thMat equates to a database file specification. 3 COMPILETIME= The source of the database definitions when the program isA compiled. This can be either a data dictionary path name or anB OpenVMS file specification. If you specify only the COMPILETIMEB identifier and omit the RUNTIME identifier, Oracle Rdb uses the< COMPILETIME identifier for both compiling and running the program. 3 RUNTIME= The source of the database definitions when the program isB run N. This can be either an OpenVMS file specification or a hostF language variable. If you do not specify this parameter, Oracle RdbA uses the COMPILETIME identifier for both compiling and running the program. 3 DBKEY_SCOPE_COMMITC The DBKEY SCOPE clause controls when the database key (dbkey) ofE an erased record may be reused by Oracle Rdb. When the DBKEY SCOPEC is COMMIT, Oracle Rdb cannot reuse the dbkey of an erased record@ to store another record until the transacOtion that erased the2 original record completes (by entering COMMIT).A The DBKEY SCOPE COMMIT clause specifies that the dbkey of eachB record used is guaranteed to remain consistent only during each transaction. 3 DBKEY_SCOPE_FINISHE With the DBKEY SCOPE IS FINISH clause, Oracle Rdb cannot reuse the@ dbkey (to store another record) until the user who erased theB original record detaches from the database (by using the FINISH statement).B Further, the DBKEY PSCOPE FINISH clause specifies that the dbkeyB of each record used is guaranteed not to change until this user4 detaches from the database(usually, with FINISH). 3 REQUEST_HANDLE_SCOPE_DEFAULTB The REQUEST_HANDLE SCOPE clause is only used by RDBPRE and RDML? programs, not with RDO or RDB$INTERPRET. In a RDBPRE programC where an RDO request occurs within a higher level language loop,? the REQUEST_HANDLE SCOPE clause determines whether system orC user request handles are Qset to zero in the RDO FINISH statement within the loop.B The default is DEFAULT, where the values of the request handles> are not set to zero when the RDO FINISH statement executes. 3 REQUEST_HANDLE_SCOPE_FINISHB The REQUEST_HANDLE SCOPE clause is only used by RDBPRE and RDMLA programs, not with RDO or RDB$INTERPRET. In a program where an> RDO request occurs within a higher level language loop, the@ REQUEST_HANDLE SCOPE clause determines whether system or user> rRequest handles are set to zero in the RDO FINISH statement within the loop.D With the REQUEST_HANDLE SCOPE is FINISH clause, the values of theA request handles are set to zero after the RDO statement FINISH executes. !3 PRESTARTED_TRANSACTIONS_ARE_ON. Explicitly enables prestarted transactions.D For most applications, Rdb recommends that you enable prestarted @ transactions. The default is PRESTARTED TRANSACTIONS ARE ON. B If you use the PRESTARTED TRANSACTIONS SARE ON clause or do not < specify the PRESTARTED TRANSACTIONS clause, the COMMIT or= ROLLBACK statement for the previous read/write transaction> automatically reserves the TSN for the next transaction and reduces I/O. "3 PRESTARTED_TRANSACTIONS_ARE_OFF$ Disables prestarted transactions.> Use the PRESTARTED TRANSACTIONS ARE OFF clause only if your< application uses a server process that is attached to theA database for long periods of time and causes the snapshot filTe> to grow excessively. If you use the PRESTARTED TRANSACTIONSD ARE OFF clause, Oracle Rdb uses additional I/0 because each STARTC TRANSACTION statement must reserve a transaction sequence number (TSN). 2 MoreG You must have the Oracle Rdb READ privilege for a database to invoke* it using the INVOKE DATABASE statement. 2 Examples Example 13 The following example invokes a database in RDO:G RDO> INVOKE DATABASE PATHNAME 'DISK1:[DICTIONARY]CORP.MISU.PERSONNEL'7 This example uses the data dictionary definitions in? DISK1:[DICTIONARY]CORP.MIS.PERSONNEL to invoke the PERSONNEL database in RDO. Example 2? The INVOKE DATABASE statement must be part of every program:: &RDB& INVOKE DATABASE FILENAME 'DISK2:[DEPT3]PERSONNEL'; This statement declares the database defined by the fileC specification DISK2:[DEPT3]PERSONNEL. The preprocessor then usesF this definition when compiling the program, and Oracle Rdb usVes theB database file DISK2:[DEPT3]PERSONNEL.RDB when the program runs. Example 3C The following BASIC example invokes a database using an EXTERNAL database handle:" &RDB& INVOKE DATABASE EXTERNALG &RDB& PERSONNEL = PATHNAME 'DISK1:[DICTIONARY]CORP.MIS.PERSONNEL'@ This example shows a global declaration. Other modules in the@ program can refer to the database using the handle PERSONNEL;D they must use the same database handle for the same database. The) pWrogram does not declare the variable.A o GLOBAL and EXTERNAL are synonymous. These make the database= handle global to all modules that declare the database.B Oracle Rdb creates a PSECT containing one longword using the; name supplied by the user with the overlay attribute.+ o The default database scope is GLOBAL.> o The preprocessor generates declarations for all database handles. Example 4? The following COBOL example uses the COMPILETIME anXd RUNTIME options:- &RDB& INVOKE DATABASE LOCAL PERSONNEL =# &RDB& COMPILETIME PATHNAME3 &RDB& 'DISK1:[DICTIONARY]ACCT.PERSONNEL' &RDB& RUNTIME FILENAME- &RDB& 'USERDISK3:[DEPT3]PERSONNEL'B This example declares the database using two different sources:9 o At compile time, the preprocessor uses the database) definitions in the data dictionary.9 o At run time, Oracle Rdb uses the definition in file% USERDISK3:[DYEPT3]PERSONNEL.RDB. wwB1 Logical_NamesE This section describes new Oracle Rdb logical names and changes toI other Oracle Rdb logical names. For complete information on Oracle RdbF logical names, see the Oracle Rdb Guide to Database Performance and Tuning. 2 RDMS$BIND_VM_SEGMENT_Changed> The logical names RDMS$BIND_VM_SEGMENT changed to RDM$BIND_A VM_SEGMENT, that is, without the S. This logical name preventsC memory fragmentation and alloZws certain applications which would< otherwise run out of virtual memory to execute correctly.& NOTE= The RDM$BIND_VM_SEGMENT logical name is not for general: use, as preserving larger block sizes (by preventing> fragmentation) may cause problems for some applications.; To use this logical name use the DCL command as follows:! $ DEFINE RDM$BIND_VM_SEGMENT 1> Use this logical name either on the system experiencing the< pro [blem or in some other appropriate place such as in the; LOGIN.COM file of the users experiencing the difficulty. 2 RDMS$BIND_QG_TIMEOUTA The RDMS$BIND_QG_TIMEOUT logical name is used to set the query@ optimizer elapsed time limit. The elapsed time that the queryD optimizer spends compiling a query can now be limited by defining? the logical name RDMS$BIND_QG_TIMEOUT and specifying a value@ in seconds. A timer is established which will cause the queryA compilation to be\ aborted if too much elapsed time has passed.D This logical name is translated at attach time and supersedes all( options specified in the application.@ The following DCL command is used to define the RDMS$BIND_QG_7 TIMEOUT logical name and set a value of 120 seconds.$ $ DEFINE RDMS$BIND_QG_TIMEOUT 120< In this example, the query optimizer will abort the query. compilation after 120 seconds have elapsed.> See the RDMS$BIND_QG_REC_LIMIT help topic at this level for> ] information on how to limit the number of records delivered during query processing. 2 RDMS$BIND_QG_REC_LIMIT= The RDMS$BIND_QG_REC_LIMIT logical name is used to set the@ query optimizer row number delivery limit. The number of rowsC delivered during query processing can now be limited by definingA the logical name RDMS$BIND_QG_REC_LIMIT and specifying a value= of n records. Defining this logical name is useful for any? query that returns large quantities of rows a ^nd is likely toA do large numbers of I/O operations. This limit counts the rowsC being returned by the query. Note that this value is independent@ of the number of records read by the application, for example? intermediate records for a join, or component records for an? aggregate. It is very similar to the LIMIT TO clause in SQL.D However, if this limit is exceeded, an error message is returned.D This logical name is translated at attach time and supersedes all( options s_pecified in the application.D The following DCL command is used to define the RDMS$BIND_QG_REC_4 LIMIT logical name and set a value of 20 records:% $ DEFINE RDMS$BIND_QG_REC_LIMIT 20A In this example, the query optimizer will terminate processing+ the query after 20 records are returned.< See the RDMS$BIND_QG_TIMEOUT help topic at this level for> information on how to limit the elapsed time that the query) optimizer can spend compiling a query. 2 RDM$BIND_CK `PT_TRANS_INTERVAL? You can use the RDM$BIND_CKPT_TRANS_INTERVAL logical name to@ define a process-specific checkpoint interval value when undo> /redo recovery processing is enabled. By default, a processC checkpoints when the AIJ block size limit is reached or the timeD interval limit is exceeded, whichever occurs first. The RDM$BIND_C CKPT_TRANS_INTERVAL logical name uses the number of transactionsB as the checkpoint trigger. For example, if you define RDM$BIND_A CKPT_TRAN aS_INTERVAL to be 10, the process on which the logicalB is defined checkpoints after committing ten transactions IF theD transaction limit is reached before the block size or time limits are exceeded. 2 RDMS$USE_OLD_UPDATE_RULES> This section discusses use of the RDMS$USE_OLD_UPDATE_RULESA logical name to preserve update behavior. You cannot modify orC erase records in a relation if the relation is joined with other relations.& NOTE bA This restriction applies to RDO, RDBPRE, and RDML only. SQL0 syntax does not allow this type of update.= However, updates to a relation are allowed if you join the/ relation with other relations in a subquery.@ This update restriction can cause applications that depend onA the previous update behavior to fail unless update queries are> modified. You can use the RDMS$USE_OLD_UPDATE_RULES logical@ name to retain the previous update behavior, then modify your c applications.@ Define the RDMS$USE_OLD_UPDATE_RULES logical name to be 1, as0 shown below, to enforce the old update rules.' $ DEFINE RDMS$USE_OLD_UPDATE_RULES 1D Support for this logical name will be removed in a future release of Oracle Rdb. 2 RDMS$BIND_WORK_FILE_Changed? The RDMS$BIND_WORK_FILE logical name is used to redirect theD location of temporary files that Oracle Rdb sometimes creates forC use in matching operations. Oracle Rdb creates the file whedn theD process running the query runs out of virtual memory, and deletes( the file once the query is completed.C You can define RDMS$BIND_WORK_FILE and specify a device name andC directory. This enables the file to use resource identifiers for disk quota allocation.< The following example shows how to assign the location of6 temporary files to a specific device and directory.4 $ DEFINE RDMS$BIND_WORK_FILE WORK$DISK:[RDB.WORK] wwB 1 MODIFY e= Changes the value in a field in one or more records from a@ relation or open stream. Before you use the MODIFY statement,A you must start a read/write transaction and establish a record? stream with a FOR statement or a START_STREAM statement. TheA context variables you refer to in MODIFY statement must be the> same as those defined in the FOR or START_STREAM statement. Example:8 RDO> FOR E IN EMPLOYEES WITH E.EMPLOYEE_ID = "00175" cont> MODIFY E USING% conft> E.LAST_NAME = "Smathers" cont> END_MODIFY cont> END_FOR 2 Format1 (B)0MODIFY qqq> context-var qqqk lqqqqqqqqqq USING qqqqwqqqqqqqq>qqqqqqwqqqqqk1 mqq> on-error qqj x/ lqqqqqqqqqqqqqqqqqq context-var . field-name qq> = qqq> value-expr qqwqkD x mqqqqqqqqqqqqqqqqqqqq ; context-gvar . * qqqqqqqqq> = qqq> record-descr qqqquD lqqqqqqqqqqqqqqqqqqq END_MODIFY qqqq> 3 on-errorD The ON ERROR clause, which specifies a host language statement to. be performed if an Oracle Rdb error occurs. 3 context-varD A context variable declared in the FOR or START_STREAM statement.A The MODIFY statement must appear after FOR or START_STREAM and before END_FOR or END_STREAM.A Youh can modify fields in only one relation at a time. That is,D all the context variables on the left side of the assignment in a4 MODIFY statement must refer to the same relation. 3 record-descrD A valid data dictionary record descriptor matching all the fields of the relation. 3 field-name( The name of the field to be modified. 3 value-exprF an Oracle Rdb value expression that specifies the new value for the modified field. 2 MoreE You nee id the Oracle Rdb READ and MODIFY privileges to the relationF and also the Oracle Rdb MODIFY privilege to the database to use the MODIFY statement.C Prior to Version 4.1, Oracle Rdb allowed you to modify rows in a> table that was directly joined with other tables. BeginningC with Version 4.1, Oracle Rdb returns an error message if you tryG to modify a row under these conditions. For example, Oracle Rdb will@ return the error, $RDMS-E-JOIN_CTX_UPD, relation EMPLOYEES isA p jart of a join, cannot be updated, when you try to execute the following query:E FOR S IN SALARY_HISTORY CROSS D IN DEGREES CROSS DP IN DEPARTMENTS- WITH S.EMPLOYEE_ID = D.EMPLOYEE_ID AND- S.EMPLOYEE_ID = DP.MANAGER_ID AND S.SALARY_END MISSING D.DEGREE = 'MA'= MODIFY S USING S.SALARY_AMOUNT = S.SALARY_AMOUNT * 1.1 END_FOR@ The preceding query will modify some salary history rows moreD than once and gives multiple salary rai kses to some managers. This5 query can be reworded using a subquery as follows: FOR S IN SALARY_HISTORY$ WITH S.SALARY_END MISSING AND5 (ANY D IN DEGREES CROSS DP IN DEPARTMENTS3 WITH S.EMPLOYEE_ID = D.EMPLOYEE_ID AND D.DEGREE = "MA")= MODIFY S USING S.SALARY_AMOUNT - S.SALARY_AMOUNT * 1.1 END_FOR? This revised query will work with the new as well as the oldC update rules and it will ensure that each qualified manager getsl a single salary raise.F Note that some examples in the Guide to Using RDO, RDBPRE, and RDML? will not work with the update rules introduced in Oracle RdbA Version 4.1. To run these examples, rewrite them using the ANY! subquery mentioned previously. 2 Examples Example 1$ Modify a field value in a record:? DISPLAY "Enter employee's ID number: " WITH NO ADVANCING. ACCEPT ID.: DISPLAY "Enter new status code: " WITH NO ADVANCING. ACCEPTm STATUS_CODE.& &RDB& START_TRANSACTION READ_WRITE4 &RDB& FOR E IN EMPLOYEES WITH E.EMPLOYEE_ID = ID &RDB& MODIFY E USING &RDB& ON ERROR! GO TO ERROR-PAR &RDB& END_ERROR) &RDB& E.STATUS_CODE = STATUS_CODE &RDB& END_MODIFY &RDB& END_FOR &RDB& COMMIT wwB 1 ON_ERROR? Specifies the statement(s) the host language will perform if> an error occurs during the execution of the associatend data> manipulation statement. The statements can be host language9 statements or Oracle Rdb data manipulation statements.& NOTE< ON ERROR is supported only for the high-level languageB preprocessors. ON ERROR is not supported for RDO or Callable RDO. 2 FormatI (B)0ON ERROR qwq> statement qwq> END_ERROR mqqqqqqqq If some other error code is detected, "Unknown error" is& displayed and the program stops. 2 MoreD If you have invoked a database, you have the necessary privileges to use the ON_ERROR clause. wwB1 PLACE? Returns the dbkey of a specified record. The PLACE statementA lets you determine the target page number for records that areD to bet loaded into the database. The PLACE statement is similar inC syntax to the STORE statement. However, the PLACE statement does not actually store a record.< The PLACE statement can result in significant performance< improvements in database load procedures that specify theB PLACEMENT VIA INDEX clause for a hashed index. Use it only with5 records for which a hashed index has been defined.@ The PLACE statement is valid only in RDO and in Callable RDO. 2 Formatd u(B)0PLACE q> context-var qq>IN qqwqqqqqqqq>qqqqqqqqqwqq> relation-name qqkK mq>db-handle q> . qj xI lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq USING qqqwqqqqqqqq>qqqqqqqwqqqqqqqqk. mqq> on-error qqqj x, lqqqqqqqqqqqqqqqqqqqqq context-var . field-name qqq> = qqq> value-expr qqqwqqqwqqqqqkH x mqqqqqqqqqqqqqqqqqqqqvqqqq ; context-var . * qqqqqqqqqq> = qq> record-descr qqqqqqqqj xH lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqk\ tq> GET qq> host-var qq> = qq> context-var qq> . qq> RDB$DB_KEY qu xZ mq> PRINT qqqqqqqqqqqqqqqqqqq> context-var qq> . qq> RDB$DB_KEY qj xH lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq END_PLACE qqqqqq> 3 context-var A valid context variable. 3 db-handle: A host language variable used to refer to the database. 3 relation-nameA The name of the relation into which the value would be stored. 3 on-errorD The ON ERROR clause, which specifies a host language statement orJ Oracle Rdb data manipulation statement to be performed if an Oracle Rdb error occurs. 3 field-nameA The namxes of the fields that appear in the index referenced inA the DEFINE STORAGE MAP statement's PLACEMENT VIA INDEX clause.C All index segments must be specified or the results of the PLACE? statement will be of little use. Field-names not used in the% index, if listed, will be ignored. 3 value-exprD A valid Oracle Rdb value expression that specifies the value that would be stored. 3 record-descrD A valid data dictionary record descriptor matching all the fiel ydsD of the relation. You can use a host language statement to includeD the relation definition in your program. Each field of the record? descriptor must match exactly the field names and data typesE of the fields in the Oracle Rdb relation referenced by the context variable. 3 host-var< A user-defined host language variable, into which you may> store the dbkey of the record that would be stored. Use theA GET...RDB$DB_KEY construct to assign the value of the dbkey tzo the host language variable. 2 MoreC You must have the Oracle Rdb WRITE privilege to the database and' relation to use the PLACE statement. 2 ExampleC The PLACE statement returns the dbkey of the specified record in the following example: RDO> PLACE E IN EMPLOYEES* cont> USING E.EMPLOYEE_ID = "94789" cont> PRINT E.RDB$DB_KEY cont> END_PLACE wwj1 PreprocessorsF Oracle Rdb preprocessors check and proces {s Oracle Rdb statements inF your program, converting the Oracle Rdb statements to host languageD calls to the database. RDBPRE, the preprocessor for BASIC, COBOL,A and FORTRAN, automatically invokes the necessary host language? compiler for your program. You must invoke the host languageD compiler after you preprocess a C or Pascal program with the RDML preprocessor.2 Callable_RDOH Callable RDO is a program interface that you must use when Oracle RdbK does not supp |ort a preprocessor for your program language. You can alsoK use this interface when you want to perform Rdb data definition tasks orI dynamic data manipulation tasks in BASIC, C, COBOL, FORTRAN, or Pascal programs.@ When you use the Callable RDO program interface, your programH communictes with Oracle Rdb using a callable function, RDB$INTERPRET.I Unlike preprocessor interfaces, the Callable RDO interface performs in an interpretive manner.K The Rdb statements you us }e in your pgoram are string literals. When theI program executes, the statements are passed to Oracle Rdb in the callsI to RDB$INTERPRET. The interactive Rdb interface, RDO, then interprets and executes them.G You call the RDB$INTERPRET function as you would call a VMS Run-TimeJ Library routine. In the calling sequence, you pass both Rdb statementsH and host language variables that cuase values from teh database to beJ retrieved or updated. The call to RDB$INTERPRET re ~turns a status valueH that indicates the success or failure of the statements. If the callJ was successful, RDB$INTERPRET also returns retrieved database values to% the appropriate program variables.E For more information, refer to the Guide to Using RDO, RDBPRE, and RDML.3 RestrictionB If the program that uses Callable RDO (RDB$INTERPRET) is linkedJ implicitly with SYS$SHARE:RDBINTSHR (that is, allows the OpenVMS Linker2 utility (LINKER) to resolve the reference u singK SYS$LIBRARY:IMAGELIB.OLB) then the message vector and transaction handle) values are not returned to the caller.H However, if the program is linked explicitly with SYS$SHARE:RDBINTSHRF as the following example shows, then message vector and transactionF handle values are returned. In this case, there must be two PSECTs? declared and named RDB$TRANSACTION_HANDLE (8 bytes long) andC RDB$MESSAGE_VECTOR (20 longwords, that is, 80 bytes long) in the caller's program. $ LINK PROGRAM,SYS$INPUT/OPT SYS$SHARE:RDBINTSHR.EXE/SHARE$ PSECT_ATTR=RDB$MESSAGE_VECTOR,SHR( PSECT_ATTR=RDB$TRANSACTION_HANDLE,SHR; However the explicit linking against the shareable imageH SYS$SHARE:RDBINTSHR is not upward compatible and the application willC need to be relinked for each new version of Oracle Rdb released.+ There is no workaround for this problem. 2 RDBPRE@ You can define a symbol to invoke RDBPRE. Once you are in theC RDBPRE environment, you can specify the programming language and- the input file specification. For example: $ RDBPRE :== $RDBPRE $ RDBPRE! INPUT FILE> MYPROG.RFO/FORTRAN@ A more convenient method is to define a symbol that invokes a> particular preprocessor. For example, if you frequently useA the preprocessor with FORTRAN data manipulation language (DML) programs: $ RFOR :== $RDBPRE/FORTRAN $ RFOR MYPROGRAM.RFO 3 /BASICB Specifies that the input file is a BASIC source file. FollowingC successful RDBPRE preprocessing, the resulting file is submitted' automatically to the BASIC compiler. 3 /COBOLB Specifies that the input file is a COBOL source file. FollowingC successful RDBPRE preprocessing, the resulting file is submitted' automatically to the COBOL compiler. 3 /FORTRAND Specifies that the input file is a FORTRAN source file. FollowingC successful RDBPRE preprocessing, the resulting file is submitted)  automatically to the FORTRAN compiler. 3 /INITIALIZE_HANDLES= The /[NO]INITIALIZE_HANDLES qualifier allow you to control; whether RDBPRE will initialize RDBPRE-supplied database,> transaction, and request handles. Use of the /NOINITIALIZE_> HANDLES qualifier allows you to link a main image against a5 shareable image and share handles between the two. Format:2 /INITIALIZE_HANDLES (Default)& /NOINITIALIZE_HANDLESA These  qualifiers have no effect on whether or when handles areB cleared in the generated code; they only control initialization< of handles in declarations. Furthermore, they only affectB database, transaction and request handles that RDBPRE declares.= User-specified transaction and request handles will not be> initialized when you use the /INITIALIZE_HANDLES qualifier.> In RDBPRE when you use the /NOINITIALIZE_HANDLES qualifier,? any handle you specify in your application program must also' be specified in the shareable image. 2 RDML8 You can define a symbol to invoke the Relational Data: Manipulation Language (RDML) preprocessor. For example: $ RDML :== $RDML $ RDML _Source file: SAL_HISTORY.RC> A more convenient method is to define symbols. For example: $ RDMLC :== $RDML/C $ RDMLPAS :== $RDML/PASCAL $! $ RDMLC SAL_HISTORY.RC@ See the RDML Help module that is available from DCL level for details. wwj1 PRINT> Displays values from data records in a record stream on the? current default output device. PRINT is intended for testingB and learning. Using PRINT, you can type a query at the terminalC and see the results immediately. You can also use the SET OUTPUT= statement to write the results to a file or another output device.> PRINT is valid only in RDO. To retrieve values in an RDBPREC program, use the GET statement to assign database values to host language variables. RDO Example: RDO> FOR J IN JOBS' cont> PRINT J.JOB_CODE, J.JOB_TITLE cont> END_FOR 2 MoreD If you have invoked a database, you have the necessary privileges to use the PRINT statement.1 You can use the PRINT statement in three ways:? o When you establish a record stream with the FOR or START_C STREAM statement, you use the PRINT statement to write valuesA from the current record stream to the output dev ice. In the? case of START_STREAM, you also need FETCH to indicate the# current record in the stream.: o You can also use PRINT alone, without a FOR or FETCHB statement, to retrieve the result of a statistical function.D The record stream is formed by the record selection expression( within the statistical expression.D o You can use PRINT...RDB$DB_KEY in a STORE...END_STORE block toB display the database key of the record just stored. Example:%  RDO> STORE E IN EMPLOYEES USING% cont> E.EMPLOYEE_ID = "15231";# cont> E.LAST_NAME = "Smith"; cont> PRINT E.RDB$DB_KEY cont> END_STORE RDB$DB_KEY 21:339:0 2 Format@ (B)0PRINT qqqwqwqqq> value-expr qqqqqqqqwqwqqq>, x mqqq> context-var . * qqqj x* mqqqqqqqqqqqqqq , START_TRANSACTION READ_ONLY RDO> RDO> FOR E IN EMPLOYEES cont> PRINT E.* cont> END_FOR RDO> RDO> COMMITD You can use the wildcard character (*) to display all fields fromB one or more relations named in your RSE. RDO displays the namesA of the fields as column headers and displays the correspondingB field values beneath them. When you use the wildcard character,@ you cannot display values for segmented strings, literals, or statistical expressions.C This RDO query displays all the field values from each record in the EMPLOYEES relation. Example 23 Retrieve values from named fields in a relation:# RDO> START_TRANSACTION READ_ONLY RDO> RDO> FOR E IN EMPLOYEES; cont> PRINT E.LAST_NAME, E.FIRST_NAME, E.MIDDLE_INITIAL cont> END_FOR RDO> RDO> COMMIT? This RDO query displays field values from each record in the EMPLOYEES relation. Example 30 Retrieve values from fields in two relations:# RDO> START_TRANSACTION READ_ONLY RDO>3 RDO> FOR E IN EMPLOYEES CROSS JH IN JOB_HISTORY cont> OVER EMPLOYEE_ID" cont> WITH JH.JOB_END MISSING) cont> PRINT E.LAST_NAME, JH.JOB_CODE cont> END_FOR RDO> RDO> COMMIT? This RDO statement performs a join of two relations and usesB PRINT to display a value from each. The result is the last name) and current job code of each employee. Example 43 Retrieve the result of a statistical expression:# RDO> START_TRANSACTION READ_ONLY RDO>* RDO> PRINT COUNT OF E IN EMPLOYEES WITH cont> E.STATE = "MA" RDO> RDO> COMMIT= This example retrieves the number of employees who live in Massachusetts. wwPz 1 RDOINIA The RDOINI file is a startup file for RDO. You can include RDO@ statements in this file to set up the characteristics of your? terminal sessio n, set the default data dictionary directory,B invoke databases, and perform other frequently used operations.B If you define the logical name RDOINI to point to a centralized= initialization file, RDO uses this file as a startup file.C Otherwise, RDO looks for a file called RDOINI.RDO in the current default directory. $ TYPE STARTUP.RDO. INVOKE DATABASE PERS = PATHNAME 'PERSONNEL' SHOW DATABASES. $ DEFINE RDOINI "DISK2:[OBRIEN]STARTUP.RDO" $ RDOL Database with db_handle PERS in path 'DISK1:[DICTIONARY]CORP.PERSONNEL;1' RDO> ww1 RDO_Foreign_CmdA You can invoke RDO as a foreign DIGITAL Command Language (DCL) command. Example: $ RDO :== $RDOA $ RDO CHANGE DATABASE FILE PERS JOURNAL FILE DSK1:[TOP]PS.AIJ. 2 MoreC RDO as a foreign DCL command is useful in DCL command proceduresA because it lets you test the success or failure of the RDO DCLC command line. For example, after each DCL command, you can enter in your procedure:2 $ IF $SEVERITY .NES. "1" THEN GOTO HANDLE_ERROR6 The integer values for each DCL severity level are: Value Severity 0 Warning 1 Success 2 Error 3 Information' 4 Severe (fatal) errorB The possible integer values returned by RDO are 1, 2, or 4. The- specific status codes returned by RDO are: SS$_NORMAL& RDO-E-ERRDET, an error was detected/ RDO-F-SEVERRDET, a severe error was detected. These are returned in DCL's $STATUS symbol.C Users who currently invoke RDO as a foreign command will receive? one of the above (as additional) messages if the RDO commandC fails. See the OpenVMS DCL Dictionary for more information about- handling errors in DCL command procedures. wwj1 READY< In programs, the READY statement explicitly declares yourA intention to access one or more databases and causes an attach2 to the database. READY is not available in RDO.C You do not have to use READY to access a database. A database isA readied automatically the first time you refer to it. However,, you do need an INVOKE DATABASE statement.? If you issue a READY statement without specifying a databaseB handle, Oracle Rdb opens all databases declared in that module. 2 MoreE You need the Oracle Rdb READ privilege for the database to use the READY statement.@ You can use the READY statement to test the availability of aC database. For example, you may want to check availability before) your program prompts a user for input. 2 FormatN (B)0READY qqqwqqqq>qqqqqqqqqqqqqqwqqqwqqqq>qqqqqqqqqqqqqwqqqqq>< mqwqq> db-handle qwqj mqqqq> on-error qqqj mqqqqqq , 2 DATABASE PERS = FILENAME "WORK$DISK:PERSONNEL"; . . main () { READY PERS; . . . FINISH PERS; Pascal Program program empupdate;2 DATABASE PERS = FILENAME 'WORK$DISK:PERSONNEL'; .  . . begin READY PERS; . . . FINISH PERS; Example 2> The following program fragments demonstrate how to open two< databases within the same program. The program fragments:D o Use the DATABASE statement to declare two databases, PERSONNEL and PAYROLL1 o Declare database handles for both databases o Open both databases  o Close each database C Program #include 3 DATABASE PERS = FILENAME "WORK$DISK:PERSONNEL";1 DATABASE PAY = FILENAME "WORK$DISK:PAYROLL"; main () { . . . READY PERS; . . . FINISH PERS; . . . READY PAY;  . . . FINISH PAY; . . . READY PERS, PAY; . . . FINISH PERS, PAY; Pascal Program program new_employee;3 DATABASE PERS = FILENAME 'WORK$DISK:PERSONNEL';1 DATABASE PAY = FILENAME 'WORK$DISK:PAYROLL'; .  . . READY PERS; . . . FINISH PERS; . . . READY PAY; . . . FINISH PAY; . . . READY PERS, PAY; .  . . FINISH PERS, PAY; wwX1 Release_Notes: The Oracle Rdb Release Notes are in the following file: SYS$HELP:RDBvvu.RELEASE_NOTES$ where vv = version and u = update For example: SYS$HELP:RDB071.RELEASE_NOTES ww[1 Rel_operators2 Permitted Relational Operation SymbolsD EQ = True if the two value expressions are%  equal.H NE <> True if the two value expressions are not% equal.D GT > True if the first value expression is7 greater than the second.D GE >= True if the first value expression isC greater than or equal to the second.I LT < True if the first value expression is less/  than the second.I LE <= True if the first value expression is less; than or equal to the second.D BETWEEN True if the first value expression isG between the second and third or equal to+ one of them.H ANY True if the record stream specified by theF RSE includes at least one reco rd. If youI add NOT, the condition is true if there are> no records in the record stream.E MATCHING True if the second expression matches aF substring of the first value expression.E MATCHING uses these special characters:7 * Matches any string9 % Matches any characterC MISSING  True if the value expression is null.H UNIQUE True if the record stream specified by theF RSE includes only one record. If you addI NOT, the condition is true if there is moreI than one record in the record stream or the5 record stream is empty.H CONTAINING True if the string specified by the secondC  string expression is found within the@ string specified by the first. Not- case sensitive.G STARTING WITH True if the first characters of the firstG string expression match the second string9 expression. Case sensitive. ww[1 Replication_Option9 Replication Option is a software product that lets you: distribute whole databases, or parts of them, to target? directories on the same or different nodes in a network. The> source database for extraction and extraction rollup targetC databases can be a DSRI-compliant database such as Oracle Rdb or= one of the Oracle data access products, known as gateways.C Note that RDO does not support all the latest Replication OptionE features. Oracle recommends that you use the SQL interface insteadF of RDO because SQL is an industry-standard database access languageD and only SQL supports all the latest Replication Option features.2 Release_Notes@ To see the current Release Notes for Replication Option, type or print the following file:! SYS$HELP:DDALvvu.RELEASE_NOTES$ where vv = version and u = update For example:! SYS$HELP:DDAL060.RELEASE_NOTES 2 Error_msg_doc> Errors returned by Replication Option are documented onlineC in the file SYS$HELP:DDAL$MSG.DOC, which you can PRINT, TYPE, or  SEARCH at DCL level. 2 EXTRACTION9 Specifies that Replication Option create an extraction@ database at the target site. Because each extraction database= is independent of the source database, users at the targetB directory can access extraction databases with either read-only? or read/write transactions. Each time an extraction transfer< executes, Replication Option creates a new version of the@ target database and transfers a complete copy of the selected recor ds to the target node.C Indexes, constraints, and access rights are not transferred whenD the target database is created. Once the target database has beenA created, you can define views, indexes, and constraints for it@ and modify the access rights. Refer to the Replication Option< Handbook for more information about extraction databases. 2 EXTRACTION_ROLLUP@ Specifies that Replication Option create an extraction rollup@ database at the target site with records select ed from one orD more source databases. Because each extraction rollup database isD independent of the source database, users at the target directoryB can access extraction rollup databases with either read-only orC read/write transactions. Each time an extraction rollup transfer< executes, Replication Option creates a new version of the@ target database and transfers a complete copy of the selected records to the target node.C Indexes, constraints, and access rights are not  transferred whenD the target database is created. Once the target database has beenD created, you can define indexes and constraints for it and modifyB the access rights. Refer to the Replication Option Handbook for/ more information about extraction databases. 2 REPLICATIONB Specifies that Replication Option create a replication database= at the target site. When a replication transfer executes, F Replication Option creates a database at the target site during theA  initial execution and supplies updates to it during subsequentB transfers. In addition, the execution of a replication transferD might create special-purpose relations in the source database and* the target database to handle updating.8 Refer to the Replication Option Handbook for specificA information about these special database entities. Because theD source database is modified with the addition of these new system@ relations, the user who defined the transfer needs the DEFINE' access right to the source database.; After Replication Option creates the target database andA transfers the data records to it, users are expected to access? the replication database to retrieve data only. ApplicationsB should not attempt to store, modify, or erase values in records of the replication database. 2 SHOW_TRANSFER? Displays information about the transfer definition, schedule9 definition, the transfer status, or all these transferB attributes. When you enter the SHOW TRANSFER statement, you can; display information about one transfer or all transfers.& NOTE? The RDO SHOW TRANSFER statement does not display transfer< protection, the checkpoint attribute, or the NO DELETE= attribute that may have been established for a transfer@ definition using SQL. You must issue the SQL SHOW TRANSFER, statement to display these attributes. 3 FormatG (B)0SHOW TRANSFER qqqq> transfer-attribute qqqk. lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj? mqqqqqq> FOR qqqwqqq> ALL qqqqqqqqqqqqwqqq>/ mqqq> transfer-name qqj 4 transfer-attribute (B)0transfer-attribute = ) qqqwqqq> DEFINITION qqqqqwqqqq>$ tqqq> SCHEDULE qqqqqqqu$ tqqq> STATUS qqqqqqqqqu$ mqqq> ALL qqqqqqqqqqqqj@ The type of information you want displayed about the selected transfer or all transfers. 5 DEFINITION= Displays transfer definition information for the specified! transfer or for all transfers. 5 SCHEDULE= Displays schedule definition information for the specified! transfer or for all transfers. 5 STATUS> Displays the following status information for the specified! transfer or for all transfers: o Transfer nameD o State of the current transfer (unscheduled, scheduled, active,,  waiting-to-retry, retrying, suspended): o Time the transfer entered its current transfer state o Last transfer status1 o Time the last successful transfer completedB o Next scheduled transfer time (for transfers in the scheduled or waiting-to-retry state)C o Number of the currently executing retry (for transfers in the retrying state)@ o Number of the next retry (for transfers in the waiting-to- retry state) 5 ALL? Displays all information about the definition, schedule, and: status for the specified transfer or for all transfers. 4 ALL8 Specifies that you want Replication Option to display@ information about all transfers associated with your UIC. ForA transfers belonging to other UICs, Replication Option displaysA only the transfer name. To display information about transfersC belonging to other UICs, you must have OpenVMS BYPASS or READALL privilege. 4 transfer-nameB The trans fer about which you want Replication Option to display information. 2 DELETE_SCHEDULE= Deletes the schedule definition associated with a transferA definition. You can delete a schedule definition only when the> associated transfer is in the suspended state. Refer to theA STOP TRANSFER statement for information about how to suspend aC transfer. If you issue a START TRANSFER statement after deleting? the schedule, the transfer will be placed in the unscheduled state. 3 FormatP (B)0DELETE SCHEDULE qq> FOR qqq> transfer-name qqqqqq> . 4 transfer-name? Identifies the transfer whose schedule is to be deleted. The' transfer-name parameter is required. 3 More@ You must execute the DELETE SCHEDULE statement outside of the= scope of a transaction. If you issue this statement when aB transaction is outstanding, Replication Option returns an error message.@ If a transfer has a schedule definition, DELETE TRANSFER also@ deletes the corresponding schedule definition. If you want to> delete a transfer schedule, the schedule definition must be associated with your UIC. 3 Example? This example places the NH_EMPLOYEES transfer in a suspended2 state and then deletes the associated schedule." RDO> STOP TRANSFER NH_EMPLOYEES) RDO> DELETE SCHEDULE FOR NH_EMPLOYEES. 2 DELETE_TRANSFER> Deletes a transfer definition. If a transfer has a schedule= definition, DELETE TRANSFER also deletes the corresponding schedule definition. 3 FormatF (B)0DELETE TRANSFER qqq> transfer-name qqqq> . 4 transfer-name; The transfer definition to be deleted. The transfer-name parameter is required. 3 MoreB To issue the DELETE TRANSFER statement, the transfer definitionC you delete must be associated with your UIC or you must have the; DROP transfer privilege or the OpenVMS BYPASS privilege.@ You must execute the DELETE TRANSFER statement outside of the= scope of a transaction. If you issue this statement when aB transaction is outstanding, Replication Option returns an error message.; You can delete a transfer only if the transfer is in the< suspended state. Refer to the STOP TRANSFER statement for/ information about how to suspend a transfer.? When you delete a transfer definition, the associated target' database does not change in any way.  3 ExampleD The following example suspends the MA_EMPLOYEES transfer and then deletes its definition:" RDO> STOP TRANSFER MA_EMPLOYEES% RDO> DELETE TRANSFER MA_EMPLOYEES. 2 DEFINE_TRANSFER> Creates a transfer definition and stores it in the transfer? database. A transfer definition contains all the information@ necessary to select a set of records from the source databaseB and to define a target database. A transfer definition also canA contain the views to be  defined on the target database and theC command procedures to be executed before and after the execution of the transfer.C A source database for extraction transfers can be Oracle Rdb, orD a database accessed through one of the Rdb Transparent Gateways. H For replication transfers, the source database must be an Oracle Rdb database.& NOTE: The DEFINE TRANSFER statement, unlike the SQL CREATE< TRANSFER statement, cannot be us ed to define transfers< to existing databases (including replication transfers= with the NO DELETE attribute). It also does not provide= a checkpoint clause. Furthermore, unlike the SQL CREATE> TRANSFER statement, the RDO utility does not support the> MIA character set attributes. It is possible to create aB transfer definition using RDO and name a database containing@ MIA features. However, the character set attributes of the5 resulting target databas e might not be correct. @ Use of RDO is recommended only when you want to manipulate; databases that use only the DEC_MCS character set for text data. 3 Formatg (B)0DEFINE TRANSFER qq> transfer-name qqwqqq> REPLICATION qqqqqqqqqwqqkN tqqq> EXTRACTION qqqqqqqqqqu xU mqqq> EXTRACTION ROLLUP qqqj xG lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq> TO qq> file-spec qkI mq> DESCRIPTION IS q> /* text */ qj x@ lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqwq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqkL mq>target-db-param-clauseqj x tq>move-relations-clause qqqqqqqu x xJ x tq>move-views-clause qqqqqqqqqqqu x xJ  x mq>move-relations-rollup-clauseqj x xH mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqkJ mqqq> transfer-file-options-clause qqj xH lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq END qqqwqqqqqqqqq>qqqqqqqqqwqqwqqqqqqq>qqqqqqwqqqqqqq> .@  mq> transfer-name qqj mq> TRANSFER qqj 4 transfer-nameD Identifies the transfer by name. The transfer name must be uniqueC across all of the nodes at a given VAXcluster or VMScluster siteC because a single transfer database serves all nodes in a clusterA environment. For example, you could have two users on the sameC server attempting to create a transfer called PERS_REC. One user? would succeed while the other would receive an error message@ saying that the transfer already exists. To ensure that namesD are unique, you may wish to make the user identifier part of each transfer name.; A valid transfer name has the following characteristics:/ o Has a length from 1 to 31 bytes (octets).= o Can be formed using any of the set of ASCII characters:5 A B C ... Z 0 1 2 ... 9 _ $ a b c ... z@ Lower case letters may be used, but are treated as if they were uppercase.C o Cannot include let ters with diacritical marks (which are used* in European languages for instance).D o The first character of the name must either be a letter or theM dollar sign ($). However, Oracle Corporation recommends that you do notD use dollar signs in a transfer name; dollar signs are reserved7 for special use by Digital Equipment Corporation.+ The transfer-name parameter is required. 4 REPLICATIONB Specifies that Replication Option create a replication database< at the target site. When a replication transfer executes,; Replication Option creates a database at the target siteB during the initial execution and maintains a connection to thatB target database so the source can supply updates to the target.B Subsequent transfers involve only those modifications that haveD been made to the selected records in the source database. (If theB target and source database should become inconsistent with eachD other, you can use the REINITIALIZE  TRANSFER statement to restore consistency.)A In addition, the execution of a replication transfer generallyC creates special-purpose relations in the source database and theB target database to handle updating. Because the source database? is modified with the addition of these system relations, theB transfer definer's account needs the DEFINE access right to the source database itself.? Users are expected to access the replication target databaseC only to retriev e data. Applications should not attempt to store,B modify, or erase values in records of the replication database.B Although data values should not be manipulated in a replicationA database, you can modify the target database by defining views) and indexes, and adding access rights. 4 EXTRACTION9 Specifies that Replication Option create an extraction@ database at the target site. Because each extraction database= is independent of the source database, users at the tar get? directory can access extraction databases with read/write as? well as read-only transactions. Each time an extraction modeA transfer executes, Replication Option creates a new version ofD the target database and transfers a complete copy of the selected records to the target node.> Indexes, constraints, and access rights are not transferred> when the target database is created. Similarly, primary key; and foreign key attributes for a particular relation are< not  transferred because key attributes are implemented asB constraints. Once the target database has been created, you canB define indexes, constraints, and triggers for it and modify the access rights. 4 EXTRACTION_ROLLUP@ Specifies that Replication Option create an extraction rollupA database at the target site by transferring selected relations= and fields from one or more source databases into a singleC target database. An extraction rollup database is created at the A target site, and Replication Option reads data from the source6 databases and stores the data in a target database.C Each time an extraction rollup transfer is executed, Replication: Option creates a new version of the target database and; transfers to it a complete copy of the selected records.D The EXTRACTION ROLLUP option in the DEFINE TRANSFER statement has1 the following characteristics and limitations:> o Replication Option issues an error message if you do n ot? enter a MOVE RELATION clause or a SELECT FIELDS list in a# move-relations-rollup-clause.C o You must refer to each source database in the DEFINE TRANSFER' statement by its database handle.A o On the target database, relation names and field names mustD be unique. Consequently, all target relations of the same nameA must have the same definition, and all target fields of the@ same name must have the same data type. If the definitions> or d ata types differ, Replication Option issues an error% message and the transfer fails.B o If any database specified in the transfer definition is on a? node that is not available, Replication Option places the> transfer in a waiting-to-retry state. Replication OptionD will retry the transfer at the time specified for retry in the schedule definition.: o If any of the source nodes specified in the transferA definition fail during the transfer, the trans fer will alsoB fail. Replication Option will retry the transfer at the time5 specified for retry in the schedule definition.C o If the transfer fails, the retry will start at the beginning,& not where the transfer left off.> Indexes, constraints, and access rights are not transferred> when the target database is created. Similarly, primary key; and foreign key attributes for a particular relation are< not transferred because key attributes are implemented asB constraints. Once the target database has been created, you canB define indexes, constraints, and triggers for it and modify the access rights. 4 text@ A text string that allows you to associate a comment with the< transfer definition. The text string, together with otherA parts of the transfer definition, appears in the SHOW TRANSFER= DEFINITION display. The DESCRIPTION IS clause is optional. 4 file-specA Designates a file specification for the target data base, which> is an Oracle Rdb database. Replication Option uses the fileB specification to create and access the target database. You can? use either a full or partial file specification or a logicalC name. The file-spec parameter is required. If you do not specifyA the node, device, or directory, Replication Option assumes the@ SYS$LOGIN of the user defining the transfer. If the file typeA is not .RDB, the transfer will fail during the creation of the2 target database. Th e default file type is .RDB.A When you specify the name of a remote node as part of the fileB specification, you can include an access control list (ACL) forD login. However, the most effective method of allowing access to a# target node uses proxy accounts.B If you use DECnet/OSI note that Replication Option expects node@ names in file specifications to be from one to six charactersC long. DECnet/OSI permits node names to be much longer than this.B In order to use Repli cation Option in a DECnet/OSI environment,B you must define and use short synonyms for the long node names.< Node name synonyms can be registered either in a local orA distributed name service database. For details on establishingA node name synonyms, refer to the documentation for DECnet/OSI.@ Note that the file specification is resolved at run time. All> logical names used for the file-spec parameter are resolvedC within the copy process after it executes the transfer define r's? login initialization file, LOGIN.COM. If the target databaseD name is a logical symbol name, when it is translated, the default0 directory is the one pointed to by SYS$LOGIN.: Replication Option makes no attempt to verify whether aA database or file of the same name already exists in the target= directory. When you issue a duplicate file specification, E Replication Option creates a second file with the same name, but a higher version number.= If the database  system (Oracle Rdb) returns an error while? attempting to create a database in the target directory, theA copy process writes the error in the copy process log file and4 returns the error status to the transfer monitor. 4 target-db-param-clause" (B)0target-db-param-clause = E qqqwqwq>qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqwqq>K x tq> ALLOCATION IS qqqqqqqq> number-pages qq> PAGES qqqqu xR x tq> PAGE SIZE IS qqq> page-blocks qqqqqq> BLOCKS qqqqqqu xR x tq> NUMBER OF BUFFERS IS qq> number-buffers qqqqqqqqqqqu xR x tq> NUMBER OF USERS IS qqqq> number-users qqqqqqqqqqqqqu xR x tq> BUFFER SIZE IS qq> buffer-blocks qqq> BLOCKS qqqqqqu xK x tq> EXTENT IS qqqqqqqqqqwq> ext-pages qqq> PAGES qqqwqqu xD x x mq> (multi-vol-ext-clause) qj x xW x tq> SNAPSHOT IS qqqqwq> ENABLED qwq> IMMEDI ATE qqwqwqqqu xI x x x mq> DEFERRED qqj x x xI x x mq> DISABLED qqqqqq>qqqqqqqqqqqj x xR x tq> SNAPSHOT ALLOCATION IS q> snp-pages q> PAGES qqqqqqu xR x mq> SNAPSHOT EXTENT IS qw> ext-pages qqqq> PAGES qqqqwqj xD x m> (multi-vol-ext-clause) qqqj xB mqqqqqqqqqqqqqqqqqq Specifies that READ_WRITE transactions not write previouslyD updated copies of records they modify to the snapshot file unlessD a READ_ONLY transaction is already active. READ_ONLY transactions? that attempt to start after an active READ_WRITE transaction> must wait for all active READ_WRITE users to complete theirB transactions. With snapshots enabled, users o r applications canB read from either the snapshot file or the database file itself. 5 DISABLED@ Specifies that snapshot writing be disabled. There is usuallyB some performance gain when snapshot writing is disabled becauseG Oracle Rdb does not need to perform write operations to the snapshot' file during updates to the database.> You should not disable snapshots for replication databases.= Although users are expected only to retrieve data from the@ replication database, retrieval can occur in either READ_ONLY or READ_WRITE transactions. 5 snp-pagesC The number of pages allocated for the snapshot file. The defaultD is 100 pages. After the target database has been created, you canA use the RDO CHANGE DATABASE statement to truncate the snapshotA file. To truncate the file, specify an allocation size smaller' than the current snapshot file size. 5 multi-vol-ext-clause (B)0multi-vol-ext-clause = < qqqqq> MINIMUM OF qq> min-pages qqq> PAGES, qk3 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj< mqq> MAXIMUM OF qq> max-pages qqq> PAGES, qk3 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj? mqq> PERCENT GROWTH IS qqq> growth qqqq> 6 min-pagesB The minimum number of pages of each target database extent. The default is 100 pages. 6 max-pagesB The maximum number of pages of each target database extent. The default is 10,000 pages. 6 growth= The percent of growth for each target database extent. The default is 20 percent growth. 4 move_relations_clause! (B)0move-relations-clause = Z qwqq> MOVE RELATIONS ALL qqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqwqqqq>@ x xP mqwqq> MOVE RELATION qqwqqqqqqqqqqqqqqqwqq> rse qqqqqqk xB x mq> /* text */ qj x x @ x lqqqqqqqqqqqqqqqqqqqqqqqq SELECT FIELDS qwqq> ALL qqqqqqqq>qqqqqqqwqqwqqj? x mwq> select-field-name qwj x= x mqqqqqqqq , database. You can also transfer views using the move-views- clause.B You must have READ privilege for the relations of an Oracle Rdb@ source database that you specify in a MOVE RELATION clause orB a MOVE RELATIONS ALL clause. For databases accessed through theC Rdb Transparent Gateways, Replication Option does not check for  READ privilege for views. 5 MOVE_RELATIONS_ALL? Allows you to have Replication Option select all records and? fields from all user relations, excluding views, that are in> the source databa se at the time the transfer is defined. If@ you wish to move views, you must use the move-views-clause or> the MOVE RELATION clause. Fields defined with a COMPUTED_BY@ clause are restricted to those that use the value expressions? shown in the value-expr syntax diagram in this section. If aA field is not defined by a supported value expression, you willD receive a warning message, and the COMPUTED_BY fields will not be transferred.A If you define a transfer on a source da tabase that is itself a@ target extraction database, do not use the MOVE RELATIONS ALLA clause. An error will result during transfer execution because= Replication Option will attempt to define the DDAL$VINTAGEA relation in the new target database twice. The second transfer? would create a DDAL$VINTAGE relation in the target database.A Then, using the MOVE RELATIONS ALL clause, it would attempt toC copy the DDAL$VINTAGE relation that already exists in the sourceB databas e. To avoid this error, specify explicitly each relation3 to be moved instead of using MOVE RELATIONS ALL.@ Do not use the MOVE RELATIONS ALL statement for an extractionB rollup transfer. If you use the MOVE RELATIONS ALL statement toB define an extraction rollup transfer, the transfer will fail onA execution. Instead, you must name the individual relations you4 want to transfer to the extraction rollup target. 5 text@ A text string that allows you to associate a comm ent with theB transfer definition. The text string, together with other parts= of the transfer definition, appears in the SHOW DEFINITION2 display. The DESCRIPTION IS clause is optional. 5 rseA The record selection expression (RSE) used to identify records? from the source database that Replication Option includes in@ a record stream and transfers to the target database. The RSE? specifies conditions that individual records must satisfy in? order to be included in t he transfer to the target database.A Replication Option supports COMPUTED_BY fields named in an RSEA if the fields are defined using the value expressions shown inC the value-expr syntax diagram in this section. If the fields areB not defined by a supported value expression, you will receive a fatal error message.? In extraction, extraction rollup, and replication transfers,C you can use a relation-clause and with-clause. In extraction and@ extraction rollup transfe rs, you can also use a first-clause," reduce-clause, and sort-clause. 5 SELECT_FIELDS_ALLD Enables you to include every field in a specific relation. FieldsA defined with a COMPUTED_BY clause are restricted to those thatC use the value expressions shown in the value-expr syntax diagramB in this section. If a field is not defined by a supported valueD expression, you will receive a warning message, and the COMPUTED_? BY fields will not be transferred. You cannot use the SELECT: FIELDS ALL statement for an extraction rollup transfer. 5 select-field-name (B)0select-field-name = A qqqqqqqq> context-variable qq> . qqq> field-name qqqqq>B Allows you to name a specific field or group of fields you want@ moved to the target database. You can specify only one SELECTA clause for each MOVE clause. Replication Option moves only theD named fields to the target database. If you do not specify SELECT8 FIELDS ALL, the select-field-name clause is required.> Replication Option supports COMPUTED_BY fields named in the? select-field-name clause if the fields are defined using the> value expressions shown in the value-expr syntax diagram inC this section. If the fields are not defined by a supported value6 expression, you will receive a fatal error message. 4 move-views-clause (B)0move-views-clause = H qqqq> MOVE VIEWS qqwqq> ALL qqqqqqqqqqqwqqq>1  mwq> view-name qqwqqj, mqqqqqq , cannot be transferred. If views that contain unsupported? COMPUTED_BY fields are specified in the move-views-clauseD of a DEFINE TRANSFER statement, the transfer definition fails.A You need to redefine the transfer, excluding the views that2 re fer to the unsupported COMPUTED_BY fields.! o READ privilege for the viewI For a view in an Oracle Rdb database to be transferred, ReplicationA Option requires that you have Oracle Rdb READ privilege forC the view and for the underlying relations. If you do not haveC READ privilege for views you specify in the move-views-clauseA of a DEFINE TRANSFER statement, the transfer will fail. YouD need to obtain READ privilege for these views before including*  them in a DEFINE TRANSFER statement.C For databases accessed through the Rdb Transparent Gateways, E Replication Option does not check for READ privilege for views.C You can also move views with the move-relations-clause. However,B when you use the move-relations-clause to move a view, the view- becomes a relation in the target database. 5 view-nameB The name of the view Replication Option transfers to the targetD during a transfer. If you do not specif y a view name, Replication. Option assumes the default, MOVE VIEWS ALL. 4 move-relations-rollup-clause( (B)0move-relations-rollup-clause = P qwq> MOVE RELATION qqqqwqqqqqqqq>qqqqqqqqwq> rse qqqqwqqqqwq>@ x mq> / *text*/qqqqqj x x> x lqqqqqqqqqqqqqqqqqqqqqqqqq x mqqwqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqwqk xN x mq> INTO RELATION qqqq> relation-name q qqqqj x x> x lqqqqqqqqqqqqqqqqqqqqqqqqq SELECT FIELDS qqwqq> select-field-name qqqqqwqwqj< x mqqqqqqqqqq , target database from a number of source databases during an? extraction rollup transfer. The move-relations-rollup-clause" has the following restrictions:; o Replication Option requires you to invoke each sourceB database with a different database handle. You must then useC these handles in the move-relations-rollup-clause to identify% tables of each source database.< o The move-relations-rollup-clause must be used with the" EXTRACTION ROLLUP parameter.A Rollup transfers must be extractions. If you attempt to useC the move-relations-rollup-clause with a replication transfer,( the transfer definition will fail.B o The MOVE RELATIONS ALL and SELECT FIELDS ALL clauses are not" allowed in rollup transfers. 5 rseB For more information on record selection expression, select the: subtopic RSE under the DEFINE_TRANSFER Format subtopic. 5 select-field-name (B)0select-field-name = A qqqqqqqq> context-variable qq> . qqq> field-name qqqqq>B Allows you to name a specific field or group of fields you want@ moved to the target dat abase. You can specify only one SELECTA clause for each MOVE clause. Replication Option moves only theD named fields to the target database. If you do not specify SELECTC FIELDS ALL, the select-field-name clause is required. All fieldsC that you name in the record selection expression (RSE) must also( be named in the SELECT FIELDS clause.> Replication Option supports COMPUTED_BY fields named in the? select-field-name clause if the fields are defined using the> value expre ssions shown in the value-expr syntax diagram inC this section. If the fields are not defined by a supported value6 expression, you will receive a fatal error message. 4 transfer-file-options-clause& (B)0transfer-file-options-clause G qwqwqqqqqqqqqqqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqq>H x tqq> PROLOGUE FILE IS qqqq> prologue-file-spec qqqqqqquF x tqq> NOPROLOGUE qqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqquH x tqq> EPILOGUE  FILE IS qqqq> epilogue-file-spec qqqqqqquF x tqq> NOEPILOGUE qqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqquO x tqq> LOG FILE IS qqqqqqqqq> log-file-spec qqqqqqqqqqqquF x mqq> NOLOG qqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqqqqqqqqqqqqqu? mqqqqqqqqqqqqqqqqqqqqqqqqqqq The prologue-file-spec parameter is optional. If you do not:  include this parameter, Replication Option assumes that> NOPROLOGUE is in effect. The default file type is .COM. The8 default directory for the prologue file is SYS$LOGIN.D If your file specification includes a node name and you are using> DECnet/OSI, note that Replication Option expects node names@ in file specifications to be from one to six characters long.@ DECnet/OSI permits node names to be much longer than this. In? order to use Replication Option in a DECnet/OSI environ ment,B you must define and use short synonyms for the long node names.< Node name synonyms can be registered either in a local orA distributed name service database. For details on establishingA node name synonyms, refer to the documentation for DECnet/OSI. 5 epilogue-file-specB The name of the epilogue command procedure file to be run afterB the transfer executes. This file runs after the first executionC of the transfer and after all subsequent transfers. The epilogu eD file is a DCL command file. You can include a version number or aC remote node name in the file specification. The name is resolved when the transfer is defined.> The epilogue-file-spec parameter is optional. If you do not: include this parameter, Replication Option assumes that> NOEPILOGUE is in effect. The default file type is .COM. The8 default directory for the epilogue file is SYS$LOGIN.D If your file specification includes a node name and you are using> DECnet/OSI, note that Replication Option expects node names@ in file specifications to be from one to six characters long.@ DECnet/OSI permits node names to be much longer than this. In? order to use Replication Option in a DECnet/OSI environment,B you must define and use short synonyms for the long node names.< Node name synonyms can be registered either in a local orA distributed name service database. For details on establishingA node name synonyms, refer to the documentation for DECnet/OSI. 5 log-file-spec= The OpenVMS file where the Replication Option copy processA writes any logging information related to the execution of theB transfer. If you include a version number or a node name in the< file specification, Replication Option returns an error. B Replication Option creates a new log file every time a transfer? executes. The name is resolved when the transfer is defined.A The log-file-spec parameter is optional. If you do not include>  this parameter, Replication Option assumes that NOLOG is inC effect. The default file type is .LOG. The default directory for the log file is SYS$LOGIN. 4 RSE (B)0rse = F qqwqqqqqqqq>qqqqqqqqwqq> relation-clause qq>qqqqqqqqqqqqqqqqqqqqkF mq> first-clause qj xD lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjE mwqqqqqqq>qqqqqqqqwqwqqqqqqqq>qqqqqqqqqqwqqwqqqqqqqq>qqqqqqqqwqqq>G mq> with-claus e qj mq> reduce-clause qqj mq> sort-clause qqjA The record selection expression (RSE) used to identify records? from the source database that Replication Option includes in@ a record stream and transfers to the target database. The RSE? specifies conditions that individual records must satisfy in? order to be included in the transfer to the target database.A Replication Option supports COMPUTED_BY fields named in an RSEA if the fields are defined using the value expressions shown inC the value-expr syntax diagram in this section. If the fields areB not defined by a supported value expression, you will receive a fatal error message.? In extraction, extraction rollup, and replication transfers,C you can use a relation-clause and with-clause. In extraction and@ extraction rollup transfers, you can also use a first-clause," reduce-clause, and sort-clause. 5 first-clause (B)0first-clause = 7 qqqq> FIRST qqqqqq> value-expr qqqqqqqqqqq> (B)0value-expr = / qqqqqqqwqqqq> database-field qqqqqqwqq>, tqqqq> quoted-string qqqqqqqu, tqqqq> numeric-literal qqqqqu, tqqqq> arithmetic-expr qqqqqu, tqqqq> missing-value qqqqqqqu, tqqqq> concat-expr qqqqqqqqqu, tqqqq> ( value-expr ) qqqqqqu, mqqqq> q qq> value-expr qqqjA Specifies how many records are selected from the record stream@ formed by the record selection expression (RSE). You can onlyA use the first-clause for an extraction or an extraction rollup< transfer. If you specify a first-clause for a replication8 transfer, Replication Option issues an error message. 5 relation-clause (B)0relation-clause = N q> context-variable q> IN wqqqqqqqq>qqqqqqqqwq> relation-name q>2 m> db-handle q> . jC The context variables and relations to be included in the record stream or loop.D If you specify a view name in the relation-clause, the moved view- becomes a relation in the target database.A The context-variable supplies a temporary name to identify theB record stream. Once you have associated a context-variable withC a relation, you use the context-variable to refer to fields from that relation.> The db-handle is a host variable or name used to refer to a& specific database you have invoked.= In extrac tion or replication transfers, you should not useE database handles in the RSE of a MOVE RELATION clause. Replication< Option returns an error message if you include a databaseD handle in the RSE. However, in an extraction rollup transfer, youB must use database handles in the RSE to specify the relation or3 Replication Option will return an error message. 5 with-clause (B)0with-clause = I qqqqqqqqqqqqq> WITH qqqqqqqqqq> conditional-expr qqqqqqqqqqq>  (B)0conditional-expr = L qwqqq> conditional-expr qq> AND qq> conditional-expr qqqwqqq>H tqqq> conditional-expr qq> OR qqq> conditional-expr qqquF tqqqqqqqqqqqqqqqqqqqqqqqq> NOT qq> conditional-expr qqquC tqqq> value-expr1 qq> rel-oper qq> value-expr2 qqqqqqqqu? tqqq> between-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu? tqqq> containing-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu? tqqq> matching-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu? tqqq> starting-with-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqu? mqqq> missing-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj@ The with-clause contains a conditional expression that allowsA you to specify conditions that must be true for a record to be included in a record stream. 5 reduce-clause (B)0reduce-clause = N qqqqqqqqqqqqqq> REDUCED TO qqqwqqqqq> value-expr qqqwqqqqq>8 mqqqqqqqq , database-field qqqqqqwqq>, tqqqq> quoted-string qqqqqqqu, tqqqq> numeric-literal qqqqqu, tqqqq> arithmetic-expr qqqqqu, tqqqq> missing-value qqqqqqqu, tqqqq> concat-expr qqqqqqqqqu, tqqqq> ( value-expr ) qqqqqqu, mqqqq> q qq> value-expr qqqjB Allows you to eliminate duplicate values for fields in a record@ stream. You can use the reduce-clause for an extraction or anA extraction rollup transfer. If you specify a reduce-clause for= a replication transfer, Replication Option issues an error message. 5 sort-clause (B)0sort-clause = S qqq> SORTED BY qqwqwqqqqqqqqqqqqqqqqqqwqqqqq> value-expr qqwqqq>F x tqq> ASCENDING qqqqu xF x mqq> DESCENDING qqqj x? mqqqqqqqqqqqqqqqqqqqqqq , database-field qqqqqqwqq>, tqqqq> quoted-string qqqqqqqu, tqqqq> numeric-literal qqqqqu, tqqqq> arithmetic-expr qqqqqu, tqqqq> missing-value qqqqqqqu, tqqqq> concat-expr qqqqqqqqqu, tqqqq> ( value-expr ) qqqqqqu, mqqqq> q qq> value-expr qqqjD Allows you to sort the records in the record stre am by the values> of specific fields. You can sort the records according to aB value expression called a sort key. The sort key determines theC order of the records in the record stream. You can use the sort-@ clause for an extraction or an extraction rollup transfer. IfD you specify a sort-clause for a replication transfer, Replication" Option issues an error message.> Specifying ASCENDING (the default) causes the records to beE sorted in ascending order. Specifying DESCENDING causes Oracle Rdb+ to sort the records in descending order.? The value expression specifies the sort value. This value is called the sort key. 3 MoreC After you issue the DEFINE TRANSFER statement, the transfer does8 not execute until one of the following events occurs:= - The time specified in the corresponding DEFINE SCHEDULE statement arrives. - You issue a START TRANSFER NOW statement> You cannot alter a transfer using RDO. You must eit her drop? the transfer and re-create it, or use the SQL ALTER TRANSFER statement.@ You must have READ privilege for the relations and views of aC Oracle Rdb source database that you specify in a DEFINE TRANSFERB statement. Replication Option returns an error message when youA specify relations and views in a DEFINE TRANSFER statement forD which you do not have READ privilege. Replication Option does notD check for READ privilege for relations and views when you specify<  a database accessed through the Rdb Transparent Gateways.@ You must execute the DEFINE TRANSFER statement outside of the= scope of a transaction. If you issue this statement when aB transaction is outstanding, Replication Option returns an error message.< You can refer to relations, fields, and views in a DEFINE? TRANSFER statement either implicitly or explicitly. When you? include either the MOVE RELATIONS ALL, SELECT FIELDS ALL, orB MOVE VIEWS ALL clause, you refe r to relations, fields, or views> implicitly. Replication Option uses the current definitionsA of the relations, fields, and views in the source database and@ stores those names explicitly in the transfer definition. YouD refer to relations, fields, and views explicitly when you include> the MOVE RELATION, SELECT FIELDS, or MOVE VIEWS clauses and2 supply specific relation, field, or view names.D All fields that you name in the record selection expression (RSE)@ of the DEFINE  TRANSFER statement must also be included in theA SELECT FIELDS clause. If you do not name the fields explicitlyA in the SELECT FIELDS select-field-name statement or implicitly> in the select-field-name clause, Replication Option returnsC an error message when the transfer executes, indicating that the/ field name is not found in the symbol table.= Replication Option transfers those COMPUTED_BY fields that@ depend only on the values of a relation in which the field is> d efined. You cannot transfer views that contain unsupportedB COMPUTED_BY fields. If views that contain unsupported COMPUTED_? BY fields are specified in the move-views-clause of a DEFINEA TRANSFER statement, the transfer definition fails. You need to? redefine the transfer, excluding the views that refer to the" unsupported COMPUTED_BY fields.? Replication Option allows you to transfer views in two ways:! o Using the move-views-clause= Replication Option transfers  the definition of the viewB when you specify MOVE VIEWS view-name or MOVE VIEWS ALL. YouD must also explicitly or implicitly name in the DEFINE TRANSFER@ statement all the relations, views, or fields on which theD transferred view definitions are based. The transfer will failB if any underlying relations, views, or fields are not named.% o Using the move-relations-clause@ Replication Option transfers a view by creating a relation? in the target data base containing the view's records whenB you use the MOVE RELATION clause. This method improves query> performance in the target database. For example, you canA achieve the effect of a CROSS clause by transferring a view$ that is a CROSS in the source.D You specify the relations you wish to move in the move-relations-> clause and the views in the move-views-clause of the DEFINE> TRANSFER statement. When you are doing an extraction rollup> transfer, you specify t he relations you wish to move in theA move-relations-rollup-clause of the DEFINE TRANSFER statement.C The same clause can occur in a DEFINE TRANSFER statement no moreD than once. You cannot specify the same relation or view more thanD once in the move clauses. If a relation name or view name appears> in more than one move clause, Replication Option returns an error.A Individual move-relations clauses are separated by semicolons,C as indicated in the syntax diagrams. Yo u can implement the move- relations-clause in two ways: o Specify MOVE RELATIONS ALL; o Specify a series of relations separated by semicolonsB The move-relations-clause has the following characteristics and limitations:A o All fields in each move-relations-clause must reside in the same relation.D o You cannot name the same relation in more than one MOVE clause& of a single transfer definition.5 The move-relations-rollup-clause has the follow ing# characteristics and limitations:D o All fields in each move-relations-rollup-clause must reside in the same relation.D o You cannot name the same relation in more than one MOVE clause& of a single transfer definition.B o For each relation of a move-relations-rollup-clause that youB enter, you can supply a target relation specification in theA form of an INTO RELATION clause. You can create one or manyC relations in the target database from se veral source database@ relations by renaming the target relations in the transfer definition.C o You cannot specify MOVE RELATIONS ALL or SELECT FIELDS ALL inD a move-relations-rollup-clause. When you specify these clausesA in the DEFINE TRANSFER statement, the transfer will fail at the time of definition.@ The format of record selection expressions (RSE) that you canA include in a transfer definition for extraction and extractionD rollup transfer s is more limited than the RSE allowed by RDO. YouB cannot include the following expressions and clauses in the RSE7 of the MOVE clause of the DEFINE TRANSFER statement: o CROSS clause o ANY operator o UNIQUE operator o Host variable o Statistical expressions o FIRST FROM expression o Database key values" o Segmented string expressions@ You can specify FIRST clauses, REDUCED clauses, and SORTED BY> clauses in the RSE of both ex traction and extraction rollup@ transfers. You can achieve the effect of a CROSS clause in an@ extraction or an extraction rollup transfer by transferring aB relation, that is itself a view, defined in the source database' as a cross of two or more relations.@ The next example shows an extraction transfer definition thatB specifies the FIRST, REDUCED, and SORTED BY clauses in the RSE.A The transfer also achieves the capability of a CROSS clause byB moving a view, CURRENT_SA LARY. In the source database, CURRENT_? SALARY is a cross of the EMPLOYEES, SALARY_HISTORY, and JOB_ HISTORY relations.* RDO> INVOKE DATABASE FILENAME PERSONNEL1 RDO> DEFINE TRANSFER SALARY_HISTORY EXTRACTION0 cont> TO NEWNODE::NEWDISK:[NEWDIR]EMP_SALARY1 cont> MOVE RELATION FIRST 1000 E IN EMPLOYEES# cont> REDUCED TO E.LAST_NAME, cont> SORTED BY ASCENDING E.LAST_NAME cont> SELECT FIELDS ALL;> cont> MOVE RELATION C IN CURRENT_SALARY SELECT FIELDS  ALL3 cont> LOG IS FIRSTDISK:[FIRSTDIR]EMP_SALARY.LOG cont> END.B Because you cannot use certain expressions to identify required> records, the resulting groups of records transferred to theC extraction database might be larger than the number of extracted; records users will actually use. However, local users on> the target node can then include precise RSEs accessing the extraction database.< The format of an RSE that you can include in the transfer@ definition for replication transfers is more limited than the@ RSE allowed by RDO. You cannot include the following forms of> expressions or clauses in the RSE of the MOVE clause of the DEFINE TRANSFER statement: o FIRST clause o CROSS clause o REDUCED clause o SORTED BY clause o ANY operator o UNIQUE operator o Host variable o Statistical expressions o FIRST FROM expression o Database key values! o Segmented string e xpressionB Because you cannot use certain expressions to identify required> records, the resulting groups of records transferred to theB replication database might be larger than the number of recordsC users will actually use. However, local users on the target nodeC can then include precise record selection expressions when using* RDO to access the replication database.@ If a transfer fails during execution, the transfer will begin@ again at the next scheduled retry tim e if the failure results from a nonfatal error.= This next transfer will start from the beginning to ensure@ consistency with any updates that might have been made to the source database.B Replication Option transfers only definitions for the database,A fields, and relations specified in the transfer definition. IfA the source database includes additional database entities suchB as indexes, constraints, or access control lists, these are not? transferred to the ta rget database. You must either directlyD access the individual target database and explicitly define theseB entities or run command procedures to define the entities after the transfer executes.B When relations specified in the transfer definition are createdB in the target database, they are given the access control listsE (ACLs) that have the Oracle Rdb default values. You can change the9 ACLs in the target database after it has been created.A Replication Option does  not support SQL ANSI-style privileges.; Target databases that Replication Option creates use theE default Oracle Rdb ACL-style privileges. SQL ANSI-style privilegesB assigned to a source database are not copied to or preserved on% target databases during transfers.@ In a transfer definition, you can use logical symbol names to? name the source database file, the target database file, theC copy process log file, and the prologue and the epilogue commandA procedure files . However, Replication Option treats these file names differently:( o Source database file logical namesA If the source file name is a logical symbol that translates@ to a standard OpenVMS file name specification, Replication7 Option performs the logical name translation. The> SHOW TRANSFER DEFINITION statement shows the source file> name in its translated form. The logical symbol can alsoD translate into strings that, in turn, contain logical symbol s.? As long as the resulting string looks like a OpenVMS fileD specification and the logical symbol is not a concealed device0 name, the translation process is repeated.G If the logical symbol translates into an Rdb Transparent Gateway D access string (for example, /TYPE=VIDA/FILE=ACCESS_FILE/...), > Replication Option does no further translations. Even if> the VIDA name string contains logical symbol references,; these references are not translated into OpenVMS file@ specifications. You can use a logical name in place of the= string to identify an Rdb Transparent Gateway database.' o Target database file logical name> If the target database name is a logical name, it is not? translated by Replication Option when it is stored in the transfer definition.( o Copy process log file logical name@ Replication Option translates the log file logical name inC the same way as source file logical names, with the following exceptions:A o The log file specification is translated in RDO when the/ DEFINE TRANSFER statement is executed.; o These log file names must be standard OpenVMS file> specifications. Node names or version numbers are not allowed.@ o Prologue and epilogue command procedure file logical namesB Replication Option translates the prologue and epilogue fileD logical names in the same way as the source file logical name,$ with the following exceptions:: o The prologue and epilogue file specifications are@ translated in RDO when the DEFINE TRANSFER statement is executed.9 o The log file names must be standard OpenVMS file; specifications. Node names and version numbers are? allowed. Replication Option expects node names in file> specifications to be from one to six characters long.= DECnet/OSI permits node names to be m uch longer thanA this. In order to use Replication Option in a DECnet/OSI@ environment, you must define and use short synonyms forB the long node names. Node name synonyms can be registeredD either in a local or distributed name service database. ForA details on establishing node name synonyms, refer to the& documentation for DECnet/OSI.A Prior to Rdb/VMS Version 3.1, data values for text fields were= sorted in ascending or descending o rder based on the ASCIIE character set. With Rdb/VMS Version 3.1 and higher (and Oracle RdbA Version 5.0 and higher), you can create databases that specify> different sort sequences on a field-by-field basis. You canF specify the default for the database as a whole. Replication Option< has not enhanced transfer definitions to handle collationA sequences in any way. In addition, target databases created byC Replication Option do not have the collation sequence attributes= d efined. Sorting in a target database remains ASCII-based.= Currently, there is no way that users can transfer default/ collation sequences for fields or databases.> In an extraction transfer, you can change table definitions@ in the source database or definitions of columns on which the? transferred tables are based. However, those changes are not( reflected in the transfer definition.@ In replication transfers, you can make such changes until the> initial transfer begins. Thereafter, any attempts to changeA or delete definitions for tables or columns in the replication@ transfer are not allowed, with the exception of the following@ four column attributes; these attributes can be modified even% after the initial transfer begins: o Edit string" o Default value for DATATRIEVE o Query name for DATATRIEVE o Query headerA However, note that if you do change the attributes listed in aB source column, a comparable chang e is not made automatically toC the target database column. If you want that to happen, you must? make the change in both the source and the target databases.D In both extraction and replication transfers, if you make changes= that cause the source tables or columns to be incompatibleB with the transfer definitions, Replication Option detects these> differences at the time of transfer execution. The transferD fails, the transfer status reflects the failure, and the transfer  is suspended.> However, with extractions or initial replications, the copy? process does not detect changes to the data type of a field.A For example, you can change a field from the data type CHAR to3 the data type INTEGER without causing a failure. 3 Examples Example 1? The following example defines a transfer, NH_EMPLOYEES, thatB creates an extraction database. The transfer definition selects? New Hampshire employees' address records for transfer to the! remote node.* RDO> INVOKE DATABASE FILENAME PERSONNEL/ RDO> DEFINE TRANSFER NH_EMPLOYEES EXTRACTIONB cont> DESCRIPTION IS /* Employees who live in New Hampshire */' cont> TO NODE1::DISK1:[ADAMS]NH_EMP: cont> MOVE RELATION E IN EMPLOYEES WITH E.STATE = "NH"& cont> SELECT FIELDS E.EMPLOYEE_ID, cont> E.LAST_NAME, cont> E.FIRST_NAME, cont> E.MIDDLE_INITIAL, cont> E.ADDRESS_DATA_1, cont> E.ADDRESS_DATA_2, cont> E.CITY, con"t> E.STATE, cont> E.POSTAL_CODE! cont> LOG IS NH_EMPLOYEES.LOG cont> END. Example 2D This example shows an extraction from a remote source database toC a local target database. The DEFINE TRANSFER statement specifies< the transfer of all personnel records to the target node.= RDO> INVOKE DATABASE FILENAME NODE1::DISK1:[DIR1]PERSONNEL- RDO> DEFINE TRANSFER PERS_EXAMP EXTRACTION= cont> DESCRIPTION IS /* Extraction of personnel records*/$ cont> #TO [LEARNER.PERS]PERS_COPY cont> MOVE RELATIONS ALL- cont> LOG IS [LEARNER.PERS]PERS_EXAMP.LOG cont> END. Example 3A This example shows an extraction transfer from a remote source@ to a remote target database. The log file, PERS_EXAMP.LOG, is located on the source node.= RDO> INVOKE DATABASE FILENAME NODE1::DISK1:[DIR1]PERSONNEL- RDO> DEFINE TRANSFER PERS_EXAMP EXTRACTION= cont> DESCRIPTION IS /* Extraction of personnel records*/, cont> TO NODE2::DI$SK2:[PROTO]PERS_TARGET cont> MOVE RELATIONS ALL cont> LOG IS PERS_EXAMP.LOG cont> END. Example 4> This example of a replication transfer definition sends theB entire colleges relation and the entire degrees relation to the@ target database. The replication database can be accessed forA information about employees' college and degree histories. The@ transfer definition includes some database parameters for the target database.* RDO> INVOKE DATABASE FILE%NAME PERSONNEL0 RDO> DEFINE TRANSFER COLLEGE_INFO REPLICATIONB cont> DESCRIPTION IS /* Info about employees' colleges only */- cont> TO NODE1::DISK1:[BURTON]EMP_COLLEGE cont> NUMBER OF USERS IS 25* cont> SNAPSHOT ALLOCATION IS 150 PAGES% cont> MOVE RELATION C IN COLLEGES cont> SELECT FIELDS ALL;$ cont> MOVE RELATION D IN DEGREES cont> SELECT FIELDS ALL! cont> LOG IS COLLEGE_INFO.LOG cont> END. Example 5D This replication transfer specifies & three fields from the CREDIT_A CARDS source database for transfer to the target database. The@ fields are CARD_NUM, EXPIRATION_DATE, and VALID. Only invalid5 credit card records are selected for the transfer.- RDO> DEFINE TRANSFER BAD_CARDS REPLICATION3 cont> DESCRIPTION IS /* Invalid credit cards */+ cont> TO NODE1::DISK1:[CREDIT]BAD_CARDS5 cont> MOVE RELATION C IN CARDS WITH C.VALID = "N"# cont> SELECT FIELDS C.CARD_NUM, cont> C.EXPIRATION_DATE, con't> C.VALID cont> LOG IS BAD_CARDS.LOG cont> END. Example 6B The following example defines a replication transfer that sendsB the entire EMPLOYEES, JOB_HISTORY, SALARY_HISTORY, DEPARTMENTS,B and JOBS relations. The definition also selects three views for; transfer: CURRENT_INFO, CURRENT_JOB, and CURRENT_SALARY.* RDO> INVOKE DATABASE FILENAME PERSONNEL0 RDO> DEFINE TRANSFER NH_PERSONNEL REPLICATION) cont> TO NODE1::DISK1:[DBADMIN]NHP.RDBA cont> MOVE RE (LATION E IN EMPLOYEES SELECT FIELDS ALL;A cont> MOVE RELATION JH IN JOB_HISTORY SELECT FIELDS ALL;A cont> MOVE RELATION SH IN SALARY_HISTORY SELECT FIELDS ALL;A cont> MOVE RELATION D IN DEPARTMENTS SELECT FIELDS ALL;@ cont> MOVE RELATION J IN JOBS SELECT FIELDS ALL? cont> MOVE VIEWS CURRENT_INFO, CURRENT_JOB, CURRENT_SALARY+ cont> LOG FILE IS DISK1:[DBADMIN]NHP.LOG cont> END. Example 7B The following example moves the CURRE )NT_JOB view defined in theD source database as a CROSS of the EMPLOYEES relation and the JOB_A HISTORY relation. You can achieve the effect of a CROSS clauseD by transferring a view that is a CROSS in the source database. OnD the target database, the records selected by the view are created as a relation.* RDO> INVOKE DATABASE FILENAME PERSONNEL' RDO> DEFINE TRANSFER CJOB EXTRACTION( cont> TO NODE1::DISK1:[RAMESH]JOB_DBA cont> MOVE RELATION C IN CURRENT_JOB WITH C.JO *B_CODE = "SEII"? cont> SELECT FIELDS C.LAST_NAME, C.FIRST_NAME, C.ADDRESS cont> LOG FILE IS CJOB.LOG cont> END TRANSFER. Example 8A The following example shows an extraction rollup transfer thatC invokes several source databases: PERSONNEL, WORKERS, and STAFF.B The transfer selects fields in the EMPLOYEES relations from theC three databases identified by the database handles DB1, DB2, andD DB3 and located on three different nodes and in the JOBS relation@ + from DB1. Then the transfer moves these relations to a single target database, LOCAL_DB.C RDO> INVOKE DATABASE DB1=FILENAME "NODE1::DISK1:[DIR1]PERSONNEL"A RDO> INVOKE DATABASE DB2=FILENAME "NODE2::DISK2:[DIR2]WORKERS"? RDO> INVOKE DATABASE DB3=FILENAME "NODE3::DISK3:[DIR1]STAFF"/ RDO> DEFINE TRANSFER LABOR EXTRACTION ROLLUP( cont> TO NODE4::DISK4:[DIR4]LOCAL_DB@ cont> MOVE RELATION E IN DB1.EMPLOYEES WITH E.EMP_CODE= "A+"* cont> INTO RELATION EXEMPT_EMPLOYEES9 , cont> SELECT FIELDS E.EMP.ID,E.SALARY,E.JOB_CODE;@ cont> MOVE RELATION E IN DB2.EMPLOYEES WITH E.EMP_CODE= "A+"* cont> INTO RELATION EXEMPT_EMPLOYEES9 cont> SELECT FIELDS E.EMP_ID,E.SALARY,E.JOB_CODE;@ cont> MOVE RELATION E IN DB3.EMPLOYEES WITH E.EMP_CODE= "A+"* cont> INTO RELATION EXEMPT_EMPLOYEES9 cont> SELECT FIELDS E.EMP.ID,E.SALARY,E.JOB_CODE;< cont> MOVE RELATION J IN DB1.JOBS WITH J.JOB_CODE= "J17"$ cont> INTO RELATION ENTRY_JOBS1 con-t> SELECT FIELDS J.JOB_NAME,J.JOB_CODE+ cont> LOG FILE IS DISK4:[DIR4]LOCAL.LOG cont> END. Example 9C The following EMPLOYEES transfer creates an extraction database.B The transfer selects records using a first-clause, with-clause," reduce-clause, and sort-clause.* RDO> INVOKE DATABASE FILENAME PERSONNEL, RDO> DEFINE TRANSFER EMPLOYEES EXTRACTION1 cont> TO NODE1::DISK1:[NELSON]EMPLOYEES_INFO0 cont> MOVE RELATION FIRST 10 E IN EMPLOYEES# cont> . WITH E.CITY = "BOSTON"< cont> REDUCED TO E.LAST_NAME, E.FIRST_NAME, E.ADDRESS- cont> SORTED BY DESCENDING E.LAST_NAME= cont> SELECT FIELDS E.LAST_NAME, E.FIRST_NAME, E.ADDRESS0 cont> LOG FILE IS DISK1:[NELSON]EMPLOYEES.LOG cont> END TRANSFER. Example 10@ The following extraction transfer includes two command files.? The prologue command procedure establishes a connection to aA remote node, and the epilogue command procedure terminates theB connectio/n. This example shows how to specify the prologue file> and epilogue file; it does not show the command procedures.E RDO> INVOKE DATABASE FILENAME NODE1::DISK1:[DBADMIN.PERS]PERSONNEL. RDO> DEFINE TRANSFER PERS_SAMPLE EXTRACTION cont> TO PERS_COPY cont> MOVE RELATIONS ALL% cont> PROLOGUE FILE IS DIALUP.COM% cont> EPILOGUE FILE IS HANGUP.COM cont> LOG IS PERS_SAMPLE.LOG cont> END. 2 DEFINE_SCHEDULE> Creates a schedule definition and stores it in the 0transferA database. The schedule definition specifies when and how oftenC a transfer should execute. A transfer can have only one schedule? definition associated with it. Replication Option returns an@ error if you attempt to define a schedule for a transfer that already has one. 3 FormatJ (B)0DEFINE SCHEDULE qq> FOR qq> transfer-name qqqk1 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj, mqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqk5 mqq> 1 START qq> start-date-time qqqj x, lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj4 mqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqk= mqq> EVERY qqwq> every-delta-time qqqqqwqqj x6 mq> every-absolute-time qqj x4 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjF mqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqkV mq> RETRY q> count q> TIMES qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwj xV 2 mq> RETRY EVERY qq> delta-time qj xF lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj@ mqq> END qwqqqqqqqqqqqqqqqqqqqwqwqqqqqqqqqqqqqwqqq> .4 mqq> transfer-name qj mq> SCHEDULE qj 4 transfer-name= The transfer for which this schedule is being defined. TheD transfer must already exist when you create a schedule definition3 for it. The transfer-name parameter is required. 4 start-date-time? The time 3to execute the initial transfer. You can specify an> absolute or delta time. If you supply an absolute time, theB initial transfer will be executed at the time specified. If youA use a delta time, Replication Option uses the current time andB the delta-time value to calculate the actual transfer time. TheB START clause is optional. If you do not include a START clause,A the start time is set to the current time so that the transfer> will execute as soon as the transfer schedule4 definition is processed.@ The start-date-time parameter uses the following absolute andA delta-time formats. You can omit any of the trailing fields inA the date or time. You can omit any of the fields in the middleB of the format as long as you include the punctuation marks. ForB more information on date and time formats, see the entry on theC $BINTIM OpenVMS system service in the OpenVMS documentation set. Absolute-time dd-mmm-yyyy hh:mm:ss.cc Delta tim5e dddd:hh:mm:ss.ccA In the absolute and delta time designations, the abbreviations have the following meanings: dddd Number of days dd Day of the month mmm Month yyyy Year hh Hours mm Minutes ss Seconds cc Hundredths of a second 4 every-delta-time? Used to calculate the time to execute the next transfer. TheA EVERY clause is optional. If you specify the EVERY clause, youB must specify either every-d 6elta-time or every-absolute-time. If< you omit the EVERY clause, the transfer occurs only once.C The valid specification for every-delta-time is the delta formatA used by the $BINTIM OpenVMS system service. The delta time you? specify is the time from the completion of the last transfer@ sequence until the start of the next one. A transfer sequenceB is the set of transfers from the first attempt until one of the@ following conditions is met: the execution is successful, theC7 maximum number of retries specified in the RETRY clause has beenD reached, or a fatal error has occurred (one for which retries are not attempted). 4 every-absolute-time (B)0every-absolute-time = D qqqqqwqqqqqq> DAY qqqqqqwqqwqqqqqqqqqqq>qqqqqqqqqwqwqqq>I tqqqqqq> WEEK qqqqqu mqq> AT qq> at-time qqj x@ tqqqqqq> MONTH qqqqj x; mqqwqqq> weekday qqqwqqqqqqqqqq>qqqqqqqqwqqwqqj? 8 x mq> AT qq>at-time qqj x6 mqqqqqqqqqqqqqqqq , Note that if the initial transfer starts on the 31st of the= month and the transfer schedule specifies EVERY MONTH, the@ next execution of the transfer will be on the last day of theD following month, whether the last day is the 28th, 29th, 30th, or 31st. 5 weekday> The transfer executes on the weekdays that yo:u list. If youC list more than one weekday, separate the days with commas. Valid weekday specifications are: SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY 5 at-timeA Qualifies every-absolute-time by specifying the time of day at? which the transfer should occur. This parameter is optional.@ If you specify DAY, WEEK, or MONTH, but do not specify an at-? time, Replication Option uses the time of day of the init ;ial? transfer. In the case of a list of weekdays, the at-time forC each day can be specified. If the at-time for any weekday is notD specified, the default is the time used for the previous entry inD the list. For the first entry in the list, the time of day of the2 initial transfer is used, if none is specified. 4 count@ The maximum number of times to retry a transfer if a transferA execution fails. If you do not include a retry count or if theB count value is set <to zero, Replication Option does not attemptB to retry the transfer until the next scheduled transfer time as! indicated by the EVERY clause.? Replication Option does not retry a transfer if the transferD failed as a result of a fatal error. You can recover from a fatal% error only by manual intervention. 4 delta-timeB The length of time Replication Option waits between the time ofB the last failed attempt and the time of the next retry attempt.@ The RETRY EVERY d =elta-time clause is optional and can only be9 specified if the RETRY count TIMES clause is included.? If you specify RETRY count TIMES in the schedule definition,@ but do not specify RETRY EVERY delta-time, Replication OptionD attempts the retry immediately. See the description of the start-C date-time parameter earlier in this section for valid delta-time values. 3 More= To define a transfer schedule, you must have the same userB identification code (UIC) as th >e user who defined the transfer,= or have the ALTER transfer privilege or the OpenVMS BYPASS< privilege. If you try to define a transfer schedule for a> transfer defined by a user with a different UIC, and you doB not have the appropriate access right or privilege, Replication< Option returns an error message and prevents the schedule< from executing. If you have BYPASS privilege and define a? schedule for a transfer associated with a different UIC, the4 UIC associated with t ?he transfer does not change.? When you define a schedule for a transfer in the unscheduled@ state, that transfer is placed in the scheduled state. If theB transfer is in the suspended state, it remains in the suspendedA state. To place the suspended transfer in the scheduled state,A use the START TRANSFER statement. When the transfer executes, > Replication Option places the transfer in the active state.D You cannot modify a schedule definition using RDO. If you need toD @ change a parameter value in a schedule definition, you must firstC delete the schedule using the DELETE SCHEDULE statement and thenC define a new schedule, or, use the SQL ALTER SCHEDULE statement.@ When you define a one-time-only transfer schedule and specify; a transfer time that has already passed, issuing a START@ TRANSFER statement changes the transfer status from suspended? to scheduled. However, when you issue a SHOW TRANSFER STATUS> statement, the "next transfer to Abe executed" phrase is not< included. To avoid this problem and cause the transfer to1 execute, use the START TRANSFER NOW statement.@ You must execute the DEFINE SCHEDULE statement outside of the= scope of a transaction. If you issue this statement when aB transaction is outstanding, Replication Option returns an error message.C You can change the default date/time format that was establishedB before VMS Version 5.0 to a date/time format that complies withB the LIB B$ international date and time formatting routines of VMSD Version 5.0 and higher. For example, you might want to change theD input format from 1-APR-1989 to one that allows entry of dates inD the form April 1, 1989. You can change the output format as well.A To change the input date/time format, define the LIB$DT_INPUT_E FORMAT logical name as discussed in the OpenVMS RTL Library (LIB$)D documentation. To change the output date/time format, define the G logical name LIB$DT_FORCMAT. If you change the date/time format from F the one used prior to VMS Version 5.0, then you must place the date? and time in quotation marks. If you continue to use the dateC /time format in effect before VMS Version 5.0, you can enter the@ date and time with or without quotation marks as you wish. ,bC For further information about the date/time routines provided byA the OpenVMS Run-Time Library, refer to the OpenVMS RTL LibraryD (LIB$) documentation. Refer also to the Ora Dcle Rdb documentation C set for details specific to that product's use of international  date/time formats.; Replication Option does not guarantee the reexecution of; a transfer at the specified rate. If the copy process is? tied up for any reason and cannot finish its task before the? next transfer repetition cycle, the copy process ignores the? repetition. The cycle is reset to the next expected transfer time.D A replication transfer with a schedule that runs Eon an infrequent? basis can consume a considerable amount of disk space in the= source database. For example, if a replication transfer is> scheduled to occur once a month, any new or changed records? to be transferred are duplicated in the relation RDB$CHANGES? in the source database and are retained for the remainder ofB the month until the schedule starts the transfer. This space isB released only after the duplicate records have been transferred> and erased. Thus, for t Fhe entire month that the duplication? records are stored, they take up disk space. In general, youB should not choose an infrequent transfer cycle if the number of0 daily changes to the source database is high.A In addition, even if this monthly replication transfers only a? single record each month, another problem can arise if other? replication transfers use the same source database. AlthoughC those transfers might execute more frequently than once a month,@ their rec Gords are not necessarily erased from the RDB$CHANGESB relation right away. Replication Option erases the records only? if no records entered earlier are waiting to be transferred. 3 Examples Example 1> Executes the NH_EMPLOYEES transfer at 1:24 a.m. on June 24,> 1988. The transfer will then execute every day at 5:30 p.m.= If a nonfatal error occurs, the transfer execution will beD retried three times with 30 minutes between the end of the failed4 transfer executioHn and the start of the next one.( RDO> DEFINE SCHEDULE FOR NH_EMPLOYEESA cont> START 24-JUN-1988 01:24:00.00 <---- Absolute timeA cont> EVERY DAY AT 17:30 <---- Absolute time cont> RETRY 3 TIMES# cont> RETRY EVERY 0 00:30:00 cont> END SCHEDULE. Example 2@ This example uses a delta-time specification to have 36 hours? (1 day plus 12 hours) between the completion of one transfer@ execution and the beginning of the next. The ex Iample uses twoA delta times, EVERY 1 12:00 and RETRY EVERY 0 03:00:00. EVERY 1A 12:00 states that there will be 36 hours (1 day plus 12 hours)A between the completion of the first transfer and the beginningC of the next. If transfer execution does not succeed on the first? attempt, the transfer schedule permits Replication Option to@ make up to five additional attempts to complete the transfer.? RETRY EVERY 0 03:00:00 means Replication Option should retry> the transfer th Jree hours after a nonfatal failure until the? transfer completes successfully or until the maximum of five@ retries has been attempted. If the transfer does not complete? successfully after five retries, the next attempt will be 36' hours after the last failed attempt.( RDO> DEFINE SCHEDULE FOR NH_EMPLOYEES cont> START 15-MAY-1988C cont> EVERY 1 12:00 !<---- 1 day plus 12 hours cont> RETRY 5 TIMES7 cont> RETRY EVERY 0 03:00:00 !<---- 3 Khours cont> END. Example 3< The following transfer schedule causes Replication Option= to execute a transfer for the first time at 12 noon on the> 15th of October 1988. Subsequent transfers will occur every> day thereafter at 5:30 p.m. If an error occurs preventing a> successful transfer, Replication Option will retry every 30C minutes until the transfer is successful or the maximum of three retries has been reached.( RDO> DEFINE SCHEDULE FOR NH_EMPLOYEES" L cont> START 15-OCT-1988 12:00< cont> EVERY DAY AT 17:30 !<---- Every day cont> RETRY 3 TIMES# cont> RETRY EVERY 0 00:30:00 cont> END SCHEDULE. Example 4= The following schedule definition assumes that you want toC execute the transfer immediately after you complete the schedule= definition and, therefore, it contains no START clause. If@ the system time is 20-OCT-1988 16:00:00 when you complete theD DEFINE SCHEDULE statement, the neMxt execution of the NH_EMPLOYEES/ transfer will start on 20-NOV-1988 16:00:00.( RDO> DEFINE SCHEDULE FOR NH_EMPLOYEES cont> EVERY MONTH cont> RETRY 3 TIMES! cont> RETRY EVERY 0 00:30:00 cont> END. Example 5A This example calls for the NH_EMPLOYEES transfer to execute atA 3:00 p.m. every Wednesday. The schedule definition calls for aA maximum of three retries occurring at intervals of 30 minutes.( RDO> DEFINE SCHEDULE FOR NH_EMPLOYEES' cont> NSTART 12-NOV-1988 15:00:00.00H cont> EVERY WEDNESDAY AT 15:00:00 !<---- Wednesdays at 3 p.m. cont> RETRY 3 TIMES# cont> RETRY EVERY 0 00:30:00 cont> END. Example 6A The following example causes an initial transfer to execute on@ the 15th of July at 5 p.m., on every Monday after the 15th at@ 5 p.m., every Tuesday at 11 a.m., and every Friday at 11 a.m.> Because a RETRY clause is not specified, even if a nonfatal? failure occurs, the transfer willO not execute until the next regularly scheduled time.( RDO> DEFINE SCHEDULE FOR NH_EMPLOYEES" cont> START 15-JUL-1988 17:001 cont> EVERY MONDAY, TUESDAY AT 11:00, FRIDAY cont> END. Example 7C This example causes a transfer to start at midnight on July 15th6 and on the 15th of every month thereafter at 7 p.m.( RDO> DEFINE SCHEDULE FOR NH_EMPLOYEES cont> START 15-JUL-1988 cont> EVERY MONTH AT 19:00 cont> END. 2 REINITIALIZE_TRANSFERPD Reinitializes a replication transfer. You use this statement whenA the source database and the replication target database are no% longer consistent with each other. 3 FormatL (B)0REINITIALIZE TRANSFER qqqqqq> transfer-name qqq> 4 transfer-name> The replication transfer that you want to reinitialize. The' transfer-name parameter is required. 3 MoreB If you want to reinitialize a particular transfer, the transfer@ definitio Qn must be associated with your UIC, or you must have@ the DBCTRL or ALTER transfer privilege, or the OpenVMS BYPASS privilege.? You can reinitialize a transfer only when the transfer is inA the suspended state. To suspend a transfer, first issue a STOPA TRANSFER statement. You must execute the REINITIALIZE TRANSFERB statement outside the scope of a transaction. If you issue thisB statement when a transaction is outstanding, Replication Option returns an error message. RC After you enter the REINITIALIZE statement, the transfer remains? in the suspended state. You must then issue a START TRANSFER% statement to restart the transfer.< The REINITIALIZE TRANSFER statement has different effectsD depending on the type of replication transfer being reinitialized5 and whether the transfer is TO NEW or TO EXISTING:@ o For a standard replication transfer created with SQL to an> existing database, REINITIALIZE TRANSFER forces the nextD Sexecution of the transfer to drop all target tables and createB new target tables rather than update the tables with changed data.; o For a replication transfer created with the NO DELETE@ attribute using SQL, REINITIALIZE TRANSFER forces the next> execution of the transfer to drop all rows in the targetC tables except those whose dbkey has been set to zero. Any rowB whose dbkey has not been set to zero is copied to the target( database from the sour Tce database.; o For a replication transfer specifying TO NEW FILENAME@ target-file-spec created with SQL, or for any RDO transfer? definition, new versions of the target database files areA created and all tables specified in the transfer definitionA and their corresponding rows will be copied from the source& database to the target database. 3 ExampleA This example places the CARS_LAX transfer in a suspended stateB and then reinitializes it. The Uschedule and definition for thisC replication transfer remain in place. Once the transfer has been% reinitialized, you can restart it. RDO> STOP TRANSFER CARS_LAX& RDO> REINITIALIZE TRANSFER CARS_LAX RDO> START TRANSFER CARS_LAX 2 START_TRANSFERD Executes a transfer on demand, or changes the state of a transferD from the suspended state to the scheduled, unscheduled, or active state. 3 FormatC (B)0START TRANSFER qqqqq> transferV-name qqk* lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj, mqqqwqqqqqqqqqqqq>qqqqqqqqqqqqqqwqqqq>. mqqq> NOW qqwqqqqqqqqqqqqwqqj+ tq> WAIT qqqqu+ mq> NOWAIT qqj 4 transfer-name= The transfer to be started. The transfer-name parameter is required. 4 NOW= Changes the transfer state to active and begins execution.< If the transfer has a schedule defined for it, subsequentB transfers occur W as specified by that schedule. The NOW argument is optional. 4 WAIT_NOWAIT> Specifies whether Replication Option returns control to RDOD immediately after the transfer starts or waits until the transfer? completes. You must use the NOW argument if you specify WAIT? or NOWAIT. The default, NOWAIT, causes Replication Option to? return control immediately to the RDO command mode while the@ transfer executes. With NOWAIT in effect, you can enter otherB RDO statements Xwhile the copy process completes the transfer of+ database records to the target database.= The WAIT option ensures that the transfer completes before control is returned to RDO. 3 More@ If you want to start a transfer, the transfer definition mustC be associated with your UIC, or you must have the ALTER transfer. privilege, or the OpenVMS BYPASS privilege.B You can use the START TRANSFER statement without any qualifiersA to change the state of a suspended tran Ysfer. Issuing the START@ TRANSFER statement places the transfer in the scheduled stateC if a schedule definition exists for the transfer. Execution thenC occurs at the next scheduled time. If a schedule definition doesA not exist, the transfer is placed in the unscheduled state andD will execute only when you issue a START TRANSFER statement using? the NOW qualifier or you define a schedule for the transfer.C If you specify both the NOW and WAIT arguments and your transfer Z> has an epilogue procedure, Replication Option waits for the: epilogue procedure to finish before resuming execution.C You cannot enter the START TRANSFER statement when a transactionB is outstanding. You must terminate any outstanding transactions/ before issuing the START TRANSFER statement.B You can use the START TRANSFER statement to initiate a transferD on demand by including the NOW option. The NOW option immediatelyB places the transfer in the active state. This e [xecute-on-demand> feature is useful in batch processing environments when you@ want to initiate the transfer after another job has completed7 successfully, regardless of the transfer's schedule.@ When you define a one-time-only transfer schedule and specify; a transfer time that has already passed, issuing a START@ TRANSFER statement changes the transfer status from suspended? to scheduled. However, when you issue a SHOW TRANSFER STATUS> statement, the "next transfer to be \ executed" phrase is not< included. To avoid this problem and cause the transfer to1 execute, use the START TRANSFER NOW statement.? Do not issue a START TRANSFER NOW WAIT statement when RDO is= attached to a source database and the transfer is either a> replication transfer that has not finished or a replication@ initialization transfer. Instead, issue a FINISH statement toB detach from the database, and then enter the START TRANSFER NOWA WAIT statement. Otherwise, the co]py process waits indefinitely@ for you to release the source database. Because you specified> that you want to wait for the copy process to complete, the* transfer operation will never complete. 3 Examples Example 1A This example starts a transfer called ENROLL_SPANISH1. If this> transfer has a schedule defined for execution one hour from@ now but the transfer is suspended, issuing the START TRANSFER< statement only changes the transfer's state to scheduled.= E^xecution of the transfer will not occur for another hour.& RDO> START TRANSFER ENROLL_SPANISH1 Example 2A In this example, transfer ENROLL_SPANISH1 has been defined but? has no schedule. You issue this START TRANSFER NOW statement@ because you want to execute the transfer immediately. Control1 returns to RDO as soon as the transfer begins.* RDO> START TRANSFER ENROLL_SPANISH1 NOW 2 STOP_TRANSFER? Places a transfer in the suspended state. Replication Option_D does not attempt to execute the transfer until you remove it fromA the suspended state using the START TRANSFER statement. If theD transfer is in the active state, the STOP TRANSFER statement also8 stops the copy process associated with that transfer. 3 FormatG (B)0STOP TRANSFER qqqqqqq> transfer-name qqqqq> 4 transfer-name? The transfer to be suspended. The transfer-name parameter is required. 3 More: If you want to stop ` a particular transfer, the transfer; definition must be associated with your UIC, or you must? have ALTER or DROP transfer privilege, or the OpenVMS BYPASS privilege.C You must terminate any outstanding transactions before you issue a STOP TRANSFER statement.: If you want to stop a particular transfer, the transfer/ definition must be associated with your UIC.A A transfer cannot occur until you remove it from the suspendedB state using the START TRANSFER stat aement. If the transfer is inD the active state, the STOP TRANSFER statement also stops the copyD process associated with that transfer. After you stop a currentlyB executing extraction, extraction rollup, or initial replicationD transfer, you cannot access the partially created target database# unless you restart the transfer.A If a replication update transfer is executing and you stop theA transfer, users of the target database can continue their work? unaffected. Furtherbmore, stopping the transfer does not stop@ the capture of the changes in the source database (written toC RDB$CHANGES). The changes are transferred to the target databaseD when the transfer is restarted. No updates to the target database@ are missed as a result of stopping a replication transfer forA which the target relations have already been created. However,@ since stopping a transfer does not stop the capture of recordD changes, changes continue to be written to RDB$CHANGEcS regardless? of a transfer's state. Records are added to RDB$CHANGES evenB for transfers that are suspended for a long time. The number ofC records in RDB$CHANGES and the overall size of the database both continue to grow. 3 Example? The following example places the EUROPE_PERS transfer in the suspended state.! RDO> STOP TRANSFER EUROPE_PERS 2 RDO_ERRORS RDO$MSG 3 ABSACTIVE> AIJ backup active or backup operations suspended on this nodeA Expladnation: After-image journal backup operations have already been suspended from this node.A User Action: Examine the secondary message(s) or look in theA database monitor log file (SYS$SYSTEM:*MON.LOG) for more information.3 ABSNSUSPENDED1 AIJ backup operations not suspended on this nodeA Explanation: After-image journal backup operations have not been suspended from this node.A User Action: Examine the secondary message(s) or look in theA database emonitor log file (SYS$SYSTEM:*MON.LOG) for more information.3 ABSSUSPENDED5 AIJ backup operations already suspended on this nodeA Explanation: After-image journal backup operations have already been suspended from this node.A User Action: Examine the secondary message(s) or look in theA database monitor log file (SYS$SYSTEM:*MON.LOG) for more information.3 ACCVIO/ access violation on read/write of user addressA Explanation: A readable parameter is notf readable by the DBCS7 or a writeable parameter is not writeable by the DBCS.0 User Action: Pass good parameters to the DBCS. 3 ACENOTFND' no matching access control entry foundA Explanation: In a protection statement that refers to anA existing access control entry, there was no existing entry that matched the input.A User Action: Use SHOW PROTECTION to see what the ACL currently( looks like, and correct your statement. 3 ACLNOTIMP ACL not imported for gA Explanation: The ACL contained in the RBR file could not be7 imported to the named object (database/relation/field)A User Action: If you really want it, you must either obtain theA needed privileges (BYPASS) or import the database under theA account of the former owner (which may not be sufficientA anyway). If you do not care about the restoration ofA protections you can ignore the message or import the databaseA using the NOACL parameter whichh will cause all privileges and+ protections in the RBR file to be ignored. 3 ACTMISMATCH6 journal is for database activation