Monday 19 December 2011

Oracle Interview Questions

1. How would you determine the time zone under which a database was operating?
using SELECT dbtimezone FROM DUAL;
2. Explain the use of setting GLOBAL_NAMES equal to TRUE.
It ensure the use of consistent naming conventions for databases and links in a networked environment.
3. What command would you use to encrypt a PL/SQL application?
4. Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.
5. Explain the use of table functions.
6. Name three advisory statistics you can collect.
7. Where in the Oracle directory tree structure are audit traces placed?
8. Explain materialized views and how they are used.
9. When a user process fails, what background process cleans up after it?
It is PMON.
10. What background process refreshes materialized views?
11. How would you determine what sessions are connected and what resources they are waiting for?
12. Describe what redo logs are.
13. How would you force a log switch?
alter system switch logfile;
14. Give two methods you could use to determine what DDL changes have been made.
15. What does coalescing a tablespace do?
16. What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?
17. Name a tablespace automatically created when you create a database.
When database is created then system tablespace is created automatically.....
18. When creating a user, what permissions must you grant to allow them to connect to the database?
Grant create session to username;
19. How do you add a data file to a tablespace?
Syntax will be like this:     
       alter tablespace USERS add datafile '/ora01/oradata/users02.dbf' size 50M;
20. How do you resize a data file?
Alter database datafile '/ora01/oradata/users02.dbf' resize 100M;
21. What view would you use to look at the size of a data file?
dba_data_files
22. What view would you use to determine free space in a tablespace?
dba_free_space
23. How would you determine who has added a row to a table?
By using trigger on INSERT option
24. How can you rebuild an index?
ALTER INDEX index_name REBUILD;
25. Explain what partitioning is and what its benefit is.
A table partition is also a table segment, and by using partitioning technique we can enhance performance of table access.
26. You have just compiled a PL/SQL package but got errors, how would you view the errors?
By using ERRNAME and ERRCODE;
27. How can you gather statistics on a table?
28. How can you enable a trace for a session?
alter session set sql_trace='TRUE';
29. What is the difference between the SQL*Loader and IMPORT utilities?
SQL*LOADER loads external data which is in OS files to oracle database tables while IMPORT utility imports data only which
       is exported by EXPORT utility of oracle database.
30. Name two files used for network connection to a database.
TNSNAMES.ORA and SQLNET.ORA

No comments: