zoukankan      html  css  js  c++  java
  • OCP-1Z0-052-V8.02-150题

    150. The user HR receives the following error while inserting data into the TTK table:

    ERROR at line 1:

    ORA-01653: unable to extend table HR.TTK by 128 in tablespace SMD

    Upon investigation, you find that SMD is a small file tablespace. Which three action would allow the user

    to insert data? (Choose three.)

    A.Add a data file to the SMD tablespace.

    B.Add a data file to the temporary tablespace associated with the user HR.

    C.Resize the data file associated with the SMD tablespace to make it larger.

    D.Alter the data file associated with the SMD tablespace to grow automatically.

    E.Change the segment space management for the SMD tablespace to automatic.

    n segments is managed through free lists.

    Answer: ACD

    答案解析:

    此题考怎么增加表空间的大小,有三种方法

    1、增加一个文件:ALTER TABLESPACE lmtbsb ADD DATAFILE '/u02/oracle/data/lmtbsb02.dbf' SIZE 1M;

    2、改变原来数据文件的大小:ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/stuff01.dbf' RESIZE 300M;

    3、设置自动增长:ALTER TABLESPACE users ADD DATAFILE '/u02/oracle/rbdb1/users03.dbf' SIZE 10M AUTOEXTEND ON NEXT 512K MAXSIZE 250M;

    故答案选ACD

    Increasing the Size of a Tablespace

    You can increase the size of a tablespace by either increasing the size of a data file in the tablespace or adding one. See "Creating Data Files and Adding Data Files to a Tablespace" for more information.

    Additionally, you can enable automatic file extension (AUTOEXTEND) to data files and bigfile tablespaces. See "Enabling and Disabling Automatic Extension for a Data File".

    Manually Resizing a Data File

    You can manually increase or decrease the size of a data file using the ALTER DATABASE statement. Therefore, you can add more space to your database without adding more data files. This is beneficial if you are concerned about reaching the maximum number of data files allowed in your database.

    For a bigfile tablespace you can use the ALTER TABLESPACE statement to resize a data file. You are not allowed to add a data file to a bigfile tablespace.

    Manually reducing the sizes of data files enables you to reclaim unused space in the database. This is useful for correcting errors in estimates of space requirements.

    In the next example, assume that the data file /u02/oracle/rbdb1/stuff01.dbf has extended up to 250M. However, because its tablespace now stores smaller objects, the data file can be reduced in size.

    The following statement decreases the size of data file /u02/oracle/rbdb1/stuff01.dbf:

    ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/stuff01.dbf'
    RESIZE 100M;

    Note:

    It is not always possible to decrease the size of a file to a specific value. It could be that the file contains data beyond the specified decreased size, in which case the database will return an error.

    Enabling and Disabling Automatic Extension for a Data File

    You can create data files or alter existing data files so that they automatically increase in size when more space is needed in the database. The file size increases in specified increments up to a specified maximum.

    Setting your data files to extend automatically provides these advantages:

    • Reduces the need for immediate intervention when a tablespace runs out of space

    • Ensures applications will not halt or be suspended because of failures to allocate extents

    To determine whether a data file is auto-extensible, query the DBA_DATA_FILES view and examine the AUTOEXTENSIBLE column.

    You can specify automatic file extension by specifying an AUTOEXTEND ON clause when you create data files using the following SQL statements:

    • CREATE DATABASE

    • ALTER DATABASE

    • CREATE TABLESPACE

    • ALTER TABLESPACE

    You can enable or disable automatic file extension for existing data files, or manually resize a data file, using the ALTER DATABASE statement. For a bigfile tablespace, you are able to perform these operations using the ALTER TABLESPACE statement.

    The following example enables automatic extension for a data file added to the users tablespace:

    ALTER TABLESPACE users
    ADD DATAFILE '/u02/oracle/rbdb1/users03.dbf' SIZE 10M
    AUTOEXTEND ON
    NEXT 512K
    MAXSIZE 250M;

    The value of NEXT is the minimum size of the increments added to the file when it extends. The value of MAXSIZE is the maximum size to which the file can automatically extend.

    The next example disables the automatic extension for the data file.

    ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/users03.dbf'
    AUTOEXTEND OFF;

    官方参考:http://docs.oracle.com/cd/E11882_01/server.112/e25494/tspaces.htm#BABDFCAE

  • 相关阅读:
    【Vue】详解Vue生命周期
    千万不要用window自带文本编辑器编辑配置文件或者代码
    [其它]iOS 13 正式版发布 iPhone 6s或更新型号均可升级
    [转]解决ubuntu16.04 ‘E: 无法获得锁 /var/lib/dpkg/lock-frontend
    [golang]使用gomail发邮件(在Go中发送电子邮件的最佳方式)
    [golang]按图片中心旋转后的新图左顶点和原图左顶点的偏移量计算
    分布式CAP定理,为什么不能同时满足三个特性?
    Java如何运行一个class文件的main方法
    数据库的四大特性以及四个隔离级别和引发的问题
    Redis为什么可以支持那么大的并发访问量?为什么redis没有单点并发瓶颈?
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317152.html
Copyright © 2011-2022 走看看