Database Administration Oracle Standards
Total Page:16
File Type:pdf, Size:1020Kb
CMS DATABASE ADMINISTRATION ORACLE STANDARDS 5/16/2011 Contents 1. Overview ....................................................................................................................................................... 4 2. Oracle Database Development Life Cycle ..................................................................................................... 4 2.1 Development Phase .............................................................................................................................. 4 2.2 Test Validation Phase ............................................................................................................................ 5 2.3 Production Phase .................................................................................................................................. 5 2.4 Maintenance Phase .............................................................................................................................. 6 2.5 Retirement of Development and Test Environments ........................................................................... 6 3. Oracle Database Design Standards ............................................................................................................... 6 3.1 Oracle Design Overview ........................................................................................................................ 6 3.2 Instances ............................................................................................................................................... 7 3.2.1 Instance Naming Standards .......................................................................................................... 7 3.2.2 Object Usage ................................................................................................................................. 7 3.2.3 Required Parameters (DDL Syntax) .............................................................................................. 7 3.3 Databases ............................................................................................................................................. 9 3.3.1 Database Naming Standards ........................................................................................................ 9 3.3.2 Object Usage ................................................................................................................................. 9 3.3.3 Required Parameters (DDL Syntax) .............................................................................................. 9 3.4 Tablespaces ........................................................................................................................................ 10 3.4.1 Tablespace Naming Standards ................................................................................................... 11 3.4.2 Object Usage ............................................................................................................................... 11 3.4.3 Required Parameters (DDL Syntax)--Locally Managed ............................................................... 11 3.5 Tables .................................................................................................................................................. 12 3.5.1 Table Naming Conventions ......................................................................................................... 12 3.5.2 Object Usage ............................................................................................................................... 12 3.5.3 Required Components of the CREATE TABLE Statement ........................................................... 12 3.6 Columns .............................................................................................................................................. 12 3.6.1 Column Naming Standards ......................................................................................................... 13 3.6.2 Object Usage ............................................................................................................................... 13 3.6.3 Datatypes .................................................................................................................................... 14 3.7 Indexes ................................................................................................................................................ 14 5/16/2011 CMS Oracle Standards and Guidelines i 3.7.1 Object Usage ............................................................................................................................... 14 3.8 Referential Constraints (Foreign Keys) ............................................................................................... 15 3.8.1 Foreign Key Naming Standards ................................................................................................... 15 3.8.2 Object Usage ............................................................................................................................... 15 3.8.3 Required Parameters (DDL Syntax) ............................................................................................ 15 3.9 Temporary Tables ............................................................................................................................... 16 3.9.1 Object Usage ............................................................................................................................... 16 3.9.2 Syntax ......................................................................................................................................... 17 3.10 Views................................................................................................................................................... 17 3.10.1 Naming Standards for Views ...................................................................................................... 17 3.10.2 Object Usage ............................................................................................................................... 17 3.10.3 Required Parameters (DDL Syntax) ............................................................................................ 18 3.11 Materialized Views.............................................................................................................................. 18 3.11.1 Naming Standards for Materialized Views ................................................................................. 18 3.11.2 Object Usage ............................................................................................................................... 18 3.11.3 Required Parameters (DDL Syntax) ............................................................................................ 19 3.12 Synonyms ............................................................................................................................................ 20 3.12.1 Object Usage ............................................................................................................................... 20 3.12.2 Syntax ......................................................................................................................................... 20 4. Standard Naming Conventions.................................................................................................................... 21 4.1 Object and Dataset Names ................................................................................................................. 21 4.1.1 Usage .......................................................................................................................................... 21 4.1.2 Standard Naming Format ........................................................................................................... 21 4.2 File Names .......................................................................................................................................... 23 4.2.1 File Naming Convention ............................................................................................................. 23 4.2.2 Sample File Name ....................................................................................................................... 23 4.3 Utility File Names and Script Names ................................................................................................... 24 5. Oracle Standards: Packages ........................................................................................................................ 24 5.1 Overview ............................................................................................................................................. 24 5.2 Naming Standards ............................................................................................................................... 24 5.3 Object Usage ....................................................................................................................................... 24 5.4 Required Parameters (DDL Syntax) - Package Specification ............................................................... 25 5/16/2011 CMS Oracle Standards and Guidelines ii 6. Oracle Standards: Stored Procedures/Functions ........................................................................................ 25 6.1 Overview ............................................................................................................................................. 25 6.2