Transaction Control Language:-
- Transaction is a logic unit of work
- Whatever the changes we made to the DataBase can be referred as a Transaction.
- Whenever we perform a DML operation like select,update,insert ,delete the results will be stored in Buffer .But not in Permanent Database .
- The user Can control the transaction changes with the use of TCL Commands
2}RollBacka
3}Save Transaction
In general these
commands are used for managing the changes affecting the data.
1)Commit:-
It is used to save the work Done /Used to Make changes permanently SY:-Begin Transaction Transaction Name
2)Rollback:-
This Command is used to restore the database
to original since the last Commit.
Rollback command can only be used to Undo
transactions since last .........commit/Rollback Command was used.
SY:-Rollback Transaction Transaction Name
3)SavePoint:-
It is a mechanism to rollback portion of
transactions
In general Savepoint is used to create
points within group of transactions which to ......Rollback.
1.Exbegin transaction sampath—creating a transactionafter creating the transaction iam deleting the records likedelete from employee where empid=1delete from employee where empid=3rollback transaction sampath2.Exbegin transaction krishnainsert into employee values(3,'parveen',90000)insert into employee values(3,'krishna',22000)commit transaction krishnaselect * from employeerollback transaction krishna
Data Control Language:-
These
Sql Commands are used for providing the security to database objects.
1)Grant
2)Revoke
(1)Grant:-
This command is used for give access privileges to users for database
This command is used for give access privileges to users for database
Previleges are:-Select
,Insert,Update,Delete.
Syntax:-Grant <Previleges> on <Table Name > to <Users> [with Grant Option]Ex:-Grant select,insert on Employee to Krishnaveni
(2)Revoke:-
These
commands are Used for Withdraw access privileges to users for database.
Sy:-Revoke <Privileges > on Table Name from <users>Ex:-revoke select,insert on Employee from Krishnaveni Cascade
No comments:
Post a Comment