- 浏览: 276967 次
- 性别:
- 来自: 广州
-
最新评论
-
Yiwu_zh:
步骤清晰,跟着来做,真搭建好了
不过用的是10.5版本,输出有 ...
搭建简单的DB2 HADR -
luogen33:
db2备份单个表 -
gthao:
1 楼正解。。如果schema里面有内容的话,就删除不了,会报 ...
db2建立schema -
znttql:
整理的太好了 非常感谢啊
DB2 日期 时间 -
alvin198761:
能根据schame备份数据库不??
db2备份单个表
Block Row Chaining(行连接)和 Row Migrating(行迁移) UNDO 表空间: 该参数主要为了兼容 7.0 版本,用来限制其他用户是否可以访问 sys schema 下的对象。以后的版本可以通过 SELECT_CATALOG_ROLE, EXECUTE_CATALOG_ROLE 或 DELETE_CATALOG_ROLE 权限来控制。 SQL> set long 2000 DBMS_METADATA.GET_DDL('TABLE','TEST') CREATE TABLE "SYS"."TEST"
Block 可以分为
Header
Table Directory
Row Directory
Row Data
Free Space
其中,block header、table directory、row directory 合起来称为 Overhead。
详细解释:
The header contains general block information, such as the block address and the type of segment (for example, data or index).
Table Directory
This portion of the data block contains information about the table having rows in this block.
Row Directory
This portion of the data block contains information about the actual rows in the block (including addresses for each row piece in the row data area).this space is not reclaimed when the row is deleted.
Overhead
The data block header, table directory, and row directory are referred to collectively as overhead. Some block overhead is fixed in size; the total block overhead size is variable. On average, the fixed and variable portions of data block overhead total 84 to 107 bytes.
Row Data
This portion of the data block contains table or index data. Rows can span blocks.
Free Space
Free space is allocated for insertion of new rows and for updates to rows that require additional space (for example, when a trailing null is updated to a nonnull value).
the row is too large to fit into one data block when it is first inserted. In this case, Oracle stores the data for the row in a chain of data blocks (one or more) reserved for that segment. Row chaining most often occurs with large rows, such as rows that contain a column of datatype LONG or LONG RAW. Row chaining in these cases is unavoidable.
Row Migrating:
a row that originally fit into one data block is updated so that the overall row length increases, and the block's free space is already completely filled. In this case, Oracle migrates the data for the entire row to a new data block, assuming the entire row can fit in a new block. Oracle preserves the original row piece of a migrated row to point to the new block containing the migrated row. The rowid of a migrated row does not change.
SEGMENT
High Water Mark
The high water mark is the boundary between used and unused space in a segment.
When Extents Are Deallocated?
当 Extents 分配给某个对象时,一般不会自己回收,除非以下几种情况发生:
2.TRUNCATE...DROP STORAGE statement(用 delete 不会回收)
3.ALTER TABLE table_name DEALLOCATE UNUSED(HWM 之后的空间);
4.Oracle deallocates one or more extents of a rollback segment if it has the OPTIMAL size specified
TRUNCATE 语法:
TABLESPACE
EXTENT MANAGEMENT LOCAL 的两种 Extents 分配方式:
UNIFORM SIZE:you can specify an extent size or use the default size, which is 1 MB. Temporary tablespaces that manage their extents locally can only use this type of allocation.
当使用 Local 管理 Extents 时参数 NEXT, PCTINCREASE, MINEXTENTS, MAXEXTENTS, and DEFAULT STORAGE 不能使用。
SEGMENT SPACE MANAGEMENT 的两种管理方式:
Specifying MANUAL tells Oracle that you want to use free lists for managing free space within segments.Free lists are lists of data blocks that have space available for inserting rows. This form of managing space within segments is called manual segment-space management because of the need to specify and tune the PCTUSED, FREELISTS, and FREELISTS GROUPS storage parameters for schema objects created in the tablespace.
AUTO
This keyword tells Oracle that you want to use bitmaps to manage the free space within segments. A bitmap, in this case, is a map that describes the status of each data block within a segment with respect to the amount of space in the block available for inserting rows. As more or less space becomes available in a data block, its new state is reflected in the bitmap. Bitmaps allow Oracle to manage free space more automatically, and thus, this form of space management is called automatic segment-space management.It completely eliminates any need to specify and tune the PCTUSED, FREELISTS, and FREELISTS GROUPS storage parameters for schema objects created in the tablespace. If such attributes should be specified, they are ignored.
系统表空间:
The Data Dictionary
参数 O7_DICTIONARY_ACCESSIBILITY 的作用:
说明: 主要用于从 Oracle7 移植到 Oracle8i。如果该值为 TRUE, SYSTEM 权限 (如 SELECT ANY TABLE) 将不限制对 SYS 方案中各对象的访问 (Oracle7 行为)。如果该值为 FALSE, 只有被授予了 SELECT_CATALOG_ROLE, EXECUTE_CATALOG_ROLE 或 DELETE_CATALOG_ROLE 权限的用户才能访问 SYS 方案中的各对象。
值范围: TRUE | FALSE
默认值: TRUE
另外,由于 pl/sql 的编译的一些特性,oracle 采取了角色在存储过程、函数、包等在 pl/sql 中不起作用的策略,必须直接授权才生效,所以即使有dba角色在存储过程中也是无效的。(参考:http://www.itpub.net/251232,1.html)
DBMS_METADATA
The DBMS_METADATA package provides interfaces for extracting complete definitions of database objects. The definitions can be expressed either as XML or as SQL DDL.
最简单的使用方法:
SQL> select dbms_metadata.get_ddl('TABLE','TEST') from dual;
--------------------------------------------------------------------------------
( "OWNER" VARCHAR2(30),
"OBJECT_NAME" VARCHAR2(128),
"SUBOBJECT_NAME" VARCHAR2(30),
"OBJECT_ID" NUMBER,
"DATA_OBJECT_ID" NUMBER,
"OBJECT_TYPE" VARCHAR2(18),
"CREATED" DATE,
"LAST_DDL_TIME" DATE,
"TIMESTAMP" VARCHAR2(19),
"STATUS" VARCHAR2(7),
"TEMPORARY" VARCHAR2(1),
"GENERATED" VARCHAR2(1),
"SECONDARY" VARCHAR2(1)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "SYSTEM"
http://blog.csdn.net/eygle/archive/2004/12/22/225673.aspx
更详细的使用方法:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_metad2.htm#1024701
发表评论
-
Oracle Cursor Sharing
2011-05-06 01:57 0上周被问到一个问题:oracle参数cursor_sharin ... -
sqlplus登录自动运行脚本
2011-04-20 00:02 2060如果每次使用sqlplus都要设置如serveroutput或 ... -
被问到的问题,导出DDL
2011-04-15 20:31 934导出DDL定义的几种方法 有时候经常需要导出建表语句,在这 ... -
about RESETLOGS
2010-09-15 22:12 924终于要面对RESETLOGS了, ... -
STATISTICS_LEVEL
2010-07-19 16:15 1122看图说话: Oracle Advisory B ... -
SGA_TARGET
2010-07-19 11:03 1425当SGA_TARGET设置为非零值,oracle 10g会自动 ... -
method of segment space management
2010-07-13 16:40 820Locally Managed Tablespaces有两种管 ... -
042 nologging 题目
2010-07-13 15:30 1252原题如下: if the tablespace is in t ... -
oracle sql解析顺序
2010-07-12 16:47 1471今天被问到了一个where rownum与order by的顺 ... -
利用oracle学习DB2
2010-07-01 11:14 914现在开始要接触多一个D ... -
关于RAC failover的实践
2010-05-21 09:19 1141关于之前RAC的failover同事们都有一个猜想,failo ... -
卸载clusterware
2010-05-20 09:32 1377最简单的就是运行以下两个脚本: ./rootdelete. ... -
dataguard成功实现物理switchover
2010-04-26 16:28 1367一直都不能实现switchover,在看了不少文档后终于实现, ... -
使用exp/imp转移大的数据库定义(脚本)
2010-04-23 15:05 975都知道exp rows=n可以不导出具体的数据,但是做全库导出 ... -
oracle 连接解释方法
2010-04-13 14:05 1027Easy Connect: 格式: <usern ... -
RMAN-06428
2010-03-25 15:11 1272今天建立新的nbu oracle client 遇到RMAN- ... -
oracle import改表名
2010-03-24 16:23 4971小技巧 现在工作有大量exp/imp工作,其中遇到过需要该表 ... -
dataguard 笔记
2010-03-23 09:50 1152推荐按照三思的文档去做,当然首先要了解dataguard的原理 ... -
fga的教训
2010-03-17 10:30 1277这是一个教训,记录下来 一个简单的需求,监测一个表记录不明被 ... -
ORA-08102
2010-03-11 11:01 1567处理完ORA-600 4193后又来了个ORA-08102 ...
相关推荐
[DATAFILE datafile_spec1 [, datafile_spec2] [{MINIMUM EXTENT integer [k|m] | BLOCKSIZE integer [k] | logging_clause | FORCE LOGGING | DEFAULT {data_segment_compression} storage_clause | [online | ...
table、segment、extent和block之间的关系是:table 创建时,默认创建了一个data segment,每个datasegment含有min extents指定的extents数,每个extent据据表空间的存储参数分配一定数量的blocks。 tablespace和...
[EXTENT MANAGEMENT DICTIONARY | LOCAL [AUTOALLOCATE | UNIFORM SIZE size]] [SEGMENT SPACE MANAGEMENT (COMPACT | AUTO)]; ``` 其中,`tablespace_name`是要创建的表空间名称,`datafile_spec`或`temp_file_...
Oracle的逻辑结构包括Database、Tablespace、Segment、Extent和Block。Database由多个Tablespace组成,Tablespace又由多个Segment构成,Segment由多个Extent组成,而Extent是一组连续的Blocks。 处理SQL语句的过程...
2. **Table/Segment/Extent/Block关系**:Table是逻辑概念,Segment是其物理实现,Segment由一个或多个Extent组成,Extent由连续的Block构成,Block是最小I/O单位。 3. **Tablespace和Datafile关系**:Tablespace是...
[EXTENT MANAGEMENT DICTIONARY|LOCAL [AUTOALLOCATE|UNIFORM SIZE number K | M]] [SEGMENT SPACE MANAGEMENT AUTO|MANUAL]; ``` #### 三、选项解析 **1. TEMPORARY/UNDO选项** - `CREATE TEMPORARY TABLESPACE...
逻辑结构包括 database、tablespace、segment、extent 和 block。 Oracle 表空间的创建可以使用 CREATE TABLESPACE 语句,包括 BIGFILE、SMALLFILE 和 TEMPORARY 三种类型。创建表空间时需要指定数据文件的路径和...
逻辑存储结构主要包括数据块(Data Block)、扩展区(Extent)、段(Segment)以及表空间(Tablespace)。 - **数据块**:这是Oracle数据库中最小的数据存储单位,也是I/O操作的基本单位。 - **扩展区**:一组连续...
#### 二、数据字典视图(Data Dictionary Views) 数据库提供了多种数据字典视图来帮助DBA进行空间管理,这些视图包括但不限于: - **v$datafile**:显示数据文件的信息。 - **v$fixed_table**:列出固定表的名称和...
- **Data Block**: 数据块是最小的存储单位,它是Oracle数据库内部操作的数据单元。 2. **表空间的属性** - 表空间可以被设置为在线(Online)或脱机(Offline)。系统表空间(SYSTEM)、回滚表空间(UNDOTBS)和...
逻辑结构中,数据库是由表空间(tablespace)组成,表空间又包含段(segment),段由多个区(extent)组成,而区则进一步由Oracle Block(数据块)构成。物理结构涉及数据文件、控制文件和重做日志文件,它们分别...
- **EXTENT MANAGEMENT**:选择表空间的扩展管理方式,DICTIONARY为数据字典管理,LOCAL可以配合AUTOALLOCATE或UNIFORM进行本地化管理。 - **SEGMENT SPACE MANAGMENT AUTO/MANUAL**:设置段空间的管理方式,AUTO...
2. 网状结构模型:按照网状数据结构建立的数据库系统称为网状数据库系统,其典型代表是DBTG(Data Base Task Group)。 3. 关系结构模型:关系式数据结构把一些复杂的数据结构归结为简单的二元关系(即二维表格形式)。...
[-f ] PQ event wait graph using ASH data Arguments are the same as for ash except that the output must be shown with the mxgraph tool - ash_sql <sql_id> Show all ash rows group by sampli_time and ...