Showing posts with label DBMS. Show all posts
Showing posts with label DBMS. Show all posts

Wednesday, November 4, 2015

Disadvantages in the File System

·         Data Redundancy
·         Data Inconsistency
·         Difficulty in Accessing Data
·         Data Isolation
·         Integrity Problems
·         Atomicity Problem
·         Concurrent Access anomalies
·         Security Problems
Data Redundancy
Data Redundancy is same information’s are duplicated in several files. This makes data redundancy.
Data Inconsistency
Data Inconsistency means different copies of the same data are not matching. This  occurs as the result of  update operations that are not updating the same data stored at different places.
Example: Address Information of a customer is recorded differently in  different files.
Difficulty in Accessing Data
It is not easy to retrieve information using a conventional file processing system. Convenient and efficient information retrieval is almost impossible using conventional file processing system. 
Data Isolation
Data are scattered in various files, and the files may be in different format, writing new application program to retrieve data is difficult.
Integrity Problems
The data values may need to satisfy some integrity constraints.
 For example  the balance field Value must be greater than 5000. We have to handle this through program code in file processing systems. But in database we can declare the integrity constraints along with definition itself.

Monday, November 2, 2015

DBMS

11. What are a block and a block number?
A block is a contiguous sequence of sectors from a single track of one platter. Each request
specifies the address on
the disk to be referenced. That address is in the form of a block number.
12. What are called journaling file systems?
File systems that support log disks are called journaling file systems.
13. What is the use of RAID?
A variety of disk-organization techniques, collectively called redundant arrays of independent
disks are used to improve the performance and reliability.
14. Explain how reliability can be improved through redundancy?
The simplest approach to introducing redundancy is to duplicate every disk. This technique is called mirroring or shadowing. A logical disk then consists of two physical disks, and write is
carried out on both the disk. If one of the disks fails the data can be read from the other. Data will be lost if the second disk fails before the first fail ed disk is repaired.
15. What is called mirroring?
The simplest approach to introducing redundancy is to duplicate every disk. This technique is called mirroring or shadowing.

Sunday, November 1, 2015

TRENDS IN DATABASE TECHNOLOGY

1. What are the advantages and disadvantages of indexed sequential file? APRIL/MAY-
2011
The advantage of ordering records in a sequential file according to a key is that you can then
search the file more quickly. If you know the key value that you want, you can use one of the relatively fast searches. The disadvantage is that when you insert, you need to rewrite at least everything after the insertion point, which makes inserts very expensive unless they are done at the end of the file. An indexed file approach keeps a (hopefully) small part of each row, and some kind of "pointer" to the row's location within the data file. This allows a search to use the index, which is ordered by the index and (again hopefully) much smaller and therefore much faster than scanning the entire data file for the indexed data.
2. What is database tuning? APRIL/MAY-2011
Database tuning describes a group of activities used to optimize and homogenize the
performance of a database. It usually overlaps with query tuning, but refers to design of the database files, selection of the database management system (DBMS), operating system and CPU the DBMS runs on.
3. Give the measures of quality of a disk.
Capacity
Access time
Seek time
Data transfer rate
Reliability
Rotational latency time.
Cheaper than disk Expensive when compared with disk
5. What are the types of storage devices?
Ø Primary storage
Ø Secondary storage
Ø Tertiary storage

Saturday, October 31, 2015

DBMS

31. Define page.
The database is partitioned into some number of fixed-length blocks, which are referred to as
pages.
32. Explain current page table and shadow page table.
The key idea behind the shadow paging technique is to maintain two page tables during the life
of the transaction: the current page table and the shadow p age table. Both the page tables are identical when the transaction starts. The current page table may b e changed when a transaction performs a write operation.
33. What are the drawbacks of shadow-paging technique?
Ø Commit Overhead
Ø Data fragmentation
Ø Garbage collection
34. Define garbage collection.
Garbage may be created also as a side effect of crashes. Periodically, it is necessary to find all the garbage pages and to add them to the list of free pages. This process is called garbage
collection.
35. Differentiate strict two phase locking protocol and rigorous two phase locking protocol.
In strict two phase locking protocol all exclusive mode locks taken by a transaction is held

Friday, October 30, 2015

DBMS

21. What is a recovery scheme?
An integral part of a database system is a recovery scheme that can restore the database to the consistent state that existed before the failure.
22. What are the two types of errors?
The two types of errors are:
Ø Logical error
Ø System error
23. What are the storage types?
The storage types are:
Ø Volatile storage
Ø Nonvolatile storage
24. Define blocks?
The database system resides permanently on nonvolatile storage, and is partitioned into fixed- length storage units called blocks.
25. What is meant by Physical blocks?
The input and output operations are done in block units. The blocks residing on the disk are referred to as physical blocks.

Thursday, October 29, 2015

DBMS

11. Give the reasons for allowing concurrency?
The reasons for allowing concurrency is if the transactions run serially, a short transaction may
have to wait for a preceding long transaction to complete, which can lead to unpredictable delays in running a transaction. So concurrent execution reduces the unpredictable delays in running transactions.
12. What is average response time?
The average response time is that the average time for a transaction to be completed after it has
been submitted.
13. What are the two types of serializability?
The two types of serializability is
Ø Conflict serializability
Ø View serializability
14. Define lock?
Lock is the most common used to implement the requirement is to allow a transaction to access a data item only if it is currently holding a lock on that item.
15. Define deadlock?
Ø Exclusive
Neither of the transaction can ever proceed with its normal execution. This situation is called deadlock.

Monday, October 26, 2015

DBMS

31. Explain the two types of participation constraint.
Total: The participation of an entity set E in a relationship set R is said to be total if every
entity in E participates in at least one relationship in R.
Partial: if only some entities in E participate in relationships in R, the participation of entity set
E in relationship R is said to be partial.
32. What is meant by lossless-join decomposition? APRIL/MAY-2011
We claim the above decomposition is lossless. How can we decide whether decomposition is
lossless?
1. Let R be a relation schema.
2. Let F be a set of functional dependencies on R.
3. Let R1and R2 form a decomposition of R.
4. The decomposition is a lossless-join decomposition of R if at least one of the following functional dependencies are in :
a. R1∩ R2→ R1
b. R1∩ R2→ R2
33. List the disadvantages of relational database system
Repetition of data
Inability to represent certain information.
34. What is first normal form?
The domain of attribute must include only atomic (simple, indivisible) values.
35. What is meant by functional dependencies?
Consider a relation schema R and a C R and ß C R. The functional dependency a ß holds on
relational schema R if in any legal relation r(R), for all pairs of tuples t1 and t2 in r such that t1 [a] =t1 [a], and also t1 [ß] =t2 [ß].

Sunday, October 25, 2015

Unit 1 - DBMS

21. Define the terms i) Entity set ii) Relationship set
Relationship set : The set of all relationships of the same type is termed as a relationship set.
22. Define single valued and multivalued attributes.
Single valued attributes: attributes with a single value for a particular entity are called single
valued attributes.
Multivalued attributes : Attributes with a set of value for a particular entity are called
multivalued attributes.
23. What are stored and derived attributes?
Stored attributes: The attributes stored in a data base are called stored attributes.
Derived attributes: The attributes that are derived from the stored attributes are called derived attributes.
24. What are composite attributes?
Composite attributes can be divided in to sub parts.
25. Define null values
In some cases a particular entity may not have an applicable value for an attribute or if we do not know the value of an attribute for a particular entity. In these cases null value is used.

Saturday, October 24, 2015

DBMS

11. What is conceptual schema?
The schemas at the view level are called subschemas that describe different views of the
database.
12. Define data model?
A data model is a collection of conceptual tools for describing data, data relationships, data
13. What is storage manager?
A storage manager is a program module that provides the interface between the low level data
stored in a database and the application programs and queries submitted to the system.
14. What are the components of storage manager?
The storage manager components include
a) Authorization and integrity manager b) Transaction manager
c) File manager
d) Buffer manager
15. What is the purpose of storage manager?
The storage manager is responsible for the following a) Interaction with the file manager
b) Translation of DML commands in to low level file system commands c) Storing, retrieving and updating data in the database

Wednesday, October 7, 2015

database system architecture



1.       schemas in database management system architecture.
There are following three levels or layers of DBMS architecture: 
         External Level
    Conceptual Level
·         Internal Level


Each user should be able to access the same data, but have a different customized view of the data. Each user should be able to change the way he or she views the data, and this change should not affect other users.
• Users should not have to deal directly with physical database storage details, such as indexing or hashing. In other words a user's interaction with the database should be independent of storage considerations.
• The Database Administrator (DBA) should be able to change the database storage structures without affecting the user's views.
. The internal structure of the database should be unaffected by changes to the physical aspects of storage, such as the changeover to a new storage device.
. The DBA should be able to change the conceptual structure of the database without affecting all users.

External Level or View level

It is the users' view of the database. This level describes that part of the database that is relevant to each user. External level is the one which is closest to the end users. This level deals with the way in which individual users vie\v data. Individual users are given different views according to the user's requirement.
A view involves only those portions of a database which are of concern to a user. Therefore same database can have different views for different users. The external view insulates users from the details of the internal and conceptual levels. External level is also known as the view level. In addition different views may have different representations of the same data. For example, one user may view dates in the form (day, month, year), while another may view dates as (year, month, day).

Conceptual Level or Logical level

It is the community view of the database. This level describes what data is stored in the database and the relationships among the data. The middle level in the three level architecture is the conceptual level. This level contains the logical structure of the entire database as seen by the DBA. It is a complete view of the data requirements of the organization that is independent of any storage considerations. The conceptual level represents:
• All entities, their attributes, and their relationships;
An Entity is an object whose information is stored in the database. For example, in student database the entity is student. An attribute is a characteristic of interest about an entity.
For example, in case of student database Roll No, Name, Class, Address etc. are attributes of entity student.
• The constraints on the data;
• Semantic information about the data;
• Security and integrity information.

Tuesday, October 6, 2015

disadvantages in the file system



·         Data Redundancy
·         Data Inconsistency
·         Difficulty in Accessing Data
·         Data Isolation
·         Integrity Problems
·         Atomicity Problem
·         Concurrent Access anomalies
·         Security Problems
Data Redundancy
Data Redundancy is same information’s are duplicated in several files. This makes data redundancy.
Data Inconsistency
Data Inconsistency means different copies of the same data are not matching. This  occurs as the result of  update operations that are not updating the same data stored at different places.
Example: Address Information of a customer is recorded differently in  different files.
Difficulty in Accessing Data
It is not easy to retrieve information using a conventional file processing system. Convenient and efficient information retrieval is almost impossible using conventional file processing system. 
Data Isolation
Data are scattered in various files, and the files may be in different format, writing new application program to retrieve data is difficult.

Monday, October 5, 2015

Components of a DBMS



The DBMS accepts the SQL commands generated from a variety of user interfaces, produces query evaluation plans, executes these plans against the database, and returns the answers. The major components of DBMS are as follows:
 (i) Query processor: The query processor transforms user queries into a series of low level instructions. It is used to interpret the online user's query and convert it into an efficient series of operations in a form capable of being sent to the run time data manager for execution. The query processor uses the data dictionary to find the structure of the relevant portion of the database and uses this information in modifying the query and preparing and optimal plan to access the database.
(ii) Run time database manager: Run time database manager is the central software component of the DBMS, which interfaces with user-submitted application programs and queries. It handles database access at run time. It converts operations in user's queries coming. Directly via the query processor or indirectly via an application program from the user's logical view to a physical file system. It accepts queries and examines the external and conceptual schemas to determine what conceptual records are required to satisfy the user’s request. It enforces constraints to maintain the consistency and integrity of the data, as well as its security. It also performs backing and recovery operations. Run time database manager is sometimes referred to as the database control system and has the following components:
• Authorization control: The authorization control module checks the authorization of users in terms of various privileges to users.
• Command processor: The command processor processes the queries passed by authorization control module.




Integrity checker: It .checks the integrity constraints so that only valid data can be entered into the database.
Query optimizer: The query optimizers determine an optimal strategy for the query execution.
• Transaction manager: The transaction manager ensures that the transaction properties should be maintained by the system.
• Scheduler: It provides an environment in which multiple users can work on same piece of data at the same time in other words it supports concurrency.

Saturday, October 3, 2015

Purpose and functions of Database Management Systems



1.       State the Purpose and functions of Database Management Systems
·         Data redundancy is found- the presence of duplicate data in multiple data files
e.g. Customer Name, NI number, Address is present in several different files on several different systems. Errors are generated, time entering data is wasted.
·         Data inconsistency will become a problem
 e.g. information is duplicated in each system and may be updated in most systems but not necessarily in all – the savings account and loan account may have different addresses for a particular customer.
·         Lack of data independence.
In the bank imagine cases where any change in data format or structure requires a change in all the programs that access the data.
e.g. effort required to change from 3-digit STD to 4-digit STD may be very difficult.
·         Data lacks integrity
This is the quality by which information from the system can be trusted.
·         Lack of flexibility
Creating reports
e.g. in this system a summary of account balances in each separate account would require separate reports for each open account or cutting and pasting into a word processor file – not a satisfactory state of affairs.

Tuesday, June 23, 2015

XML Databases

Definition
            An XML database is a data persistence software system that allows data to be stored in XML format

Data-Centric Documents:
            Data-centric documents are documents that use XML as a data transport. Examples of data-centric documents are sales orders, flight schedules, scientific data, and stock quotes. Data-centric documents are characterized by fairly regular structure, fine-grained data (that is, the smallest independent unit of data is at the level of a PCDATA-only element or an attribute), and little or no mixed content. The order in which sibling elements and PCDATA occurs is generally not significant, except when validating the document.

Document-Centric Documents:
            Document-centric documents are (usually) documents that are designed for human consumption. Examples are books, email, advertisements, and almost any hand-written XHTML document. They are characterized by less regular or irregular structure, larger grained data (that is, the smallest independent unit of data might be at the level of an element with mixed content or the entire document itself), and lots of mixed content.

XML-QL: Querying XML Data
The motivation for XQuery is that increasing amounts of information are stored, exchanged, and presented using XML. An XQuery is an expression that:
Reads a number of XML documents or fragments
Returns a sequence of well-formed XML fragments

Monday, June 22, 2015

Application Servers

CGI does not scale well because of the drawback mentioned above. This performance problem led to the development of specialized programs called application servers. An application server has pre- forked threads or processes and thus avoids the start-up cost of creating a new process for each request. In addition to eliminating the process-creation
overhead:
Integration of heterogeneous data sources: Most companies have data in many different database systems, from legacy systems to modern object-relational systems. Electronic commerce applications require integrated access to all these data sources.
Transactions involving several data sources: In electronic commerce applications, a user transaction might involve updates at several data sources. An application server can ensure transactional semantics across data sources by providing atomicity, isolation, and durability. The transaction boundary is the point at which the application server provides transactional semantics. If the transaction boundary is at the application server, very simple client programs are possible.

Security: Since the users of a Web application usually include the general population, database access is performed using a general-purpose user identifier that is known to the application server. While communication between the server and the application at the server side is usually not a security risk, communication between the client (Web browser) and the Web server could be a security hazard. Encryption is usually performed at the Web server, where a secure protocol (in most cases the Secure Sockets Layer (SSL) protocol) is used to communicate with the client.

Session management: Often users engage in business processes that take several steps to complete. Users expect the system to maintain continuity during a session, and several session identifiers such as cookies, URL extensions, and hidden fields in HTML forms can be used to identify a session. Application servers provide functionality to detect when a session starts and ends and to keep track of the sessions of individual users.

Sunday, June 21, 2015

CGI (Common Gateway Interface):

Web-to-database connecting technologies


To build a bridge between web and enterprise database, a number of alternative technologies and architectures have been available. These include:
CGI (Common Gateway Interface):
CGI is a Web standard for accessing external programs, to integrate databases with Web servers. CGI Dynamically generates HTML documents from back-end databases. CGI programs can be written in any scripting language (interpreted) or programming language available to be executed on a web server, including C, C++, Fortran, PERL, TCL, VB and others.

Saturday, June 20, 2015

WEB DATABASES

What is a Web Database?
A web database is an organized listing of web pages. It's like the card catalogue that you might find in the library. The database holds a "surrogate" (or selected pieces like the title, the headings, etc.) for each web page. The creation of these surrogates is called "indexing", and each web database does it in a different way. Web databases hold surrogates for anywhere from 1 million to several billion web pages.
Why Web Database?

The current web is largely based on file system technology, which can deal well with the resources that are primarily static. However, with unprecedented growth of resources, it is no longer adequate to rely on this conventional file technology for organising, storing and accessing large amount of information on the web. Thus, many websites turn towards database technology to keep track of the increasing amount of data.

Role of databases in Web applications
Many organizations offer products through their Web sites, and customers can place orders by visiting a Web site. For such applications a URL must identify more than just a file, however rich the contents of the file; a URL must provide an entry point to services available on the Web site