Oracle面试题

上一篇 / 下一篇  2008-03-02 17:47:22 / 个人分类:一般分类

1. Explain the difference between a hot backup and a cold backup and the benefits associated with each.N6O|?艂]? 
?凲觡?? 
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 log mode. 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.庈8L翃 
?p?lt;m2?? 
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?@wBrri 7 
t?-g? 
I would create a text based backup control file, stipulating where on disk all the data files where and then issue the recover command with the using backup control file clause.p懅?輥q 
瀣z7豦傋8 
3. How do you switch from an init.ora file to a spfile? FBD}? 
揧k羊畻*? 
Issue the create spfile from pfile command.tYq昖异m? 
|镕9倿胸? 
4. Explain the difference between a data block, an extent and a segment.?烉阊)H_? 
Yx侪憛? 
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.?颣衣? 
敚诉鳞?lt;T 
5. Give two examples of how you might determine the structure of the table DEPT.?╳韓贵 
儒儮?H#搐 
Use the describe command or use the dbms_metadata.get_ddl package.?廸寣簸? 
絭)燓?b? 
6. Where would you look for errors from the database engine?A/磑a踎耴_ 
z剙f跃 j? 
In the alert log.7姖穡m? 
?)0WN?@5 
7. Compare and contrast TRUNCATE and DELETE for a table.?妯鰵c 
?肹ZX净{ 
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 a now rollback. The delete command, on the other hand, is a DML operation, which will produce a rollback and thus take longer to complete.[究┫?? 
w2@蚵y? 
8. Give the reasoning behind using an index.L0n?oI^? 
产#?鉸 
Faster access to data blocks in a table.盶GF-钱餤? 
?1搽廨?? 
9. Give the two types of tables involved in producing a star schema and the type of data they hold.X稯貝鈌~? 
呮*䴓`& 
Fact tables and dimension tables. A fact table contains measurements while dimension tables will contain data that will help describe the fact tables.,7銇⑴Q? 
=?`R?? 
10. . What type of index should you use on a fact table?J?Z]^? 
臏炌烻r] 
A Bitmap index.?簺还? 
?丹〗雖鸜 
11. Give two examples of referential integrity constraints.觲?絜谇_ 
c?腇景 
A primary key and a foreign key.?|t畺曙 
??壂O&じ 
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??纟?囌X? 
颃怟` 7? 
Disable the foreign key constraint to the parent, drop the table, re-create the table, enable the foreign key constraint.蒔P俀淿j题 
^W3粶葾 
13. Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each.B翜譻迆c 
p 奆揆?? 
ARCHIVELOG mode is a mode that you can put the database in for creating a backup of all transactions that have occurred in the database so that you can recover to any point in time. NOARCHIVELOG mode is basically the absence of ARCHIVELOG mode and has the disadvantage of not being able to recover to any point in time. NOARCHIVELOG mode does have the advantage of not having to write transactions to an archive log and thus increases the performance of the database slightly.鍆Jyi 
镒tj寂 
14. What command would you use to create a backup control file?q嵳洹?颂 
茱}VXB?燂? 
Alter database backup control file to trace.齏鑁?篙J6 
喍稞R'餛 
15. Give the stages of instance startup to a usable state where normal users may access it.P鴯绛趪) 
5?謚e>i 
STARTUP NOMOUNT - Instance startup~FO;? 
?C屩HpzP? 
STARTUP MOUNT - The database is mounted[躇?s;T濧 
? 魫垳? 
STARTUP OPEN - The database is opened刳a#c吜头? 
瘨-聄J婛冖 
16. What column differentiates the V$ views to the GV$ views and how?XO聓槲翦 
楯銜嬮卛2 
The INST_ID column which indicates the instance in a RAC environment the information came from.с*攎d\? 
e働?哃:Hn 
17. How would you go about generating an EXPLAIN plan?m1?P僞沆 
??岧匪话 
Create a plan table with utlxplan.sql.^?]郲Y|戒 
Xb桹r话? 
Use the explain plan set statement_id = 'tst1' into plan_table for a SQL statementq鼉J皍?m 
m刻絢5?? 
Look at the explain plan with utlxplp.sql or utlxpls.sql猘尺re赎u? 
現%鱍铙? 
18. How would you go about increasing the buffer cache hit ratio?惙嗻郿2? 
, $缫?? 
Use the buffer cache advisory over a given workload and then query the v$db_cache_advice table. If a change was necessary then I would use the alter system set db_cache_size command.JQ`}鮭 
Q$芩6lz? 
19. Explain an ORA-01555V"|靳@柱 
_?偳\ %榿 
You get this error when you get a snapshot too old within rollback. It can usually be solved by increasing the undo retention or increasing the size of rollbacks. You should also look at the logic involved in the application getting the error message.闑舎??L? 
?琅ā?- 
20. Explain the difference between $ORACLE_HOME and $ORACLE_BASE.宜 畘4伉? 
?罖)3细箧 
ORACLE_BASE is the root directory for oracle. ORACLE_HOME located beneath ORACLE_BASE is where the oracle products reside.扈j/譕x? 
!P?鸨y犵 
w飾邤xGs 
21. How would you determine the time zone under which a database was operating?J悟?Z餄 
坪? 蓸洦? 
select DBTIMEZONE from dual;&H叞脝t汜? 
22. Explain the use of setting GLOBAL_NAMES equal to TRUE.??d?鰱? 
-垌檳yb 
Setting GLOBAL_NAMES dictates how you might connect to a database. This variable is either TRUE or FALSE and if it is set to TRUE it enforces database links to have the same name as the remote database to which they are linking.玌V妉" ? 
?x筯给a 
23. What command would you use to encrypt a PL/SQL application?衂,?q#蛴 
鳦?R ?? 
WRAP嵇+j?x 
!y NuhB 
24. Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.?9諾o醅tw 
???W4迒 
A function and procedure are the same in that they are intended to be a collection of PL/SQL code that carries a single task. While a procedure does not have to return any values to the calling application, a function will return a single value. A package on the other hand is a collection of functions and procedures that are grouped together based on their commonality to a business function or application.:h{?d\ 
:?垥? 
25. Explain the use of table functions.?懾?cY? 
5=瀒K願=? 
Table functions are designed to return a set of rows through PL/SQL logic but are intended to be used as a normal table or view in a SQL statement. They are also used to pipeline information in an ETL process.J7W?c ? 
瞗徧E漱峥 
26. Name three advisory statistics you can collect.恦v敺? 
?7?t?? 
Buffer Cache Advice, Segment Level Statistics, & Timed StatisticsX匂d箖? 
ゆ石℡e?? 
27. Where in the Oracle directory tree structure are audit traces placed??uw谦振$? 
+陜璹楅\阨 
In unix $ORACLE_HOME/rdbms/audit, in Windows the event viewer?彣嵄差? 
K幻?鄆H卜 
28. Explain materialized views and how they are used.v?\??? 
z Wヶ ] 
Materialized views are objects that are reduced sets of information that have been summarized, grouped, or aggregated from base tables. They are typically used in data warehouse or decision support systems.-俍洺味< 
轲论邿6 
29. When a user process fails, what background process cleans up after it?鄹..Ab纛p 
s萪U嫩骦 
PMONW*溎@? 
濻娗U栴磝 
30. What background process refreshes materialized views?"?;?P 
^?>?gS壷 
The Job Queue Processes.霬KT肯棙? 
椄`z#? 
31. How would you determine what sessions are connected and what resources they are waiting for?鐘5远?騧 
'8??y ? 
Use of V$SESSION and V$SESSION_WAIT?q韕磢?? 
趍/|簪梢呇 
32. Describe what redo logs are.垭譝]鏁? 
继j?8跑Q 
Redo logs are logical and physical structures that are designed to hold all the changes made to a database and are intended to aid in the recovery of a database.墑&T?o? 
b哩?竿? 
33. How would you force a log switch?坳韑飲喌毙 
琔苐`$8崣? 
ALTER SYSTEM SWITCH LOGFILE;謵|??" 
34. Give two methods you could use to determine what DDL changes have been made.囸z,%9g@? 
&夓?&A 
You could use Logminer or Streams?奡稡9?? 
Ji6妆?S\ 
35. What does coalescing a tablespace do??傌鑼垎U 
LM校.铜? 
Coalescing is only valid for dictionary-managed tablespaces and de-fragments space by combining neighboring free extents into large single extents.?F趱暘 
庐?嫊髿饤 
36. What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?嵗{?E0 2X 
湏譢* 
A temporary tablespace is used for temporary objects such as sort structures while permanent tablespaces are used to store those objects meant to be used as the true objects of the database.唢榳Q1lq 
岎4Y蘰皴 
37. Name a tablespace automatically created when you create a database.I?曬:1? 
D欸?[p? 
The SYSTEM tablespace.濻!?Wi\ 
?錣&`}甔笻 
38. When creating a user, what permissions must you grant to allow them to connect to the database??杄_3跍YE 
(vv2"?* 
Grant the CONNECT to the user.+窚?0[巈? 
`k羗跭钴E 
39. How do you add a data file to a tablespace?謭坌B?娏7 
隠h箶蜮煺 
ALTER TABLESPACE <tablespace_name> ADD DATAFILE <datafile_name> SIZE <size>o碇埑QK荙? 
40. How do you resize a data file?K橑茷?? 
f 3固o7? 
ALTER DATABASE DATAFILE <datafile_name> RESIZE <new_size>;?4?書?$ 
41. What view would you use to look at the size of a data file?酡択@\? 
銕x斨3?? 
DBA_DATA_FILES尹圯A裩B丟 
42. What view would you use to determine free space in a tablespace?YbU?h? 
x??鎑?? 
DBA_FREE_SPACE?u";^阑h? 
43. How would you determine who has added a row to a table?爌x?&馄囷 
B?昜?P 
Turn on fine grain auditing for the table.鼾?][鍝 
9绝跸镻? 
44. How can you rebuild an index?Hwy流?? 
瘕TOe忼栗( 
ALTER INDEX <index_name> REBUILD;py!A?? 
45. Explain what partitioning is and what its benefit is.V7蝙??? 
爤U 0?? 
Partitioning is a method of taking large tables and indexes and splitting them into smaller, more manageable pieces.柣R?1? 
S?i慺? 
46. You have just compiled a PL/SQL package but got errors, how would you view the errors?咇?7s陱⿻ 
?!?_镚? 
SHOW ERRORS?硃a栠樖 
47. How can you gather statistics on a table?蘚偏v<>? 
畊??Y?9 
The ANALYZE command.5莹1犐嶖? 
??軾撼? 
48. How can you enable a trace for a session?腔??lt;唅 
秦pij" g 
Use the DBMS_SESSION.SET_SQL_TRACE orv?琿+樀? 
k0囗?? 
Use ALTER SESSION SET SQL_TRACE = TRUE;<獐u&UK\ 
?lt;?兺遴 
49. What is the difference between the SQL*Loader and IMPORT utilities?DB.#憭櫋P? 
覽調殑撨? 
These two Oracle utilities are used for loading data into the database. The difference is that the import utility relies on the data being produced by another Oracle utility EXPORT while the SQL*Loader utility allows data to be loaded that has been produced by other utilities from different data sources just so long as it conforms to ASCII formatted or delimited files.齬8Aё査( 
曢U?驻轥 
50. Name two files used for network connection to a database.熲IYMs?d 
?渀`?? 
TNSNAMES.ORA and SQLNET.ORA闿谶"炃鲒? 
蜜够T癌) 
Technical – UNIX穂??镌y 
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.鄼髂C?2 
9wg-壬苅A? 
1. How do you list the files in an UNIX directory while also showing hidden files?躃避呃z瀋 
&=鍥倓b兆6 
ls -ltra栦牗辪搯翀 
2. How do you execute a UNIX command in the background???;蚟 
哖kX蕎?? 
Use the "&"Ms蓐V*?? 
7叭箕;~篡? 
3. What UNIX command will control the default file permissions when files are created?喈姨Y縱亸 
挑权?} 
Umask!5?&蝇A媒 
劐I?c箕q? 
4. Explain the read, write, and execute permissions on a UNIX directory.駧<m庈Q9敐 
鷺h懻巭h? 
Read allows you to see and list the directory contents.坠?襐|H笼 
捉?ru 
Write allows you to create, edit and delete files and subdirectories in the directory.?˙昘w4= 
?嶅邵?辴? 
Execute gives you the previous read/write permissions plus allows you to change into the directory and execute programs or shells from the directory.焎^L?8&5 
/蕢?+V? 
5. the difference between a soft link and a hard link?t鳖捨酗 
#ps詉y抨凄 
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.葄 諴%括L 
>L?{rW)? 
6. Give the command to display space usage on the UNIX file system.x准!灿G骍S 
聼虝A詗迎m 
df -lk>?ㄉcPW6 
7. Explain iostat, vmstat and netstat.bFPB硖鼛? 
>`逑OT坳? 
Iostat reports on terminal, disk and tape I/O activity.j{?X梌? 
'~码舚L 
Vmstat reports on virtual memory statistics for processes, disk, tape and CPU activity.鱓-婛AV? 
{秹NC^(? 
Netstat reports on the contents of network data structures.~4 惯稺虋? 
?f2鍦M[? 
8. How would you change all occurrences of a value using VI?? 8?存n5 
!g?lt;偈q 
Use :%s/<old>/<new>/g?F埆瑳L? 
朑烇ぎ甜 
9. Give two UNIX kernel parameters that effect an Oracle install儸楷?埶 
蜹~?d鮝飼 
SHMMAX & SHMMNII!?閺? 
@ J鯿竂$] 
10. Briefly, how do you install Oracle software on UNIX.驾s嚗?o~ 
刢綑粛s? 
Basically, set up disks, kernel parameters, and run orainst.

TAG:

引用 删除 xf   /   2008-10-02 11:49:50
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-13  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 10571
  • 日志数: 659
  • 文件数: 5
  • 建立时间: 2007-12-29
  • 更新时间: 2008-10-10

RSS订阅

Open Toolbar