Parent and Child Transactions (169)
Transaction-specific temporary tables are accessible by user transactions and theirchild transactions. However, a given transaction-specific temporary table cannot beused concurrently by two transactions in the same session, although it can be used bytransactions in different sessions.If a user transaction does an INSERT into the temporary table, then none of its childtransactions can use the temporary table afterward.If a child transaction does an INSERT into the temporary table, then at the en
Temporary Table Segment Allocation (168)
Temporary tables use temporary segments. Unlike permanent tables, temporary tablesand their indexes do not automatically allocate a segment when they are created.Instead, segments are allocated when the first INSERT (or CREATE TABLE ASSELECT) is performed. This means that if a SELECT, UPDATE, or DELETE is performedbefore the first INSERT, then the table appears to be empty.You can perform DDL statements (ALTER TABLE, DROP TABLE, CREATE INDEX, andso on) on a temporary table only when no session i
Temporary Tables (167)
In addition to permanent tables, Oracle can create temporary tables to holdsession-private data that exists only for the duration of a transaction or session.The CREATE GLOBAL TEMPORARY TABLE statement creates a temporary table that canbe transaction-specific or session-specific. For transaction-specific temporary tables,data exists for the duration of the transaction. For session-specific temporary tables,data exists for the duration of the session. Data in a temporary table is private to these
Nested Tables (166)
You can create a table with a column whose datatype is another table. That is, tablescan be nested within other tables as values in a column. The Oracle database serverstores nested table data out of line from the rows of the parent table, using a storetable that is associated with the nested table column. The parent row contains aunique set identifier value associated with a nested table instance.嵌套表1. 一个表的某列的数据类型可以为另一个表.即一个表可以作为一个列值嵌套在表中.2. Oracle
Partitioned Tables (165)
Partitioned tables allow your data to be broken down into smaller, more manageablepieces called partitions, or even subpartitions. Indexes can be partitioned in similarfashion. Each partition can be managed individually, and can operate independentlyof the other partitions, thus providing a structure that can be better tuned foravailability and performance.分区表1. 用户可以使用分区表将数据划分为更小 , 更易管理的单位 , 这种单位被称为分区.2. 分区还可以被继续划分为子分区 .3. 索引也可以采取
Default Value Insertion and Integrity Constraint Checking (164)
Integrity constraint checking occurs after the row with a default value is inserted. Forexample, a row is inserted into the emp table that does not include avalue for the employee's department number. Because no value is supplied for thedepartment number, Oracle inserts the deptno column's default value of 20. Afterinserting the default value, Oracle checks the FOREIGN KEY integrity constraintdefined on the deptno column.默认值的插入及完整性约束检查1. 当一个包含默认值的行被插入之后将发生完整性
Default Values for Columns (163)
You can assign a default value to a column of a table so that when a new row isinserted and a value for the column is omitted or keyword DEFAULT is supplied, adefault value is supplied automatically. Default column values work as though anINSERT statement actually specifies the default value.The datatype of the default literal or expression must match or be convertible to thecolumn datatype.If a default value is not explicitly defined for a column, then the default for the columnis implicitly se
Nulls Indicate Absence of Value (162)
A null is the absence of a value in a column of a row. Nulls indicate missing,unknown, or inapplicable data. A null should not be used to imply any other value,such as zero. A column allows nulls unless a NOT NULL or PRIMARY KEY integrityconstraint has been defined for the column, in which case no row can be insertedwithout a value for that column.Nulls are stored in the database if they fall between columns with data values. In thesecases they require 1 byte to store the length of the column (z
Using Table Compression (161)
Compression occurs while data is being bulk inserted or bulk loaded. These operationsinclude:■ Direct path SQL*Loader■ CREATE TABLE and AS SELECT statements■ Parallel INSERT (or serial INSERT with an APPEND hint) statementsExisting data in the database can also be compressed by moving it into compressedform through ALTER TABLE and MOVE statements. This operation takes an exclusivelock on the table, and therefore prevents any updates and loads until it completes. Ifthis is not acceptable, then
Table Compression (160)
Oracle's table compression feature compresses data by eliminating duplicate values ina database block. Compressed data stored in a database block (also known as diskpage) is self-contained. That is, all the information needed to re-create theuncompressed data in a block is available within that block. Duplicate values in all therows and columns in a block are stored once at the beginning of the block, in what iscalled a symbol table for that block. All occurrences of such values are replaced wit
Column Order (159)
The column order is the same for all rows in a given table. Columns are usually storedin the order in which they were listed in the CREATE TABLE statement, but this is notguaranteed. For example, if a table has a column of datatype LONG, then Oracle alwaysstores this column last. Also, if a table is altered so that a new column is added, thenthe new column becomes the last column stored.In general, try to place columns that frequently contain nulls last so that rows take lessspace. Note, though,
Rowids of Row Pieces (158)
The rowid identifies each row piece by its location or address. After they are assigned,a given row piece retains its rowid until the corresponding row is deleted or exportedand imported using Oracle utilities. For clustered tables, if the cluster key values of arow change, then the row keeps the same rowid but also gets an additional pointerrowid for the new values.Because rowids are constant for the lifetime of a row piece, it is useful to referencerowids in SQL statements such as SELECT, UPDA
row header format (157)
Each row piece, chained or unchained, contains a row header and data for all or someof the row’s columns. Individual columns can also span row pieces and, consequently,data blocks.The row header precedes the data and contains information about:■ Row pieces■ Chaining (for chained row pieces only)■ Columns in the row piece■ Cluster keys (for clustered data only)A row fully contained in one block has at least 3 bytes of row header. After the rowheader information, each row contains column leng
Row Format and Size (156)
Oracle stores each row of a database table containing data for less than 256 columns asone or more row pieces. If an entire row can be inserted into a single data block, thenOracle stores the row as one row piece. However, if all of a row’s data cannot beinserted into a single data block or if an update to an existing row causes the row tooutgrow its data block, then Oracle stores the row using multiple row pieces. A datablock usually contains only one row piece for each row. When Oracle must s
How Table Data Is Stored (155)
When you create a table, Oracle automatically allocates a data segment in a tablespaceto hold the table’s future data. You can control the allocation and use of space for atable’s data segment in the following ways:■ You can control the amount of space allocated to the data segment by setting thestorage parameters for the data segment.■ You can control the use of the free space in the data blocks that constitute the datasegment’s extents by setting the PCTFREE and PCTUSED parameters for the
Overview of Tables (154)
Tables are the basic unit of data storage in an Oracle database. Data is stored in rowsand columns. You define a table with a table name (such as employees) and set ofcolumns. You give each column a column name (such as employee_id, last_name,and job_id), a datatype (such as VARCHAR2, DATE, or NUMBER), and a width. Thewidth can be predetermined by the datatype, as in DATE. If columns are of the NUMBERdatatype, define precision and scale instead of width. A row is a collection of columninformatio
Introduction to Schema Objects (153)
A schema is a collection of logical structures of data, or schema objects. A schema isowned by a database user and has the same name as that user. Each user owns a singleschema. Schema objects are logical data storage structures. Schema objects do not have aone-to-one correspondence to physical files on disk that store their information.However, Oracle stores a schema object logically within a tablespace of the database.The data of each object is physically contained in one or more of the tables
一分钟脉搏70次
今天测了一下脉搏 , 一分钟70次 .在学校里面一分钟可是低于60次啊 , 看样子得加紧锻炼身体了 .[@more@]
索引为什么比其所对应的表大
翻了一下pub上面2002年的老帖子Index growth could be due to the manner in which Oracle splits the blocks as the index is populated. Indexes are created as b*trees. The only balancing occurs as a 50:50 block splits. Each leaf block is allocated a range of key values. When a value is deleted the space is not immediately available for any new key values - only for ones that fall in the existing range for the block. A block is only placed back on the free list when all the index entries for that block
Transaction Control Statements in Autonomous Blocks (152)
Transaction control statements in an autonomous PL/SQL block apply only to thecurrently active autonomous transaction. Examples of such statements are:SET TRANSACTIONCOMMITROLLBACKSAVEPOINTROLLBACK TO SAVEPOINTSimilarly, transaction control statements in the main transaction apply only to thattransaction and not to any autonomous transaction that it calls. For example, rollingback the main transaction to a savepoint taken before the beginning of an autonomoustransaction does not undo the autonom