 |
The goal of the Database Standards is to document new databases and applications in a consistent manner across
platforms. These methods and requirements should provide a template for better documentation and make it easier to
identify objects during daily maintenance and crisis events.
Below is the list of deliverables and standards for any new database development:
- The application and database documentation must be listed in the Global Index Notebook.
- There must be an Entity Relationship diagram drawn with the entity and unique identifiers listed.
- Each entity must have a definition written in paragraph form.
- Each table must have a definition that may be identical to the corresponding entity.
- Each column in a table must have a definition, a descriptor, a size, a domain, and a datatype.
- The column abbreviations used must be in the Data Management Abbreviation list.
- There must be a Physical Diagram of the database that includes table and column names.
- The data stored in a column must correspond to the column definition and domain.
- The database must be backed up each workday (Monday-Friday).
- All online updates to data in tables must be done via the use of stored procedures. (see Security Policy below)
- All customer and developer staff userids for ORACLE and IDMS databases on the OS/390 must be authenticated by RACF.
- All databases must have separate development, test, and production environments.
The paragraphs below give more detail about how we name entities, tables, and columns. There is additional information
on security and backup. If you need JCL for any of the utilities listed below check out the share libraries.
ORACLE - DB.ORCL.SHRLIB.CNTL
IDMS - DB.R120.SHRLIB.CNTL
Additional documentation about IDMS entities can be found in DB.R120.TEXT(NAMING). It includes naming standards
for segments, dbnames, dictionaries, and DMCLs.
13.1 Record and Table Names
Goal: To have record and table names that are consistent, clear, and descriptive of the data maintained in the record
or table. A record or table is a data representation of an entity with an existence in the real world. Buildings,
employees, stock items, etc. have an existence, and the university has a need to keep data about each occurrence of those entities. A record or table name should indicate what entity that record or table contains data about.
Process:
- 1.1. Name the table (the word table will be used to mean either record or table) to indicate the entity that is
represented by that table. A table containing data about a building should be called Building. A table containing
data about an employee should be called Employee. A table containing data about a stock item should be called
Stock-Item.
- Sometimes there is a need for more than one table to contain data about an entity. For example, we may
have a table containing data about an employee's personnel data, a table with payroll data, and a table with
historical data. The table name should be expanded. In the above example, we would have the table names:
Employee-Pers, Employee-Pay, and Employee-Hist.
- All table names will be singular. A table name for a table representing buildings will be Building. A table name
for a table representing employees will be Employee.
- Because a table may be used by more than one application, there will not be a reference to an application in a
table name. An FRS account table should always have the same name no matter what application needs to use the
data in that table.
- A column or element name may not be a table name. An element or column represents an attribute of an entity,
not the entity itself. Employee name is an attribute of employee. The Employee table would have a column called
Employee-Name, or properly abbreviated, EMP-NM.
- In a network IDMS database, the record name will have an IDMS internal record ID appended as a suffix to the
record type. The record name for university buildings will be Building-303. These suffix numbers are not necessary in
databases defined as relational in IDMS, Sybase or Oracle.
13.2 Data Element and Column Names
Goal: To have data element and table column names that are consistent, clear, and descriptive of the data maintained
in the element or column. An element or column should have the same name every place it appears in all databases
across all platforms. Customers and programmers should not have to guess what name is used in a specific database
on a specific platform. Additionally, standard names will improve productivity, facilitate sharing of programmer resource
among groups, and provide coherent table joins.
Process:
13.3 Oracle Dataset Names for Oracle nondatabase files
- 3.1. Datasets we created to assist systems with installs:
DB.ORCL.INSTALL.DATA
DB.ORCL.INSTALL.CNTL
- 3.2. Datasets with SQL code not requiring modification, SQL templates, etc.:
DB.ORCL.DBG.DATA
- 3.3. Datasets for SQL code for specific databases:
DB.ORxn.schm.DATA where x = D for development, T = test, P = production
n = 1,2,3,etc., schm = 4 character schema owner
- 3.4. Datasets containing database structures exported from an
AIS Oracle database:
DB.ORxn.schm.EXPORT.Dyymmdd
See #3 for naming explanation and
yy is bytes 3-4 of century, mm = month, dd=day of month
- 3.5. Datasets containing database structures from vendor:
DB.ORCL.appname.EXP.DATA.Dyymmdd
DB.ORCL.appname.EXP.DEFN.Dyymmdd
where appname is the application name such as COEUS30,
DATA = signifies that export file contains only a data extract,
DEFN = signifies that export file contains only data definitions
- 3.6. PDS for sharing SQL code with rest of AIS:
DB.ORCL.SHRLIB.CNTL
- 3.7. PDS for each of us to do our own work:
DB.int.ORxn.DATA - SQL code
DB.int.ORxn.CNTL - JCL
where Int = your 3 character initials
ORxn (see #3 above for details)
13.4 Oracle dataset naming conventions
| |
Prefix |
2nd |
3rd |
4th |
Remarks |
Idea #1 |
DB |
SUBSYS_NAME |
Sss+ttt+Fn |
|
sss=3 char schema/application abbrev.
ttt = 3 byte number for tablespace #
relative to schema
|
Ex: |
|
ORT1 |
OSP001F1 |
|
F=constant for file |
| |
|
ORT1 |
SYS001F1 |
|
n=file number: 1-9, then A-Z |
What about Rbs, temp tbs? (no "schema") |
|
ORT1 |
RBS001F1 |
|
rollback segment tablespace |
| |
ORT1 |
TMP001F1 |
|
rollback segment tablespace |
EXCEPTIONS:
What about
Control, alert, trace & redo logs
(nontablespaces) |
|
ORT1 |
CONTROLn |
|
n=the number of a control file 1-9 |
| |
ORT1 |
LOGna |
|
n=group number; a=member id |
| |
ORT1 |
Alseqnum |
LOG |
seqnum=log sequence number |
| |
ORT1 |
ALERT |
|
must be purged/archived periodically |
| |
ORT1 |
TRACEnn |
|
nn=number assigned by instance |
Notes:
- The tablespace name would be sss+TBS+nnn: OSPTBS001.
- The ddname for tablespace files is the 3rd level of the dataset name.
- The ddname for nontablespace files is the default name assigned during the Instance setup process.
5. Security
All userids that access databases on the UNIX or the OS/390 servers must be created by the Function Access
Control System, FACS. The requests can be made via the WEB at http://www.unc.edu/ais/systems/security/
All customer and developer staff userids that access ORACLE and IDMS databases on the OS/390 server must be
authenticated by RACF.
PL/SQL is not required to update Oracle tables when the access is through a proxy user not exposed to customers.
Specific instances covered by this policy would be:
- Access via server-side datasources, EJBs, and O/R mappers,
- Access via mainframe batch, and
- Access via CICS Oracle adapter configured to a proxy user or transaction ID.
The general intent of this policy change is to allow the use of developer productivity tools to generate access to
Oracle tables and abstract that access away from customers. This policy does not relieve the developer from writing
efficient code. Poorly performing applications may be required to use PL/SQL as the means to gain efficiency.
This policy does not require that all database access use dynamic SQL. Some applications may wish to use
procedures, and packages in order to limit update access to their databases. That is entirely acceptable.
6. Backup and Recovery Issues, Suggestions, and AIS methods
Systems does nightly backups of IDMS and ORACLE OS/390 databases. The backups are kept for two weeks worth
of backup cycles. (Reminder: Nightly backups are done Monday through Friday. This means that weekend work will
not be included in an official backup until Monday night. Therefore, please keep copies of your weekend files after you
have finished. This will allow you to recover on Monday midday if a database crashes and must go back to a Friday
night backup. )
Data Management keeps five cycles of journals for IDMS CVs and Oracle Instances.
It cannot be stressed enough that it is best to have a backup strategy worked out before you need it.
IDMS files updated through the CV (central version/IDMS engine) have changes logged in the IDMS JOURNALS. If you
are unclear about whether you are running through the CV, check MESSAGES in your job on IOF and look for SYSCTL.
You should see DB.CV12.SYSCTL (test environment), DB.CV11.SYSCTL (production environment), or
DB.CV16.SYSCTL (retrieval query CV) if you are running through the Central Version.
IDMS files can be updated locally provided you keep your own backup files for recovery, you have RACF authority, and
you understand which files must be recovered together if there is a problem. Local updating means that the CV
(central version) does not journal the changes you make to the files. When a local batch job abends, the IDMS files
are left locked. Then you must restore all of the files which must be recovered together to the prior backup and start over.
Oracle has a utility called EXPORT/IMPORT. If you EXPORT a database you can capture the complete database
structure, security, and data. Then if you have problems, you can IMPORT the information back to the database with the
EXPORT file. These two utilities go together and only read files produced by the utility. (A word of caution: IMPORTs
can be very slow. Some sites with large databases do not rely on IMPORTs for regular processing.) You can export
from one database and import to another database in another instance. You can import individual tables within a larger
EXPORT.
If you need JCL for any of the utilities listed above, check out the share libraries.
ORACLE - DB.ORCL.SHRLIB.CNTL
IDMS - DB.R120.SHRLIB.CNTL
7. Standard Instance Environments: Development, Test, and Production
All databases must have separate development, test, and production environments. In-house IDMS applications use
DEVDICT, TSTDICT, and PRDDICT. ORACLE Instances on the OS/390 have ORD1 (ORDn), ORT1 (ORTn), and ORP1
(ORPn) which represent three instances. The third letter of the instance name corresponds to D for development,
T for test, and P for production.
8. Stored Procedure, Trigger, Function, etc. Setup/Design/Implementation recommendations
Including standard return codes, operation, design, coding, and documentation
Module Specifications
There are no specific standards for these items, yet. They will be added as development progresses.
9. Recommended Ways to Load Database
If you need JCL for any of the utilities listed below, check out the share libraries.
ORACLE - DB.ORCL.SHRLIB.CNTL
IDMS - DB.R120.SHRLIB.CNTL
The IDMS load utility to load an empty database is FASTLOAD. See the IDMS UTILITIES manual for more details.
Oracle has a batch loader called SQL LOADER. Sometimes, it is abbreviated to SQLLDR. It is fast and widely used.
Samples of the JCL can be found in DB.ORCL.SHRLIB.CNTL(SQLLDR). A template for the LOADPARM referenced
can be found in DB.ORCL.SHRLIB.CNTL(LOADPARM).
If you need to load an Oracle Database from another Oracle Database, see the EXPORT/IMPORT description in #6 above.
10. System Test plan
A System Test plan should be scheduled to allow enough time to test the new database and application before it is put
in production. This test will allow customers to use the application before it is production critical. This testing should
provide the information the database and programming staff need to know that the security pieces are in place for the
customers' access to the database.
11. Oracle Database Design Documentation
Currently (10/27/1999), the in-house Oracle database designs done by Data Management are documented in
Embarcadero's ERSTUDIO. It has the capability to create the diagrams needed with textual definition for entities,
tables and columns. It can produce the database documentation in an HTML format.
|