14
1. What are the representative applications of Databases? List them. A collection of programs that enables you to store, modify, and extract information from a database. There are many different types of DBMSs, ranging from small systems that run on personal computers to huge systems that run on mainframes. The following are examples of database applications: computerized library, systems automated teller machines, flight reservation systems, computerized parts inventory systems. Databases function in many applications, spanning virtually the entire range of computer software. Databases have become the preferred method of storage for large multi- user applications, where coordination between many users is needed. Even individual users find them convenient, and many electronic mail programs and personal organizers are based on standard database technology. Software database drivers are available for most database platforms so that application software can use a common API to retrieve the information stored in a database. Commonly used database APIs include JDBC and ODBC. Copy © Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

Bt0066 database management system1

Embed Size (px)

Citation preview

1. What are the representative applications of Databases? List them.

A collection of programs that enables you to store, modify, and extract information from a database. There are many different types of DBMSs, ranging from small systems that run on personal computers to huge systems that run on mainframes. The following are examples of database applications: computerized library, systems automated teller machines, flight reservation systems, computerized parts inventory systems.

Databases function in many applications, spanning virtually the entire range of computer software. Databases have become the preferred method of storage for large multi-user applications, where coordination between many users is needed. Even individual users find them convenient, and many electronic mail programs and personal organizers are based on standard database technology. Software database drivers are available for most database platforms so that application software can use a common API to retrieve the information stored in a database. Commonly used database APIs include JDBC and ODBC.

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

2. Explain Oracle Architecture with a neat diagram.

Oracle Database Server is made of two major components.Oracle Server = Oracle Instance (RAM) + Oracle Database (Physical disk)

Oracle Instance Created in the RAM of the server. Gets created on startup of the database. Memory size and other related parameters are defined in

parameter file. Used to access the database (Physical files). It is always connected to one database only. Made of memory structure and background processes.

When user starts a tool like Oracle forms, other application software or SQL plus to connect to oracle database, a user process starts on the user’s machine. It will request the connection to the database, so server process will start on the server on which database is created.

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

User process communicates with Oracle Instance via server process, and server process communicates with database.

User can create connection with Oracle server by three different ways:

1. 1 Tier connection: In this type user log on to the same machine on which oracle database is resides.

2. 2 Tire connection: In this type user log on to the separate client machine and then connects to database through network. This also called as client-server type of the connection.

3. 3 Tier (N Tire) connection: In this type, user log on to the separate client machine and connect to middle tire-application server and application server connects to oracle database.

Session: A session is a separate connection between user and oracle server. This gets created when user get authenticated by the oracle server.

Oracle Database It is a physical storage disk on the server. It is the physical files related to the database. These files are mainly three types.

o Data files - Contains actual data.o Online Redo log files - Records changes in the data.o Control files - Contains information to maintain and operate

the database.

Oracle server also having other files, those are not a part of database are.

o Password file - Authenticate user to startup and shutdown the database.

o Parameter file - It defines the characteristics of an Instance like size of the different memory structure of the SGA etc.

o Archive log files – These are the offline copies of the online redo log files.

Click here to get more information about database.

Oracle Instance Details

Oracle Instance = Memory Structure + Background processes.

Memory Structure

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

It is made of two memory areas:

System Global Area (SGA): Created at the startup of instance. Program Global Area (PGA): Created at the startup of the server

process.

System Global Area (SGA):

System Global Area is made of following different memory areas:

Database Buffer Cache Shared pool Redo log buffer Large pool (Optional) Java pool (Optional) Other miscellaneous like area for locks, latches and other

processes related required memory area. 2. Differentiate relation and relation schema.

Relational Schema refers to meta-data elements which are used to describe structures and constraints of data representing a particular domain. Whereas a relation is a property or predicate that ranges over more than one argument. Relation and Relation schema are the terminologies of SQL and Relation is known as Table and Relation Schema is known as Table definition. In other words, Relation schema defines the meta data elements which represent a particular domain. For example, they define the structures and constraints of data. On the other hand, relation is the predicate for example, Relation schema for a person "relation" can be shown in the following manner: Person(FirstName, LastName, Age, Gender, Address) A relation schema can be thought of as the basic information describinga table or relation. This includes a set of column names, the data types associatedwith each column, and the name associated with the entire tableA database relation is a predefined row/column format for storing information in a relational database. Relations are equivalent to tables.

3. Explain indexed and virtual storage access methods.

ISAM (Indexed Sequential Access Method), like physical sequential files, stores the records back-to-back, making for very efficient use of disk space.  However, unlike physical sequential, ISAM files must be stored on disk, since the disk addresses are needed to create the indexes.  The physical location of records within ISAM is not

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

important since the indexes take care of the access to the records.  A single ISAM file may have many dozens of indexes, each allowing the files to be retrieved in some pre-defined order.  In some case, the size of the indexes will exceed the size of the base file. the Virtual Storage Access Method (VSAM) (Virtual Storage Access Method) it is a combination of the best features of QSAM and ISAM. Allows physical sequential files to be indexed on multiple data items. By having multiple indexes, data can be retrieved directly in several ways and you can access data anywhere in the file using a different index. VSAM is designed specifically for use with disks. Because VSAM data set structure permits the use of both direct and sequential access types, you can select either the type or the combination of access types that best suits your specific application requirements.

5. What information is stored in the system catalogs?

The system catalog is a collection of tables and views that contain data about the following:

Tables and views in a DBEnvironment Any indexes, hash structures, constraints, and rules defined for

tables

DBEFiles and DBEFileSets in the DBEnvironment

Specific authorities granted to each user

Programs that can access data in the DBEnvironment

Current DBEnvironment statistics

Temporary space for sorts

Procedures

ALLBASE/SQL uses the system catalog to maintain data integrity and to optimize data access. The system views are primarily a tool for the DBA. Initially, only the DBA can access these views. Other users need to be granted SELECT authority by the DBA to access them. Users without SELECT authority can retrieve descriptions of database objects they own from the CATALOG views. For information on system and catalog views, refer to chapter "System Catalog" in the ALLBASE/SQL Database Administration Guide.

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

When a DBEnvironment is first configured, the information in the system catalog describes the system tables and views themselves. As database objects are defined, their definitions are stored in the system catalog. As database activities occur, most of the information in the catalog is updated automatically, so the system catalog provides an up-to-date source of information on a DBEnvironment.

Immediately following an UPDATE STATISTICS statement, the views in the system catalog, summarized in Table 2-2, are a source of up-to-date information on a DBEnvironment and the structure and use of its databases. Refer to the ALLBASE/SQL Database Administration Guide for additional information on the system catalog.

6. What are entities and attributes? Give examples.

Entity,Object in the real world.Attributes,Describe each entity. the entity is typically a Clinical Event, as described above. In more general-purpose settings, the entity is a foreign key into an "Objects" table that records common information about every "object" (thing) in the database – at the minimum, a preferred name and brief description, as well as the category/class of entity to which it belongs. Every record (object) in this table is assigned a machine-generated Object ID.

As you begin to design the music database, you are either creating a new system or you are transferring data from a non-relational system to ALLBASE/SQL. Regardless of where you're coming from, you need to take a comprehensive look at all the information needs that will be served by the database system. This means identifying the elements for which you need to store and retrieve information. These elements are known as entities. A list of entities grows out of studying how the data is used by its owners.

By approaching the problem intuitively, you can probably identify four different categories of information required by the radio station:

Album information. Selection information.

Composer information.

Station log information.

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

These are the entities in the data.

Next, you need to define the attributes of each entity, which are the useful pieces of information to be stored in tables. In addition to supplying informational detail, some attributes are used to distinguish one entity from another. As you subdivide your data, make sure that for each entity you define, at least one attribute can uniquely identify an instance of the entity. This attribute or group of attributes is known as a key.

Table 2-1 Attributes for Four Entities

Album EntitySelection

EntityComposer

EntityStation Log

Entity

Album NameSelection Title

NameSelection Title

MediumComposer Name

Date of Birth

Start Time

Album Cost Timing Birthplace End Time

Recording Company

Performers Comment Announcer

Date Recorded Comment   Comment

Manufacturer's Code

     

Comment      

 

As the design evolves, entities eventually become database tables, and attributes eventually become columns. Note, however, that at this stage you have not yet identified the form of the database tables. Before you can do that, you need to identify relationships.

7. List and explain MySQL architectural primary subsystems.

MySQL is based on a tiered architecture, consisting of both primary subsystems and support components that interact with each other to read, parse, and execute queries, and to cache and return query results.

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

Primary SubsystemsThe MySQL architecture consists of five primary subsystems that work together to respond to a request made to the MySQL database server:The Query Engine The Storage Manager The Buffer Manager The Transaction Manager The Recovery Manager

The organization of these features is shown in Figure 1.We’ll explain each one briefly to help you gain a better understanding of how the parts fit together.

FIGURE 1 MySQL subsystems

The Query EngineThis subsystem contains three interrelated components:The Syntax Parser The Query Optimizer The Execution Component

The Syntax Parser decomposes the SQL commands it receives from calling programs into a form that can be understood by the MySQL engine. The objects that will be used are identified, along with the correctness of the syntax. The Syntax Parser also checks the objects being referenced to ensure that the privilege level of the calling program allows it to use them.

The Query Optimizer then streamlines the syntax for use by the Execution Component, which then prepares the most efficient plan of query execution. The Query Optimizer checks to see which index should be used to retrieve the data as quickly and efficiently as possible. It chooses one from among the several ways it has found to execute the query and then creates a plan of execution that can be understood by the Execution Component.

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

The Query Optimizer uses probability-based induction, so you may want to override it if you think that you already know the ideal way to access your query results; this will prevent the engine from using another, less optimal plan. MySQL provides you the option of giving the engine certain “hints” if you want it to use specific indexes without checking the Optimizer.

The Execution Component then interprets the execution plan and, based on the information it has received, makes requests of the other components to retrieve the records.

8. Construct an E-R diagram for a car insurance company whose customers own one or more cars each. Each car has associated with it zero to any number of recorded accidents.

The relation between Customers and Cars is 1->n, as one customer can own one or more cars.

The relation ship between Car-Insurance Company and Customer can be n->1, as some customers has more than 1 car..so they may have more than one insurance with the company.The relationship between cars and Accidents is (0...1) -> n.(0..1) means it is either 0 or 1.

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

9. Explain various performance measures of disks.

The main measures of the qualities of a disk are capacity, access time, data transfer rate, and reliability,

access time: the time from when a read or write request is issued to when data transfer begins. To access data on a given sector of a disk, the arm first must move so that it is positioned over the correct track, and then must wait for the sector to appear under it as the disk rotates. The time for repositioning the arm is called seek time, and it increases with the distance the arm must move. Typical seek time range from 2 to 30 milliseconds.

Average seek time is the average of the seek time, measured over a sequence of (uniformly distributed) random requests, and it is about one third of the worst-case seek time.

Once the seek has occurred, the time spent waiting for the sector to be accesses to appear under the head is called rotational latency time. Average rotational latency time is about half of the time for a full rotation of the disk. (Typical rotational speeds of disks ranges from 60 to 120 rotations per second).

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/

The access time is then the sum of the seek time and the latency and ranges from 10 to 40 milli-sec.data transfer rate, the rate at which data can be retrieved from or stored to the disk. Current disk systems support transfer rate from 1 to 5 megabytes per second.reliability, measured by the mean time to failure. The typical mean time to failure of disks today ranges from 30,000 to 800,000 hours (about 3.4 to 91 years).

10. What are the benefits of making the system catalogs relations?

The system catalogs are the place where a relational database management system stores schema metadata, such as information about tables and columns, and internal bookkeeping information .To keep track of all objects, their relationships, etc., the RDBMS use the same technique they are advocating — a set of relational tables and views. This approach was first defined in the SQL92 standard (ISO/IEC 9075-2:199x) and was implemented across all major RDBMS — to a certain degree.

All metadata is made available as catalog views.Catalog views present metadata in a format that is independent of any catalog table implementation, therefore catalog views are not affected by changes in the underlying catalog tables.Catalog views are the most efficient way to access core server metadata.Catalog views are the general interface to catalog metadata and provide the most direct way to obtain, transform, and present customized forms of this metadata.Catalog view names and the names of their columns are descriptive. Query results match what might be expected by a user who has a moderate knowledge of the feature that corresponds to the metadata that is being queried.hence all this help for query optimization.

Copy© Milan K Antony | [email protected] | http://solveditpapers.blogspot.in/