Oracle面试题

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  
请使用浏览器的分享功能分享到微信等