Friday 31 July 2020

What are various users of DBMS? What are the roles or functionalities of DBA ?

Users of DBMS:

 

There are six different types of database system. These users are differentiated on the basis of the way they interact with the system. These are as follows:

 1.  Application Programmers:

·       They write application programs to interact with the database.

·    Application programs can be written in programming languages like COBOL, PL/I, C++, JAVA and some other higher level 4GL.

·       Such programs access the database by issuing the appropriate request using SQL statement to DBMS.

 2. End-users:

·        These are those users that use the application.

·         End users need not know about the working, database design, access mechanism methods, etc.

·        They just use the system to get their required tasks done. 

·        End users are of two types:

a)    Direct users:

                     i)        Direct users can see the computer and the database system directly.

                    ii)        They interact with the system by following instructions provided in the user interface. 

                   iii)        Direct users mostly interact using the application programs that are already developed for getting the desired result or an output.

                   iv)        For ex. people at railway reservation counters who directly interact with database are the direct users for the railway reservation system.

b)   Indirect users:

                     i)        Indirect users are those users who desire benefit from the work of DBMS indirectly.

                    ii)        They use the output generated by the programs for decision making or any other purpose.

                   iii)        Their primary concern is with the output and as such they don’t worry about the programming part.


3. System Analyst:

·         They determine the requirements of end-users, especially of naive and parametric end users.

·         A system analyst may be a single individual or a group of people.

·         They develop specifications for transactions that meet the requirements stated by the end users.

·         System analyst(s) plays a major role in database design process.

·         They also prepare the system requirement statement which comprises of the feasibility study, economic and technical feasibilities, etc. of the system.


     4. Sophisticated users:

·         These users interact with the system without writing any programs.

·         Instead, they form their request in a database query language like a SQL.

·         These individual queries are then submitted to a query processor whose function is to breakdown DML (Data Manipulation Language) statements into instructions that the Storage Manager understands.

·         The analyst(s) who submit queries for data exploration in the database fall in this category.

 

5. Naive users:

·         These are unsophisticated users who interact with the system by invoking one of the application programs that have been written previously.

·         For ex. a bank teller needs to transfer $50 from account A to account B invoke a program called ‘Transfer’.  This program asks the teller for;

a)    amount of money to be transferred

b)    account from which the money is to be transferred and

c)    account to which the money is to be transferred

·         They are the simple users and lack the technical details about an overall operating mechanism of the system.


 6. Database Administrator (DBA):

·         The DBA is the key person for a DBMS. He can be an individual or a group of persons.

·         The DBA makes the strategic and policy decisions regarding the data of an organization.

·         They provide the necessary technical support for implementing these decisions.

·         In a database environment, the primary source is the database itself and the secondary source is the DBA and related software.

·         The database system administration is the main responsibility of the DBA.

 

 

 Functions and Responsibilities of DBA:

 

 Normally, there are three types of users for a DBMS system viz.

 

  1. The end users who uses the application. They actually put the data in the system for its use into business.
  2. Application programmers who develop the application programs for a system. They have more knowledge about the data and its structure. They make use of programming languages and logic for program creation.
  3. The DBA, who is like a super user of the database system.

 

The role of the DBA is very important and is defined by following functions:

 

1.    Schema definition: the DBA defines the schema which contains the structure of the data in the application. The DBA creates the original database schema by executing a set of data definition statements in the DDL. The DBA determine what data needs to be present in the system and how this data has to be represented and organized.

2.    Co-ordinate with users: the DBA needs to interact continuously with the users to understand the data in the system and its use.

3.    Defining security and integrity checks: the DBA finds about the access restrictions to be defined and defines security checks accordingly. He also defines data integrity checks.

4.    Defining backup recovery procedures: the DBA also defines procedures for backup and recovery. It includes specifying what data is to be backed up, periodicity of backups, medium and storage place for the backup data, etc.

5.    Monitoring performance: the DBA has to continuously monitor the performance of the queries and take measures to optimize all the queries in the application.

6.    Schema and Physical organization modification: the DBA carries out changes to the schema and physical organization to reflect the changing needs of the organization. He can also alter the physical organization to improve performance.

7.    Granting of authorization: by granting different types of authorization the database administrator can regulate which parts of the database various users can access. The authorization information is kept in a special system structure that the database system can search whenever someone attempts to access the data in the system.

8.    Routine maintenance: the DBA also perform the maintenance task for the database system.

Thursday 30 July 2020

What are the various services or functions of an Operating System (OS) ?

Operating System Services or Functions of an OS:

An operating system provides a user friendly environment for the creation and execution of programs and provides services to the user. Services provided by one operating system differ with other operating system i.e. it differs from OS to OS.


 

1.    Program creation:  

     OS provides editors, debuggers to assist the programmer in creating programs.

 

2.    Program execution: 

    A number of tasks are required to execute a program. It includes instructions and data to be loaded into main memory, IO devices, files and other resources must be prepared.  The OS handles these tasks for the user. The program must be able to end its execution either normally or abnormally.

 

3.    IO operation: 

     Here by IO we mean an IO for any file or any specific IO device.  Program may require any IO device while running.  A user cannot execute IO operations directly; the OS must provide some means to do so.

 

4.    File system manipulation:  

    Program needs to read a file or write the data to a file.  An OS gives the permission to the program for operations on a file.

 

5.    Communication:  

     In some cases, the data transfer between two processes is required. The two processes may reside on one computer or on different computers but, connected through a computer network.  Communication may be implemented by two methods - shared memory and message passing.

 

6.    Error detection:  

     The OS constantly needs to be aware of possible errors.  It should take the appropriate action to ensure correct and consistent computing. Ex. of errors include memory error, power failure, printer out of paper, illegal instruction in the program (division by zero, arithmetic overflow, etc.).

 

 A multi-user OS provides following services:

 

1.    Resource allocation:

OS manages different types of resources. OS collects all the resources in the network environment or a system and grant these resources to requested process. Resources commonly managed by OS include CPU cycles, main memory, IO devices, file storage etc.

 

2.    Accounting:

Logs of each user must be kept to keep record of which user uses how much and what kind of computer resources.  These logs are used for accounting purposes, for billing and to improve system efficiency.

 

3.    Protection:

Protection ensures that all access to system resources is controlled.  Security to a system is usually implemented by means of a password.  External IO devices must be protected from invalid access attempts. In protection, all the access to the resources is controlled.  In multi process environment, it is possible that one process to interface with other or with other operating system, so protection is required.

 


Wednesday 29 July 2020

What are the 5 components of DBMS?

Components of DBMS:



Every component plays a vital role in database management. These components are:

1.    Data:

A data can be defined as a collection of raw facts and figures.  The term database is referred as a collection of the related data. The data is a key component and for the management of it the DBMS works.

2.    Software:

It includes both types of software viz. system and application software that are used to work on a database. The software is set of instruction required to manage, maintain and work with data. It also provides an interface between the user and a database.

3.    Hardware:

The hardware includes CPU as well as other peripheral devices such as monitor, keyboard, hard disk, printer, etc. These are required for input, processing and output purposes.

4.    User:

It includes all types of users that are benefited by the DBMS. Following are the various types of users commonly associated with a DBMS:

a)    The DBA (Database Administrator) is a person or group of persons that have the central control over the DBMS. They are in charge of implementing the system within an organization. Further, they have all the system privileges and it is they decide access permissions for other users to access the database system.

b)    The end users are persons who sit at workstations and interact with the system. They may need to respond to requests from people that are outside of an organization, or to find answers to the questions quickly asked by higher level management. In some cases they may generate periodic reports. If required, they should be allowed to change data within the system.

c)    Direct users are those users that use the database system directly by following instructions provided in an interface. Such users interact with system using applications that are already developed.

d)    Indirect users work with the DBMS indirectly. They commonly use output generated programs for decision making.

e)    The application programmers interact with the system using HLL such as VB, Java, C#.Net etc. they access the data from programs written using such HLL.

 

5.    Procedures:

Procedures are instructions and rules that assist on how to use the DBMS, in its design and running the database. They serve as a guide to the users that operate and manage it.

Tuesday 28 July 2020

What is a Three Level Architecture in DBMS?

3 - Level Architecture of DBMS:

This approach was proposed by an ANSI/SPARC (American National Standard Institute / Standards Planning and Requirements Committee).

Three Level Architecture

Fig: Three Level Architecture

The overall architecture is divided into the following three levels viz.

  1. External level

  2. Conceptual level and;

  3. Internal or physical level


The objective of the three-level architecture is to separate the user's view.

  • It allows independent customized user views: Each user should be able to access the same data, but have a different customized view of the data.
  • These should be independent: changes to one view should not affect others.
  • It hides the physical storage details from users: Users should not have to deal with physical database storage details.
  • The database administrator (DBA) should be able to change the database storage structures without affecting the users’ views.
  • The internal structure of the database should be unaffected by changes to the physical aspects of the storage: For example, a changeover to a new disk.

 

1. External Level:

It is the highest level of data abstraction. The way users recognize the data is called an External level. Each external level is defined using an External schema. External schema consists of definitions of each of the various types of external record found at that level. It determines how data looks like regardless of how they are stored in the storage media. It is also called as user's view of the database that describes a part of the database that is relevant to a particular user. It excludes irrelevant data as well as data which the user is not authorised to access.

2. Conceptual Level:

It is the next lower level of abstraction. The conceptual level offers both the mapping and independence between the external and internal levels. This schema describes the database structure and hides information about the physical storage structures. The main focus is on describing data types, entities, relationships, etc. This logical level sits between the user level and physical storage view. But, there is only single conceptual view of a single database. It also holds security and integrity information. The Database Administrator (DBA) works at this level and only DBA can define this level. It provides a global view of database and it is independent of hardware and software.

 

3. Internal or Physical Level:

It is the lowest level of the data abstraction. The way the DBMS and the operating system distinguish the data is the internal level, where the data is stored using the data structures and file. The Physical level is defined by the means of Internal schema. It is concerned with the physical storage of the information means what data are stored and how and provides complete internal structure of storage, access paths, specification of keys, indexes, pointers etc.

 

Mapping Between the Three Levels:

Mapping corresponds to one record of one level to record of another level. There are two mappings in three levels architecture:

1. Mapping between External and Conceptual level.
2. Mapping between Internal and Conceptual level.
3. Internal to physical database.

What are the various components of an Operating System (OS)?

System Components:

 

Every operating system consists of following system components viz.

 

1.    Process management

2.    Main memory management

3.    File management

4.    Secondary storage management

5.    IO system management

6.    Networking

7.    Protection system

8.    Command interpreter system

 

1.     Process Management:

A process refers to a program in execution. The process abstraction is a fundamental OS mechanism to manage concurrent program execution.  The OS responds by creating a process. A process needs certain resources such as CPU time, memory, files and IO devices.  These resources are either given to the process when it is created or allocated to it while it is running.

 

When the process terminates the operating system will reclaim any reusable resources. The term process refers to an executing set of machine instructions.  A program by itself is not a process.  A program is a passive entity while a process is an active entity. The operating system is responsible for the following activities of the process management:

  • Creating and destroying of the user and system processes.
  • Allocation of hardware resources among the processes.
  • Controlling the progress of processes.
  • Providing mechanisms for a process communications.
  • To provide mechanism for deadlock handling.

 

2.     Main Memory Management:

Memory management module of an OS is concerned with the management of primary memory.  Memory management is concerned with the following functions:

  • Keeping track of the status of each location of main memory i.e. each memory location is either free or allocated.
  • Determining allocation policy for memory.
  • Allocation technique i.e. particular location must be selected and allocation information updated.
  • De-allocation technique and policy.  After de-allocation, status information must be updated.

Memory management is primarily concerned with allocation of physical memory of finite capacity to requesting processes.  Overall resource utilization and other performance criteria of a computer system are affected by performance of the memory management module.  Many memory management schemes are available and the effectiveness of the different algorithms depends on the particular situation.

 

3.     File Management:

File is a named, logical collection of information on the secondary storage.  Computers use physical storage media for storing the different information. A file may contain report, an executable program or a set of commands to the OS.  A file consists of sequence of bits, bytes, lines or records whose meanings are defined by their creators.

For storing the files physical media is used. Physical media are of different types like a magnetic disk, magnetic tape and optical disk etc.  All the media has its own characteristics and physical organization.

 

 An OS is responsible for the following in connection with the file management:

  • Creating and deleting of files
  • Mapping files onto secondary storage
  • Creating and deleting directories
  • Backing up files on stable storage media
  • Supporting primitives for manipulating files and directories
  • Transmission of file elements between main and secondary storage

 

4.    Secondary Storage Management:

Secondary storage device is used for storing all the data and programs.  These programs and data access by computer system must be kept in main memory.  Size of main memory is small to accommodate all data and programs.  It also loses the data when the power is lost.  For this reason secondary storage devices are used.  Therefore the proper management of disk storage is of central importance to a computer system.

 An OS is responsible for following activities related to disk management:

  • Free space management
  • Storage allocation
  • Disk scheduling

 

5.     IO System Management:

The module that keeps track of the status of devices is called the IO traffic controller.  Each IO device has a device handler that resides in a separate process associated with that device.

 

The IO subsystem consists of:

  1. A memory management component that includes buffering, caching and spooling.
  2. A general device driver interface.
  3. Drivers for specific hardware devices.

 

6.     Networking:

It enables computer users to share resources and speed up computation. The processes communicate with one another through various communication lines.

 

Following parameters are considered while designing the networks:

  • Topology of network
  • Type of network
  • Physical media
  • Communication protocols
  • Routing algorithm

 

7.     Protection System:

Modern computer systems support many users and allow the concurrent execution of multiple processes.  Organizations rely on computers to store information. The information and devices must be protected from unauthorized users or processes.  The protection is any mechanism for controlling the access of programs; processes or users to the resources defined by a computer system.

They are implemented in OS to support various security policies. The goal of the security system is to authenticate subjects and to authorize their access to any object. It can improve reliability by detecting latent errors at the interfaces between component subsystems. 

 

8.     Command Interpreter System:

It is an interface between user and the OS.  It is a system program for an operating system.  The command interpreter is a special program in a UNIX and MS DOS operating system. The command interpreter is included in the kernel of some OS. 

When users log in first time or when a job is initiated, a control statement is processed by the command interpreter. Command interpreter reads the control statements, analyses it and carries out the required action.


Monday 27 July 2020

What are Storage Structure, IO Structure, Synchronous and Asynchronous IO in OS?


Computer System Operation:


Modern computer system

Fig: Modern computer system

The above figure shows a modern computer system.  It consists of one or more CPUs and a number of device controllers connected through a common bus that provides access to shared memory.

The CPU and the device controllers can execute concurrently. But as such they compete for memory cycles. To ensure orderly access to shared memory, a memory controller is provided whose function is to synchronize access to the memory.


Storage Structure:

RAM or the main memory is the only large storage area that the processor can access directly. It is commonly implemented in a semiconductor technology called Dynamic Random Access Memory (DRAM), which forms an array of memory words. Each word has its own address. The following figure shows storage device hierarchy:


Storage device hierarchy
Fig: Storage device hierarchy

The programs and data cannot reside in main memory permanently because of the following two reasons:

1.     Main memory is usually too small to store all the needed programs and data permanently.

2.    Main memory is a volatile storage device that loses its contents when power is turned off. So, most computer systems provide secondary storage as an extension to main memory.  The main requirement for secondary storage is that it should be able to hold large quantities of data permanently.


IO Structure:

 

By storage we mean one of the storage devices in a computer system.  A large portion of OS code is dedicated for managing IO because:

·         it is important for the reliability and;

·         performance of a system.

 

The computer does not have direct random access to any byte at any time on the disk - the magnetic disk in the drive are rotating and magnetic heads move in and out in order to access any part of the surface area on the disk that holds data.  Access usually involves a disc rotation delay and also a head positioning delay.

 

A computer system consists of CPUs and multiple device controllers, connected through a common bus.  Each device controller is in charge of a specific type of device. Depending on the controller, there may be more than one attached device. The device controller is responsible for moving the data between the peripheral devices that it controls and its local buffer storage.

 

Operating systems have a device driver for each device controller. Device driver is software that communicates with controller.  This device driver understands the device controller and presents a uniform interface to the device to the rest of the OS.  Most of the device drivers run in kernel mode.

 

 An IO operation is performed using the following steps:

1.     The device driver loads the appropriate registers within the device controller.

2.     The device controller examines the contents of these registers to determine what action to take.

3.     The controller starts the transfer of data from device to its local buffer.  Once the transfer of data is complete, the device controller informs the device driver via an interrupt that it has finished its operation.

4.     The device driver then returns control to the OS, possibly returning the data or a pointer to the data if the operation was a read.

 

 IO requests can be handled in two ways viz. synchronously or asynchronously.

Synchronous and Asynchronous IO
Fig (a) : Synchronous IO   (b) : Asynchronous IO

1.    Synchronous IO:

      A program makes the appropriate OS call, as the CPU is now executing OS code, the original program’s execution is halted i.e it waits. If the CPU always waits for IO completion, at most one IO request is outstanding at a time.  So, whenever an IO interrupt occurs, the OS knows exactly which device is interrupting.  However, this approach excludes concurrent IO operations to several devices and also excludes the possibility of overlapping useful computation with IO.

 

2.     Asynchronous IO:

      A better alternative is to start the IO and then continue processing other operating system or user program code. We also need to be able to keep track of many IO requests at the same time.  For this purpose the OS uses a table containing an entry for each IO device:  the device status table. Each table entry indicates the device type, address, and state (not functioning, idle or busy).

 

Since it is possible for other processes to issue request to the same device, the OS will also maintain a wait queue - a list of waiting request for each IO device. An IO device interrupts when it needs service. When an interrupt occurs, the operating system first determines which IO device caused the interrupt. It then indexes into the device table to determine the status of that device, and modifies the table entry to reflect the occurrence of the interrupt.

 

The main advantage of asynchronous IO is increased system efficiency.  While IO is taking place, the CPU can be used for a processing or starting IO to other devices. Because IO can be slow compared to processor speed, the system makes efficient use of its facilities.