Informix IDS 11体系管理(918查验)认证指南,第1局部IDS安置和设置配备铺排(4)

管理磁盘空间

物理单位

数据库效劳器运用以下物理单位管理磁盘空间:

  • 页面
  • 区段(Extent)
  • Blobpage
  • Sbpage



块是分派给效劳器的磁盘或物理空间单位。块可所以裸配备(分外字符配备)或 UNIX 熟文件。当向效劳器分派块时,需要指定下面三个值:

  1. 路子名:用于块的文件路子或裸配备称呼。
  2. 偏移量:物理阻遏距离,从配备的初始局部到配备开端读写的职位处所,单位为 KB。如果树立运用熟文件的块,则偏移量为 0;非零偏移量只用于裸配备。
  3. 大小:指定分派用于裸配备的空间大小,单位为 KB,肇始量为偏移量或块所运用的 UNIX 文件大小。

效劳器的逻辑限定为 32,767 块。但是,UNIX 内核将限定历程可以掀开的文件数,该限定将替换效劳器限定。

页面

页面是效劳器运用的基础 I/O 单位。从 IDS Version 10 开端,页面的大小不再凭据产物平台确定。任何在根 dbspace 后树立的块/dbspaces 的页面大小范畴从 2K 到 16K 之间,运用多个默许页面大小。如果现有页面不能存放指定大小的页面,将树立一个缓冲池。

区段

磁盘中陆续的物理页面聚集。表空间的大小凭据区段单位分派。表的区段大小在树立表时指定。

Blobpage

Blobpage 是存储在 blobspace 中的 blob 数据模范的基础存储单位。可将 blobpage 的大小设置配备铺排为体系页面大小的多少倍。

Sbpage

sbpage 是数据库效劳器用来存储 sbspace 内的智能大对象(smart large objects)的页面模范。与 blobpage 差异,sbpage 不能够制止设置配备铺排。sbpage 的大小与数据库页面大小相同。





回页首



逻辑单位

数据库效劳器运用以下逻辑单位存储数据:

  • Dbspace
  • Blobspace
  • Sbspace
  • Tblspace


Dbspace

Dbspace 是一个或多个用于存储数据库和表的块的逻辑组合。每个 dbspace 必须至多分派了一个块。

Blobspace

blobspace 是一个逻辑存储单位,由一个或多个只存储有 TEXT 和 BYTE 数据的块构成。数据库效劳器将存储在 blobspace 中数据间接写入磁盘。该数据并不经由共享内存驻留区。

Sbspace

sbspace 是一个逻辑存储单位,由一个或多个存储智能大对象的块构成。智能大对象包孕 BLOB、CLOB 和用户界说数据模范(UDTs)。

Tblspace

Tblspace 是为存储一个 dbspace 中特定表或索引信息而分派的全盘区段的聚集。tblspace 示意的空间不肯定是陆续的,而任何区段示意的空间则肯定是陆续的。

Listing 2. 运用 onspaces 树立 dbspace

                    
onspaces
-c  
-d  <dbspace>
-k  <pagesize> 
-m  <mpathname moffset> 
-o  <offset>  
-p  <pathname> 
-s  <size> 
-t  <tempspace> 
where  
      spacename is the name of the dbspace to be created. 
      pagesize is non-default page size for the new dbspace. 
      mpathname is mirror pathname 
      moffset is mirror offset    
      offset is offset into the device in KB 
      pathame is Path to the initial chunk  
      size is Size of initial chunk in KB 
      -t indicates if the dbspace created is temporary.
Example : To create a 1-million KB mirrored dbspace dbspace1 with an offset
of 200,000KB for initial(Primary) chunk and an offset of 450,000 for the 
mirrored chunk.
onspaces -c -d dbspace1 -p /dev/rdsk/device1 -o 200000 -s 1000000 -m 
/dev/rdsk/device2 450000



清单 3. 树立 blobspace
                    
onspaces
-c 
-b  <spacename> 
-g  <blobpagesize>
-m  <mpathname moffset>
-o  <offset>
-p  <pathname>
-s  <size>
where spacename is the name of the blobspace to be created.
      blobpagesize is Blobpage size in number of disk pages.
      mpathname is mirror pathname.
      moffset is mirror offset.
      offset is Offset into the device in KB 
      pathname is Path to the initial chunk 
      size is Size of initial chunk in KB 
Example : To create a 1-million KB mirrored blobspace blobsp1 
with an offset of 200,000KB for both initial(Primary) and 
mirrored chunk and a blobpage size of 100KB ( 2K system page size ) .
onspaces -c -b blobsp1 -g 50 -p /dev/rdsk/device8 -o 200000 -s 1000000 -m 
/dev/rdsk/device9 200000



清单 4. 树立 sbspace
                    
onspaces
-c 
-S  <spacename> 
-m  <mpathname moffset>
-o  <offset>
-p  <pathname>
-s  <size>
-t 
-Ms <metasize<
-Mo <metaoffset< :  
-Df <options< 
where spacename is the name of the blobspace to be created.
      blobpagesize is Blobpage size in number of disk pages.
      mpathname is mirror pathname.
      moffset is mirror offset.
      offset is Offset into the device in KB 
      pathname is Path to the initial chunk 
      size is Size of initial chunk in KB 
      -t indicates if the dbspace created is temporary.
      metasize is Size of the sbspace metadata area in KB.
      metaoffset is Offset of the metadata area into the sbspace in KB
      options Lists default specifications for smart large objects stored 
      in the sbspace.
Example : To create a 1-million KB mirrored sbpace sbspace1 with an 
offset of 200,000KB for both initial(primary) and mirror chunks, a metadata 
size of 7500 KB with 10000 KB offset and expected average smart blobsize of 32KB.
onspaces -c -S sbspace1 -p /dev/rdsk/device5 -o 200000 -s 1000000 -m 
/dev/rdsk/device6 200000 -Ms 7500 
-Mo 10000 -Df "AVG_LO_SIZE=32"


删除空间

可运用 onspaces 器材在体系命令行中删除 dbspace、blobspace 或 sbspace。在删除 dbspace 之前,必须先要删除个中树立的所罕见据库和表。

在删除 blobspace 之前,必须先要删除含有引用该 blobspace 的 TEXT/BYTE 列的表。

清单 5. 运用 onspaces 删除空间

                    
Example : To drop the dbspace dbspace1.
onspaces -d dbspace1


向 dbspace 或 blobspace 添加块

可运用 onspaces 器材向 dbspace 或 blobspace 添加块。清单 6 展现了运用 onspaces 器材向 dbspace 添加块运用的参数:

清单 6. 向 dbspace 或 blobspace 添加块

                    
onspaces
-a  <spacename>
-m  <mpathname moffset> 
-o  <offset>  
-p  <pathname> 
-s  <size> 
where  
      spacename is the name of dbspace or a blobspace to which chunk needs 
      to be added.
      mpathname is mirror pathname 
      moffset is mirror offset    
      offset is offset into the device in KB 
      Path to the device or filename of the chunk
      Size of the chunk in KB
Example : To add a 500,000 KB mirrored chunk to dbspace2 with a 100,000 KB offset.
onspaces -a dbspace2 -p /dev/rdsk/device4 -o 100000 -s 500000


向 sbspace 添加块

可运用 onspaces 向 sbspace 添加块。清单 7 展现了运用 onspaces 器材向 sbpace 添加块运用的参数:

清单 7. 向 sbspace 添加块

                    
onspaces
-a  <spacename>
-m  <mpathname moffset> 
-o  <offset>  
-p  <pathname> 
-s  <size> 
-Ms <metasize>
-Mo <metaoffset>
-U  
where  
      spacename is the name of sbspace to which chunk needs to be added.
      mpathname is mirror pathname 
      moffset is mirror offset    
      offset is offset into the device in KB 
      Path to the device or filename of the chunk
      Size of the chunk in KB
      metasize is Size of the sbspace metadata area to be allocated in the 
      new chunk in KB .
      metaoffset is the Offset of the metadata area into the new chunk in KB 
      -U Indicates that the new chunk is to contain only user data 
Example : To add a 100,000KB mirrored chunk to the sbspace named sbspace1 with an 
offset of 20,000 KB for both initial and mirrored chunks and 
metadata size of 750KB and 1000 KB offset .
onspaces -a sbspace1 -p /dev/rdsk/chunk6 -o 20000 -s 100000 -m 
/dev/rdsk/chunk7 -Ms 750 -Mo 1000







回页首



SQl 管理 API

添加了两个新的内置 SQL 管理 API 函数,经由 SQL 的 EXECUTE function 语句,模拟 Dynamic Server 的差异管理命令行器材,可以完生长途管理义务。

ADMINTASK 函数为 Dynamic Server 的管理命令行器材提供了一个 SQL 接口。这些内置函数只在每个 Dynamic Server 实例的 sysadmin 数据库中做了界说,而且只能被用户 informix 挪用。

当用户毗邻到 Dynamic Server 实例的 sysadmin 数据库时,可长途挪用这些函数。

ADMINTASK 函数的每个挪用会生成两个成绩:

  1. 实行指定的命令义务,频频是模拟一些管理器材
  2. 将新行拔出到 sysadmin 数据库的 command_history 表中

TASK 函数前去阐明');前去形态的字符串。ADMIN 函数前去一个整数阐明');前去形态,这是到 command_history 表的链接。

清单 8. 运用 task() 函数树立 dbspace

                    
EXECUTE FUNCTION task('create dbspace','dbs1', '/dev/rdsk/device1 ', '200000', 
'1000000');
Output : (expression)  Space 'dbs1' added.
				



清单 9. 运用 task() 函数删除 dbspace
                    
EXECUTE FUNCTION task ('drop dbspace', 'dbs1');
Output : (expression)  Space 'dbs1' dropped.
** WARNING **  A level 0 archive will need to be done before any chunks from
DBspace dbs1 can be reused (see Dynamic Server Administrator's manual).



清单 10. 运用 task() 函数向下面的 dbspace 添加镜像
                    
EXECUTE FUNCTION task ( 'add mirror', 'dbs1', '/dev/rdsk/device1','200000', 
'/dev/rdsk/device2', '450000');
Output: (expression)  Mirror chunk '/dev/rdsk/device2' added to space 'dbs1'



清单 11. 运用 task() 函数树立 blobspace
                    
EXECUTE FUNCTION task('create blobspace ','blobsp1', '/dev/rdsk/device8 ', '50', 
'200000', '1000000');
Output: (expression)  Space 'blobsp1' added.



清单 12. 运用 task() 函数树立 sbspace
                    
EXECUTE FUNCTION task('create blobspace ','blobsp1', '/dev/rdsk/device8 ', '50', 
'200000', '1000000');
Output: (expression)  Space 'blobsp1' added.




版权声明: 原创作品,许可转载,转载时请务必以超链接体例标明文章 原始因由 、作者信息和本声明。不然将穷究法律责任。

原文地址:https://www.cnblogs.com/zgqjymx/p/1973055.html