Tuesday, 10 September 2013

Oracle DBA Interview Questions and Answers -2



Page-2

16:  In linux, how can we change which databases are started during a reboot?
A:   Edit /etc/oratab

17:  When a user process fails, what Oracle background process will clean after it?
A :   PMON

18: How can you reduce the space of TEMP datafile?
A: Prior to Oracle 11g, you had to recreate the datafile. In Oracle 11g a new feature was introduced, and you can shrink the TEMP tablespace.

19: How can you view all the current users connected in your database in this moment?
A: SELECT COUNT(*) USERNAME FROM V$SESSION GROUP BY USERNAME;

20: Explain the differences between  shutdown immediate, shutdown normal, shutdown abort?
A:  SHUTDOWN NORMAL: It waits for all sessions to end, without allowing new connections.
      SHUTDOWN IMMEDIATE : Rollback current transactions and terminates every session.
      SHUTDOWN ABORT : Aborts all the sessions, leaving the database in an inconsistent state. It’s the   fastest method, but can lead to database corruption.

21: Is it possible to backup your database without the use of an RMAN database to store the catalog?
A:  Yes, but the catalog would be stored in the controlfile.

22: What command will you use to navigate through ASM files?
A: asmcmd

23: Which one is faster: D2ELETE or TRUNCATE?
A: TRUNCATE

24: Are passwords in oracle case sensitive?
A: Only since Oracle 11g.

25: Explain the difference between a hot backup and a cold backup and the benefits associated with each.
A : hot backup is basically taking a backup of the database while it is still up and running and it must be in   archive log mode. A cold backup is taking a backup of the database while it is shut down and does not require being in archive logmode. The benefit of taking a hot backup is that the database is still available for use while the backup is occurring and you can recover the database to any point in time. The benefit of taking a cold backup is that it is typically easier to administer the backup and recovery process. In addition, since you are taking cold backups the database does not require being in archive log mode and thus there will be a slight performance gain as the database is not cutting archive logs to disk.

26: You have just had to restore from backup and do not have any control files. How would you go about  bringing up this database?
A: I would create a text based backup control file, stipulating where on disk all the data files were and then issue the recover command with the using backup control file clause.

27: How do you switch from an init.ora file to a spfile?
A: Issue the create spfile from pfile command.

28: Explain the difference between a data block, an extent and a segment.
A: data block is the smallest unit of logical storage for a database object. As objects grow they take chunks of additional storage that are composed of contiguous data blocks. These groupings of contiguous data blocks are called extents. All the extents that an object takes when grouped together are considered the segment of the database object.

29: Compare and contrast TRUNCATE and DELETE for a table.
A : Both the truncate and delete command have the desired outcome of getting rid of all the rows in a table. The difference between the two is that the truncate command is a DDL operation and just moves the high water mark and produces few rollback data. The delete command, on the other hand, is a DML operation, which will produce rollback data and thus take longer to complete.

30: Give the reasoning behind using an index.
A : Faster access to data blocks in a table.


No comments:

Post a Comment

Ask your Questions....