20151122 ocp 052(01-10)解析

1.you need to load information about new customers from the new_cust table into the tables cust and cust_special ,

if a new customer has a credit limit greater than 10000,then the details have to be inserted into cust_special,all

new customer details have to be inserted into the cust table ,whitch techniche should be used to load the data most 

efficirntly?

a.external table (oracle外部表)

b.the merge command

c.the multitable insert command

d.insert using with check option 


SQL如下,insert all when creadit_limit>=10000 into cust_special when 1=1 into cust;


a. 外部表示不存在于数据库的表,通过向oracle提供描述外部表的元数据,我们可以吧一个操作系统文件当成一个只读的数据库表,

就像这些数据存储在一个普通的数据库表中进行访问

外部表都是只读的,不能进行dml操作。。。

b.merger命令只能针对一张表进行插入或者修改操作

d.insert命令没有with check option选项,with check option是在create视图时用的

2.rman备份策略

Oracle中,增量备份时分等级的,级别从0开始,一级一级递增,不过实际上用的最多的也就是0级和1级了,0级增量备份是后面级别的增量备份的 基础,0级备份实际上就是一个完全备份,与普通的完全备份唯一的不同点是0级备份可以作为其他级别增量备份的基础,而普通的完全备份是不能的。

从级别1开始,Oracle的增量备份分为差异增量备份和积累增量备份两种,其中差异增量备份备份的是自上一次同级别的差异备份或者是上一次更高级 别的备份完成之后的数据库发生改变的数据块;而积累增量备份则是备份的自上一次上一级增量备份完成以来数据库发生改变的数据块。


这个为差异增量备份(diffrential incremental backup) 


这个为积累增量备份( Cumulative backup 

047 2.

you perform diffential incremental level1 bakcups of your database on each working day and level 0 bakcup on sundays,

to tape,which two statements are true abount diffrential incremental backups

a.the backup performed on suandays contains all the blocks that have ever been used in the database

d.the backup performed on monday contains all the blocks that have changed since the level 0 backup 

and every other working day contains all the blocks that have changed since the level 1 backup

差异备份是RMAN生成的增量备份的默认类型。对于差异备份来说,RMAN会备份自上一次同级或低级差异增量备份以来所有发生变化的数据块。

 

如图:本题是说星期天进行级别为0的差异增量备份操作,这个备份会操作备份整个数据库。

根据这个级别为0的备份,我们在星期一到星期六进行级别为1的差异增量备份操作。

使用差异备份,每天的备份将包含自一次差异备份以来发生的所有更改。

最后,在下一个星期天,进行别一次基本备份(即级别为0的增量备份)。

熟悉下rman增量备份的操作

a.rman target /

b.backup incremental level 0 database 执行0级增量备份

c.backup incremental level 0 database; 执行1级增量备份

3.

AMM:automatic memory management(11.1才有的特性) 即让数据库完全管理SGA、PGA的大小,而对于管理员只需要设置一个总的大小(memory_target),数据库会动态的调整SGA、PGA的大小以及其中包含的各个组件大小,如Database buffer cache、Shared pool等等。

ASMM:automatic shared memory management,即让设置一个SGA的目标值以及SGA的最大值,数据库来动态调整其中的各个组件,如Database buffer cache、Shared pool等等。
AMM只需要设置一个memory_target,其中SGA、PGA数据库会根据运行的具体情况来调整这些大小,这样有一个好处即管理方便,经验不充足的人建议就设置AMM让数据库来管理各个内存空间大小的分配。   ASMM则是设置SGA_TARGET,让数据库来管理SGA中各个组件的大小。


参照完整性规则(Referential Integrity)

4.you have two tables with referential integrity enforced between them,you need to insert data to the child table first because it is going to be a long

transation  and data for the parent table will be available in a large stage,which can be inserted as part of the same transation

有两个表,他们之间有参照完整性的约束。在同一个事物中,你需要现在子表中插入数据,然后再使父表变为可用

在有外键约束的情况下,这样是不能插入的,所以可以在执行事务钱,设置约束延迟生效,即在事物提交时生效

set the transation to deferred before starting the transation

5.

identify two situations in which you can use data recovery advisor for recovery 

a.the database diles are corrupted when the database is open;

d.the database is not opening because the required database files are missing;


DRA是和Oracle经典备份还原工具RMAN绑定使用的。DRA是自动在后台进行数据库状态检查和数据收集,一旦发现错误,就会自动的进行修复建议的提示。DRA目前可以在两种方式下进行工作,一个是数据库启动障碍,比如启动过程报错。另一个是运行过程障碍,例如运行中数据库异常损坏(如数据文件被后台删除)。


6.your database is open and the LISTENER listener is runing ,the new dba stop the listener by using the command;

LSNRCTL?STOP

what happens to the sessions that are presently connected to the database instance

b.the session are not affected and continue to function normally;

当回话连接到数据库后,即使是停止了监听,也不会影响会话的正常操作的

7.you executed this command to create a temporary table;

sql>create global temporary table report _work_area(startdate DATE,enddate DATE,class CHAR(20) ON COMMIT PRESERVE ROWS; 

which statement is true abount the rows inserted into the report_word_area table during a transation

a.the rows stay in the table only until session termination.

ORACLE临时表总结

2013-08-27 20:23 by 潇湘隐者, 14917 阅读, 0 评论, 收藏编辑

临时表概念

   临时表就是用来暂时保存临时数据(亦或叫中间数据)的一个数据库对象,它和普通表有些类似,然而又有很大区别。它只能存储在临时表空间,而非用户的表空间。ORACLE临时表是会话或事务级别的,只对当前会话或事务可见。每个会话只能查看和修改自己的数据。

1)ON COMMIT DELETE ROWS

它是临时表的默认参数,表示临时表中的数据仅在事物过程(Transaction)中有效,当事物提交(COMMIT)后,临时表的暂时段将被自动截断(TRUNCATE),但是临时表的结构 以及元数据还存储在用户的数据字典中。如果临时表完成它的使命后,最好删除临时表,否则数据库会残留很多临时表的表结构和元数据

2)ON COMMIT PRESERVE ROWS

它表示临时表的内容可以跨事物而存在,不过,当该会话结束时,临时表的暂时段将随着会话的结束而被丢弃,临时表中的数据自然也就随之丢弃。但是临时表的结构以及元数据还存储在用户的数据字典中。如果临时表完成它的使命后,最好删除临时表,否则数据库会残留很多临时表的表结构和元数据。

会话级的临时表的数据和你当前会话有关系,当前SESSION不退出的情况下,临时表中的数据就还存在,临时表的数据只有当你退出当前SESSION的时候才被截断(TRUNCATE TABLE)

8.in which of the scenarios will the dba perform recovery ?

b.a tablespace is accidentally dropped;

e.the hard disk on which the datafile is stored is corrupted 

在那种情况下dba会执行恢复

a.告警日志被损坏,影响不到数据库的正常打开和正常运行。可以删除掉,系统会重新生成一个告警日志的

b.表空间被不慎删除,属于用户误操作,需要DBA来执行恢复

c.重做日志的一个成员被损坏,一般来说,重做日志是多路复用的,只要一组里面有一个可用,数据库是可以正常打开的。

如果一个成员redo日志损坏,可以清除后重建一个

d.数据库的会话被不正常终止。与实例异常断开的用户进程中可能包含正在进行的,需要回退的未提交任务。为了确保服务器进程会话仍保持连接,进程

监视器后台进程会定期轮询服务器进程。如果pmon发现某个服务器进程的用户不再处于连接状态,pmon会从任何正在进行的事物处理中进行恢复,还会回退未提交的

更改并解除失败回话持有的任何锁。从用户进程失败中进行恢复是不需要DBA干预,但是管理员必须观察变化趋势

e.存储在硬盘上的数据已损坏,属于介质故障,需要dba恢复。将介质故障定义为导致一个或多个数据库文件(数据文件,

控制文件或重做日志文件)丢失或损坏的任何故障。要从介质中进行恢复,需要还原并回复缺失的文件。
9.you are working on an instance started using the spfile,you want to move the flash recovery area of  your database to 

a new location ,you want the flashback log files to be stored in the new location 

given below are the steps to accomplish the task in random order;

step 1.change the value of the DB_RECOVERY_FILE_DEST initlialization parameter to a new value.

step 2.shutdown the instance.

step3.startup the instance and mount the database.

step4.execute the alter database flashback off command

step5.execute the alter database flashback on command.

step6.open the database.

题目要求更换falsh recovery area的位置

首先设置db_recovery_file_dest 为新的闪回日志路径,然后在mount状态下,关闭启动,更新下路径的指定,最后打开数据库

10.a user,who is anthenticated externally,logs in to a remote machine and connect to the database instance,

what action would you take to ensure that a user cannot connect to the database instance by logging in to a remote machine?

c.set the remote_os_anthent parameter to false

限制远程数据库验证:默认情况下,remote_os_authent参数设置为false

remote_os_authent参数为true则允许client端远程连接,否则必须使用用户名,密码来连接,不能用sqlplus / as sysdba

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值