Informix之onspaces语法及实例(磁盘空间管理)

(其中红色字体为手工输入,蓝色字体为主要变化关注点。)

1、基本用法:

-bash-3.1$ onspaces --

Usage:

 onspaces { -a <spacename> -p <path> -o <offset> -s <size> [-m <path> <offset>]

               { { [-Mo <mdoffset>] [-Ms <mdsize>] } | -U }

               } |

          { -c { -d <DBspace> [-k <pagesize>] [-t]

                    -p <path> -o <offset> -s <size> [-m <path> <offset>] } |

               { -d <DBspace> [-k <pagesize>]

                    -p <path> -o <offset> -s <size> [-m <path> <offset>]

                    [-ef <first_extent_size>] [-en <next_extent_size>] } |

               { -b <BLOBspace> -g <pagesize>

                    -p <path> -o <offset> -s <size> [-m <path> <offset>] } |

               { -S <SBLOBspace> [-t]

                    -p <path> -o <offset> -s <size> [-m <path> <offset>]

                    [-Mo <mdoffset>] [-Ms <mdsize>] [-Df <default-list>] } |

               { -x <Extspace> -l <Location> } } |

          { -d <spacename> [-p <path> -o <offset>] [-f] [-y] } |

          { -f[y] off [<DBspace-list>] | on [<DBspace-list>] } |

          { -m <spacename> {-p <path> -o <offset> -m <path> <offset> [-y] |

                            -f <filename>} } |

          { -r <spacename> [-y] } |

          { -s <spacename> -p <path> -o <offset> {-O | -D} [-y] } |

          { -ch <sbspacename> -Df <default-list> } |

          { -cl <sbspacename> } |

          { -ren <spacename> -n <newname> }

    -a  - Add a chunk to a DBspace, BLOBspace or SBLOBspace

    -c  - Create a DBspace, BLOBspace, SBLOBspace or Extspace

    -d  - Drop a DBspace, BLOBspace, SBLOBspace, Extspace, or chunk

    -f  - Change dataskip default for specified DBspaces

    -m  - Add mirroring to an existing DBspace, BLOBspace or SBLOBspace

    -r  - Turn mirroring off for a DBspace, BLOBspace or SBLOBspace

    -s  - Change the status of a chunk

    -ch - Change default list for smart large object space

    -cl - garbage collect smart large objects that are not referenced

    default-list = {[LOGGING = {ON|OFF}]  [,ACCESSTIME = {ON|OFF}]

            [,AVG_LO_SIZE = {1 - 2097152}] }

    -ren - Rename a DBspace, BLOBspace, SBLOBspace or Extspace

2、实例:

(1)(创建dbspace)

-bash-3.1$ onstat -d

IBM Informix Dynamic Server Version 11.50.UC1DE -- On-Line -- Up 04:03:45 -- 93844 Kbytes

Dbspaces

address  number   flags      fchunk   nchunks  pgsize   flags    owner    name

44d4a7f8 1        0x70001    1        1        2048     N  B     informix rootdbs

44e107e8 2        0x60001    2        1        2048     N  B     informix dbs1

 2 active, 2047 maximum

Chunks

address  chunk/dbs     offset     size       free       bpages     flags pathname

44d4a958 1      1      0          450000     340077                PO-B  /home/informix/ids11uc1/dbs/rootdbs

44e10948 2      2      0          250000     161794                PO-B  /dbs/dbs1

 2 active, 32766 maximum

NOTE: The values in the "size" and "free" columns for DBspace chunks are

      displayed in terms of "pgsize" of the DBspace to which they belong.

Expanded chunk capacity mode: always

-bash-3.1$ touch /dbs/dbstest1

-bash-3.1$ chmod 660 /dbs/dbstest1

-bash-3.1$ onspaces -c -d dbspacetest1 -p /dbs/dbstest1  -o 20000 -s 1000000

Verifying physical disk space, please wait ...

/dbs: write failed, file system is full.

-bash-3.1$ onspaces -c -d dbspacetest1 -p /dbs/dbstest1  -o 20000 -s 1000

Verifying physical disk space, please wait ...

Space successfully added.

** WARNING **  A level 0 archive of Root DBSpace will need to be done.

-bash-3.1$ onstat -d

IBM Informix Dynamic Server Version 11.50.UC1DE -- On-Line -- Up 04:08:39 -- 93844 Kbytes

Dbspaces

address  number   flags      fchunk   nchunks  pgsize   flags    owner    name

44d4a7f8 1        0x70001    1        1        2048     N  B     informix rootdbs

44e107e8 2        0x60001    2        1        2048     N  B     informix dbs1

472abd88 3        0x60001    3        1        2048     N  B     informix dbspacetest1

 3 active, 2047 maximum

Chunks

address  chunk/dbs     offset     size       free       bpages     flags pathname

44d4a958 1      1      0          450000     340077                PO-B  /home/informix/ids11uc1/dbs/rootdbs

44e10948 2      2      0          250000     161794                PO-B  /dbs/dbs1

472ead50 3      3      10000      500        447                   PO-B  /dbs/dbstest1

 3 active, 32766 maximum

NOTE: The values in the "size" and "free" columns for DBspace chunks are

      displayed in terms of "pgsize" of the DBspace to which they belong.

Expanded chunk capacity mode: always

 

(2)(创建blobspace)

-bash-3.1$ touch dbtest2

-bash-3.1$ chmod 660 dbtest2

-bash-3.1$ onspaces -c -b blobsptest1 -g 50 -p /home/share/dbtest2 -o 200000 -s 1000

Verifying physical disk space, please wait ...

Space successfully added.

** WARNING **  A level 0 archive of Root DBSpace will need to be done.

-bash-3.1$ onstat -d

IBM Informix Dynamic Server Version 11.50.UC1DE -- On-Line -- Up 04:29:15 -- 93844 Kbytes

Dbspaces

address  number   flags      fchunk   nchunks  pgsize   flags    owner    name

44d4a7f8 1        0x70001    1        1        2048     N  B     informix rootdbs

44e107e8 2        0x60001    2        1        2048     N  B     informix dbs1

472abd88 3        0x60001    3        1        2048     N  B     informix dbspacetest1

4732ae68 4        0x60011    4        1        102400   N BB     informix blobsptest1

 4 active, 2047 maximum

Note: For BLOB chunks, the number of free pages shown is out of date.

      Run 'onstat -d update' for current stats.

Chunks

address  chunk/dbs     offset     size       free       bpages     flags pathname

44d4a958 1      1      0          450000     340077                PO-B  /home/informix/ids11uc1/dbs/rootdbs

44e10948 2      2      0          250000     161794                PO-B  /dbs/dbs1

472ead50 3      3      10000      500        447                   PO-B  /dbs/dbstest1

472edd50 4      4      100000     500       ~10         10         POBB  /home/share/dbtest2

 4 active, 32766 maximum

NOTE: The values in the "size" and "free" columns for DBspace chunks are

      displayed in terms of "pgsize" of the DBspace to which they belong.

Expanded chunk capacity mode: always

 

(3)(创建sbspaces)

-bash-3.1$ touch /home/share/dbtest3

-bash-3.1$ chmod 660 dbtest3

-bash-3.1$ onspaces -c -S sbspacetest1 -p /home/share/dbtest3 -o 200000 -s 10000

Verifying physical disk space, please wait ...

Space successfully added.

** WARNING **  A level 0 archive of Root DBSpace will need to be done.

-bash-3.1$ onstat –d

(略)

 

(4)(删除dbspace or sbspace)

-bash-3.1$ onspaces -d dbspacetest1    

WARNING: Dropping a DBspace.

Do you really want to continue? (y/n)y

Space successfully dropped.

** WARNING **  A level 0 archive will need to be done before any chunks from

DBspace dbspacetest1 can be reused (see Dynamic Server Administrator's manual).

 

-bash-3.1$ onspaces -d sbspacetest1

WARNING: Dropping a sbspace.

Do you really want to continue? (y/n)y

Space successfully dropped.

** WARNING **  A level 0 archive will need to be done before any chunks from

sbspace sbspacetest1 can be reused (see Dynamic Server Administrator's manual).

 

(5)(增加chunk到dbspace or blobspace or subspace)

-bash-3.1$ touch /home/share/dbchunk

-bash-3.1$ chmod 660 dbchunk

-bash-3.1$ onspaces -a blobsptest1 -p /home/share/dbchunk -o 200000 -s 1500

Verifying physical disk space, please wait ...

Chunk successfully added.

-bash-3.1$ onstat -d

IBM Informix Dynamic Server Version 11.50.UC1DE -- On-Line -- Up 04:52:13 -- 93844 Kbytes

Dbspaces

address  number   flags      fchunk   nchunks  pgsize   flags    owner    name

44d4a7f8 1        0x70001    1        1        2048     N  B     informix rootdbs

44e107e8 2        0x60001    2        1        2048     N  B     informix dbs1

4732ae68 4        0x60011    4        2        102400   N BB     informix blobsptest1

 3 active, 2047 maximum

Note: For BLOB chunks, the number of free pages shown is out of date.

      Run 'onstat -d update' for current stats.

 

Chunks

address  chunk/dbs     offset     size       free       bpages     flags pathname

44d4a958 1      1      0          450000     340077                PO-B  /home/informix/ids11uc1/dbs/rootdbs

44e10948 2      2      0          250000     161794                PO-B  /dbs/dbs1

472ead50 3      4      100000     750       ~15         15         POBB  /home/share/dbchunk

472edd50 4      4      100000     500       ~10         10         POBB  /home/share/dbtest2

 4 active, 32766 maximum

NOTE: The values in the "size" and "free" columns for DBspace chunks are

      displayed in terms of "pgsize" of the DBspace to which they belong.

Expanded chunk capacity mode: always

 

(6)(删除chunk)

-bash-3.1$ onspaces -d blobsptest1 -p /home/share/dbchunk -o 50000

IBM Informix Dynamic Server must be in quiescent mode.

Chunk not dropped.

-bash-3.1$ onmode -s

This will perform a GRACEFUL SHUTDOWN -

Do you wish to continue (y/n)? y

-bash-3.1$ onstat -

IBM Informix Dynamic Server Version 11.50.UC1DE -- Quiescent -- Up 04:59:43 -- 93844 Kbytes

-bash-3.1$ onspaces -d blobsptest1 -p /home/share/dbchunk -o 50000

WARNING:  Dropping a chunk.

Do you really want to continue? (y/n)y

Chunk not dropped.

ISAM error:  No such chunk

-bash-3.1$ onspaces -d blobsptest1 -p /home/share/dbchunk -o 200000

WARNING:  Dropping a chunk.

Do you really want to continue? (y/n)y

Chunk successfully dropped.

** WARNING **  A level 0 archive for BLOBspace blobsptest1 will need to be done

before '/home/share/dbchunk' can be reused (see Dynamic Server Administrator's manual).


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值