资源描述
一份ORACLE DBA面试题
一:SQL tuning 类
1:列举几种表连接方式
答:merge join,hash join,nested loop
2:不借助第三方工具,怎样查看sql的执行计划
答:sqlplus
set autotrace ...
utlxplan.sql创建plan_table表
3:如何使用CBO,CBO与RULE的区别
答:在初始化参数里面设置optimizer_mode=choose/all_rows/first_row等可以使用cbo.<br />rbo会选择不合适的索引,cbo需要统计信息。
4:如何定位重要(消耗资源多)的SQL
答:根据v$sqlarea 中的逻辑读/disk_read。以及寻找CPU使用过量的session,查出当前session的当前SQL语句,或者:监控WIN平台Oracle的运行
5:如何跟踪某个session的SQL
答:先找出对应的'sid,serial',然后调用system_system.set_sql_trace_in_session(sid,serial,true);参考:跟踪某个会话
6:SQL调整最关注的是什么
答:逻辑读。IO量
7:说说你对索引的认识(索引的结构、对dml影响、对查询影响、为什么提高查询性能
答:默认的索引是b-tree.
对insert的影响.(分裂,要保证tree的平衡)
对delete的影响.(删除行的时候要标记改节点为删除).
对update的影响,如果更新表中的索引字段,则要相应的更新索引中的键值。
查询中包含索引字段的键值和行的物理地址。
8:使用索引查询一定能提高查询的性能吗?为什么
答:不能。如果返回的行数目较大,使用全表扫描的性能较好。
9:绑定变量是什么?绑定变量有什么优缺点
答:通俗的说,绑定变量就是变量的一个占位符,使用绑定变量可以减少只有变量值不同的
语句的解析。
10:如何稳定(固定)执行计划
答:使用stored outline.
11:和排序相关的内存在8i和9i分别怎样调整,临时表空间的作用是什么
答i:使用sort_area_size,hash_area_size,每个session分配相同的值,不管有无使用。
9i: 使用pga_aggregate来统一管理。
临时表空间的作用:
在sort_area_size中不能完成的部分在临时表空间完成,临时表空间在重建索引,创建临时表等都要用到。
还有hash join不能完成的也在临时表空间中做。
12:存在表T(a,b,c,d),要根据字段c排序后取第21—30条记录显示,请给出sql
select a,b,c,d from (select a,b,c,d from T order by c) where rownum<=30
minus
select a,b,c,d from (select a,b,c,d from T order by c) where rownum <=20;
或者:
select * from (select rownum rn,a.* from (select a,b,c,d from T order by c) a )where rn between 21 and 30;
二:数据库基本概念类
1pctused and pctfree 表示什么含义有什么作用
答:表示数据块什么时候移入和移出freelist。
pctused:如果数据块的使用率小于pctused的值,则该数据块重新加入到fresslist中。
pctfree:如果数据块的使用率高于pctfree的值,则该数据块从freelist中移出。
2:简单描述table / segment / extent / block之间的关系
答:一个table至少是一个segment,如果分区表,则每个分区是一个segment,table可以看成是一个逻辑上的概念,segment可以看成是这个逻辑概念的物理实现;
segment由一个或多个extents组成,segment不可以跨表空间但可以跨数据文件;
extent由多个连续的blocks组成,不可以跨数据文件;
block由1-多个os块组成,是oracle i/o的最小存储单位。
3:描述tablespace和datafile之间的关系
答:tablespace是逻辑上的概念,datafile是物理上的概念。
一个tablespace可以由多个datafile组成,一个datafile不能跨越多个tablespace。
4:本地管理表空间和字典管理表空间的特点,ASSM有什么特点
答:一个使用freelist管理,一个使用位图管理。
5:回滚段的作用是什么
答:保存数据的前像,保证数据读取的时间点一致性。Oracle里数据的多版本特性就是通过回滚段来实现的,正因为此,Oracle数据库实现了读写不竞争的性能优势!
6:日志的作用是什么
答:纪录对数据库的操作,便与恢复。
7:SGA主要有那些部分,主要作用是什么
答:db_cache(缓存数据块),shared_pool(缓存sql,执行计划,数据字典信息等),large_pool(MTS模式、parallel 、rman等要用到),java pool(java程序如SQLJ存储过程运行时要用到)
8:racle系统进程主要有哪些,作用是什么
答:smon(合并空间,实例恢复),pmon(清理失败的进程),归档进程(负责在日志切换的时候归档日志文件),lgmr(日志书写器进程,负责写日志),ckpt(检查点进程,触发检查点),dbwr(数据库写入器,负责把数据写入导datafile)
三:备份恢复类
1:备份如何分类
答:逻辑备份(exp)与物理备份。
或者冷备份与热备份。
2:归档是什么含义
答:把日志文件放到另一个地方。
3:如果一个表在2004-08-04 10:30:00 被drop,在有完善的归档和备份的情况下,如何恢复
答:拷贝备份,
recover database until time 2004-08-04 10:30:00
alter database open resetlogs;
4:rman是什么,有何特点
答:rman叫恢复管理器.
特点很多。可以在线备份,到少目标数据库是mount状态。
1:热备份。
2:可以存储脚本。
3:可以增量备份。
4:自动管理备份集。
5:standby的特点
答:利用传输重做日志来达到同步的目的。可以设定多个保护级别,9i后支持逻辑standbyDB。
6:对于一个要求恢复时间比较短的系统(数据库50G,每天归档5G),你如何设计备份策略
答:每天一个全备份。
四:系统管理类
1:对于一个存在系统性能的系统,说出你的诊断处理思路
答:做一个statspack,根据top 5,system load,top sql等来做相应的调整。
2:列举几种诊断IO、CPU、性能状况的方法
答:hp-unix:iostat -x 1 5;
top/vmstat/glance
3:对statspack有何认识
答:一个性能诊断工具而已,其本质就是在两个时间点采样两个系统数据。(动态性能视图),然后根据两个snapshot,产生一个报告。
4:如果系统现在需要在一个很大的表上创建一个索引,你会考虑那些因素,如何做以尽量减小对应用的影响
答:1:增大sort_area_size(8i)/pga_aggregate_target(9i)值。
2:如果表有分区(一般大表都要用到分区的),按分区逐个建索引,如果是本地索引的话;
3:系统空闲的时候建。
5:对raid10 和raid5有何认识
答:raid10是先镜像后条带,适合对写入速度要求较高的数据库系统,特别是online redolog文件,raid5适合大部分的数据库系统和数据仓库系统,读性能优于写性能。
五:综合随意类
1:你最擅长的是oracle哪部分?
答:性能/sql 调优、备份恢复。
2:喜欢oracle吗?喜欢上论坛吗?或者偏好oracle的哪一部分?
答: 优化。
3:随意说说你觉得oracle最有意思的部分或者最困难的部分
答:SQL调优,最困难的是Oracle的网络管理,Oracle的Connect Manager没用过。
4:为何要选择做DBA呢?
答:爱好加职业历史积累。
4:如果系统现在需要在一个很大的表上创建一个索引,你会考虑那些因素,如何做以尽量减小对应用的影响
答:1:增大sort_area_size(8i)/pga_aggregate_target(9i)值。
2:用并行的方式来建。
3:系统空闲的时候建。
其他:
什么是聚集索引,什么是非聚集索引,什么又是主键?
聚簇索引的顺序就是数据的物理存储顺序,叶节点就是数据节点。
非聚簇索引的顺序与数据物理排列顺序无关,叶节点仍然是索引节点,只不过有一个指针指向对应的数据块。
能够唯一表示数据表中的每个记录的字段或者字段的组合就称为主键,通过它可强制表的实体完整性。
1、事务是什么?A:所谓事务是用户定义的一个数据库操作序列,这些操作要么全做要么全不做,是一个不可分割的工作单位。
2、oracle中truncate和delete命令有何区别?A:
(1)delete将在回滚段中产生回滚信息,truncate不产生,因此无论表中的记录多少,truncate执行都很快。
(2)truncate 是 DDL,执行隐含的commit,truncate不能回滚。任何没有提交的 DML 改变也将会和truncate一起提交。
(3)truncate 重置表及其索引高水位标志。全表扫描和索引快速全扫描读高水位标志下的所有数据块,因此在delete后全扫描性能没有提高,但truncate后将会变快。
(4)truncate 不触发 delete 触发器。
(5)没有对象权限允许一个用户 truncate 另一个用户的表。这样做需要 DROP ANY TABLE 系统权限。
(6)当一个表被 truncate,表及其索引的存储将被重置回初始大小。而 delete 不收缩表及其索引的大小。
(7)当父表有一个可用的引用完整性约束时不能被 truncate。必须先disable引用父表的外键约束,再truncate。
3、Oracle中char和varchar2数据类型有什么区别?有数据”test”分别存放到char(10)和varchar2(10)类型的字段中,其存储长度及类型有何区别?A:char是定长字符类型,varchar2是变长字符类型。“test”在char(10)中被补齐空格,存储长度是10字节,在varchar2(10)中存储长度是4字节。
Oracle DBA笔试及面试题汇总:基础篇-考试认证
使用篇
1:使用索引查询一定能提高查询的性能吗?举出实例
2:数据库设计的一、二、三范式、BCNF是什么?
3:StoreProcedure和Function有何区别?
4:如何跟踪某个session的SQL?
5:如何使用CBO,CBO与RULE的区别?
6:描述tablespace和datafile之间的关系
7:truncate和delete有何区别?哪一种操作性能更快?
8:什么是Snapshot?与View有何区别?
9:pctused and pctfree 表示什么含义有什么作用
10:cursor一般用在什么地方?有何弱点?
管理篇
1:SQL调整最关注的是什么?
2:Oracle的系统进程有哪些?作用是什么?
3:本地管理表空间和字典管理表空间的特点,ASSM有什么特点?
4:备份如何分类?
5:如果一个表被drop,在有完善的归档和备份的情况下,如何恢复
6:rman是什么,有何特点?
7:standby的特点
8:对于一个要求恢复时间比较短的系统(数据库50G,每天归档5G),你如何设计备份策略
9:对于一个存在系统性能的系统,说出你的诊断处理思路
10:列举几种诊断IO、CPU、性能状况的方法
11:对statspack有何认识
12:如果系统现在需要在一个很大的表上创建一个索引,你会考虑那些因素,如何做以尽量减小对应用的影响
13:对raid10 和raid5有何认识
14:SGA主要有那些部分,主要作用是什么
15:简单描述table / segment / extent / block之间的关系
16:说说你对索引的认识(索引的结构、对dml影响、对查询影响、为什么提高查询性能)
46家著名企业笔试试题(IT业)--香港电信/ORACLE/维尔VERITAS/凹凸电子/普华永道PW/奇码数字信息C
香港电信笔试题
1. Based on your understanding of the following java related technologies:
servlets, JavaServerPage, JavaBeans, Enterprise JavaBeans, how do you think these technologies are work together or are applied in the development of an in ternet-based application (25marks).
2. In your opinion ,what do you think are the advantages or benefits of using an object-oriented approach to software development? how do you think those benefits can be achieved or realized? (15marks).
3. In designing your classes, given the choice between inheritance and aggregation which do you choose (15marks).
4. How would you work around the lack of multiple inheritance feature in Java (15marks).
5. What would you consider to be the hardest part of OO analysis and design and why (10marks).
6. How do you keep yourself up to date with the latest in software techonogy, especially in the field of software development (10marks).
7. What si your career aspiration? Why do you think this E-Commerce Development Center can help you in achieving your career goals (10marks) (1hr, answer in English).
ORACLE的笔试题
1. Would you please describe yourself in 3-4 lines? (limited in 500 words)
2. Could you tell us why we should choose you as a Loreal Person, and what makes you unique? (limited in 500 words)
3. What is your short-term and long-term career plan? (limited in 500 words)
4. What kind of group activities are you interested in and what type of role do you often play?
(limited in 500 words)
5. Please use one sentence to give a definition of ‘Beauty’, and describe the most beautiful thing in your life. (limited in 500 words)
维尔VERITAS软件笔试题
1. A class B network on the internet has a subnet mask of 255.255.240.0, what is the maximum number of hosts per subnet .
a. 240 b. 255 c. 4094 d. 65534
2. What is the difference: between o(log n) and o(log n^2), where both log arithems have base 2 .
a. o(log n^2) is bigger b. o(log n) is bigger c. no difference
3. For a class what would happen if we call a class’s constructor from with the same class’s constructor .
a. compilation error b. linking error
c. stack overflow d. none of the above
4. “new” in c++ is a: .
a. library function like malloc in c
b. key word c. operator
d. none of the above
5. Which of the following information is not contained in an inode .
a. file owner b. file size
c. file name d. disk address
6. What’s the number of comparisons in the worst case to merge two sorted lists containing n elements each .
a. 2n b.2n-1 c.2n+1 d.2n-2
7. Time complexity of n algorithm T(n), where n is the input size ,is T(n) =T(n-1)+1/n if n>1 otherwise 1 the order of this algorithm is .
a. log (n) b. n c. n^2 d. n^n
8. The number of 1’s in the binary representation of 3*4096+ 15*256+5*16+ 3 are .
a. 8 b. 9 c. 10 d. 12
百威啤酒(武汉公司)
1,为什么申请来百威?
2,将来有什么打算?
3,有没有社会活动经历?
4,有没有当众演讲的经历?
5,经常使用那些软件?
6,喜欢哪些课程?
7,你认为工作中的什么因素对你来说最重要?
8,什么时候可以来上班?可以在这里工作多久?
9,八点上班,要加班和出差,能不能做到?
星巴克
1、 您是一家咖啡店的店经理,你发现店内同时出现下列状况:
1)许多张桌子桌面上有客人离去后留下的空杯未清理,桌面不干净待整理。
2)有客人正在询问店内卖哪些品种,他不知如何点咖啡菜单。
3)已有客人点完成咖啡,正在收银机旁等待结帐。
4)有厂商正准备要进货,需要店经理签收。
请问,针对上述同时发生的情况,你要如何排定处理之先后顺序,为什么
2、 有一位甲员工脾气不好以致在前三家店因为与店内其他同事相处不佳而屡屡调动,现在甲被调到你的店里面来,请问身为店经理的你,将如何应对??
3、 你是店经理,本周五结帐后,发现门市总销售额较上周五减少30%,请问可能原因 会是哪几种,各原因如何应对?
凹凸电子软件笔试题
1. Select ONE of the following projects to discuss:
a. Signal Filtering: You are given a sampled real time waveform consisting of a sensor reading mixed with highly periodic impulses and high frequency noise. The desired output is the real time filtered sensor signal with the impulses and noise removed, and a readout of the impulse period. The FFT may not be used.
b. Interrupt Processing. A headware register consisting of eight independent edge triggered latches is used to record external asynchronous interrupt requests. When any of the request bits are latched, a software interrupt is generated. The software may read the latch to see which interrupt(s) occurred. Writing a one to any latch bit will clear the latch. How does that software assure that no interrupt request is ever missed?
c. User Interface: a prototype MP3 player interface consisting of a playlist display and a few control buttons is given to you. How would you make the interface “skinnable”, with user selected graphics, options, and control button placement?
Each project description is incomplete. What questions would you ask to completely specify the project? What development tools would you prefer to use?
What algorithm /data structures/design would you use?
2. What program(s) have you coded for you own enjoyment (not part of a school project, not for pay). What type of software project would you most enjoy working on?
3. Have you participated in a team programming project? What is the hardest part of programming as a team, as opposed to programming alone?
友
立资讯笔试题目
1.一堆鸡蛋,3个3个数剩余2个,5个5个数剩余1个,7个7个数剩余3个,问这
堆鸡蛋 最少有多少个?并给出通解。
2.列举五岳,及其所在省份。
3.何为四书。
4.按顺序默写24节气。
5.默写于谦的《吟石灰》。
6.英语翻译约300字。
7.作文一篇:求职有感。
普华永道PWC笔试题目(作文)
1.最近10年来中国媒体的变化。
2.你认为发展汽车产业和公共交通哪个更重要?
3.如何理解风险投资?
4.如何理解广告的消极作用和积极作用?
Avant! 微电子EE笔试题
1.名词解释:VLSI,CMOS,EDA,VHDL,Verilog,HDL,ROM,RAM,DRC,LVS。
2.简述CMOS工艺流程。
3.画出CMOS与非门的电路,并画出波形图简述其功能。
4.画出N沟道增强型MOSFET的剖面图。
5.简述ESD和latch-up的含义。
6.简述三极管与MOS管的区别。
7.简述MOORE模型和MEALY模型。
8.简述堆栈与队列的区别。
奇码数字信息有限公司笔试题
1.画出NMOS的特性曲线(指明饱和区,截至区,线性区,击穿区和C-V曲线)
2.2.2um工艺下,Kn=3Kp,设计一个反相器,说出器件尺寸。
3.说出制作N-well的工艺流程。
4.雪崩击穿和齐纳击穿的机理和区别。
5.用CMOS画一个D触发器(clk,d,q,q-)
Oracle DBA 笔试题
(答题时间60分钟)
Unix/Linux题目
1、如何查看主机cpu,内存、IP和磁盘空间?
2、你常用的进程管理、主机性能察看命令有哪些?
3、建立组dba和该组下用户oracle,默认shell为bash。
4、如何查看用户oracle的登陆历史和命令操作历史?
5、写crontab,让脚本/opt/test.sh在每周日晚上8:00执行。
6、如何查找当前目录及其所有子目录下含有“ORA-”或“warning”字符内容的所有带log后缀的文件。
7、写一个shell,完成自动登陆数据库(用户名密码是test/testpwd, 网络连接串是db_wending)并获取数据库当前SCN的功能。
Oracle Database题目
1、如何快速了解一个已经运行很久的数据库系统?
2、如何获得SQL语句的执行计划和统计信息?
3、列出你常用的数据字典视图和动态性能视图。
4、陈述使用过的数据库备份和恢复技术,及其优缺点。
5、描述 table/segment/tablespace/datafile/extent/block 之间的关系。
6、前台系统反映非常慢,需要你去分析诊断。请详细陈述诊断流程,包括写下可能用到的操作系统命令、数据库视图等。
7、公司准备把Oracle9i升级为Oracle10.2.0.4,但批准的停库时间仅为10分钟,你打算如何应对?
8、详细陈述RAC、Dataguard、Streams Replication、Advanced Replication等Oracle HA技术的原理和优缺点。
9、写存储过程,把当前用户下数据库对象个数信息按对象类型分组输出来。
10、请写下你常关注的oracle初始化参数。
--End--
国外公司的Oracle DBA 面试题
2007-11-20 10:20
Oracle DBA Interview Questions By B G
1. How many memory layers are in the shared pool?
2. How do you find out from the RMAN catalog if a particular archive log has been backed-up?
3. How can you tell how much space is left on a given file system and how much space each of the file system's subdirectories take-up?
4. Define the SGA and:
? How you would configure SGA for a mid-sized OLTP environment?
? What is involved in tuning the SGA?
5. What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?
6. Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?
7. How do you tell what your machine name is and what is its IP address?
8. How would you go about verifying the network name that the local_listener is currently using?
9. You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
10. What view(s) do you use to associate a user's SQLPLUS session with his o/s process?
11. What is the recommended interval at which to run statspack snapshots, and why?
12. What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?
13. Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.
14. How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?
15. What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?
16. In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?
17. How would you best determine why your MVIEW couldn't FAST REFRESH?
18. How does propagation differ between Advanced Replication and Snapshot Replication (readonly)?
19. Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?
20. How would you begin to troubleshoot an ORA-3113 error?
21. Which dictionary tables and/or views would you look at to diagnose a locking issue?
22. An automatic job running via DBMS_JOB has failed. Knowing only that "it's failed", how do you approach troubleshooting this issue?
23. How would you extract DDL of a table without using a GUI tool?
24. You're getting high "busy buffer waits" - how can you find what's causing it?
25. What query tells you how much space a tablespace named "test" is taking up, and how much space is remaining?
26. Database is hung. Old and new user connections alike hang on impact. What do you do? You
展开阅读全文