Oracle DBA Interview Questions and Answers


Oracle DBA Interview Questions and Answers

1)How many memory layers are in the shared pool?
A)Sharedpool contains 3 memory layers.

1.Library cache:
2.Data dictionary cache
3.UGA
Library cache -contains parsed sql statements cursor information execution plansdata dictionary cache -user account information priveleges information datafile segment and extent information stored into the data dictionary cache.

2)How do you find out from the RMAN catalog if a particular archive log has been backed-up?
A)

3) How can you tell how much space is left on a given file system and how much space each of the

file system's subdirectories take-up?

A) #df -k to check free space in KB
    #df -h to check free space in GB

4)Define the SGA and:

• How you would configure SGA for a mid-sized OLTP environment?
• What is involved in tuning the SGA?
A)System Global Area (SGA), which is shared by all server and background  processes and holds the following:
o Database buffer cache
o Redo log buffer
o Shared pool
o Large pool (if configured)

• Program Global Areas (PGA), which is private to each server and background process; there is one PGA for each process. The PGA holds the following:
o Stack areas
o Data areas

What is involved in tuning the SGA?
Answer :Properly size your database buffers (shared_pool, buffer cache, log buffer, etc) by looking at your buffer hit ratios. Pin large objects into memory to prevent frequent reloads
.
5)What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?
A)The cache miss ratio is the the number of cache misses compared to the total number of cache read attempts. This is calculated as follows:


Select sum(getmisses) / sum(gets) "Miss ratio" From v$rowcache;

The miss ratio should be less than 15%. If this is not the case, increase the initialisation parameter SHARED_POOL_SIZE

6)Other than making use of the statspack utility, what would you check when you are monitoring or

running a health check on an Oracle 8i or 9i database?
A)UTLBSTAT.SQL and UTLESTAT.SQL - Begin and end stats monitoring or

Oracle Enterprise Manager - Tuning Pack
TKProf

7. How do you tell what your machine name is and what is its IP addresses?

Answer
Windows: ipconfig
UNIX: ifconfig -a
HP-UX : ifconfig 1an0
Linux : ifconfig

8. How would you go about verifying the network name that the local_listener  is currently using?
Answer: With the command: Show parameter LISTENER. After executing this command in SQL, the result that you will get for HOSTNAME is the network name of the local host.

9. You have 4 instances running on the same UNIX box. How can you determine  Which shared memory and semaphores are associated with which instance?
Answer :

10. What view(s) do you use to associate a user's SQLPLUS session with his  o/s process?
Answer : v$session

11. What is the recommended interval at which to run stats pack snapshots, and why?
Answer :

12. What spfile/init.ora file parameter exists to force the CBO to make the  execution path of a given statement use an index, even if the index scan may  appear to be calculated as more costly?
Answer: optimizer_index_cost_adj

13. Assuming today is Monday, how would you use the DBMS_JOB package to  schedule the execution of a given procedure owned by SCOTT to start  Wednesday at 9AM and to run subsequently every other day at 2AM.
Answer: dbms_job.submit(
:jobno, 'statspack.snap;',
trunc(sysdate)+9/24,
'trunc(SYSDATE+1/24,''HH'')',
TRUE,
:instno);

14. How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

Answer: Use vi to edit Crontab file append a line on the file
00 2 * * * /test/test.sh

15. What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?
Answer: DBMS_STANDARD package provides language facilities that help your application interact with Oracle.
Function sql_txt (sql_text out ora_name_list_t) return binary_integer;

16. In which dictionary table or view would you look to determine at which  time a snapshot or MVIEW last successfully refreshed?
Answer: select owner, mview_name, last_refresh_type, last_refresh_date from dba_mviews;
or select * from dba_snapshot_refresh_times;

17. How would you best determine why your MVIEW couldn't FAST REFRESH?
Answer: from dba_mview_refresh_times (DBMS_MVIEW.EXPLAIN_MVIEW)

18. How does propagation differ between Advanced Replication and Snapshot  Replication (read-only)?
Answer: Advanced Replication can have multiple master sites i.e. you can update at any master site, while snapshot replication only has 1 update site

19. Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?
Answer: dba_repcatlog ; dba_repsites_new ; dba_repextensions

20. How would you begin to troubleshoot an ORA-3113 error?
Answer: End Of File on Communication Channel
The Ora-3113 error is a general error reported by Oracle client tools, which signifies that they cannot communicate with the Oracle shadow process.
Solution
• Increase permanent swap file and test with increasing larger sizes, especially if you are getting 3113 in conjunction with a very large data transfer between client and server.
• (settings -> control panel -> SYSTEM ->performance -> change)
• Sql*Net vs. Database versions mismatch
• Delete unwanted files (like core, .lst, .trc, .log etc) if your executables partition becomes full, especially $ORACLE_HOME
• Set sqlnet.expire_time = 0 in sqlnet.ora file
• If your database is running in archive log mode make sure LOG_ARCHIVE_START = TRUE is set in your init.ora file
• If you have installed Oracle parallel server option but do not have distributed Lock manager installed or running, the 3113 may be encountered
- select * from v$option;

- if you find the two conditions stated above are true, you should de-install the parallel server option. It is recomended to go through Oracle installer to de-install any product, else folow this approach.

- shutdown any Oracle instances
- %script /tmp/relink.out
- %cd $ORACLE_HOME/rdbms/lib
- %rm -f oracle
- %make -f oracle.mk no_parropt ioracle
- %exit

• Try using the SQL*Net V1 driver for local connections:

- setenv TWO_TASK P:

• Your 'Oracle' executable may be corrupt. Relink it

- shutdown any Oracle instances
- %script /tmp/relink.out
- %cd $ORACLE_HOME/rdbms/lib
- %rm -f oracle
- %make -f oracle.mk ioracle
- %exit

• Some unix platform need LD_LIBRARY_PATH to be set correctly to resolve any dynamically linked libraries problems.

• Check the SQL*Net protocol you are using drivers oracle if you are using TCP/IP it should list TCP/IP if driver command does not exists on your machine, then try

- %script /tmp/symbols.out
- %cd $ORACLE_HOME/bin
- %nm oracle
grep -i SYMBOL # where symbol can be osnptt, osnasy, osnttt, osntlitcp, osntlispx, osndnt
- %exit

21. Which dictionary tables and/or views would you look at to diagnose a  locking issue?
Answers: sys.v_$lock, sys.v_$session sys.obj$ , sys.user$ ,
sys.v_$process

22. An automatic job running via DBMS_JOB has failed. Knowing only that  "it's failed", how do you approach troubleshooting this issue?
Answers:


23. How would you extract DDL of a table without using a GUI tool?

Answers:
select dbms_metadata.get_ddl('TABLE','tab_name') from dual;


What is the recommended interval at which to run stats pack snapshots, and why?

The single most common misuse of STATSPACK is the «more is better» approach. Often STATSPACK reports spans hours or even days. The times between the snapshots (the collection points) should, in general, be measured in minutes, not hours and never days.

The STATSPACK reports we like are from 1 5-minute intervals during a busy or peak time, when the performance is at its worst. That provides a very focused look at what was going wrong at that exact moment in time. The problem with a very large STATSPACK snapshot window, where the time between the two snapshots is measured in hours, is that the events that caused serious performance issues for 20 minutes during peak processing don't look so bad when they're spread out over an 8-hour window. It's also true with STATSPACK that measuring things over too long of a period tends to level them out over time. Nothing will stand out and strike you as being wrong. So, when taking snapshots, schedule them about 15 to 30 minutes (maximum) apart. You might wait 3 or 4 hours between these two observations, but you should always do them in pairs and within minutes of each other. 24. You're getting high "busy buffer waits" - how can you find what's  causing it?


25. What query tells you how much space a tablespace named "test" is taking  up, and how much space is remaining?

Answers:

26. Database is hung. Old and new user connections alike hang on impact.  What do you do? Your SYS SQLPLUS session IS able to connect.
Answers:

27. Database crashes. Corruption is found scattered among the file system  neither of your doing nor of Oracle's. What database recovery options are available? Database is in archive log mode.
Answers:

28. Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).
Answers:

29. How do you increase the OS limitation for open files (LINUX and/or Solaris)?
Answers:

30. Provide an example of a shell script which logs into SQLPLUS as SYS,  determines the current date, changes the date format to include minutes &  seconds, issues a drop table command, displays the date again, and finally  exits.
Answers: Create a file.sh using vi then type the following line
sqlplus -s sys/*******@service_name
select sysdate from dual;
ALTER SESSION SET NLS_DATE_FORMAT='YYYY/MM/DD MI:SS'
drop table xx;
select sysdate from dual;
exit;

31. Explain how you would restore a database using RMAN to Point in Time?
Answer: Rman page no 4 – 26 --- 29

32. How does Oracle guarantee data integrity of data changes?


33. Which environment variables are absolutely critical in order to run the  OUI?
Answer: On UNIX: Oracle_Home , Path , ORA_NLS33 AND LD_LIBRARY_PATH.

34. What SQL query from v$session can you run to show how many sessions are  Logged in as a particular user account?
Answer: Select count (*) from v$session where username=’User_account_name’

35. Why does Oracle not permit the use of PCTUSED with indexes?

36. What would you use to improve performance on an insert statement that  Places millions of rows into that table?

37. What would you do with an "in-doubt" distributed transaction?

38. What are the commands you'd issue to show the explain plan for "select * from dual"?

39. In what script is "snap$" created? In what script is the "scott/tiger" schema created?
Answer :

40. If you're unsure in which script a sys or system-owned object is  created, but you know it's in a script from a specific directory, what UNIX Command from that directory structure can you run to find your answer?
Answer :

41. How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?
Answer : In tnsnames use host=DSS.icallinc.com

42. You create a private database link and upon connection, fails with: ORA-2085: connects to . What is the problem? How would you go about resolving this error?

Answer : This happens after the DB_NAME of the database was changed (as in note# 15390.1 ie re-create controfile with set database option etc ...).After This, the NAME column value is the new DB_NAME in V$DATABASE. The problem comes from the PROPS$ where GLOBAL_DB_NAME is still the old database name. So the WA is to execute the ALTER DATABASE RENAME GLOBAL_NAME (global_name=false is not a WA if global_naming is required).

43. I have my backup RMAN script called "backup_rman.sh". I am on the target database. My catalog username/password is rman/rman. My catalog db is called  rman. How would you run this shell script from the O/S such that it would  run as a background process?

Answer : backup_rman.sh >&1&

44. Explain the concept of the DUAL table.
Answer : Dual is a table which is created by oracle along with the data dictionary.  It consists of exactly one column whose name is dummy and one record.
The value of that record is X.

sql> desc dual
Name Null? Type
DUMMY VARCHAR2(1)
sql> select * from dual;
The owner of dual is SYS but dual can be accessed by every user. As dual contains exactly one row (unless someone fiddled with it),  it is guaranteed to return exactly one row in select statements if a constant expression selected against dual, such as in:
select sysdate from dual
Although it is possible to delete the one record, or insert additional records,
one really should not do that!.

45. What are the ways tablespaces can be managed and how do they differ?
Answer : 2 ways Locally Managed or Managed in the dictionary
Locally-managed tablespaces have the following advantages over dictionary-managed tablespaces:
Local management of extents avoids recursive space management operations, which can occur in dictionary-managed tablespaces if consuming or releasing space in an extent results in another operation that consumes or releases space in a rollback segment or data dictionary table.
Local management of extents automatically tracks adjacent free space, eliminating the need to coalesce free extents.

46. From the database level, how can you tell under which time zone a Database is operating?
Answer : select DBTIMEZONE from dual;

47. What's the benefit of "dbms_stats" over "analyze"?
Answer : Starting with the introduction of the dbms_stats package, Oracle provides a simple way for the Oracle professional to collect statistics for the CBO. The old-fashioned analyze table and dbms_utility methods for generating CBO statistics are obsolete and somewhat dangerous to SQL performance because they don't always capture high-quality information about tables and indexes. The CBO uses object statistics to choose the best execution plan for all SQL statements.

The dbms_stats utility does a far better job in estimating statistics, especially for large partitioned tables, and the better stats result in faster SQL execution plans.

48. Typically, where is the conventional directory structure chosen for  Oracle binaries to reside?

Answer : \oracle\ora91\bin ( windows
$Oracle_Home\

49. You have found corruption in a tablespace that contains static tables that is part of a database that is in NOARCHIVE log mode. How would you
Restore the table space without losing new data in the other table spaces?

Answer:



50. How do you recover a data file that has not been physically been backed  up since its creation and has been deleted. Provide syntax example

Answer: Assume that the file ‘/u01/ORADATA/data/data01.dbf’ of tablespace DATA is damaged and you don't have a backup of the data file.

• SVRMGRL

• SVRMGRL> connect internal

• connected

• SVRMGRL> shutdown abort

• Oracle Instance Aborted

• SVRMGRL> startup mount

• Oracle Instance Started

• SVRMGRL> alter database create datafile ‘/u01/ORADATA/data/data01.dbf’;

• Statement Processed

• SVRMGRL> recover datafile ‘/u01/ORADATA/data/data01.dbf’;

• Statement Processed

• SVRMGRL> select * from v$datafile;

• You will see a list of datafiles with their status. If the status of the concerned file has not been reset to ONLINE, issue the following command.

• SVRMGRL> alter database datafile ‘/u01/ORADATA/data/data01.dbf’ online;

• Statement Processed

• SVRMGRL> select * from dba_tablespaces;

• If the status of the tablespace CASE is not ONLINE, then issue the following command.

• SVRMGRL> alter tablespace CASE online;

• Statement Processed

• SVRMGRL> alter database




Oracle DBA Interview Questions asked by MNC

This section of http://oracledba-oracle.blogspot.com Oracle DBA Interview Questions and Answers consist of only questions asked by many MNC companies so read topics and find the answers and comment your answers below.

Please tell me right answers for these i am getting conflicting answers. Appreciate ur reply.

1. What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?

2. Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.

3. How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

4. What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?

5. In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?

6. How would you best determine why your MVIEW couldn’t FAST REFRESH?

7. How does propagation differ between Advanced Replication and Snapshot Replication (read-only)?

8. Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?

9. How would you begin to troubleshoot an ORA-3113 error?

10. Which dictionary tables and/or views would you look at to diagnose a locking issue?

11. An automatic job running via DBMS_JOB has failed. Knowing only that “it’s failed”, how do you approach troubleshooting this issue?

12. How would you extract DDL of a table without using a GUI tool?

13. You’re getting high “busy buffer waits” - how can you find what’s causing it?

14. What query tells you how much space a tablespace named “test” is taking up, and how much space is remaining?

15. Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.

16. Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracle’s. What database recovery options are available? Database is in archive log mode.

17. Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).

18. How do you increase the OS limitation for open files (LINUX and/or Solaris)?

19. Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.

20. Explain how you would restore a database using RMAN to Point in Time?

21. How does Oracle guarantee data integrity of data changes?

22. Which environment variables are absolutely critical in order to run the OUI?

23. What SQL query from v$session can you run to show how many sessions are logged in as a particular user account?

24. Why does Oracle not permit the use of PCTUSED with indexes?

25. What would you use to improve performance on an insert statement that places millions of rows into that table?

26. What would you do with an “in-doubt” distributed transaction?

27. What are the commands you’d issue to show the explain plan for “select * from dual”?

28. In what script is “snap$” created? In what script is the “scott/tiger” schema created?

29. If you’re unsure in which script a sys or system-owned object is created, but you know it’s in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

30. How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?

31. You create a private database link and upon connection, fails with: ORA-2085: connects to . What is the problem? How would you go about resolving this error?

32. I have my backup RMAN script called “backup_rman.sh”. I am on the target database. My catalog username/password is rman/rman. My catalog db is called rman. How would you run this shell script from the o/s such that it would run as a background process?

33. Explain the concept of the DUAL table.

34. What are the ways tablespaces can be managed and how do they differ?

35. From the database level, how can you tell under which time zone a database is operating?

36. What’s the benefit of “dbms_stats” over “analyze”?

37. Typically, where is the conventional directory structure chosen for Oracle binaries to reside?

38. You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

39. How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.

40. Draft one mock email requesting your non-technical management grant you downtime to (provide justification where applicable) complete the following tasks:




Oracle DBA Interview Questions by Expert 2

1. What are the different tablespaces in database?

2. How to drop the index?

3. How to drop the column in a table?

4. How to take the export and import of users level?

5. What are the new parameters in imp?

6. If the application is running very slow? At what points you need
to go about the database in order to improve the performance?

7. Specifically on Application Tuning?

8. What are the possible backups are there?

9. How to see the free spaces information in sun solaris?

10. How to find the running processes?

11. How to clone the database?

12. What is Oracle database instance?

13. What is Oracle database?

14. Name all the background processes?

15. What are LGWR, SMON, PMON, DBWR?
Explain in details?

16. What exactly happens when a user issues an UPDATE statement?

17. What are the various hit ratios in SGA? How to monitor?

18. What files form a database? Explain about control files?

19. When an UPDATE statement is very slow, what will you do?

20. What privileges are needed to connect to a database?

21. How to monitor rollback segment contention?

22. When “SNAPSHOT TOO OLD” error will occur?

23. What is the difference between logical backup and physical backup?

24. How to export Oracle tablespace?

25. What is DIRECT=Y option in export?

26. Pipe command syntax

27. How to take hot backup?

28. What third party tools, you used for sql tuning?

29. What is TRANSACTION TABLE in rollback segment?

30. What is the simplest way to collect database statistics?

31. How to generate trace file? tkprof options?

32. What is the difference between rule based optimization and
cost based optimization?

32. When will you use NESTED LOOP join and SORT MERGE join?

33. What is the difference between CHAINED ROW and MIGRATED ROW?
Rollback segment contention? How do you solve?

34. What for OPTIMAL (rollback segment) size? And tell me the syntax
how will you define it?

35. Describe the exp utility parameters andsyntax?

36. Describe the imp utility parameters and syntax?

37. Backup strategy that you followed for different clients?

38. What are the different export options?

39. How to use pipe commands in UNIX during export?

40. How to find the running processes?

41. Have you ever used any database monitoring tools?

42. If the application is running very slow? At what points you
need to go about the database in order to improve the performance?

43. How to solve the contention on Rollback segments?

44. What are the parameters you need to look at in output file (tkprof)?
How to identify that the given SQL statement is bad by looking into the
tkprof output file? How to use pipe commands in UNIX during export?

45. Tell me about your technical background?

46. What were all the problems you have faced?

47. What are the projects that you have so far involved?



Oracle DBA Interview Questions by Expert 3

1. What is the difference between the WHERE clause and the HAVING clause on a SQL statement?

2. What is SQL.BSQ?

3. What is the difference between a static and a dynamic cursor and when would you choose one over the other? Then, if they cannot answer these questions, likely I would show them to the door. But if they passed I would continue with questions reserved for those with real experience on
their resume.

4. Describe the most difficult crash and restore you have ever had to deal with in great and painful detail. If none ... out the door again or we continue with:

5. What dba_ and v$ objects should be available to developers and why?

6. Go to the whiteboard and demonstrate your knowledge of ALL ASPECTS of the Oracle Security Model.

7. Explain the difference between UNDO and ROLLBACK as implemented inOracle 9i and explain why you would use one rather than the other.

8. Then I would ask about what they would do if they received a half-dozen or so common error messages including ORA-00600 and ORA-01555
and make sure they understood multiversioning and other basic architecture matters.

9. A series of questions hardware platform related such as, if a Solaris environment, what is in /etc/system and how does it relate to Oracle.

10. Finally I'd ask how they feel about not having a life and carrying a pager 24 hours a day.

Oracle DBA Interview Questions by Expert 4

1. How many memory layers are in the shared pool?
1/3 of physical memory, can be 2/4k depending on bit of 32 or 64

2. How do you find out from the RMAN catalog if a particular archive log has been backed-up? The database should be in ARCHIVE mode if you are going to use RMAN as backup method.

3. How can you tell how much space is left on a given file system and how much space each of the file system's subdirectories take-up?

4. Define the SGA and:
• How you would configure SGA for a mid-sized OLTP environment?
• What is involved in tuning the SGA?

5. What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?

6. Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?

7. How do you tell what your machine name is and what is its IP address?

8. How would you go about verifying the network name that the local_listener is currently using?

9. You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?

10. What view(s) do you use to associate a user's SQLPLUS session with his o/s process?

11. What is the recommended interval at which to run statspack snapshots, and why?

12. What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?

13. Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.

14. How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

15. What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?

16. In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?

17. How would you best determine why your MVIEW couldn't FAST REFRESH?

18. How does propagation differ between Advanced Replication and Snapshot
Replication (read-only)?

19. Which dictionary view(s) would you first look at to
understand or get a high-level idea of a given Advanced Replication environment?

20. How would you begin to troubleshoot an ORA-03113 error?

21. Which dictionary tables and/or views would you look at to diagnose a locking issue?

22. An automatic job running via DBMS_JOB has failed. Knowing only that "it's failed", how do you approach troubleshooting this issue?

23. How would you extract DDL of a table without using a GUI tool?

24. You're getting high "busy buffer waits" - how can you find what's causing it?

25. What query tells you how much space a tablespace named "test" is taking up, and how much space is remaining?

26. Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.

27. Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracle's. What database recovery options are available? Database is in archive log mode.

28. Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).

29. How do you increase the OS limitation for open files (LINUX and/or Solaris)?

30. Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.

31. Explain how you would restore a database using RMAN to Point in Time?

32. How does Oracle guarantee data integrity of data changes?

33. Which environment variables are absolutely critical in order to run the OUI?

34. What SQL query from v$session can you run to show how many sessions are logged in as a particular user account?

35. Why does Oracle not permit the use of PCTUSED with indexes?

36. What would you use to improve performance on an insert statement that places
millions of rows into that table?
37. What would you do with an "in-doubt" distributed transaction?
38. What are the commands you'd issue to show the explain plan for "select * from dual"?
39. In what script is "snap$" created? In what script is
the "scott/tiger" schema created?
40. If you're unsure in which script a sys or system-owned object is created, but you know it's in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

41. How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?

42. You create a private database link and upon connection, fails with: ORA-2085: connects to . What is the problem? How would you go about resolving this error?

43. I have my backup RMAN script called "backup_rman.sh". I am on the target database. My catalog username/password is rman/rman. My catalog db is called rman. How would you run this shell script from the o/s such that it would run as a background process?

44. Explain the concept of the DUAL table.

45. What are the ways tablespaces can be managed and how do they differ?

46. From the database level, how can you tell under which time zone a database is operating?

47. What's the benefit of "dbms_stats" over "analyze"?

48. Typically, where is the conventional directory structure chosen for Oracle binaries to reside?

49. You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

50. How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.

51. Draft one mock email requesting your on-technical management grant you downtime to (provide justification where applicable) complete the following tasks:
(1) Generate statistics on a large table;
(2) Generate an RDA – if you don't know what an RDA is please say so.
(3) Rename datafiles.


Oracle DBA Interview Questions by Expert 5
1. Explain by one sentences, role, references, privilege on a table and profile?

2. What can trigger a snapshot to old error?

3. What are the DB files, how oracle discover them?

4. Where do you look for the trace file?

5. The following question about implementation. The answer is not a number but the way you do it.
You have got a raw partition. The size is 800M
dd if=/dev/rdsk/c.t.d.s. of=/dev/null bs=1024 819200 block.
You create one file table space what is it's maximum size available for the rollback and what is the maximum size for rollback? Explain how the extents for rollback segments are allocated?

9. How to backup a database and made a recovery of a table?

10. How do you chose your db_block_size ?

11. A database has been created with the default parameters how do you increase the
DB_BLOCK_SIZE and the DB_FILE?

12. How can you move the tablespace ROLLBACK from one disk to an other, given this information?
select segment_name , tablespace_name , status , owner from
dba_rollback_segs ;
SYSTEM SYSTEM ONLINE SYS
RBS1 ROLLBACK ONLINE PUBLIC
RBS2 ROLLBACK ONLINE PUBLIC
select tablespace_name , file_name from dba_data_files where
tablespace_name = 'ROLLBACK' ;
ROLLBACK /dev/rdsk/c0t0d0s0
New location is /dev/rdsk/c1t1d0s0

13. Estimate the size of the table? The answer is not a number but a list of steps you will use to derive this number.
create table emp ( emp_id number not null ,
name varchar2(50) not null ,
surname varchar2(50) not null,
social_number varchar2(10) ) ;
emp will contains 1000 static rows.

14. Same question but the table already exists and has one extents of 1Gbytes ?

15. How to shutdown a database in Oracle version 8i and 9i?
PRO*C

1. When you can NOT use Pro*C ? Where in your application you can use Embedded SQL?

2. Explain:
ORACA
SQLCA
SQLDA
ora-1403 OR ora-100

3. What will happen in this example?
EXEC SQL AT DB1 DECLARE CURSOR C1 AS SELECT COL1 FROM TABLE2 WHERE COL =
:VAR1 ;
EXEC SQL AT DB1 OPEN C1 ;
EXEC SQL AT DB1 FETCH C1 INTO :VAR2 ;
while ( .... )
{
EXEC SQL AT DB1 UPADTE TABLE1 SET COL1 = COL1 WHERE COL2 = :VAR ;
if ( ......)
{
}
EXEC SQL AT DB2 UPDATE TABLE1 SET COL1 = COL1 + 1 WHERE COL2 = :VAR ;
if ( ....)
{
}
EXEC SQL AT DB1 COMMIT ;
EXEC SQL AT DB2 COMMIT ;
EXEC SQL AT DB1 FETCH C1 INTO :VAR2 ;
}
EXEC SQL AT DB1 CLOSE C1 ;
...

4. How can you know a value fetch is null ?
OCI

1. Explain the following?
lda
hda

2. Translate the following logical model to a physical one tables,indexes,constraints ... )? Explain
how do you read the relation between these two entities.
A (a1 a2 a3 a4 ... an) 1,1 <-> 0,N B (b1 b2 b3 ... bm)
A (a1 a2 a3 a4 ... an) 1,1 <-> 0,1 B (b1 b2 b3 ... bm)
A (a1 a2 a3 a4 ... an) 1,1 <-> 1,N B (b1 b2 b3 ... bm)
A (a1 a2 a3 a4 ... an) 1,1 <-> 1,1 B (b1 b2 b3 ... bm)

1. Three users at a time giving the following command:
alter database backup controlfile to trace;
How can you differentiate the file using the filename itself?

2. When you execute:
alter tablespace begin backup;
How can Oracle engine can identify that the corresponding datafiles are in backupmode?

3. When exporting using filesize parameter I have generated three files. How the oracle name this three files?

4. One of my rollback segments got corrupted? How can I rectified?

5. When yesterday developer gives the following command:
select count(*) from it gives the output within minutes Today the same command takes hours? What will u check?

6. When the developer trying to compile the package. But the database gets hanged?
What will u check?

7. What is the use of query in Tkprof?

8. What is the maximum number of value allowed in parse column?

9. How can we force the query not to use the index? (Something else then a using a hint)

10. Till yesterday the query is running smoothly. But today the develper is complaining?
How will u start your tuning?

11. What is the difference between count(*) and count(1)?

12. As a Oracle DBA what are all the UNIX file you should be familar with?

No comments: