Introduction to Accounts
What is an Account?
An account is a main subdivision of a Reality database, defined by a Master Dictionary (MD) which is specific to the account. Each MD is a file defined by an item in the SYSTEM file known as the account definition. This has the name of the account as its item-id.
What are Accounts for?
Accounts are generally used to subdivide the database into areas used by particular applications, although files can be shared between accounts. In addition, standard accounts are provided for administration and operation of the system. These are SYSMAN and SYSPROG respectively. SYSMAN and SYSPROG are present on every database, and are created automatically.
What happens at Logon?
When you log on to a Reality database, you logon with a particular user-id and also to a particular account. The account you logon to is either the default for the user-id, or the account you select at the appropriate prompt.
User-ids, Locations and Accounts
Your user-id remains constant throughout the logon session (the period from
logging on to logging off the
The Account Master Dictionary and Command Definition Items
The Master Dictionary (MD) of the account largely defines what you can do in the account. It contains items which define the main commands that you can execute when logged-on to the account. An additional file containing executable commands can also be assigned to your user-id via SSM. Command items consist of TCL and English commands, cataloged DataBasic programs and Procs. New commands can be created by cataloging DataBasic programs or writing new Procs using an editor. Existing commands can be deleted (via the DELETE command or an editor) to prevent users logged-on to the account using them (unless included in the optional alternative command file).
POINTER-FILE
A global file called POINTER-FILE contains saved lists generated by English and cataloged DataBasic programs.
If you wish, you can create a local file called POINTER-FILE which will be used to store saved English lists. This has the following benefits:
- The lists will be automatically moved or deleted with the account.
- Because the items are local to the account, their names do not include the account name. This means that accounts can be renamed more easily.
- Local pointer files imported from accounts saved on other MultiValue systems can be used without modification.
Cataloged DataBasic programs are not stored in local pointer files; they normally continue to be stored in the global POINTER-FILE (but refer to the description of the BASIC command for alternatives).
Other Items in MD
The MD also contains file definition items, file and command synonym items, English-related definition items and default data definition items. Other items can also exist in the MD, but are not used by system software.
File Lock Codes
The files that you can access are effectively controlled by retrieval and update lock codes set on files. The 'keys' to these are either assigned by user-id, as discussed in Securing the Database Using SSM, or by the account (or account synonym) definition item via which logon was effected.
Access to Files
The files defined within the MD of the account logged-on to, can be directly accessed by name (provided appropriate keys are assigned to you). Those defined on other accounts can also be accessed as if they were defined on the local account, however, given appropriate keys, either via file synonym definition items (Q-Pointers) in the MD or by using the syntax /account/filespec instead of just filespec. Files on other Reality or RealityX databases, on your local system or on another system, can also be accessed via Q-pointers provided a suitable remote account definition item in SYSTEM is set up. Remote file access, as this is known, is controlled via the security system at various levels.
English Definition Items and Command Synonyms
Other items in the MD provide definitions for use by English (the data inquiry language provided by Reality) and command synonyms, which are items that provide alternative names for commands that exist in the MD. The items related to English are default data definition items and definitions of English operators, connectives and modifiers. These can be deleted or duplicated (with new item-ids) to restrict or extend standard English vocabulary.
Creating Accounts
Local Accounts
New accounts are created via the CREATE-ACCOUNT command, executed from either SYSMAN or SYSPROG. The MD contents of a new account are copied from a file called NEWAC (defined from SYSFILES, a 'pseudo' account) that contains a standard set of items. The command prompts for the information needed. Note that you must run CREATE-ACCOUNT from the SYSMAN account in order to give the account a password.
Remote Accounts (R-pointers)
The CREATE-ACCOUNT command is also used to create remote account definition items. A remote account definition item allows an account on a remote database to be accessed as if it were defined on the local database. The remote database can be a Reality system or a Reality database on this or another system.
Synonym Accounts (Q-pointers)
CREATE-ACCOUNT can also create synonym accounts. These are pointers to local account definition items, which give an alternative name for logon to that account and can also give different access keys/locks and privilege level.
Deleting Accounts
Accounts are deleted using the DELETE-ACCOUNT command. This can only be executed from SYSMAN account. SYSMAN and SYSPROG accounts cannot be deleted.
Renaming Accounts
You can rename an account using the MOVE-FILE command from the SYSPROG or SYSMAN account. The syntax is:
MOVE-FILE SYSTEM old-account-name TO:
SYSTEM new-account-name
Note, however, that this only renames the account - items elsewhere in the system that reference the account (such as saved lists and cataloged DataBasic programs stored in the global POINTER-FILE) will remain associated with the old account name.
More Information
For more details about Master Dictionary items see File and Item Structures. For more details about the SSM command and location-based and user-based security, see Securing the Database Using SSM.