In: Computer Science
1. Explain why a transaction may have many cursors. Also, how is it possible that a transaction may have more than one cursor on a given table? Support your answer with example.
2. After a DBMS has been selected, what is the DBA’s role in DBMS maintenance?
3. Do you think, splitting a table might improve performance? Why/why not.
1)
Multiple Cursors
A cursor is a pointer into a set or rows. A transaction can use two or more cursors either in sequence or at the same time to execute different query or a transaction. one or more cursor also uses considerably memory. It is possible to declare more cursors for a same table. The transaction table can open more than on cursor. When one cursor closes, another cursor opens or when both the cursor opens at a time they may close at the same time or different place.
Example:
DECLARE CURSOR1
OPEN CURSOR 1
SELECT ' FROM Employee
CLOSE CURSOR1
DECLARE CURSOR2
OPEN CURSOR2
SELECT ' FROM Employee WHERE Salary >1ooo
CLOSE CURSOR2
In the examples given above, two cursors such as CURSOR1 and CURSOR2 are declared.
Then CURSOR1 opens and fetch the rows from Employee table.
Now, CURSOR1 closed and CURSOR2 opens. CURSOR2 will fetch all the rows from the
Employee table whose salary is more than 1000.
2)
The DBA role’s in DBMS maintenance:
DBA is responsible for all the maintenance activity related to database.
DBA is basically an administrator who maintains the Database.
The DBA plays a major role in DBMS maintenance.
The DBA installs the DBMS as per the need of the organization.
The DBA Changes the DBMS configuration, installation as per the requirement.
DBA maintain the DBMS, installs update, review security threat, monitor the database provide
access and grants to the user.
Every time a new version or a DBMS is releases by the vendor, it is the responsibility or DBA
who reviews and determines whether the organization should upgrade to it or not.
The DBA also need to handle any fixes to the problems in the DBMS that is released by the
vendor. If a problem occurs to affecting the database; the DBA coordinates with the required
people to resolve the issue.