xxyyy 发表于 2007-06-09 14:29

HDR的辅助服务器为何不能创建临时表?(已经解决)

我的HDR辅助服务器onstat -d结果:
$ onstat -d

Informix Dynamic Server Version 9.40.UC1G2   -- Read-Only (Sec) -- Up 3 days 21:02:27 -- 476304 Kbytes

Dbspaces
addressnumber   flags      fchunk   nchunksflags    owner    name
0x2b2697d8 1      0x61801    1      1      NL B   informix rootdbs
0x2b3dacc8 2      0x60801    2      1      NL B   informix logdbs
0x2b3dae18 3      0x40801    3      1      NL B   informix datadbs
0x2b988018 4      0x40811    4      1      NLBB   informix sblbdbs
0x2b988168 5      0x42001    5      1      N TB   informix tempdbs
5 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
addresschunk/dbsoffset   size       free       bpages   flags pathname
0x2b269928 1   1    0          2000000    1298046               PI-B/home/data/DATA
0x2b269db0 2   2    2000000    4000000    599947                PI-B/home/data/DATA
0x2b3da830 3   3    6000000    20000000   17981205            PI-B/home/data/DATA
0x2b3da9b8 4      4   26000000   2000000   ~2000000    2000000    PIBB/home/data/DATA
0x2b3dab40 5   5    28000000   2000000    1999947               PO-B/home/data/DATA
5 active, 32766 maximum

Expanded chunk capacity mode: always

文件/home/informix/etc/onconfig内容片段如下:
# DBSPACETEMP:
# OnLine equivalent of DBTEMP for SE. This is the list of dbspaces
# that the OnLine SQL Engine will use to create temp tables etc.
# If specified it must be a colon separated list of dbspaces that exist
# when the OnLine system is brought online.If not specified, or if
# all dbspaces specified are invalid, various ad hoc queries will create
# temporary files in /tmp instead.

DBSPACETEMP   tempdbs         # Default temp dbspaces

# DUMP*:

为何在辅助服务器上不能创建临时表?

请高手指点。

[ 本帖最后由 xxyyy 于 2007-6-14 22:35 编辑 ]

liaosnet 发表于 2007-06-11 16:02

HDR备机数据库是只读~~~不能建表~

xxyyy 发表于 2007-06-11 19:18

可是我看informix的技术文档,说,从机不能建立正常表,可以建立临时表用来排序、分组等的啊。

wolfop 发表于 2007-06-11 20:39

那个是隐含的临时表,比如用到group by等。 显式的并不支持。

xxyyy 发表于 2007-06-11 22:01

原帖由 wolfop 于 2007-6-11 20:39 发表
那个是隐含的临时表,比如用到group by等。 显式的并不支持。

啊,原来如此啊,我本来为了减少主机的负担,想把查询工作分流给从服务器,部分查询应用创建了临时表用来暂存中间结果,就不行啦,真是麻烦了。

不知创建临时表时用with no log关键字行不行。

哪位高手有没有更好的办法啊,请指点一二。

wolfop 发表于 2007-06-12 15:13

忘记在10版本是否可以支持显示的临时表了。

ly0601 发表于 2007-06-13 15:08

用with no log 可以创建显式临时表,我是10版的,其它版本未试过

xxyyy 发表于 2007-06-14 22:35

哈哈,经过我实验,用语法select .... into temp tablename with no log;可以在从服务器上创建临时表。

我还没有实验用create temp table tablename with no log;这样的语法是否可以创建临时表。有兴趣的朋友可以测试一下。

我的数据库版本是IDS9.4,操作系统是linux
页: [1]
查看完整版本: HDR的辅助服务器为何不能创建临时表?(已经解决)