Friday, May 9, 2008

Welcome!

Welcome to the http://muthyamnagaiah.blogspot.com/ Technology site! Technology News helps you stay on the cutting edge with the latestlatest advances and more with our technology news,Latest Mobile Models,Latest mobile Technology,Information about the latest electronic equipment ,relevent technology used ......etc

provide by My Site ....

KEEP UPDATE YOUR KNOWLEDGE...

Windows XP Tips & Tricks

XP COMMON GENUINE KEY :: V2C47-MK7JD-3R89F-D2KXW-VPK3J



Remove the Recycle Bin from the Desktop
If you don't use the Recycle Bin to store deleted files , you can get rid of its desktop icon all together.

Run Regedit and go to:

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/explorer/Desktop/NameSpace


Click on the "Recycle Bin" string in the right hand pane. Hit Del, click OK.

-------------

How to Rename the Recycle Bin
To change the name of the Recycle Bin desktop icon, open Regedit and go to:

HKEY_CLASSES_ROOT/CLSID/{645FF040-5081-101B-9F08-00AA002F954E}

and change the name "Recycle Bin" to whatever you want (don't type any quotes).

-------------

How to make your Desktop Icons Transparent
Go to ontrol Panel > System, > Advanced > Performance area > Settings button Visual Effects tab "Use drop shadows for icon labels on the Desktop"

-------------

How to Convert FAT to NTFS file system
To convert a FAT partition to NTFS, perform the following steps.

Click Start, click Programs, and then click Command Prompt.

In Windows XP, click Start, click Run, type cmd and then click OK.

At the command prompt, type CONVERT [driveletter]: /FS:NTFS.

Convert.exe will attempt to convert the partition to NTFS.

NOTE: Although the chance of corruption or data loss during the conversion from FAT to NTFS is minimal, it is best to perform a full backup of the data on the drive that it is to be converted prior to executing the convert command. It is also recommended to verify the integrity of the backup before proceeding, as well as to run RDISK and update the emergency repair disk (ERD).

-------------

Force users to press Ctrl-Alt-Delete to Logon

(XPPro only)

Go to start/run,

and type control userpasswords2

-------------

Disable CD Autorun
1) Click Start, Run and enter GPEDIT.MSC

2) Go to Computer Configuration, Administrative Templates, System.

3) Locate the entry for Turn autoplay off and modify it as you desire.

-------------

Remove Shared Documents

Open Regedit(Start- Run- Regedit) and navigate to HKEY_LOCAL_MACHINE SOFTWARE Microsoft Windows CurrentVersion Explorer My Computer NameSpace DelegateFolders

There will see a sub-key named {59031a47-3f72-44a7-89c5-5595fe6b30ee}. By Deleting this you can remove the 'Other Files stored on This Computer' group.

-------------

Win XP Won’t Completely Shutdown

- Goto Control Panel, then goto Power Options.
- Click on the APM Tab, then check the "Enable Advanced Power Management support."
- Shut down your PC. It should now successfully complete the Shut Down process.

-------------

Adjust various visual effects

1. Open up the control panel
2. Go under system and click on the advanced tab
3. Click settings under Performance options
4. You can now change various graphical effects (mainly animations and shadows)

-------------

Disable Error Reporting
1. Open Control Panel

2. Click on Performance and Maintenance.
3. Click on System.
4. Then click on the Advanced tab
5. Click on the error-reporting button on the bottom of the windows.
6. Select Disable error reporting.
7. Click OK
8. Click OK

-------------
Keyboard Shortcuts


Copy. CTRL+C
Cut. CTRL+X
Paste. CTRL+V
Undo. CTRL+Z
Delete. DELETE

Delete selected item permanently without placing the item in the Recycle Bin. SHIFT+DELETE
Copy selected item. CTRL while dragging an item
Create shortcut to selected item. CTRL+SHIFT while dragging an item
Rename selected item. F2
Move the insertion point to the beginning of the next word. CTRL+RIGHT ARROW
Move the insertion point to the beginning of the previous word. CTRL+LEFT ARROW
Move the insertion point to the beginning of the next paragraph. CTRL+DOWN ARROW
Move the insertion point to the beginning of the previous paragraph. CTRL+UP ARROW
Highlight a block of text. CTRL+SHIFT with any of the arrow keys
Select more than one item in a window or on the desktop, or select text within a document. SHIFT with any of the arrow keys
Select all. CTRL+A
Search for a file or folder. F3
View properties for the selected item. ALT+ENTER
Close the active item, or quit the active program. ALT+F4
Opens the shortcut menu for the active window. ALT+SPACEBAR
Close the active document in programs that allow you to have multiple documents open simultaneously. CTRL+F4
Switch between open items. ALT+TAB
Cycle through items in the order they were opened. ALT+ESC
Cycle through screen elements in a window or on the desktop. F6
Display the Address bar list in My Computer or Windows Explorer. F4
Display the shortcut menu for the selected item. SHIFT+F10
Display the System menu for the active window. ALT+SPACEBAR
Display the Start menu. CTRL+ESC
Display the corresponding menu. ALT+Underlined letter in a menu name
Carry out the corresponding command. Underlined letter in a command name on an open menu
Activate the menu bar in the active program. F10
Open the next menu to the right, or open a submenu. RIGHT ARROW
Open the next menu to the left, or close a submenu. LEFT ARROW
Refresh the active window. F5
View the folder one level up in My Computer or Windows Explorer. BACKSPACE
Cancel the current task. ESC
SHIFT when you insert a CD into the CD-ROM drive Prevent the CD from automatically playing.

Use these keyboard shortcuts for dialog boxes:

Move forward through tabs. CTRL+TAB
Move backward through tabs. CTRL+SHIFT+TAB
Move forward through options. TAB
Move backward through options. SHIFT+TAB
Carry out the corresponding command or select the corresponding option. ALT+Underlined letter
Carry out the command for the active option or button. ENTER
Select or clear the check box if the active option is a check box. SPACEBAR
Select a button if the active option is a group of option buttons. Arrow keys
Display Help. F1
Display the items in the active list. F4
Open a folder one level up if a folder is selected in the Save As or Open dialog box. BACKSPACE

If you have a Microsoft Natural Keyboard, or any other compatible keyboard that includes the Windows logo key and the Application key , you can use these keyboard shortcuts:

Display or hide the Start menu.
Display the System Properties dialog box. +BREAK
Show the desktop. +D
Minimize all windows. +M
Restores minimized windows. +Shift+M
Open My Computer. +E
Search for a file or folder. +F
Search for computers. CTRL+ +F
Display Windows Help. +F1
Lock your computer if you are connected to a network domain, or switch users if you are not connected to a network domain. + L
Open the Run dialog box. +R
Display the shortcut menu for the selected item.
Open Utility Manager. +U


Helpful accessibility keyboard shortcuts:

Switch FilterKeys on and off. Right SHIFT for eight seconds
Switch High Contrast on and off. Left ALT +left SHIFT +PRINT SCREEN
Switch MouseKeys on and off. Left ALT +left SHIFT +NUM LOCK
Switch StickyKeys on and off. SHIFT five times
Switch ToggleKeys on and off. NUM LOCK for five seconds
Open Utility Manager. +U

Keyboard shortcuts you can use with Windows Explorer:

Display the bottom of the active window. END
Display the top of the active window. HOME
Display all subfolders under the selected folder. NUM LOCK+ASTERISK on numeric keypad (*)
Display the contents of the selected folder. NUM LOCK+PLUS SIGN on numeric keypad (+)
Collapse the selected folder. NUM LOCK+MINUS SIGN on numeric keypad (-)
Collapse current selection if it's expanded, or select parent folder. LEFT ARROW
Display current selection if it's collapsed, or select first subfolder. RIGHT ARROW


How to make bootdisk

Download bd030112.zip (1.4MB) and rawwrite2.zip (10K) from here( http://home.eunet.no/~pnordahl/ntpasswd/ ) to make a boot floppy. If you need more SCSI driver or want to boot from CD-ROM, download the others. You can get rawwite2.exe from Linux CD as well.
Extract both bd030112.zip and rawwrite2.zip files into same directory (for your convenience) and run rawrite2.exe
Type the image filename and a drive letter.

________________________________________
_______________

RaWrite 2.0 - Write disk file to raw floppy diskette

Enter disk image source file name: bd030112.bin
Enter target diskette drive: a


--------------------------------------------------------------------------------



Remaining Update Soon Keep watch !!!

muthyamnagaiah

Structured Query Language (SQL)
4.1 SQL : An Overview
The components of SQL are
a. Data Manipulation Language – Consists of SQL statements for operating on the data (Inserting, Modifying, Deleting and Retrieving Data) in tables which already exist.
b. Data Definition Language – Consists of SQL statements for defining the schema (Creating, Modifying and Dropping tables, indexes, views etc.)
c. Data Control Language – Consists of SQL statements for providing and revoking access permissions to users
Tables used:
Ord_Aug
Ord#
OrdDate
Cust#
101
02-AUG-94
002
102
11-AUG-94
003
103
21-AUG-94
003
104
28-AUG-94
002
105
30-AUG-94
005
Items
Item#
Descr
Price
HW1
Power Supply
4000
HW2
101- Keyboard
2000
HW3
Mouse
800
SW1
MS-DOS 6.0
5000
SW2
MS-Word 6.0
8000
Customers
Cust#
CustName
City
001
Shah
Bombay
002
Srinivasan
Madras
003
Gupta
Delhi
004
Banerjee
Calcutta
005
Apte
Bombay

Ord_Items
Ord#
Item#
Qty
101
HW1
100
101
HW3
50
101
SW1
150
102
HW2
10
103
HW3
50
104
HW2
25
104
HW3
100
105
SW1
100











4.2 DML – SELECT, INSERT, UPDATE and DELETE statements.
The SELECT statement
Retrieves rows from one or more tables according to given conditions.
General form:
SELECT [ ALL DISTINCT ]
FROM
[ WHERE ]
[ ORDER BY [DESC]
[ GROUP BY ]
[ HAVING ]
Query 1:
Some SELECT statements on the Case Example
SELECT * <-----------------
FROM items;
* -denotes all attributes in the table

ResultQuery 2:
SELECT cust#,custname
FROM customers;ResultQuery 3: SELECT DISTINCT item#
FROM ord_items;ResultQuery 4:
SELECT ord# "Order ", orddate "Ordered On" <----
FROM ord_aug;
In the result set the column headings will appear as “Order” and “Ordered On” instead of ord# and orddate.

ResultQuery 5:
SELECT item#, descr
FROM items
WHERE price>2000;
ResultQuery 6:
SELECT custname
FROM customers
WHERE city<>'Bombay';Result Query 7:
SELECT custname
FROM customers
WHERE UPPER(city)<>'BOMBAY';Result
Query 8:
SELECT *
FROM ord_aug
WHERE orddate > '15-AUG-94'; <-----------

Illustrates the use of 'date' fields. In SQL, a separate datatype (eg: date, datetime etc.) is available to store data which is of type date.
Result
Query 9:SELECT *
FROM ord_items
WHERE qty BETWEEN 100 AND 200;Result Query 10:
SELECT custname
FROM customers
WHERE city IN ('Bombay', 'Madras'); <-------


The conditional expression evaluates to TRUE for those records for which the value of city field is in the list ('Bombay, 'Madras')
Result
Query 11:
SELECT custname
FROM customers
WHERE custname LIKE 'S%' ; <------------


LIKE 'S%' - 'S' followed by zero or more characters
ResultQuery 12:
SELECT *
FROM ord_items
WHERE qty>100 AND item# LIKE 'SW%';ResultQuery 13:SELECT custname
FROM customers
WHERE city='Bombay' OR city='Madras';Result
Query 14:
SELECT *
FROM customers
WHERE city='Bombay'
ORDER BY custname; <--------------------
Records in the result set is displayed in the ascending order of custname
Result
Query 15:
SELECT *
FROM ord_items
ORDER BY item#, qty DESC; <-------------


Display the result set in the ascending order of item#. If there are more than one records with the same item# , they will be displayed in the descending order of qty
ResultQuery 16:
SELECT descr, price
ORDER BY 2 FROM items
ORDER BY 2; <----------------------------

ORDER BY the 2nd attribute (price) in the attribute list of the SELECT clause
ResultQuery 17:
SELECT ord#, ord_aug.cust#, custname <----------------
FROM ord_aug, customers
WHERE city='Delhi'
AND ord_aug.cust# = customers.cust#; <----------------

SELECT statement implementing JOIN operation.JOIN condition
ResultQuery 18: SELECT ord#, customers.cust#, city
FROM ord_aug, customers
WHERE ord_aug.cust# = customers.cust#;
Result Query 19:
SELECT ord#, customers.cust#, city
FROM ord_aug, customers
WHERE ord_aug.cust# = customers.cust# (+); <-----------

(+) indicates outer join. Here it is a right outer join as indicated by the (+) after the right side field.
ResultNested SELECT statements
SQL allows nesting of SELECT statements. In a nested SELECT statement the inner SELECT is evaluated first and is replaced by its result to evaluate the outer SELECT statement.
Query 20:
SELECT item#, descr, price <---------------------------
FROM items
WHERE price > (SELECT AVG(price) FROM items); <------
Outer SELECT statement

Inner SELECT statement
Result
Query 21:
SELECT cust#, custname <------------------
FROM customers
WHERE city = ( SELECT city FROM customers
WHERE custname='Shah');
Here the outer SELECT is evaluated asSELECT cust#, custnameFROM customers WHERE city = "BOMBAY"


Result
Arithmetic Expressions
+
-
*
/
( )
Arithmetic functions are allowed in SELECT and WHERE clauses.
Query 22:
SELECT descr, price, price*0.1 "discount"
FROM items
WHERE price >= 4000
ORDER BY 3;Result
Query 23:
SELECT descr
FROM items, ord_items
WHERE price*qty > 250000
and items.item# = ord_items.item#;Result
Numeric Functions
Query 24:
SELECT qty, ROUND(qty/2,0) "qty supplied"
FROM ord_items
WHERE item#='HW2';ResultQuery 25:
SELECT qty, TRUNC(qty/2,0) "qty supplied"
FROM ord_items
WHERE item#='HW2';ResultExamples of Numeric Functions
MOD(n,m)
SQRT(n)
ROUND(n,m)
TRUNC(n,m)
'm' indicates the number of digits after decimal points in the result.Date Arithemetic
Date + No. of days
Date - No. of days
Date – Date
Query 26: SELECT ord#, orddate+15 "Supply by"
FROM ord_aug;
ResultDate Functions
MONTHS_BETWEEN(date1, date2)
ADD_MONTHS(date, no. of months)
SYSDATE
Returns system date.
Query 27:
SELECT ord#,
MONTHS_BETWEEN(SYSDATE,orddate)
FROM ord_aug;ResultQuery 28:
SELECT TO_CHAR(orddate,' DD/MM/YYYY') <---
FROM ord_aug;
Converts the value of the date field orddate to character string of the format DD/MM/YYYY
Result
Note:
DD - day of month (1-31)
D - day of week (1-7)
DAY - name of day
MM - month (01-12)
MONTH - name of month
MON - abbreviated name of month
HH:MI:SS - hours:minutes:seconds
fm - fill mode : suppress blank padding

Character Expressions & Functions
- Concatenate operator
Query 29: SELECT custname ' - ' city
FROM customers;Result
Examples of Character Functions:
INITCAP(string)
UPPER(string)
LOWER(string)
SUBSTR(string,start,no. of characters)
Group Functions
Group functions are functions which act on the entire column of selected rows.
Query 30:
SELECT SUM(qty), AVG(qty) <---------------
FROM ord_items
WHERE item#='SW1';
SUM and AVG are examples of Group Functions. They compute the sum/average of qty values of all rows where item#='SW1'.
Result
Examples of Group Functions:
SUM
AVG
COUNT
MAX
MIN
Query 31:
SELECT item#, SUM(qty)
FROM ord_items
GROUP BY item#; <-------------------------

GROUP BY clause used to group rows according to the value of item# in the result. SUM function acts individually on each group of rows.
Result
Query 32:
SELECT item#, SUM(qty)
FROM ord_items
GROUP BY item#
HAVING SUM(qty)>100; <------------------


HAVING clause used to apply the condition to be applied on the grouped rows and display the final result.
Result
Query 33:
SELECT item#, SUM(qty)
FROM ord_items
GROUP BY item#
HAVING COUNT(*)>2;Result
The INSERT statement
Inserts one or more tuples in a table.
General forms:
To insert a single tuple
INSERT INTO []
VALUES ;
To insert multiple tuples
INSERT INTO []
SELECT [ ALL DISTINCT ]
FROM
*
[ WHERE ];
* - list of existing tables
Sample INSERT statements from the Case Example
Query 34: Insert all values for a new row
INSERT INTO customers <-------------------
VALUES (006, 'Krishnan', 'Madras');

Inserts a single row in Customers Table. Attribute list need not be mentioned if values are given for all attributes in the tuple.

Query 35: Insert values of item# & descr columns for a new row
INSERT INTO items (item#, descr) <----------
VALUES ('HW4', '132-DMPrinter');
Attribute list mentioned since values are not given for all attributes in the tuple. Here Price column for the newly inserted tuple takes NULL value.
Query 36: Inserts a new row which includes a date field
INSERT INTO ord_aug
VALUES(106, '31-AUG-94', 005);
Query 37: Inserts a new row with the date field being specified in non DD-MON-YY format
INSERT INTO ord_aug
VALUES (106, TO_DATE('310894','DDMMYY'), 005);
The UPDATE statement
Updates values of one or more attributes of one or more tuples in a table.
General form:
UPDATE
SET [ WHERE ];
Sample UPDATE statements from the Case Example
Query 38: changes price of itmem SW1 to 6000
UPDATE items
SET price = 6000
WHERE item# ='SW1';
Query 39: Changes a wrongly entered item# from HW2 to SW2
UPDATE ord_items
SET item# = 'SW2'
WHERE ord#=104 AND item# = 'HW2';
The DELETE statement
Deletes one or more tuples in a table according to given conditions
General form:
DELETE FROM
[ WHERE ];
Sample DELETE statements from the Case Example
Query 40: Deletes Customer record with Customer Number 004
DELETE FROM customers
WHERE cust# = 004;
DELETE FROM Ord_Items; <-------------------

Deletes all rows in Ord_Items Table. The table remains empty after the DELETE operation.
.3 DDL – CREATE, ALTER, and DROP statements.
DDL statements are those which are used to create, modify and drop the definitions or structures of various tables, views, indexes and other elements of the DBMS.
The CREATE TABLE statement
Creates a new table.
General form:
CREATE TABLE
(*);
* - table element may be attribute with its data-type and size or any integrity constraint on attributes.
Some CREATE TABLE statements on the Case Example
Query:
CREATE TABLE customers
( cust# NUMBER(6) NOT NULL,
custname CHAR(30) ,
city CHAR(20)); - This query Creates a table CUSTOMERS with 3 fields - cust#, custname and city. Cust# cannot be null
Query:
CREATE TABLE ord_sep <-------------------
AS SELECT * from ord_aug;
Creates a new table ord_sep, which has the same structure of ord_aug. The data in ord_aug is copied to the new table ord_sep.
- This query Creates table ORD_SEP as a cpy of ORD-AUG. Copies structure as well as data.
Query:
CREATE TABLE ord_sep <------------------
AS SELECT * from ord_aug
WHERE 1 = 2;
Creates a new table ord_sep, which has the same structure of ord_aug. No data in ord_aug is copied to the new table since there is no row which satisfies the 'always false' condition 1 = 2.
- This query Creates table ORD_SEP as a copy of ORD_AUG, but does not copy any data as the WHERE clause is never satisfied.
The ALTER TABLE statement
Alters the structure of an existing table.
General form:
ALTER TABLE
ADD MODIFY (Examples of ALTER TABLE statement.Query:
ALTER TABLE customers
MODIFY custname CHAR(35); <-------------

Modifies the data type/size of an attribute in the table
- This query changes the custname field to a character field of length 35. Used for modifying field lengths and attributes.
Query:
ALTER TABLE customers
ADD (phone number(8), <------------------
credit_rating char(1));
Adds two new attributes to the Customers table. Here, for existing tuples (if any), the new attribute will take NULL values since no DEFAULT value is mentioned for the attribute.
- This query adds two new fields - phone & credit_rating to the customers table.
The DROP TABLE statement
DROPS an existing table.
General form:
DROP TABLE ;
Example:
Query:
DROP TABLE ord_sep;
- The above query drops table ORD_SEP from the database
Creating & Dropping Views
A view is a virtual relation created with attributes from one or more base tables.
SELECT * FROM myview1; at any given time will evaluate the view-defining query in the CREATE VIEW statement and display the result.Query:CREATE VIEW myview1
AS SELECT
ord#, orddate, ord_aug.cust#, custname
FROM ord_aug, customers
WHERE ord_aug.cust# = customers.cust#;
- This query defines a view consisting of ord#, cust#, and custname using a join of ORD_AUG and CUSTOMERS tables.
Query:
CREATE VIEW myview2 (ItemNo, Quantity)
AS SELECT item#, qty
FROM ord_items;
- This query defines a view with columns item# and qty from the ORD_ITEMS table, and renames these columns as ItemNo. and Quantity respectively.
Query:
CREATE VIEW myview3
AS SELECT item#, descr, price
FROM items
WHERE price < 1000
WITH CHECK OPTION; <-------------------



WITH CHECK OPTION in a CREATE VIEW statement indicates that INSERTs or UPDATEs on the view will be rejected if they violate any integrity constraint implied by the view-defining query.
- This query defines the view as defined. WITH CHECK OPTION ensures that if this view is used for updation, the updated values do not cause the row to fall outside the view.Query:DROP VIEW myview1; <---- To drop a view- this query drops the view MYVIEW1
Creating & Dropping Indexes
Query: CREATE INDEX i_city <--------------------
ON customers (city);

Creates a new index named i_city. The new index file(table) will have the values of city column of Customers table
Query:
CREATE UNIQUE INDEX i_custname <------
ON customers (custname);
Creates an index which allows only unique values for custnames

Query:
CREATE INDEX i_city_custname <---------
ON customers (city, custname);
Creates an index based on two fields : city and custname
Query:
DROP INDEX i_city; <--------------------
Drops index i_city
4 DCL – GRANT and REVOKE statements.
DCL statements are those which are used to control access permissions on the tables, indexes, views and other elements of the DBMS.
Granting & Revoking Privileges
Query:
GRANT ALL <------------------
ON customers
TO ashraf;
Grants all permissions on the table customers to the user who logs in as 'ashraf'.


Query:
GRANT SELECT <--------------
ON customers
TO sunil;
Grants SELECT permission on the table customers to the user 'sunil'. User 'sunil' does not have permission to insert, update, delete or perform any other operation on customers table.

Query:
GRANT SELECT
ON customers
TO sunil
WITH GRANT OPTION; <---------



Enables user 'sunil' to give SELECT permission on customers table to other users.
Query:
REVOKE DELETE <-------------
ON customers
FROM ashraf;
Takes away DELETE permission on customers table from user 'ashraf'.

5. Recovery and Concurrency
Recovery and Concurrency in a DBMS are part of the general topic of transaction management. Hence we shall begin the discussion by examining the fundamental notion of a transaction.5.1 Transaction
A transaction is a logical unit of work.Consider the following example:
The procedure for transferring an amount of Rs. 100/- from the account of one customer to another is given. EXEC SQL WHENEVER SQLERROR GOTO UNDO EXEC SQL UPDATE DEPOSIT SET BALANCE=BALANCE-100 WHERE CUSTID=from_cust; EXEC SQL UPDATE DEPOSIT SET BALANCE=BALANCE+100 WHERE CUSTID=to_cust: EXEC SQL COMMIT; GOTO FINISHUNDO: EXEC SQL ROLLBACK;FINISH: RETURN;
Here, it has to be noted that the single operation “amount transfer” involves two database updates – updating the record of from_cust and updating the record of to_cust. In between these two updates the database is in an inconsistent (or incorrect in this example) state. i.e., if only one of the updates is performed, one cannot say by seeing the database contents whether the amount transfer operation has been done or not. Hence to guarantee database consistency it has to be ensured that either both updates are performed or none are performed. If, after one update and before the next update, something goes wrong due to problems like a system crash, an overflow error, or a violation of an integrity constraint etc., then the first update needs to be undone.
This is true with all transactions. Any transaction takes the database from one consistent state to another. It need not necessarily preserve consistency of database at all intermediate points. Hence it is important to ensure that either a transaction executes in its entirety or is totally cancelled. The set of programs which handles this forms the transaction manager in the DBMS. The transaction manager uses COMMIT and ROLLBACK operations for ensuring atomicity of transactions.
COMMIT – The COMMIT operation indicates successful completion of a transaction which means that the database is in a consistent state and all updates made by the transaction can now be made permanent. If a transaction successfully commits, then the system will guarantee that its updates will be permanently installed in the database even if the system crashes immediately after the COMMIT.
ROLLBACK – The ROLLBACK operation indicates that the transaction has been unsuccessful which means that all updates done by the transaction till then need to be undone to bring the database back to a consistent state. To help undoing the updates once done, a system log or journal is maintained by the transaction manager. The before- and after-images of the updated tuples are recorded in the log.
The properties of transaction can be summarised as ACID properties - ACID standing for atomicity, consistency, isolation and durability.
Atomicity: A transaction is atomic. Either all operations in the transaction have to be performed or none should be performed.
Consistency: Transactions preserve database consistency. i.e., A transaction transforms a consistent state of the database into another without necessarily preserving consistency at all intermediate points.
Isolation: Transactions are isolated from one another. i.e., A transaction's updates are concealed from all others until it commits (or rolls back).
Durability: Once a transaction commits, its updates survive in the database even if there is a subsequent system crash. 5.2 Recovery from System FailuresSystem failures (also called soft crashes) are those failures like power outage which affect all transactions in progress, but do not physically damage the database.
During a system failure, the contents of the main memory are lost. Thus the contents of the database buffers which contain the updates of transactions are lost. (Note: Transactions do not directly write on to the database. The updates are written to database buffers and, at regular intervals, transferred to the database.) At restart, the system has to ensure that the ACID properties of transactions are maintained and the database remains in a consistent state. To attain this, the strategy to be followed for recovery at restart is as follows:
Transactions which were in progress at the time of failure have to be undone at the time of restart. This is needed because the precise state of such a transaction which was active at the time of failure is no longer known and hence cannot be successfully completed.
Transactions which had completed prior to the crash but could not get all their updates transferred from the database buffers to the physical database have to redone at the time of restart.