Oracle 面试宝典 - 2
1. How would you determine the time zone under which a database was operating?
- 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?
- WRAP
4. Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.
- They are all named PL/SQL blocks.
- Function must return a value. Can be called inside a query.
- Procedure may or may not return value.
- Package is the collection of functions, procedures, variables which can be logically grouped together.
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?
- PMON
10. What background process refreshes materialized views?
- Job Queue Process (CJQ)
11. How would you determine what sessions are connected and what resources they are waiting for?
- v$session,v$session_wait
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?
- Coalesce simply takes contigous free extents and makes them into a single bigger free extent.
16. What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?
- TEMP tablespace gets cleared once the transaction is done where as PERMANENT tablespace retails the data.
17. Name a tablespace automatically created when you create a database.
- SYSTEM
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?
- 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 implementing an INSERT trigger for logging details during each INSERT operation on the table
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?
- show errors
27. How can you gather statistics on a table?
- exec dbms_stats.gather_table_stats
- Also, remember to analyze all associated indexes on that table using dbms_stats.gather_index_stats
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
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。