Вы находитесь на странице: 1из 7

Technical - UNIX

Every DBA should know something about the operating system that the database will be running on.
The questions here are related to UNIX but you should equally be able to answer questions related to
common Windows environments.

1. How do you list the files in an UNIX directory while also showing hidden files?

ls -ltra

2. How do you execute a UNIX command in the background?

Use the "&"

3. What UNIX command will control the default file permissions when files are created?

Umask

4. Explain the read, write, and execute permissions on a UNIX directory.

Read allows you to see and list the directory contents.

Write allows you to create, edit and delete files and subdirectories in the directory.

Execute gives you the previous read/write permissions plus allows you to change into the directory
and execute programs or shells from the directory.

5. the difference between a soft link and a hard link?

A symbolic (soft) linked file and the targeted file can be located on the same or different file system
while for a hard link they must be located on the same file system.

6. Give the command to display space usage on the UNIX file system.

df -lk

7. Explain iostat, vmstat and netstat.

Iostat reports on terminal, disk and tape I/O activity.

Vmstat reports on virtual memory statistics for processes, disk, tape and CPU activity.

Netstat reports on the contents of network data structures.

8. How would you change all occurrences of a value using VI?

Use :%s///g

9. Give two UNIX kernel parameters that effect an Oracle install

SHMMAX & SHMMNI


10. Briefly, how do you install Oracle software on UNIX.

Basically, set up disks, kernel parameters, and run orainst.

Question 21.: What is Log Switch?

Answer: The point at which ORACLE ends writing to one online redo log file and begins writing to
another
is called a log switch.

Question 22. What are the steps involved in Instance Recovery?

Answer: Rolling forward to recover data that has not been recorded in data files, yet has been recorded
in the on-line redo log, including the contents of rollback segments.

Rolling back transactions that have been explicitly rolled back or have not been committed as
indicated by the rollback segments regenerated in step a.
Releasing any resources (locks) held by transactions in process at the time of the failure.

Resolving any pending distributed transactions undergoing a two-phase commit at the time of
the instance failure.

Question 23. Do you need a commit after DDL statements?

Answer: DDL IS A AUTO COMMIT, YOU DON??T NEED TO COMMIT AGAIN

Question 24. How would you pass hints to the SQL processor?

Answer: USING COMMENT LINES WITH (+) SIGN YOU CAN PASS THE HINTS TO SQL
ENGINE
For example à /* +PARALLEL( ) */

Question 25. what is the difference between group by and order by?

Answer: group by is used when we use aggregate functions on the columns in a query the other
columns should be in group by query
example:

select empno,ename,sum(sal) from emp


group by empno,ename

Order by is used to sort values either in ascending or descending order


Question 26. A DBA had to remove some Archivelogs to free up space in filesystem. Now when
the RMAN job starts to backup Archivelogs, it complains about missing Archivelogs that were
deleted by DBA. To resolve the issue and continue backing up remainder of Archivelogs, which
RMAN command can be used so it won't complain about missing Archivelogs.

Answer: Crosscheck command

Question 27. Which RMAN command is used to create an exact replica of a database in new
host?

Answer: DUPLICATE DATABASE

Question 28. How do you install Statspack?

Answer: By running $ORACLE_HOME/rdbms/admin/spcreate.sql script

Question 29. Process you follow to start looking into Performance issue at database level (If the
application is running very slow, at what points do you need to go about the database in order to
improve the performance?)

Answer:
· Run a TOP command in Unix to see CPU usage (identify CPU killer processes)
· Run VMSTAT, SAR, and PRSTAT command to get more information on CPU and memory usage
and possible blocking
· Run STATSPACK report to identify:

1. TOP 5 WAIT EVENTS


2. RESOURCE intensive SQL statements
· See if STATISTICS on affected tables needs to be re-generated
· IF poorly written statements are culprit, run a EXPLAIN PLAN on these statements and see whether
new index or use of HINT brings the cost of SQL down.

Question 30. Explain below wait events in STATSPACK report DB SCATTERED READ, DB
SEQUENTIAL REAL, ENQUEUE

Answer: DB SCATTERED READ - FULL TABLE SCAN


DB SEQUENTIAL REAL - IO
ENQUEUE - LOCKING

Question 31. List five most important parameter in 9i affecting performance

Answer: CURSOR_SHARING
DB_CACHE_SIZE
PGA_AGGREGATE_TARGET
DB_16K_CACHE_SIZE, DB_8K_CACHE_SIZE, DB_2K_CACHE_SIZE
Question 32. What is PGA_AGGREGATE_TARGET?

Answer: This parameter controls the maximum amount of memory PGA which can be used by the
queries
when WORKAREA_SIZE_POLICY is set to Auto.
The value you can be set in Bytes, kilobytes (K), megabytes (M) or gigabytes (G). The default
value is 0
This parameter also has an effect on the execution plans of the cost based optimizer. The
optimizer uses the value of the parameter PGA_AGGREGATE_TARGET to derive an estimate
for the minimum and maximum amount of memory which should be available at run-time for each
sort, hash-join and bitmap operator in the query. Based on this minimum and maximum value, the
optimizer selects the best plan.

Question 33. How do you analyze table partition using Oracle provided package?

Answer: DBMS_STATS.GATHER_TABLE_STATS with GRANULARITY => 'PARTITION'


OPTION

Question 34. You see a wait on LMS process in statspack, what does that mean?

Answer: A. Wait is due to Data Guard Broker.

Question 35. Name three advisory statistics you can collect.

Answer: SHARED_POOL_ADVICE
PGA_TARGET_ADVICE
DB_CACHE_ADVICE

Question 36. Explain procedure to Change CHARACTERSET of a database.

Answer: Can't change CHARACTERSET of a database, you will need to re-create the database with
appropriate CHARACTERSET.

Question 37. If you had a tablespace, TEST_TABLESPACE, which consists of three files:
TEST01.dbf, TEST02.dbf, and TEST03.dbf, and someone accidentally used the Unix command
"rm" to delete the file TEST02.dbf, what else would you need in order to recover all the data
that
was present in TEST_TABLESPACE at the time that TEST02.dbf was deleted?

Answer: All Archivelogs

Question 38. How do you put database is ARCHIVELOG mode, explain procedure
Answer:
1. Modify init.ora parameter START_ARCHIVE=TRUE
2. SQL> SHUTDOWN IMMEDIATE;
3. STARTUP MOUNT;
4. ALTER DATAVASE ARCHIVELOG;
5. ALTER DATABASE OPEN;

Question 39. How can you tell if an index on particular table is USED or NOT USED in 9i?

Answer: By turning MONITORING ON that index and querying into INDEX_USAGE table

Question 40. Explain FORCE LOGGING feature in 9i.

Answer: By setting FORCE LOGGING to TRUE, all transactions will generate REDO. This is used
for Data Guard, so no data will be missed (i.e. transactions that were run with NOLOGGING option)
in Standby database

In many Oracle DBA interviews many questions are asked relating to Unix. Here I have
collected some common Interviews questions asked to a DBA relating to Unix
environment. These questions are mostly asked for senior Oracle DBA positions. I have
compiled these questions based upon the feedback I got from many candidates who have
attended interviews in various MNC'

1. How do you see how many instances are running?

2. How do you automate starting and shutting down of databases in Unix?

3. You have written a script to take backups. How do you make it run automatically every week?

4. What is OERR utility?

5. How do you see Virtual Memory Statistics in Linux?

6. How do you see how much hard disk space is free in Linux?

7. What is SAR?

8. What is SHMMAX?

9. Swap partition must be how much the size of RAM?

10. What is DISM in Solaris?

11. How do you see how many memory segments are acquired by Oracle Instances?

12. How do you see which segment belongs to which database instances?

13. What is VMSTAT?


14. How do you set Kernel Parameters in Red Hat Linux, AIX and Solaris?

15. How do you remove Memory segments?

16. What is the difference between Soft Link and Hard Link?

17. What is stored in oratab file?

18. How do you see how many processes are running in Unix?

19. How do you kill a process in Unix?

20. Can you change priority of a Process in Unix?

Personal

1. What DBA activities did you to do today?


2. What is your typical day like?
3. What other parts of your organization do you interact with and how?
4. Do you consider yourself a development DBA or a production DBA and why?
5. Are you a nuts-n-bolts DBA or a tools-n-props DBA

Technical - Oracle

1. Explain the difference between a hot backup and a cold backup and the benefits
associated with each
2. You have just had to restore from backup and do not have any control files. How would
you go about bringing up this database?
3. How do you switch from an init.ora file to a spfile?
4. Explain the difference between a data block, an extent and a segment.
5. Give two examples of how you might determine the structure of the table DEPT.
6. Where would you look for errors from the database engine?
7. Compare and contrast TRUNCATE and DELETE for a table.
8. Give the reasoning behind using an index.
9. Give the two types of tables involved in producing a star schema and the type of data they
hold.
10. . What type of index should you use on a fact table?
11. . Give two examples of referential integrity constraints.
12. A table is classified as a parent table and you want to drop and re-create it. How would
you do this without affecting the children tables?
13. Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the
benefits and disadvantages to each.
14. What command would you use to create a backup control file?
15. Give the stages of instance startup to a usable state where normal users may access it.
16. What column differentiates the V$ views to the GV$ views and how?
17. How would you go about generating an EXPLAIN plan?
18. How would you go about increasing the buffer cache hit ratio?
19. Explain an ORA-01555
20. Explain the difference between $ORACLE_HOME and $ORACLE_BASE.
21. How would you determine the time zone under which a database was operating?
22. Explain the use of setting GLOBAL_NAMES equal to TRUE.
23. What command would you use to encrypt a PL/SQL application?
24. Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.
25. Explain the use of table functions.
26. Name three advisory statistics you can collect.
27. Where in the Oracle directory tree structure are audit traces placed?
28. Explain materialized views and how they are used.
29. When a user process fails, what background process cleans up after it?
30. What background process refreshes materialized views?
31. How would you determine what sessions are connected and what resources they are
waiting for?
32. Describe what redo logs are.
33. How would you force a log switch?
34. Give two methods you could use to determine what DDL changes have been made.
35. What does coalescing a tablespace do?
36. What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?
37. Name a tablespace automatically created when you create a database.
38. When creating a user, what permissions must you grant to allow them to connect to the
database?
39. How do you add a data file to a tablespace?
40. How do you resize a data file?
41. What view would you use to look at the size of a data file?
42. What view would you use to determine free space in a tablespace?
43. How would you determine who has added a row to a table?
44. How can you rebuild an index?
45. Explain what partitioning is and what its benefit is.
46. You have just compiled a PL/SQL package but got errors, how would you view the errors?
47. How can you gather statistics on a table?
48. How can you enable a trace for a session?
49. What is the difference between the SQL*Loader and IMPORT utilities?
50. Name two files used for network connection to a database.

Technical - UNIX

1. How do you list the files in an UNIX directory while also showing hidden files?
2. How do you execute a UNIX command in the background?
3. What UNIX command will control the default file permissions when files are created?
4. Explain the read, write, and execute permissions on a UNIX directory.
5. What is the difference between a soft link and a hard link?
6. Give the command to display space usage on the UNIX file system.
7. Explain iostat, vmstat and netstat.
8. How would you change all occurrences of a value using VI?
9. Give two UNIX kernel parameters that effect an Oracle install
10. Briefly, how do you install Oracle software on UNIX.

Вам также может понравиться