Beruflich Dokumente
Kultur Dokumente
IMS Fundamentals
Types of DBMS
1. Hierarchical A hierarchical database is a kind of database management system that links records together in a tree data structure such that each record type has only one owner, e.g. an order is owned by only one customer. Hierarchical structures were widely used in the first mainframe database management systems. However, due to their restrictions, they often cannot be used to relate structures that exist in the real world.
IMS Fundamentals
The network model is a database model conceived as a more flexible alternative to the hierarchical model. Where the hierarchical model structures data as a tree of records, with each record having one parent record and many children, the network model allows each record to have multiple parent and child records, forming a lattice structure.
IMS Fundamentals
A relational database is organized into tables, in which data is defined so that it can be reorganized and accessed in a number of different ways without having to reorganize the database tables.
IMS Fundamentals
IMS Fundamentals
What is IMS?
IMS (Information Management System) is IBM's hierarchical database product
Hierarchical Data base management system that supports the application program while processing data bases in batch or on-line environments. IMS maintains an Inverted Tree Structure starting with the Root Segment by ensuring that no segment has more than one parent. The Hierarchy can go up to fifteen levels down. The Hierarchy can represent up to 255 segment types
IMS Fundamentals
An IMS database consists of some number of database records. The size of the database is limited only by the constraint of VSAM and DASD. A maximum of 15 levels are allowed; a level can be defined as all segments that have the same number of segments above them. The root segment is always level one. Each immediate child of the root is level two and so on .IMS allows up to 255 different segment types in a single database.
IMS Fundamentals
Why IMS?
Advantages:
Large Volumes of Data can be handled Faster Access of Data Can be combined with DB2 for making data retrieval efficient (DB2 for querying and IMS for processing) Checkpoint restart feature available. Limitations: Not many tools for IMS compared to DB2 (File aid ~ file structure on pc) Rigid design of IMS doesnt make it programmer friendly
IMS Fundamentals
Access Types
HSAM/SHSAM (Simple /Hierarchic sequential Access Method) : The segments that make up the database record are related to one another by their physical locations (SHSAM has only root occurrences) HISAM/SHISAM (Simple / Hierarchic Indexed Sequential Access Method) :The data is stored with hierarchic sequential organization along with an index for random processing (SHISAM has only index of root occurrences) HDAM (Hierarchic Direct Access Method) :The segment occurrences include prefixes that contain the direct address pointers to related segment - stores root segment occurrences HIDAM (Hierarchic Indexed Direct Access Method) : Similar to HDAM but stores an index of the root segment occurrences
IMS Fundamentals
10
IMS Components
Five components of IMS Environment 1. Database Management System Is the heart of IMS subsystem. Shared by many concurrent tasks. Data is stored in DASD. Application programs access data by making DL/I calls. 2. DL/I (Data Language Interpreter) Is a set of program modules interfacing database and application program. The modules use standard operating system access methods and a set of specialized access methods to handle data transfers to and from the database. Is an interface language used by the application program.
IMS Fundamentals
11
IMS Fundamentals
12
Product Implementations
DC is used to implement the transaction manager DB is used to implement the database manager
IMS Fundamentals
13
Illustration follows:
IMS Fundamentals
14
Explanation of diagram
The diagram shows how the data elements are arranged in IMS. Data elements are stored in the hierarchical structure or in other way we can say that some data elements are dependent on other. Each grouping of data is called as segments. A segment is the unit of data that DL/I transfers to and from your program. In previous diagram DEALER, MODEL, ORDER, STOCK and SALES are the names of segments.
IMS Fundamentals
15
Definitions
Segment
- Unit of Information handled in IMS - Unit of data transferred from DL/I in an IO operation - Consists of fields, key fields & Search fields
Occurrence
- Specific segment of a particular type of segment - Contains actual user data
Root Segment
- Top of the hierarchy - All other segments are derived from the root
Parent Segment
- Segment that has dependent segments
IMS Fundamentals 16
Definitions (contd)
Child Segment
- A dependent segment
Segment Level
- Depth of an IMS structure - Root is at Level 0, max 15 levels, max 255 segments
Path
- Series of segments from Root to the child
Database record
- Each occurrence of the Segment Plus all occurrence of the subordinate segments
Twins
IMS Fundamentals
17
Concept of Segments
In IMS, segments are defined by the order in which they occur and by their relationship with other segments.
The segment type at the top level of Hierarchy represents the Root segment. Like in the above case the DEALER represents the root segment.
An occurrence of the root segment plus all the segment occurrences subordinate to it makes one database record. All of the segments except the root segment are called dependent segments. Each dependent segment is also called the child segment.
IMS Fundamentals
18
FIELDS
- Segments can be broken down into smaller increments called fields, which can be addressed individually by application programs
IMS Fundamentals 19
IMS Fundamentals
20
IMS Fundamentals
21
Control Blocks
IMS uses two kinds of control blocks to enable application programs The database descriptor/definition (DBD) and Program communication block (PCB). Database Description (DBD)
A database descriptor (DBD) is a control block that describes the physical structure of the database. The DBD also defines the appearance and contents, or fields, that make up each of the segment types in the database. It describes the way in which it is stored on the DASD and the way it is accessed.
IMS Fundamentals
23
IMS Fundamentals
24
What is DL/I ?
IMS Fundamentals
25
IMS Fundamentals
26
Defining DBD
Suppose the ACCENTURE hierarchical structure has been designed. The name of the segments has been chosen. Now we must tell IMS about this database. IMS needs to know about all the keys, search fields, and relationships that are designed as part of the organization database.
The DBD is usually coded by a DBA (Data Base Administrator). It is then submitted to the system with JCL that invokes a procedure called DBDGEN. This procedure produces an object module which is in turn passed to the linkage editor which produces a load module. The load module is stored in a library named something like IMSVS.DBDLIB.
IMS Fundamentals
27
DBD Functions
Defines the physical storage information. Defines the hierarchical structure. Define the relationship between the segments. Defines the segment layouts. Defines the key field with in the segment. Describe the information necessary to create the database. Defines any logical relationship. Defines the secondary index.
IMS Fundamentals
28
IMS Fundamentals
29
END
IMS Fundamentals
30
IMS Fundamentals
31
Command Codes
The 10 Command Codes available in IMS are :
C D F L N Q
IMS Fundamentals
Concatenated key in the SSA. Retrieve this segment data into the I-O Area (Path call). Locate the first segment occurrence that satisfies the SSA. Locate the last segment occurrence that satisfies the SSA. Do not replace this segment. Locks a segment for your program's exclusive use.
32
Command Codes
U
(Contd..)
Specify the current database positions at that level is not allowed to be changed by the call
P
V
'NULL Used as the place holder in SSA's so that command codes can be removed/inserted from SSA's without having to define separate SSA's in working storage.
IMS Fundamentals
33
AK AT AO
IMS Fundamentals
34
IMS Fundamentals
35
IMS Fundamentals
36
Checkpoint Restart
Why checkpointing? If there are other jobs updating or reading the tables, there should be a checkpoint at an interval < the DB2 timeout interval (typically 30 seconds will suffice). When A large amount of locking activity is taking place. Locks are a finite resources in a DB2 Subsystem. When we do not want to lose work already accomplished. If a job runs a long time, recovery is not just re-running the job, but also waiting for DB2 to roll back changes. Checkpoint intervals are based on the situation. For example, if online activity is present, or we are running parallel processes, checkpoints should be taken at 10 second intervals. If we are running stand alone batch, and have exclusive access to our tables, we might go as high as 60 seconds.
37
IMS Fundamentals