Blog

  • Creating a Default Temporary Tablespace

    staff augmentation service

    When you create a default temporary tablespace, Oracle Database assigns it as the temporary tablespace for users who are not explicitly assigned a temporary tablespace.

    software development

    To create a default temporary tablespace for the database:

    • Include the DEFAULT TEMPORARY TABLESPACE clause in the CREATE DATABASE statement.

    supply chain

    You can explicitly assign a temporary tablespace or tablespace group to a user in the CREATE USER statement. However, if you do not do so, and if no default temporary tablespace has been specified for the database, then by default these users are assigned the SYSTEM tablespace as their temporary tablespace. It is not good practice to store temporary data in the SYSTEM tablespace, and it is cumbersome to assign every user a temporary tablespace individually. Therefore, Oracle recommends that you use the DEFAULT TEMPORARY TABLESPACE clause of CREATE DATABASE.

    testing

  • Advantages of Attribute-Clustered Tables

    The primary benefit of attribute-clustered tables is I/O reduction, which can significantly reduce the I/O cost and CPU cost of table scans. I/O reduction occurs either with zones or by reducing physical I/O through closer physical proximity on disk for the clustered values.

    testing

    An attribute-clustered table has the following advantages:

    • You can cluster fact tables based on dimension columns in star schemas.In star schemas, most queries qualify dimension tables and not fact tables, so clustering by fact table columns is not effective. Oracle Database supports clustering on columns in dimension tables.
    • I/O reduction can occur in several different scenarios:
      • When used with Oracle Exadata Storage Indexes, Oracle In-Memory min/max pruning, or zone maps
      • In OLTP applications for queries that qualify a prefix and use attribute clustering with linear order
      • On a subset of the clustering columns for BY INTERLEAVED ORDER clustering
    • Attribute clustering can improve data compression, and in this way indirectly improve table scan costs.When the same values are close to each other on disk, the database can more easily compress them.
    • Oracle Database does not incur the storage and maintenance cost of an index.

    web development

  • Using Automatic Undo Management: Creating an Undo Tablespace

    Automatic undo management uses an undo tablespace.

    • To enable automatic undo management, set the UNDO_MANAGEMENT initialization parameter to AUTO in your initialization parameter file. Or, omit this parameter, and the database defaults to automatic undo management.

    it services

    In this mode, undo data is stored in an undo tablespace and is managed by Oracle Database. To define and name the undo tablespace yourself, you must include the UNDO TABLESPACE clause in the CREATE DATABASE statement at database creation time. If you omit this clause, and automatic undo management is enabled, then the database creates a default undo tablespace named SYS_UNDOTBS.

    mobile app development

    Creating a Default Permanent Tablespace

    Oracle strongly recommends that you create a default permanent tablespace. Oracle Database assigns to this tablespace any non-SYSTEM users for whom you do not explicitly specify a different permanent tablespace.

    quote

    To specify a default permanent tablespace for the database:

    • Include the DEFAULT TABLESPACE clause in the CREATE DATABASE statement

    If you do not specify the DEFAULT TABLESPACE clause, then the SYSTEM tablespace is the default permanent tablespace for non-SYSTEM users.

    school management

  • Overview of Attribute-Clustered Tables

    An attribute-clustered table is a heap-organized table that stores data in close proximity on disk based on user-specified clustering directives. The directives specify columns in single or multiple tables.

    school management

    The directives are as follows:

    • The CLUSTERING ... BY LINEAR ORDER directive orders data in a table according to specified columns.Consider using BY LINEAR ORDER clustering, which is the default, when queries qualify the prefix of columns specified in the clustering clause. For example, if queries of sh.sales often specify either a customer ID or both customer ID and product ID, then you could cluster data in the table using the linear column order cust_idprod_id.
      software development
    • The CLUSTERING ... BY INTERLEAVED ORDER directive orders data in one or more tables using a special algorithm, similar to a Z-order function, that permits multicolumn I/O reduction.Consider using BY INTERLEAVED ORDER clustering when queries specify a variety of column combinations. For example, if queries of sh.sales specify different dimensions in different orders, then you can cluster data in the sales table according to columns in these dimensions.
      staff augmentation service

    Attribute clustering is only available for direct path INSERT operations. It is ignored for conventional DML.

    This section contains the following topics:

    • Advantages of Attribute-Clustered Tables
    • Join Attribute Clustered Tables
    • I/O Reduction Using Zones
    • Attribute-Clustered Tables with Linear Ordering
    • Attribute-Clustered Tables with Interleaved Ordering

    supply chain

  • About the SYSAUX Tablespace

    The SYSAUX tablespace is always created at database creation. The SYSAUX tablespace serves as an auxiliary tablespace to the SYSTEM tablespace. Because it is the default tablespace for many Oracle Database features and products that previously required their own tablespaces, it reduces the number of tablespaces required by the database. It also reduces the load on the SYSTEM tablespace.

    infrastructure services

    You can specify only data file attributes for the SYSAUX tablespace, using the SYSAUX DATAFILE clause in the CREATE DATABASE statement. Mandatory attributes of the SYSAUX tablespace are set by Oracle Database and include:

    • PERMANENT
    • READ WRITE
    • EXTENT MANAGMENT LOCAL
    • SEGMENT SPACE MANAGMENT AUTO

    it consulting

    You cannot alter these attributes with an ALTER TABLESPACE statement, and any attempt to do so will result in an error. You cannot drop or rename the SYSAUX tablespace.

    The size of the SYSAUX tablespace is determined by the size of the database components that occupy SYSAUX. You can view a list of these components by querying the V$SYSAUX_OCCUPANTS view. Based on the initial sizes of these components, the SYSAUX tablespace must be at least 400 MB at the time of database creation. The space requirements of the SYSAUX tablespace will increase after the database is fully deployed, depending on the nature of its use and workload. For more information on how to manage the space consumption of the SYSAUX tablespace on an ongoing basis, see the “Managing the SYSAUX Tablespace”.

    it support

    The SYSAUX tablespace has the same security attributes as the SYSTEM tablespace.

    loyalty

  • Hash Cluster Storage

    Oracle Database allocates space for a hash cluster differently from an indexed cluster.

    loyalty

    In the example in Hash Cluster Creation, HASHKEYS specifies the number of departments likely to exist, whereas SIZE specifies the size of the data associated with each department. The database computes a storage space value based on the following formula:

    CopyHASHKEYS * SIZE / database_block_size
    

    Thus, if the block size is 4096 bytes in the example shown in Hash Cluster Creation, then the database allocates at least 200 blocks to the hash cluster.

    managed it services

    Oracle Database does not limit the number of hash key values that you can insert into the cluster. For example, even though HASHKEYS is 100, nothing prevents you from inserting 200 unique departments in the departments table. However, the efficiency of the hash cluster retrieval diminishes when the number of hash values exceeds the number of hash keys.

    mobile app development

    To illustrate the retrieval issues, assume that block 100 in Figure 2-6 is completely full with rows for department 20. A user inserts a new department with department_id 43 into the departments table. The number of departments exceeds the HASHKEYS value, so the database hashes department_id 43 to hash value 77, which is the same hash value used for department_id 20. Hashing multiple input values to the same output value is called a hash collision.

    quote

    When users insert rows into the cluster for department 43, the database cannot store these rows in block 100, which is full. The database links block 100 to a new overflow block, say block 200, and stores the inserted rows in the new block. Both block 100 and 200 are now eligible to store data for either department. As shown in Figure 2-7, a query of either department 20 or 43 now requires two I/Os to retrieve the data: block 100 and its associated block 200. You can solve this problem by re-creating the cluster with a different HASHKEYS value.

    Figure 2-7 Retrieving Data from a Hash Cluster When a Hash Collision OccursDescription of Figure 2-7 follows
    Description of “Figure 2-7 Retrieving Data from a Hash Cluster When a Hash Collision Occurs”

  • Specify Data File Attributes for the SYSAUX Tablespace

    The SYSAUX tablespace is created by default, but you can specify its data file attributes during database creation.

    erp

    To specify data file attributes for the SYSAUX tablespace:

    • Include the SYSAUX DATAFILE clause in the CREATE DATABASE statement.

    feature

    If you include a DATAFILE clause for the SYSTEM tablespace, then you must specify the SYSAUX DATAFILE clause as well, or the CREATE DATABASE statement will fail. This requirement does not exist if the Oracle Managed Files feature is enabled (see “Specifying Oracle Managed Files at Database Creation”).

    financial

    • About the SYSAUX Tablespace
      The SYSAUX tablespace is always created at database creation. The SYSAUX tablespace serves as an auxiliary tablespace to the SYSTEM tablespace. Because it is the default tablespace for many Oracle Database features and products that previously required their own tablespaces, it reduces the number of tablespaces required by the database. It also reduces the load on the SYSTEM tablespace.

    hrms

  • Hash Cluster Variations

    A single-table hash cluster is an optimized version of a hash cluster that supports only one table at a time. A one-to-one mapping exists between hash keys and rows.

    hrms

    A single-table hash cluster can be beneficial when users require rapid access to a table by primary key. For example, users often look up an employee record in the employees table by employee_id.

    infrastructure services

    A sorted hash cluster stores the rows corresponding to each value of the hash function in such a way that the database can efficiently return them in sorted order. The database performs the optimized sort internally. For applications that always consume data in sorted order, this technique can mean faster retrieval of data. For example, an application might always sort on the order_date column of the orders table.

    it consulting

    See also

    Oracle Database Administrator’s Guide to learn how to create single-table and sorted hash clusters

    it support

  • Creating a Locally Managed SYSTEM Tablespace

    During database creation, create a locally managed SYSTEM tablespace. A locally managed tablespace uses a bitmap stored in each data file to manage the extents.

    crm

    • Specify the EXTENT MANAGEMENT LOCAL clause in the CREATE DATABASE statement to create a locally managed SYSTEM tablespace.

    cyber security

    If you do not specify the EXTENT MANAGEMENT LOCAL clause, then by default the database creates a dictionary-managed SYSTEM tablespace. Dictionary-managed tablespaces are deprecated.

    data analytics

    If you create your database with a locally managed SYSTEM tablespace, and if you are not using Oracle Managed Files, then ensure that the following conditions are met:

    • You specify the DEFAULT TEMPORARY TABLESPACE clause in the CREATE DATABASE statement.
    • You include the UNDO TABLESPACE clause in the CREATE DATABASE statement.

    digital transformation

  • Hash Cluster Queries

    In queries of a hash cluster, the database determines how to hash the key values input by the user.

    digital transformation

    For example, users frequently execute queries such as the following, entering different department ID numbers for p_id:

    CopySELECT *
    FROM   employees
    WHERE  department_id = :p_id;
     
    SELECT * 
    FROM   departments 
    WHERE  department_id = :p_id;
    
    SELECT * 
    FROM   employees e, departments d 
    WHERE  e.department_id = d.department_id
    AND    d.department_id = :p_id;
    

    If a user queries employees in department_id=20, then the database might hash this value to bucket 77. If a user queries employees in department_id=10, then the database might hash this value to bucket 15. The database uses the internally generated hash value to locate the block that contains the employee rows for the requested department.

    erp

    The following illustration depicts a hash cluster segment as a horizontal row of blocks. As shown in the graphic, a query can retrieve data in a single I/O.

    feature

    Figure 2-6 Retrieving Data from a Hash ClusterDescription of Figure 2-6 follows
    Description of “Figure 2-6 Retrieving Data from a Hash Cluster”

    A limitation of hash clusters is the unavailability of range scans on nonindexed cluster keys. Assume no separate index exists for the hash cluster created in Hash Cluster Creation. A query for departments with IDs between 20 and 100 cannot use the hashing algorithm because it cannot hash every possible value between 20 and 100. Because no index exists, the database must perform a full scan.

    financial