您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“服務(wù)器字符集對DM7中List分區(qū)表有什么影響”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
1.在Linux平臺上使用disql工具創(chuàng)建List分區(qū)表sales時對分區(qū)鍵指定英文字符時,當(dāng)指定多個值時可以創(chuàng)建成功 SQL> CREATE TABLE sales 2 ( 3 sales_id INT, 4 saleman CHAR(20), 5 saledate DATETIME, 6 city CHAR(10) 7 ) 8 PARTITION BY LIST(city) 9 ( 10 PARTITION p1 VALUES ('a','b'), 11 PARTITION p2 VALUES ('c','d','e'), 12 PARTITION p3 VALUES ('f','g'), 13 PARTITION p4 VALUES ('h','i') 14 ); warning: List partition not include default,partition may be not located executed successfully used time: 115.412(ms). Execute id is 2094. 2.在Linux平臺上使用disql工具創(chuàng)建List分區(qū)表sales時對分區(qū)鍵指定中文時,當(dāng)指定多個列表值時創(chuàng)建報錯 SQL> drop table sales; executed successfully used time: 307.935(ms). Execute id is 2095. SQL> CREATE TABLE sales 2 ( 3 sales_id INT, 4 saleman CHAR(20), 5 saledate DATETIME, 6 city CHAR(50) 7 ) 8 PARTITION BY LIST(city) 9 ( 10 PARTITION p1 VALUES ('北京','天津'), 11 PARTITION p2 VALUES ('上海','南京','杭州'), 12 PARTITION p3 VALUES ('武漢','長沙'), 13 PARTITION p4 VALUES ('廣州','深圳') 14 ); CREATE TABLE sales ( sales_id INT, saleman CHAR(20), saledate DATETIME, city CHAR(50) ) PARTITION BY LIST(city) ( PARTITION p1 VALUES ('北京','天津'), PARTITION p2 VALUES ('上海','南京','杭州'), PARTITION p3 VALUES ('武漢','長沙'), PARTITION p4 VALUES ('廣州','深圳') ); PARTITION p2 VALUES ('上海','南京','杭州'), * line 11, column 30, nearby [藝嫻穄 has error[-2007]: Syntax error. used time: 0.328(ms). Execute id is 0. 3.在Linux平臺上使用disql工具創(chuàng)建List分區(qū)表sales時對分區(qū)鍵指定中文時,當(dāng)指定一個列表值時創(chuàng)建成功 SQL> CREATE TABLE sales 2 ( 3 sales_id INT, 4 saleman CHAR(20), 5 saledate DATETIME, 6 city CHAR(10) 7 ) 8 PARTITION BY LIST(city) 9 ( 10 PARTITION p1 VALUES ('北京'), 11 PARTITION p2 VALUES ('上海'), 12 PARTITION p3 VALUES ('武漢'), 13 PARTITION p4 VALUES ('廣州') 14 ); warning: List partition not include default,partition may be not located executed successfully used time: 19.809(ms). Execute id is 2096. 4.在win平臺使用disql工具創(chuàng)建List分區(qū)表sales時對分區(qū)鍵指定中文時,當(dāng)指定多個列表值時創(chuàng)建成功 disql V7.1.6.48-Build(2018.03.01-89507)ENT SQL> conn jy/abcd@10.10.10.1:5236 服務(wù)器[10.10.10.1:5236]:處于普通打開狀態(tài) 登錄使用時間: 14.001(毫秒) SQL> drop table sales; 操作已執(zhí)行 已用時間: 352.729(毫秒). 執(zhí)行號:2118. SQL> CREATE TABLE SALES( 2 SALES_ID INT, 3 SALEMAN CHAR(20), 4 SALEDATE DATETIME, 5 CITY CHAR(10) 6 ) 7 PARTITION BY LIST(CITY) 8 SUBPARTITION BY RANGE(SALEDATE) SUBPARTITION TEMPLATE( 9 SUBPARTITION P11 VALUES LESS THAN ('2012-04-01'), 10 SUBPARTITION P12 VALUES LESS THAN ('2012-07-01'), 11 SUBPARTITION P13 VALUES LESS THAN ('2012-10-01'), 12 SUBPARTITION P14 VALUES EQU OR LESS THAN (MAXVALUE)) 13 ( 14 PARTITION P1 VALUES ('北京','天津') 15 ( 16 SUBPARTITION P11_1 VALUES LESS THAN ('2012-10-01'), 17 SUBPARTITION P11_2 VALUES EQU OR LESS THAN (MAXVALUE) 18 ), 19 PARTITION P2 VALUES ('上海','南京','杭州'), 20 PARTITION P3 VALUES (DEFAULT) 21 ); 操作已執(zhí)行 已用時間: 26.710(毫秒). 執(zhí)行號:2119. SQL>
5.在Linux平臺上使用管理工具創(chuàng)建List分區(qū)表sales時對分區(qū)鍵指定中文時,當(dāng)指定多個列表值時創(chuàng)建也能成功
6.查看操作系統(tǒng)字符集為UTF-8
[root@shard1 /]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
7.修改操作系統(tǒng)字符集
[root@shard1 /]# vi /etc/locale.conf
#LANG="en_US.UTF-8"
LANG="zh_CN.gb2312"
[root@shard1 ~]# locale
LANG=zh_CN.gb2312
LC_CTYPE="zh_CN.gb2312"
LC_NUMERIC="zh_CN.gb2312"
LC_TIME="zh_CN.gb2312"
LC_COLLATE="zh_CN.gb2312"
LC_MONETARY="zh_CN.gb2312"
LC_MESSAGES="zh_CN.gb2312"
LC_PAPER="zh_CN.gb2312"
LC_NAME="zh_CN.gb2312"
LC_ADDRESS="zh_CN.gb2312"
LC_TELEPHONE="zh_CN.gb2312"
LC_MEASUREMENT="zh_CN.gb2312"
LC_IDENTIFICATION="zh_CN.gb2312"
LC_ALL=
8.當(dāng)修改字符集后在Linux平臺使用disql工具創(chuàng)建List分區(qū)表sales時對分區(qū)鍵指定中文時,當(dāng)指定多個列表值時創(chuàng)建成功
[dmdba@shard1 bin]$ ./disql jy/abcd@10.10.10.1:5236
Server[10.10.10.1:5236]:mode is normal, state is open
login used time: 9.677(ms)
disql V7.1.6.46-Build(2018.02.08-89107)ENT
Connected to: DM 7.1.6.46
SQL> drop table sales;
executed successfully
used time: 351.233(ms). Execute id is 2120.
SQL> CREATE TABLE SALES(
2 SALES_ID INT,
3 SALEMAN CHAR(20),
4 SALEDATE DATETIME,
5 CITY CHAR(10)
6 )
7 PARTITION BY LIST(CITY)
8 SUBPARTITION BY RANGE(SALEDATE) SUBPARTITION TEMPLATE(
9 SUBPARTITION P11 VALUES LESS THAN ('2012-04-01'),
10 SUBPARTITION P12 VALUES LESS THAN ('2012-07-01'),
11 SUBPARTITION P13 VALUES LESS THAN ('2012-10-01'),
12 SUBPARTITION P14 VALUES EQU OR LESS THAN (MAXVALUE))
13 (
14 PARTITION P1 VALUES ('北京','天津')
15 (
16 SUBPARTITION P11_1 VALUES LESS THAN ('2012-10-01'),
17 SUBPARTITION P11_2 VALUES EQU OR LESS THAN (MAXVALUE)
18 ),
19 PARTITION P2 VALUES ('上海','南京','杭州'),
20 PARTITION P3 VALUES (DEFAULT)
21 );
executed successfully
used time: 22.411(ms). Execute id is 2121.
從上面的測試來看,字符集對List分區(qū)表使用中文存在影響。
“服務(wù)器字符集對DM7中List分區(qū)表有什么影響”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。