oracle lob 简单介绍
何为LOB?
lob为oracle数据库的一个大对象数据类型,可以存储超过4000bytes的字符串,二进制数据,OS文件等大对象信息.最大可存储的容量根oracle的版本和oracle 块大小有关.
有那几种可供选择的LOB类型?
目前ORACLE提供了CLOB,NCLOB,BLOB,BFILE共四种LOB类型,CLOB,NLOB为大字符串类型,NLOB为多语言集字符类型,类似于NVARCHAR类型,用他们代替以前的LONG类型;BLOG为大二进制类型,用来代替以前的LONG RAW类型;BFILE可存储操作系统中的各种文件.
何为Internal LOBs 、External LOBs?
Internal LOBs指的是LOB数据存储在oracle的tablespace中,CLOB,NCLOB,BLOG都是Internal LOBs; 而External LOBs指的是LOB数据存储在数据库外部的操作系统文件中,BFIEL是唯一的External LOBs.BFILE提供了让我们可以在SQL中访问外部文件的方法.
LOB到底能存多大的数据呢?
来自于10G Oracle Database reference
BFILE :Maximum size: 4 GB Maximum size of a file name: 255 characters Maximum size of a directory name: 30
characters Maximum number of open BFILEs: The maximum number of BFILEs is limited by the value of the
SESSION_MAX_OPEN_FILES initialization parameter, which is itself limited by the maximum number of open files the operating system will allow.
BLOB: Maximum size: (4 GB - 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB) The number of LOB columns
per table is limited only by the maximum number of columns per table (that is,10001).
CLOB: Maximum size: (4 GB - 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB) The number of LOB columns
per table is limited onlyby the maximum number of columns per table (that is,10001).
NCLOB :Maximum size: (4 GB - 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB) The number of LOB columns
per table is limited only by the maximum number of columns per table (that is,10001).
相关文档:
新安装了一台数据库服务器,版本是10.2.0.1的,因为现在最新的是10.2.0.4的。 版本低了,bug多。所以就对数据库做了一个升级。
服务器是windows 2003的系统,都是可视话操作。 下一步的问题。 10.2.0.4的patchset 里面也有详细的安装说明。 之做个总结 ......
1.在ORACLE中实现SELECT TOP N
由于ORACLE不支持SELECT TOP语句,所以在ORACLE中经常是用ORDER BY跟ROWNUM的组合来实现SELECT TOP N的查询。
简单地说,实现方法如下所示:
SELECT 列名1...列名n from
(SELECT 列 ......
有时候,需要在两个Oracle数据库之间手工同步数据时,DBLink是最方便快捷的手段之一,创建DBLink的方式一般是这样:
create public database link <DBLink名称> connect to <被连接库的用户名> identified by <被连接库的密码> using '< ......