-
Single-row or array inserts and updates
-
The following direct-path
INSERT
methods:-
Direct path SQL*Loader
-
CREATE
TABLE
AS
SELECT
statements -
Parallel
INSERT
statements INSERT
statements with anAPPEND
orAPPEND_VALUES
hint
-
压缩的方法:
Table 20-1 Table Compression Methods
Table Compression Method | Compression Level | CPU Overhead | Applications | Notes |
---|---|---|---|---|
Basic compression | High | Minimal | DSS | None. |
OLTP compression | High | Minimal | OLTP, DSS | None. |
Warehouse compression (Hybrid Columnar Compression) | Higher | Higher | DSS | The compression level and CPU overhead depend on compression level specified (LOW or HIGH). |
Archive compression (Hybrid Columnar Compression) | Highest | Highest | Archiving | The compression level and CPU overhead depend on compression level specified (LOW or HIGH). |
Table 20-2 Table Compression Characteristics
Table Compression Method | CREATE/ALTER TABLE Syntax | Direct-Path INSERT | Notes |
---|---|---|---|
Basic compression |
| Rows are compressed with basic compression. |
Rows inserted without using direct-path insert and updated rows are uncompressed. |
OLTP compression |
| Rows are compressed with OLTP compression. | Rows inserted without using direct-path insert and updated rows are compressed using OLTP compression. |
Warehouse compression (Hybrid Columnar Compression) |
| Rows are compressed with warehouse compression. | This compression method can result in high CPU overhead. Updated rows and rows inserted without using direct-path insert are stored in row format instead of column format, and thus have a lower compression level. |
Archive compression (Hybrid Columnar Compression) |
| Rows are compressed with archive compression. | This compression method can result in high CPU overhead. Updated rows and rows inserted without using direct-path insert are stored in row format instead of column format, and thus have a lower compression level. |
create table t compress tablespace test as select * From emp where 0=1;create table t compress basic tablespace test as select * From emp where 0=1;
修改表为oltp 压缩方式:oltp compression 压缩表:CREATE TABLE t COMPRESS FOR OLTP tablespace test as select * From emp where 0=1;
Warehouse compression:(ORA-64307: 只有位于 Exadata 存储上的表空间才支持混合柱状压缩)CREATE TABLE t COMPRESS FOR QUERY tablespace test as select * From emp where 0=1;
Archive compression:(ORA-64307: 只有位于 Exadata 存储上的表空间才支持混合柱状压缩)CREATE TABLE t COMPRESS FOR ARCHIVE tablespace test as select * From emp where 0=1;
SQL> alter table t2 move compress for oltp;
修改表为basic 压缩方式:
SQL> alter table t3 move compress ;
增加列:
oltp:可以增加一列指定默认值并且为not null的的列,如果指定默认值,但是可为空是不支持oltp压缩方式的
If a default value is specified for an added column, then the column must beNOT
NULL
. Added nullable columns with default values are not supported.
basic:你不能给增加的列指定默认值
删除列:oltp:oltp 压缩方式可以支持列的删除列,但是为了避免长时间的解压缩和再压缩 可以设置 列的unusedDROP
COLUMN
is supported, but internally the database sets the columnUNUSED
to avoid long-running decompression andrecompression operations.
basic:不支持删除列 Dropping a column is not supported.