15 manipulating large objects

Upload: rashmihr

Post on 30-May-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 15 Manipulating Large Objects

    1/5

    Which statement about internal LOBs is true?

    A BFILE is an internalLOB.

    Internal LOBs are stored in the database.

    Internal LOBs can be accessed only in read-only mode from an Oracleserver.

    The Oracle9i server performs an implicit conversion between internal and externalLOBs.

    Explanation:LOB data types store large, unstructured data, including text, graphic images, and video clips.There are two types of LOBs, internal and external. All LOB columns store a locator. If a LOB isinternal, the locator points to a LOB segment inside the database. If a LOB is external, thelocator points to an external OS location. BFILE represents a binary file stored in the OS outsideof the database and is an external LOB. The BFILE stores a file locator to the external file.External LOBs are read-only and cannot participate in transactions. The Oracle9i serverperforms implicit conversions between CLOB and VARCHAR2 data types. Implicit conversionsbetween other LOBs are not possible.

    Which procedure would you use to close a BFILE that is being accessed?

    DBMS_LOB.FILECLOSE

    DBMS_LOB.WRITE

    DBMS_LOB.BFILENAME

    DBMS_LOB.READ

    DBMS_LOB.FILEEXISTS

  • 8/9/2019 15 Manipulating Large Objects

    2/5

    Explanation:LOB data types store large, unstructured data, including text, graphic images, and video clips.There are two types of LOBs, internal and external. All LOB columns store a locator. If a LOB isinternal, the locator points to a LOB segment inside the database. If a LOB is external, thelocator points to an external OS location. BFILE represents a binary file stored in the OS outsideof the database and is an external LOB. The BFILE stores a file locator to the external file.External LOBs are read-only and cannot participate in transactions. UseDBMS_LOB.FILECLOSE to close a BFILE that is being accessed.

    Which function or procedure would you use to initialize a BFILE column for inserting

    data?

    BFILE

    TO_BFILE

    BFILENAME

    DBMS_LOB.READ

    DBMS_LOB.FILEEXISTS

    Explanation:LOB data types store large, unstructured data, including text, graphic images, and video clips.There are two types of LOBs, internal and external. All LOB columns store a locator. If a LOB isinternal, the locator points to a LOB segment inside the database. If a LOB is external, thelocator points to an external OS location. BFILE represents a binary file stored in the OS outsideof the database and is an external LOB. The BFILE stores a file locator to the external file.

    External LOBs are read-only and cannot participate in transactions. BFILENAME is a built-infunction that can be used to initialize a BFILE column to point to an external file. Use theBFILENAME function in an INSERT statement to associate a BFILE column value with anexternal OS file.

  • 8/9/2019 15 Manipulating Large Objects

    3/5

    The resume column is of LONG data type and has a NOT NULL constraint.

    Evaluate this statement:

    ALTER TABLE employeeMODIFY (resume CLOB);

    Which statement is true?

    The statement will add a new column to an existingtable.

    The NOT NULL constraint will not be migrated to the LOBcolumn.

    The statement will convert a LONG data type column to a LOB data type.

    The statement will return a syntaxerror.

    Explanation:You can migrate LONG columns to LOB columns to move existing tables containing LONGcolumns to use LOBs. To migrate the data from a LONG column to a CLOB or an NCLOB or a

    LONG RAW to a BLOB, use the ALTER TABLE statement. The syntax is:

    ALTER TABLE [schema.] table_nameMODIFY (long_col_name {CLOB | BLOB | NCLOB};

    In this scenario, the ALTER TABLE statement migrates the RESUME column that is a LONGdata type to a CLOB data type.

    Which statement would you use to migrate a LONG data type to a LOB data type?

    ALTER TABLE

    ALTER COLUMN

  • 8/9/2019 15 Manipulating Large Objects

    4/5

    CREATETABLE

    ALTERDATABASE

    You cannot migrate a LONG data type column to a LOB datatype.

    Explanation:You can migrate LONG columns to LOB columns to move existing tables containing LONGcolumns to use LOBs. To migrate the data from a LONG column to a CLOB or an NCLOB or aLONG RAW to a BLOB, use the ALTER TABLE statement.

    Which type of LOB represents a multi-byte character object?

    BLOB

    CLOB

    BFILE

    NCLOB

    Explanation:LOB data types store large, unstructured data, including text, graphic images, and video clips.NCLOB represents a multibyte character object. BLOB represents a binary large object. CLOBrepresents a character large object. BFILE represents a binary file stored in the OS outside ofthe database. The BFILE stores a file locator to the external file.

  • 8/9/2019 15 Manipulating Large Objects

    5/5

    Which Oracle supplied package manages LOBs?

    UTL_LOB

    DBMS_LOB

    UTL_MANAGE_LOB

    DBMS_MANAGE_LOB

    Explanation:The DMBS_LOB package contains functions and procedures to access and manipulate internaland external LOBs. This package contains two types of functions and routines, mutators andobservers. Mutators modify LOB values and observers read LOB values. The mutators includeAPPEND, COPY, ERASE, TRIM, WRITE, FILECLOSE, FILECLOSEALL, and FILEOPEN. Theobservers include COMPARE, FILEGETNAME, INSTR, GETLENGTH, READ, SUBSTR,FILEEXISTS, and FILEISOPEN. The FILECLOSE, FILECLOSEALL, FILEEXISTS,FILEGETNAME, FILEISOPEN, and FILEOPEN routines are specific to BFILEs.

    The remaining options are invalid.