SEQUENCE: A sequence is an object in oracle, which is used to generate a series of numbers. It can generate unique sequential numbers for using in a primary key column of a table.
SQL> ALTER SEQUENCE SS MAXVALUE 99999;
SQL> DROP SEQUENCE SS;
SEQUENCE: A sequence is an object in oracle, which is used to generate a series of numbers. It can generate unique sequential numbers for using in a primary key column of a table.
SQL> ALTER SEQUENCE SS MAXVALUE 99999;
SQL> DROP SEQUENCE SS;
LOCK TABLE : The LOCK TABLE command is used to prevent concurrent processes from changing a table or from using it.
1)IN SHARE MODE: In which concurrent processes are allowed to perform only
read-only operations.
2)IN EXCLUSIVE MODE:Prevents concurrent processes from performing any operation
the table.
Example:
For obtaining EXCLUSIVE LOCK we write.
If we try to obtain a lock using the first statement then Oracle waits if the table is not available for locking. In second statement it returns immediately.
Example: For obtaining SHARE LOCK we write.
SQL> LOCK TABLE STUD in SHARE MODE; --- to obtain shared mode lock