Database 版 (精华区)

发信人: rhine (风雨无阻), 信区: Database
标  题: Oracle DBA Guide, V8, part 10
发信站: 哈工大紫丁香 (2000年07月08日20:31:31 星期六), 站内信件

发信人: chendu (Oracle Only), 信区: Database
标  题: Oracle DBA Guide, V8, part 10
发信站: BBS 水木清华站 (Sat Nov 13 15:26:05 1999)

Hi, required by several friends, I am posting the
Oracle Database Administrator's Guide version 8
here.

Web Master, if my post it too long and not good for
the bbs, please delete it and I am sorry for it.

Hoping everyone enjoy it!

Good luck!

-------------------------------------------------------------------------
10
Guidelines for Managing Schema Objects
This chapter describes guidelines for managing schema objects, and includes
the following topics:
Managing Space in Data Blocks
Setting Storage Parameters
Deallocating Space
Deallocating Space
Understanding Space Use of Datatypes
You should familiarize yourself with the concepts in this chapter before att
empting to manage specific schema objects as described in Chapters 11-16.
Managing Space in Data Blocks
This section describes the various aspects of managing space in data blocks,
 and includes the following topics:
The PCTFREE Parameter
The PCTUSED Parameter
Selecting Associated PCTUSED and PCTFREE Values
You can use the PCTFREE and PCTUSED parameters to make the following changes
:
increase the performance of writing and retrieving data
decrease the amount of unused space in data blocks
decrease the amount of row chaining between data blocks
The PCTFREE Parameter
The PCTFREE parameter is used to set the percentage of a block to be reserve
d for possible updates to rows that already are contained in that block. For
 example, assume that you specify the following parameter within a CREATE TA
BLE statement:
PCTFREE 20
This indicates that 20% of each data block used for this table's data segmen
t will be kept free and available for possible updates to the existing rows
already within each block. Figure 10-1 illustrates PCTFREE.
Figure 10-1 PCTFREE
Notice that before the block reaches PCTFREE, the free space of the data blo
ck is filled by both the insertion of new rows and by the growth of the data
 block header.
Specifying PCTFREE
The default for PCTFREE is 10 percent. You can use any integer between 0 and
 99, inclusive, as long as the sum of PCTFREE and PCTUSED does not exceed 10
0.
A smaller PCTFREE has the following effects:
reserves less room for updates to expand existing table rows
allows inserts to fill the block more completely
may save space, because the total data for a table or index is stored in few
er blocks (more rows or entries per block)
A small PCTFREE might be suitable, for example, for a segment that is rarely
 changed.
A larger PCTFREE has the following effects:
reserves more room for future updates to existing table rows
may require more blocks for the same amount of inserted data (inserting fewe
r rows per block)
may improve update performance, because Oracle does not need to chain row pi
eces as frequently, if ever
eces as frequently, if ever
A large PCTFREE is suitable, for example, for segments that are frequently u
pdated.
Ensure that you understand the nature of the table or index data before sett
ing PCTFREE. Updates can cause rows to grow. New values might not be the sam
e size as values they replace. If there are many updates in which data value
s get larger, PCTFREE should be increased. If updates to rows do not affect
the total row width, PCTFREE can be low. Your goal is to find a satisfactory
 trade-off between densely packed data and good update performance.
PCTFREE for Non-Clustered Tables If the data in the rows of a non-clustered
table is likely to increase in size over time, reserve some space for these
updates. Otherwise, updated rows are likely to be chained among blocks.
PCTFREE for Clustered Tables The discussion for non-clustered tables also ap
plies to clustered tables. However, if PCTFREE is reached, new rows from any
 table contained in the same cluster key go into a new data block that is ch
ained to the existing cluster key.
PCTFREE for Indexes You can specify PCTFREE only when initially creating an
index.
The PCTUSED Parameter
After a data block becomes full as determined by PCTFREE, Oracle does not co
nsider the block for the insertion of new rows until the percentage of the b
lock being used falls below the parameter PCTUSED. Before this value is achi
eved, Oracle uses the free space of the data block only for updates to rows
already contained in the data block. For example, assume that you specify th
e following parameter within a CREATE TABLE statement:
PCTUSED 40
In this case, a data block used for this table's data segment is not conside
red for the insertion of any new rows until the amount of used space in the
block falls to 39% or less (assuming that the block's used space has previou
sly reached PCTFREE). Figure 10-2 illustrates this.
Figure 10-2 PCTUSED
Specifying PCTUSED
The default value for PCTUSED is 40 percent. After the free space in a data
block reaches PCTFREE, no new rows are inserted in that block until the perc
entage of space used falls below PCTUSED. The percent value is for the block
 space available for data after overhead is subtracted from total space.
You can specify any integer between 0 and 99 (inclusive) for PCTUSED, as lon
g as the sum of PCTUSED and PCTFREE does not exceed 100.
A smaller PCTUSED has the following effects:
reduces processing costs incurred during UPDATE and DELETE statements for mo
ving a block to the free list when it has fallen below that percentage of us
age
increases the unused space in a database
A larger PCTUSED has the following effects:
improves space efficiency
improves space efficiency
increases processing cost during INSERTs and UPDATEs
Selecting Associated PCTUSED and PCTFREE Values
If you decide not to use the default values for PCTFREE or PCTUSED, keep the
 following guidelines in mind:
The sum of PCTFREE and PCTUSED must be equal to or less than 100.
If the sum equals 100, then Oracle attempts to keep no more than PCTFREE fre
e space, and processing costs are highest.
Block overhead is not included in the computation of PCTUSED or PCTFREE.
The smaller the difference between 100 and the sum of PCTFREE and PCTUSED (a
s in PCTUSED of 75, PCTFREE of 20), the more efficient space usage is, at so
me performance cost.
Examples of Choosing PCTFREE and PCTUSED Values
The following examples show how and why specific values for PCTFREE and PCTU
SED are specified for tables.
Example 1
  Scenario:
  Common activity includes UPDATE statements that increase the size of the r
ows.
  Settings:
  PCTFREE = 20
PCTUSED = 40
Example 2
Example 2
  Scenario:
  Most activity includes INSERT and DELETE statements, and UPDATE statements
 that do not increase the size of affected rows.
  Settings:
  PCTFREE = 5
PCTUSED = 60
  Explanation:
  PCTFREE is set to 5 because most
UPDATE statements do not increase row
sizes. PCTUSED is set to 60 so that space
freed by DELETE statements is used soon,
yet processing is minimized.
Example 3
  Scenario:
  The table is very large; therefore,
storage is a primary concern. Most activity includes read-only transactions.

  Settings:
  PCTFREE = 5
PCTUSED = 40
  Explanation:
  PCTFREE is set to 5 because this is a large table and you want to complete
ly fill each block.
Setting Storage Parameters
This section describes the storage parameters you can set for various data s
tructures, and includes the following topics:
Storage Parameters You Can Specify
Setting INITRANS and MAXTRANS
Setting Default Storage Parameters for Segments in a Tablespace
Setting Storage Parameters for Data Segments
Setting Storage Parameters for Index Segments
Setting Storage Parameters for LOB Segments
Changing Values for Storage Parameters
Understanding Precedence in Storage Parameters
You can set storage parameters for the following types of logical storage st
ructures:
tablespaces (most defaults for any segment in the tablespace)
tables, clusters, snapshots, and snapshot logs (data segments)
indexes (index segments)
rollback segments
Storage Parameters You Can Specify
Every database has default values for storage parameters. You can specify de
faults for a tablespace, which override the system defaults to become the de
faults for objects created in that tablespace only. Furthermore, you can spe
faults for objects created in that tablespace only. Furthermore, you can spe
cify storage settings for each individual object. The storage parameters you
 can set are:
INITIAL
The size, in bytes, of the first extent allocated when a segment is created.

Default: 5 data blocks
Minimum: 2 data blocks (rounded up)
Maximum: operating system specific
NEXT
The size, in bytes, of the next incremental extent to be allocated for a seg
ment. The second extent is equal to the original setting for NEXT. From ther
e forward, NEXT is set to the previous size of NEXT multiplied by (1 + PCTIN
CREASE/100).
Default: 5 data blocks
Minimum: 1 data block
Maximum: operating system specific
MAXEXTENTS
The total number of extents, including the first, that can ever be allocated
 for the segment.
Default: dependent on the data block size and operating system
Minimum: 1 (extent)
Maximum: unlimited
Maximum: unlimited
MINEXTENTS
The total number of extents to be allocated when the segment is created. Thi
s allows for a large allocation of space at creation time, even if contiguou
s space is not available.
Default: 1 (extent)
Minimum: 1 (extent)
Maximum: unlimited
PCTINCREASE
The percent by which each incremental extent grows over the last incremental
 extent allocated for a segment. If PCTINCREASE is 0, then all incremental e
xtents are the same size. If PCTINCREASE is greater than zero, then each tim
e NEXT is calculated, it grows by PCTINCREASE. PCTINCREASE cannot be negativ
e.
The new NEXT equals 1 + PCTINCREASE/100, multiplied by the size of the last
incremental extent (the old NEXT) and rounded up to the next multiple of a b
lock size.
Default: 50 (%)
Minimum: 0 (%)
Maximum: operating system specific
INITRANS
Reserves a pre-allocated amount of space for an initial number of DML transa
ction entries to access rows in the data block concurrently. Space is reserv
ed in the headers of all data blocks in the associated data or index segment
.
The default value is 1 for tables and 2 for clusters and indexes.
MAXTRANS
As multiple transactions concurrently access the rows of the same data block
, space is allocated for each DML transaction's entry in the block. Once the
 space reserved by INITRANS is depleted, space for additional transaction en
tries is allocated out of the free space in a block, if available. Once allo
cated, this space effectively becomes a permanent part of the block header.
The MAXTRANS parameter limits the number of transaction entries that can con
currently use data in a data block. Therefore, you can limit the amount of f
ree space that can be allocated for transaction entries in a data block usin
g MAXTRANS.
The default value is an operating system-specific function of block size, no
t exceeding 255.
See Also: For specific details about storage parameters, see the Oracle8 SQL
 Reference.
Some defaults are operating system specific; see your operating system-speci
fic Oracle documentation.
Setting INITRANS and MAXTRANS
Transaction entry settings for the data blocks allocated for a table, cluste
r, or index should be set individually for each object based on the followin
r, or index should be set individually for each object based on the followin
g criteria:
the space you would like to reserve for transaction entries compared to the
space you would reserve for database data
the number of concurrent transactions that are likely to touch the same data
 blocks at any given time
For example, if a table is very large and only a small number of users simul
taneously access the table, the chances of multiple concurrent transactions
requiring access to the same data block is low. Therefore, INITRANS can be s
et low, especially if space is at a premium in the database.
Alternatively, assume that a table is usually accessed by many users at the
same time. In this case, you might consider pre-allocating transaction entry
 space by using a high INITRANS (to eliminate the overhead of having to allo
cate transaction entry space, as required when the object is in use) and all
owing a higher MAXTRANS so that no user has to wait to access any necessary
data blocks.
Setting Default Storage Parameters for Segments in a Tablespace
You can set default storage parameters for each tablespace of a database. An
y storage parameter that you do not explicitly set when creating or subseque
ntly altering a segment in a tablespace automatically is set to the correspo
nding default storage parameter for the tablespace in which the segment resi
des.
With partitioned tables, you can set default storage parameters at the table
 level. When creating a new partition of the table, the default storage para
meters are inherited from the partitioned table; if there is no partitioned
table, then they are inherited from the tablespace.
When specifying MINEXTENTS at the tablespace level, any extent allocated in
the tablespace is rounded to a multiple of the number of minimum extents. Ba
sically, the number of extents is a multiple of the number of blocks.
Setting Storage Parameters for Data Segments
You can set the storage parameters for the data segment of a non-clustered t
able, snapshot, or snapshot log using the STORAGE clause of the CREATE or AL
TER statement for tables, snapshots, or snapshot logs.
In contrast, you set the storage parameters for the data segments of a clust
er using the STORAGE clause of the CREATE CLUSTER or ALTER CLUSTER command,
rather than the individual CREATE or ALTER commands that put tables and snap
shots into the cluster. Storage parameters specified when creating or alteri
ng a clustered table or snapshot are ignored. The storage parameters set for
 the cluster override the table's storage parameters.
Setting Storage Parameters for Index Segments
Storage parameters for an index segment created for a table index can be set
 using the STORAGE clause of the CREATE INDEX or ALTER INDEX command. Storag
e parameters of an index segment created for the index used to enforce a pri
mary key or unique key constraint can be set in the ENABLE clause of the CRE
ATE TABLE or ALTER TABLE commands or the STORAGE clause of the ALTER INDEX c
ATE TABLE or ALTER TABLE commands or the STORAGE clause of the ALTER INDEX c
ommand.
A PCTFREE setting for an index only has an effect when the index is created.
 You cannot specify PCTUSED for an index segment.
Setting Storage Parameters for LOB Segments
You can set storage parameters for LOB segments using the NOCACHE, NOLOGGING
 and PCTVERSION LOB storage parameters of the CREATE TABLE command.
Changing Values for Storage Parameters
You can alter default storage parameters for tablespaces and specific storag
e parameters for individual segments if the current settings are incorrect.
All default storage parameters can be reset for a tablespace. However, chang
es affect only new objects created in the tablespace, or new extents allocat
ed for a segment.
The INITIAL and MINEXTENTS storage parameters cannot be altered for an exist
ing table, cluster, index, or rollback segment. If only NEXT is altered for
a segment, the next incremental extent is the size of the new NEXT, and subs
equent extents can grow by PCTINCREASE as usual.
If both NEXT and PCTINCREASE are altered for a segment, the next extent is t
he new value of NEXT, and from that point forward, NEXT is calculated using
PCTINCREASE as usual.
Understanding Precedence in Storage Parameters
The storage parameters in effect at a given time are determined by the follo
wing types of SQL statements, listed in order of precedence:
ALTER TABLE/CLUSTER/SNAPSHOT/SNAPSHOT LOG/INDEX/ROLLBACK SEGMENT statement
CREATE TABLE/CLUSTER/SNAPSHOT/SNAPSHOT LOG/CREATE INDEX/ROLLBACK SEGMENT sta
tement
ALTER TABLESPACE statement
CREATE TABLESPACE statement
Oracle default statement
Any storage parameter specified at the object level overrides the correspond
ing option set at the tablespace level. When storage parameters are not expl
icitly set at the object level, they default to those at the tablespace leve
l. When storage parameters are not set at the tablespace level, Oracle syste
m defaults apply. If storage parameters are altered, the new options apply o
nly to the extents not yet allocated.
----------------------------------------------------------------------------
----
Note:
The storage parameters for temporary segments always use the default storage
 parameters set for the associated tablespace.
----------------------------------------------------------------------------
----
Storage Parameter Example
Assume the following statement has been executed:
CREATE TABLE test_storage
CREATE TABLE test_storage
   ( . . . )
   STORAGE (INITIAL 100K   NEXT 100K
      MINEXTENTS 2   MAXEXTENTS 5
      PCTINCREASE 50);
Also assume that the initialization parameter DB_BLOCK_SIZE is set to 2K. Th
e following table shows how extents are allocated for the TEST_STORAGE table
. Also shown is the value for the incremental extent, as can be seen in the
NEXT column of the USER_SEGMENTS or DBA_SEGMENTS data dictionary views:
Table 10-1 Extent Allocations
Extent#   Extent Size   Value for NEXT
1
  50 blocks or 102400 bytes
  50 blocks or 102400 bytes
2
  50 blocks or 102400 bytes
  75 blocks or153600 bytes
3
  75 blocks or 153600 bytes
  113 blocks or 231424 bytes
4
  115 blocks or 235520 bytes
  170 blocks or 348160 bytes
5
  170 blocks or 348160 bytes
  255 blocks or 522240 bytes
If you change the NEXT or PCTINCREASE storage parameters with an ALTER state
ment (such as ALTER TABLE), the specified value replaces the current value s
tored in the data dictionary. For example, the following statement modifies
the NEXT storage parameter of the TEST_STORAGE table before the third extent
 is allocated for the table:
ALTER TABLE test_storage STORAGE (NEXT 500K);
As a result, the third extent is 500K when allocated, the fourth is (500K*1.
5)=750K, and so on.
Deallocating Space
This section describes aspects of deallocating unused space, and includes th
e following topics:
Viewing the High Water Mark
Issuing Space Deallocation Statements
It is not uncommon to allocate space to a segment, only to find out later th
at it is not being used. For example, you may set PCTINCREASE to a high valu
e, which could create a large extent that is only partially used. Or you cou
ld explicitly overallocate space by issuing the ALTER TABLE ALLOCATE EXTENT
statement. If you find that you have unused or overallocated space, you can
release it so that the unused space can be used by other segments.
n be used by other segments.
Viewing the High Water Mark
Prior to deallocation, you can use the DBMS_SPACE package, which contains a
procedure (UNUSED_SPACE) that returns information about the position of the
high water mark and the amount of unused space in a segment.
Within a segment, the high water mark indicates the amount of used space. Yo
u cannot release space below the high water mark (even if there is no data i
n the space you wish to deallocate). However, if the segment is completely e
mpty, you can release space using the TRUNCATE DROP STORAGE statement.
Issuing Space Deallocation Statements
The following statements deallocate unused space in a segment (table, index
or cluster). The KEEP clause is optional.
ALTER TABLE table DEALLOCATE UNUSED KEEP integer;
ALTER INDEX index DEALLOCATE UNUSED KEEP integer;
ALTER CLUSTER cluster DEALLOCATE UNUSED KEEP integer;
When you explicitly identify an amount of unused space to KEEP, this space i
s retained while the remaining unused space is deallocated. If the remaining
 number of extents becomes smaller than MINEXTENTS, the MINEXTENTS value cha
nges to reflect the new number. If the initial extent becomes smaller, the I
NITIAL value changes to reflect the new size of the initial extent.
If you do not specify the KEEP clause, all unused space (everything above th
e high water mark) is deallocated, as long as the size of the initial extent
 and MINEXTENTS are preserved. Thus, even if the high water mark occurs with
en if the high water mark occurs with
in the MINEXTENTS boundary, MINEXTENTS remains and the initial extent size i
s not reduced.
See Also: For details on the syntax and options associated with deallocating
 unused space, see the Oracle8 SQL Reference.
You can verify that deallocated space is freed by looking at the DBA_FREE_SP
ACE view. For more information on this view, see the Oracle8 Reference.
Deallocating Space: Examples
This section includes various space deallocation scenarios. Prior to reading
 it, you should familiarize yourself with the ALTER...DEALLOCATE UNUSED stat
ements in the Oracle8 Reference.
Example 1
Table DQUON consists of three extents (see figure Figure 10-3). The first ex
tent is 10K, the second is 20K, and the third is 30K. The high water mark is
 in the middle of the second extent, and there is 40K of unused space. The f
ollowing statement deallocates all unused space, leaving table DQUON with tw
o remaining extents. The third extent disappears, and the second extent size
 is 10K.
ALTER TABLE dquon DEALLOCATE UNUSED;
Figure 10-3  Deallocating All Unused Space
If you deallocate all unused space from DQUON and KEEP 10K (see Figure 10-4)
, the third extent is deallocated and the second extent remains in tact.
Figure 10-4 Deallocating Unused Space, KEEP 10K
Figure 10-4 Deallocating Unused Space, KEEP 10K
If you deallocate all unused space from DQUON and KEEP 20K, the third extent
 is cut to 10K, and the size of the second extent remains the same.
ALTER TABLE dquon DEALLOCATE UNUSED KEEP 20K;
Example 2
When you issue the ALTER TABLE DQUON DEALLOCATE UNUSED statement, you comple
tely deallocate the third extent, and the second extent is left with 10K. No
te that the size of the next allocated extent defaults to the size of the la
st completely deallocated extent, which in this example, is 30K. However, if
 you can explicitly set the size of the next extent using the ALTER ... STOR
AGE [NEXT] statement.
Example 3
To preserve the MINEXTENTS number of extents, DEALLOCATE can retain extents
that were originally allocated to an instance (added below the high water ma
rk), while deallocating extents that were originally allocated to the segmen
t.
For example, table DQUON has a MINEXTENTS value of 2. Examples 1 and 2 still
 yield the same results. However, if the MINEXTENTS value is 3, then the ALT
ER TABLE DQUON DEALLOCATE UNUSED statement has no effect, while the ALTER TA
BLE DQUON DEALLOCATE UNUSED KEEP 10K statement removes the third extent and
changes the value of MINEXTENTS to 2.
Understanding Space Use of Datatypes
When creating tables and other data structures, you need to know how much sp
ace they will require. Each datatype has different space requirements, as de
scribed below.
Character
Datatypes
  The CHAR and VARCHAR2 datatypes store alphanumeric data in strings of ASCI
I (American Standard Code for Information Interchange) or EBCDIC (Extended B
inary Coded Decimal Interchange Code) values, depending on the character set
 used by the hardware that runs Oracle. Character datatypes can also store d
ata using character sets supported by the National Language Support (NLS) fe
ature of Oracle.
  The CHAR datatype stores fixed length character strings. When a table is c
reated with a CHAR column, a column length (in bytes, not characters) betwee
n 1 and 255 can be specified for the CHAR column; the default is 1 byte. Ext
ra blanks are used to fill remaining space in the column for values less tha
n the column length.
  The VARCHAR2 datatype stores variable length character strings. When a tab
le is created with a VARCHAR2 column, a maximum column length (in bytes, not
 characters) between 1 and 4000 is specified for the VARCHAR2 column. For ea
ch row, each value in the column is stored as a variable length field. Extra
 blanks are not used to fill remaining space in the column.
Number
Datatype
Datatype
  The NUMBER datatype stores fixed and floating point numbers. Positive numb
ers in the range 1 x 10-130 to 9.99...9 x 10125 (with up to 38 significant d
igits), negative numbers in the range
  Oracle guarantees portability of numbers with a precision equal to or less
 than 38 digits. You can specify a scale and no precision:
  -1 x 10-130 to -9.99..9x 10125 (with up to 38 significant digits), and zer
o. You can optionally specify a precision (total number of digits) and scale
 (number of digits to the right of the decimal point) when defining a NUMBER
 column. If precision is not specified, the column stores values as given. I
f noscale and no precision:
  column_name NUMBER (*, scale)
  In this case, the precision is 38 and the specified scale is maintained.
DATE Datatype
  The DATE datatype stores point-in-time values such as dates and times. Dat
e data is stored in fixed length fields of seven bytes each.
LONG Datatype
  Columns defined as LONG store variable length character data containing up
 to two gigabytes of information. LONG data is text data and is appropriatel
y converted when moved between different character sets. LONG data cannot be
 indexed.
RAW and LONG RAW Datatypes
  RAW is a variable length datatype like the VARCHAR2 character datatype, ex
cept that Net8 (which connects user sessions to the instance) and the Import
 and Export utilities do not perform character conversion when transmitting
RAW or LONG RAW data. In contrast, Net8 and Export/Import automatically conv
ert CHAR, VARCHAR2, and LONG data between the database character set and the
 user session character set if the two character sets are different.
  RAW data can be indexed; LONG RAW data cannot be indexed.
ROWIDs and the ROWID Datatype
  Every row in a non-clustered table of an Oracle database is assigned a uni
que ROWID that corresponds to the physical address of a row's row piece (or
the initial row piece if the row is chained among multiple row pieces).
  Each table in an Oracle database has an internal pseudo-column named ROWID
. This pseudocolumn is not evident when listing the structure of a table by
executing a SELECT statement, or a DESCRIBE statement using SQL*Plus, but ca
n be retrieved with a SQL query using there served word ROWID as a column na
me.
  ROWIDs use a binary representation of the physical address for each row se
lected. A ROWID's VARCHAR2 hexadecimal representation is divided into three
pieces: block.slot.file. Here, block is the data block within a file that co
ntains the row, relative to its datafile; row is the row in the block; and f
ile is the datafile that contains the row. A row's assigned ROWID remains un
changed usually. Exceptions occur when the row is exported and imported (usi
ng the Import and Export utilities). When a row is deleted from a table (and
ng the Import and Export utilities). When a row is deleted from a table (and
 the encompassing transaction is committed), the deleted row's associated RO
WID can be assigned to a row inserted in a subsequent transaction.
See Also: For more information about NLS and support for different character
 sets, see the Oracle8 Reference.
Summary of Oracle Datatypes
Table 10-2 summarizes important information about each Oracle datatype.
Table 10-2 Summary of Oracle Datatype Information
Datatype   Description   Column Length (bytes)
CHAR (size)
NCHAR (size)
  Fixed-length character data of length size.
Fixed-length character data of length size characters or bytes, depending on
 the choice of national character set.
  Fixed for every row in the table (with trailing spaces); maximum size is 2
000 bytes per row, default size is one byte per row. Consider the character
set that is used before setting size. (Are you using a one or two byte chara
cter set?)
Maximum size is determined by the number of bytes required to store each cha
racter, with an upper limit of 2000 bytes. Default and minimum size is one c
haracter or one byte, depending on the character set.
VARCHAR2 (size)
NVARCHAR
NVARCHAR
  Variable-length character data. A maximum size must be specified.
Variable-length character string having maximum length size characters or by
tes, depending on the choice of national character set.
  Variable for each row, up to 4000 bytes per row. Consider the character se
t that is used before setting size.
Maximum size is determined by the number of bytes required to store each cha
racter, with an upper limit of 4000 bytes. You must specify size for NVARCHA
R2.
NUMBER (p, s)
  Variable-length numeric data. Maximum precision p and/or scale s is 38. Th
e scale scan range is -84 to 127.
  Variable for each row. The maximum space required for a given column is 21
 bytes per row.
DATE
  Fixed-length date and time data, ranging from January 1, 4712 B.C. to Dece
mber 31, 4712 A.D. Default format: DD-MON-YY.
  Fixed at seven bytes for each row in the table.
LONG
  Variable-length character data.
  Variable for each row in the table up to 231 bytes, or two gigabytes, per
row.
RAW (size)
  Variable-length raw binary data. A maximum size must be specified.
  Variable for each row in the table, up to 2000 bytes per row.
LONG RAW
  Variable-length raw binary data.
  Variable for each row in the table, up to two gigabytes per row.
ROWID
  Binary data representing row addresses.
  Fixed at six bytes for each row in the table.
MLSLABEL
  Trusted Oracle datatype that stores representations of labels.
  See your Trusted Oracle documentation.
----------------------------------------------------------------------------
----
--------------------------------------------------------------

--
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 162.105.41.166]

--
           海纳百川,
                   有容乃大,
                           壁立千尺,
                                   无欲则刚。    

※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: dip.hit.edu.cn]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:423.953毫秒