zoukankan      html  css  js  c++  java
  • 052(十九)

    91、View the Exhibit and examine the user information

    The user has been granted CONNECT and RESOURCE roles and no individual system privileges. 
    The SL_REP user executes this command to create a table:
    SQL> CREATE TABLE orders (
    oid number(6),
    odate date,
    ccode number(4),
    oamt number(10,2)
    ) TABLESPACE purchase_space; 
    The PURCHASE_SPACE tablespace already exists in the database. 
    Which statement describes the effect of the command? 
    A. The command executes successfully and creates the table in the USERS tablespace. 
    B. The command executes successfully and creates the table in the PURCHASE_SPACE tablespace. 
    C. The command produces an error because the user does not have the privilege to createthe table. 
    D. The command produces an error because the user does not have quota in the PURCHASE_SPACE tablespace. 
    Answer: B
    
    系统权限unlimited tablespace是隐含在dba, resource角色中的一个系统权限. 当用户得到dba或resource的角色时, unlimited tablespace系统权限也隐式受权给用户
    
    UNLIMITED TABLESPACE
    Use an unlimited amount of any tablespace. This privilege overrides any specific quotas assigned. 
    If you revoke this privilege from a user, then the user's schema objects remain but further tablespace allocation is denied unless authorized by specific tablespace quotas. You cannot grant this system privilege to roles
    View Code

    92、

    92.A constraint in a table is defined with the INITIALLY IMMEDIATE clause. You executed the ALTER 
    TABLE command with the ENABLE VALIDATE option to enable the constraint that was disabled. 
    What are the two effects of this command? (Choose two.) 
    A. It fails if any existing row violates the constraint. 
    B. It does not validate the existing data in the table. 
    C. It enables the constraint to be enforced at the end of each transaction. 
    D. It prevents insert, update, and delete operations on the table while the constraint is in the process of being enabled. 
    Answer: AD 
    
    启用约束:
    enable( validate) :启用约束,创建索引,对已有及新加入的数据执行约束.
    enable novalidate :启用约束,创建索引,仅对新加入的数据强制执行约束,而不管表中的现有数据. 
    禁用约束:
    disable( novalidate):关闭约束,删除索引,可以对约束列的数据进行修改等操作.
    disable validate :关闭约束,删除索引,不能对表进行 插入/更新/删除等操作.
    
    和94题类似
    View Code

    93、

    93.The session of user SCOTT receives the following error after executing an UPDATE command on the EMP table:
    ERROR at line 1:
    ORA-00060: deadlock detected while waiting for resource
    On investigation, you find that a session opened by user JIM has a transaction that caused the deadlock. 
    Which two statements are true regarding the session of SCOTT in this scenario? (Choose two.) 
    A. The session is terminated after receiving the error and JIM can continue with his transaction. 
    B. SCOTT should perform a COMMIT or ROLLBACK to allow JIM to continue with his transaction. 
    C. The session is rolled back after receiving the error and JIM can continue with his transaction. 
    D. SCOTT has to reexecute the last command in the transaction after he commits the transaction
    Answer: BD
    
    测试:
    session 1:
    update test_xxxx set name='11' where id=1
    
    session 2:
    update test_xxxx set name='22' where id=2
    
    session 1:
    update test_xxxx set name='222' where id=2
    
    session 2:
    update test_xxxx set name='111' where id=1
    
    session 1报错:
    1    1    8    ORA-00060: deadlock detected while waiting for resource
    View Code

    94、

    94.Examine the following statement that is used to modify the primary key constraint on the SALES table:
    SQL> ALTER TABLE SALES MODIFY CONSTRAINT pk DISABLE VALIDATE;
    Which three statements are true regarding the above command? (Choose three.)
    A. The constraint remains valid. 
    B. The index on the constraint is dropped. 
    C. It allows the loading of data into the table using SQL *Loader. 
    D. New data conforms to the constraint, but existing data is not checked. 
    E. It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements. 
    Answer: ABC
    
    参考:SQL Language Reference
    关闭约束,删除索引,不能对表进行 插入/更新/删除等操作
    
    DISABLE VALIDATE disables the constraint and drops the index on the constraint, 
    but keeps the constraint valid. This feature is most useful in data warehousing situations, 
    because it lets you load large amounts of data while also saving space by not having an index. 
    This setting lets you load data from a nonpartitioned table into a partitioned table using the exchange_partition_subpart clause of the 
    ALTER TABLE statement or using SQL*Loader.
    All other modifications to the table (inserts, updates, and deletes) by other SQL statements are disallowed.
    
    
    
    
    测试:
    create table test_xxxx
    (id number(12),
    name varchar2(20)
    )
    /
    ALTER TABLE test_xxxx add  constraint  pk primary key(id)
    /
    ALTER TABLE test_xxxx MODIFY CONSTRAINT pk DISABLE VALIDATE;
    
    
    insert into test_xxxx
    values(1,'1');
    
    1    1    1    ORA-25128: No insert/update/delete on table with constraint (EDU.PK) disabled and validated
    
    /
    ALTER TABLE test_xxxx MODIFY CONSTRAINT pk enable validate
    /
    insert into test_xxxx
    values(1,'1');
    View Code

    95、

    95.You execute the following command to change the status of the SALES tablespace:
    SQL> ALTER TABLESPACE sales OFFLINE;
    Which statements describe the effect of the command? (Choose all that apply.) 
    A. The tablespace would require recovery to go back online. 
    B. A checkpoint is taken on all data files that are associated with the SALES tablespace. 
    C. The sessions that subsequently try to access the objects in the SALES tablespace receive an error. 
    D. The new status of the SALES tablespace is recorded in the control file when the database instance is closed. 
    Answer: BC
    
    参考文档:Administrator's Guide
    '
    Taking Tablespaces Offline
    
    those users will not be able to access objects in the tablespace while it is offline
    
    ALTER TABLESPACE...OFFLINE
    
    If you must take a tablespace offline, use the NORMAL clause (the default) if possible. 
    This setting guarantees that the tablespace will not require recovery to come back online, 
    even if after incomplete recovery you reset the redo log sequence using an ALTER DATABASE OPEN RESETLOGS statement. 
    
    
    NORMAL   
    When you specify OFFLINE NORMAL, the database takes a checkpoint for all data files of the tablespace as it takes them offline. NORMALis the default
    
    TEMPORARY
    If no files are offline, but you use the temporary clause, media recovery is not required to bring the tablespace back online. 
    However, if one or more files of the tablespace are offline because of write errors, and you take the tablespace offline temporarily, 
    the tablespace requires recovery before you can bring it back online
    
    IMMEDIATE
    A tablespace can be taken offline immediately, without the database taking a checkpoint on any of the data files. 
    When you specify OFFLINE IMMEDIATE, media recovery for the tablespace is required before the tablespace can be brought online. 
    You cannot take a tablespace offline immediately if the database is running in NOARCHIVELOG mode.
    
    
    Specify TEMPORARY only when you cannot take the tablespace offline normally. 
    In this case, only the files taken offline because of errors need to be recovered before the tablespace can be brought online. 
    Specify IMMEDIATE only after trying both the normal and temporary settings.
    View Code
  • 相关阅读:
    Unity NGUI 2D场景添加按钮
    EaseType缓动函数
    在没有网络的情况下用安卓手机和数据线让台式电脑上网
    面向对象编程
    static与C#中的static
    C#基础
    iSensor APP 之 摄像头调试 OV5642
    iSensor APP 之 摄像头调试 OV9655
    USB3.0之高速视频传输测试 双目相机(mt9p031、mt9m001)带宽高达300M测试 配合isensor测试 500万像素15fps
    模拟摄像头解码模块最新测试 TVP5150模块 FPGA+SDRAM+TVP5150+VGA 实现PAL AV输入 VGA视频输出
  • 原文地址:https://www.cnblogs.com/huanhuanang/p/5358286.html
Copyright © 2011-2022 走看看