CS-6014 Submitted

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Student Declaration

I__Muhammad Aheed Hashmi__ Registration No.__18-Arid-4033_, hereby declare that by


attempting the paper for the course Data Base Administration and Management, I will not be
involved in any kind of cheating/copying/plagiarizing in solving the short questions based
paper of Final Term Examination Spring 2021. I take full responsibility of my conduct. If I
found involved in any kind of such activity of cheating/copying/plagiarizing, then Institute
reserves the right to take any disciplinary action against me.

AHEED
Student Signature
Final Exam / Spring 2021 (Paper Duration 24 hours)
(Online Assignment Based Question Paper)

Course No.: CS-601 Course Title: Data Base Administration and Management
Total Marks: 20 Date of Exams:
Degree:BSIT Semester: 6th Section:
Marks
Q.No. 1 2 3 4 5 6 7 8 9 10 Obtained/
Total Marks
Marks
Obtaine
d
Obtained Marks in Words:
Name of the Teacher: HINA UMBRIN
Who taught the course: Signature of Teacher / Examiner:

To be filled by Student

Registration No.: 18-Arid-4033 Name: Muhammad Aheed Hashmi

(PRACTICAL EXAMINATION)

Answer the following questions


Q.No.1. Consider the concurrent (parallel) schedules given below. Let us suppose A = 5000

and B = 1000,In such cases we can permit the transactions that are trying to access the same
data items in serial order. Or we can permit the transactions as they are if they produce the
same result as a serial execution or not serializable. Prove that with the help of data.

Transaction Transaction T2
T1
read(A);
A := A +500;
write(A);
read(A);
temp := A * 0.2;
A := A + temp;
write(A);
read(B);
B := B + 500;
write(B); read(B);
B := B + temp;
write(B);

Transaction T1 Transaction T2
read(A);
temp := A * 0.2;
A := A – temp;
write(A);
read(B);
B := B + temp;
write(B);

read(A);
A := A+500;
write(A);
read(B);
B := B + 500;
write(B);
(Marks 12)
Answer:

Transaction T1 Transaction T2
read(A); 5000
A: = A +500; 5500
write(A); 5500
read(A); 5500
temp: = A * 0.2; 1100
A: = A + temp; 6600
write(A);6600

read(B); 1000
B: = B + 500; 1500
write(B); 1500 read(B); 1500
B: = B + temp; 2600
write(B);
2600

We perform all the transaction so the value of A, in the end, is 6600 And the value of B, in
the end, is 2600.
Transaction T1 Transaction T2
read(A); 5000
temp: = A * 0.2;
1000
A: = A – temp; 4000
write(A); 4000

read(B);1000
read(A); 4000 B: = B + temp; 2000
A: = A+500; 4500 write(B); 2000
write(A); 4500

read(B); 2000
B: = B + 500; 2500
write(B); 2500

We perform all the transaction so the value of A, in the end, is 6500 And the value of B, in
the end, is 2500.
Results
All the transaction we get to know that the result of both concurrent schedules are not the
same so it is not serializable.

Q.No.2. Write down the different methods for shut down a to shut down the oracle database

(Marks 08)
Answer:

To initiate database shutdown, use the SQL*Plus SHUTDOWN command. Control is not


returned to the session that initiates a database shutdown until shutdown is complete. Users
who attempt connections while a shutdown is in progress receive a message like the
following:

ORA-01090: shutdown in progress - connection is not permitted

To shut down a database and instance, you must first connect as SYSOPER or SYSDBA.
There are several modes for shutting down a database. These are discussed in the following
sections:

 Shutting Down with the NORMAL Clause


 Shutting Down with the IMMEDIATE Clause
 Shutting Down with the TRANSACTIONAL Clause
 Shutting Down with the ABORT Clause
Some shutdown modes wait for certain events to occur (such as transactions completing
or users disconnecting) before actually bringing down the database. There is a one-hour
timeout period for these events. This timeout behavior is discussed in this additional section:

Shutdown Timeout

1. Shutting Down with the NORMAL Clause

To shut down a database in normal situations, use the SHUTDOWN command with


the NORMAL clause:

SHUTDOWN NORMAL

The NORMAL clause is optional, because this is the default shutdown method if no clause is


provided.

Normal database shutdown proceeds with the following conditions:

No new connections are allowed after the statement is issued.

Before the database is shut down, the database waits for all currently connected users to
disconnect from the database.

The next startup of the database will not require any instance recovery procedures.

2. Shutting Down with the IMMEDIATE Clause

Use immediate database shutdown only in the following situations:

 To initiate an automated and unattended backup


 When a power shutdown is going to occur soon
 When the database or one of its applications is functioning irregularly and you cannot
contact users to ask them to log off or they are unable to log off

To shut down a database immediately, use the SHUTDOWN command with

the IMMEDIATE clause:

SHUTDOWN IMMEDIATE

Immediate database shutdown proceeds with the following conditions:

 No new connections are allowed, nor are new transactions allowed to be started, after the
statement is issued.
 Any uncommitted transactions are rolled back. (If long uncommitted transactions exist,
this method of shutdown might not complete quickly, despite its name.)
 Oracle Database does not wait for users currently connected to the database to disconnect.
The database implicitly rolls back active transactions and disconnects all connected users.
 The next startup of the database will not require any instance recovery procedures.
3. Shutting Down with the TRANSACTIONAL Clause

When you want to perform a planned shutdown of an instance while allowing active
transactions to complete first, use the SHUTDOWN command with

the TRANSACTIONAL clause:

SHUTDOWN TRANSACTIONAL

Transactional database shutdown proceeds with the following conditions:

 No new connections are allowed, nor are new transactions allowed to be started, after the
statement is issued.
 After all transactions have completed, any client still connected to the instance is
disconnected.
 At this point, the instance shuts down just as it would when a SHUTDOWN
IMMEDIATE statement is submitted.

The next startup of the database will not require any instance recovery procedures.

A transactional shutdown prevents clients from losing work, and at the same time, does not
require all users to log off.

4. Shutting Down with the ABORT Clause

You can shut down a database instantaneously by aborting the database instance. If possible,
perform this type of shutdown only in the following situations:

The database or one of its applications is functioning irregularly and none of the other types
of shutdown works.

 You need to shut down the database instantaneously (for example, if you know a power
shutdown is going to occur in one minute).
 You experience problems when starting a database instance.

When you must do a database shutdown by aborting transactions and user connections, issue
the SHUTDOWN command with the ABORT clause:
SHUTDOWN ABORT

An aborted database shutdown proceeds with the following conditions:

 No new connections are allowed, nor are new transactions allowed to be started, after the
statement is issued.
 Current client SQL statements being processed by Oracle Database are immediately
terminated.
 Uncommitted transactions are not rolled back.
 Oracle Database does not wait for users currently connected to the database to disconnect.
The database implicitly disconnects all connected users.

The next startup of the database will require instance recovery procedures.

Shutdown Timeout

Shutdown modes that wait for users to disconnect or for transactions to complete have a limit
on the amount of time that they wait. If all events blocking the shutdown do not occur within
one hour, the shutdown command cancels with the following message: ORA-01013: user
requested cancel of current operation.

You might also like