小弟马上就要考试了~~帮忙看一道题啊~~

[复制链接]
查看11 | 回复9 | 2008-3-24 01:04:28 | 显示全部楼层 |阅读模式
You work as a database administrator for Examsheets.net. In the EXAMSHEETSPRODUCTION
database you have granted RESUMABLE system privilege to the CONNECT role. Resumable
space operation has been enabled for all user session. You want users NOT to be aware of any
kind of space-related problems while performing transactions. Instead, you want the problem to
be resolved by a database trigger automatically. Which combination of triggering time and event
would you use to achieve this objective?
A. AFTER CREATE
B. AFTER SUSPEND
C. BEFORE CREATE
D. AFTER TRUNCATE
E. BEFORE SUSPEND
F. AFTER INSERT OR DELETE OR DELETE
G. BEFORE INSERT OR DELETE OR DELETE
Answer: B
这个题我怎么也看不懂什么意思,希望有谁能看的懂的话帮忙讲解一下,万分感激~!!!!!
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
哥们 为了不让你的帖子沉没,我帮你顶一下...其实我也看不懂!你考的啥呀 好象相当牛叉嘛...
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
好几个单词都不认识...英语需要加强!!
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
我考ORACLE DBA OCP啊...
这个题只是第一门考试OCA的题
哈哈 谢谢你回贴啊~~!
顶起来啊!!!!
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
不过也许这个题真的超范围了,因为我对这个题目里涉及的东西一点概念印象都没有.
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
B是对的
首先需要了解resumable的作用
[php]
session1:
SQL> create tablespace users datafile 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USE
RS.DBF' SIZE 3M;
表空间已创建。
SQL> grant resumable to xys;
授权成功。
SQL> create or replace trigger trigg_system
2after suspend on database
3begin
4 dbms_resumable.set_timeout(10);
5end;
6/
警告: 创建的触发器带有编译错误。
SQL> show error
TRIGGER TRIGG_SYSTEM 出现错误:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/2PL/SQL: Statement ignored
2/2PLS-00201: 必须声明标识符 'DBMS_RESUMABLE'
SQL> create or replace trigger trigg_system
2after suspend on database
3begin
4 dbms_resumable.set_timeout(10);
5end;
6/
警告: 创建的触发器带有编译错误。
SQL> connect /as sysdba
已连接。
SQL> grant execute on dbms_resumable to xys;
授权成功。
SQL> connect xys/manager
已连接。
SQL> create or replace trigger trigg_system
2after suspend on database
3begin
4 dbms_resumable.set_timeout(10);
5end;
6/
触发器已创建
session2:
SQL> create table t_resumable tablespace users as select *from dba_objects;
表已创建。
SQL> insert into t_resumable select *from t_resumable;
insert into t_resumable select *from t_resumable

*
第 1 行出现错误:
ORA-01653: 表 XYS.T_RESUMABLE 无法通过 128 (在表空间 USERS 中) 扩展

SQL> alter session enable resumable;
会话已更改。
--注意这里insert操作会等待10秒,10秒之后出现了错误
SQL> insert into t_resumable select *from t_resumable;
insert into t_resumable select *from t_resumable

*
第 1 行出现错误:
ORA-30032: 挂起的 (可恢复) 语句已超时
ORA-01653: 表 XYS.T_RESUMABLE 无法通过 128 (在表空间 USERS 中) 扩展
--回到session1修改一下timeout时间(10秒有些短,来不及修改datafile 4的autoextend属性),单位是秒
SQL> create or replace trigger trigg_system
2after suspend on database
3begin
4 dbms_resumable.set_timeout(60);
5end;
6/
触发器已创建
session2:
--此时下面insert会等待60秒,如果60秒之后发现空间可用,则继续执行
SQL> insert into t_resumable select *from t_resumable;
已创建11413行。
--此期间在session1中修改datafile 4使其能自动扩展
SQL> alter database datafile 4 autoextend on;
数据库已更改。
SQL>
/
[/php]
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
长见识了
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
RESUMABLE的作用我大概理解了,可是我还是不太明白和AFTER SUSPEND有什么关系呢??
难道用户在等待可恢复空间时必须要被挂起??
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
在加载大量数据的时候有用处。
回复

使用道具 举报

千问 | 2008-3-24 01:04:28 | 显示全部楼层
When a resumable statement encounter a correctable error, the system internally generates the AFTER SUSPEND system event. Users can register triggers for this event at both the database and schema level. If a user registers a trigger to handle this system event, the trigger is executed after a SQL statement has been suspended.
SQL statements executed within a AFTER SUSPEND trigger are always non-resumable and are always autonomous. Transactions started within the trigger use the SYSTEM rollback segment. These conditions are imposed to overcome deadlocks and reduce the chance of the trigger experiencing the same error condition as the statement.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行