返回首页

gbase数据、南大通用产品文档:GBase8s在 UNIX 上配置 DSN

更新日期:2024年09月11日

配置文件提供驱动程序用来连接至 DSN 的信息,诸如驱动程序属性。
本部分提供关于 UNIX™ 上的驱动程序规范和 DSN 规范的信息,并描述下列 DSN 配
置文件:

sqlhosts

odbcinst.ini

odbc.ini
要修改这些文件,请使用文本编辑器。该部分还提供驱动程序和 DSN 规范的示例。

GBase 8s ODBC Driver 程序员指南
南大通用数据技术股份有限公司
- 29 -
如果您正在启用单点登录(SSO),请参阅《GBase 8s 安全指南》中的“为 SSO 配置
ESQL/C 和 ODBC Driver”的内容。

建表语句
create tablespace example2 relative location 'tablespace2';
create tablespace example3 relative location 'tablespace3';
create table bmsql_config (
cfg_name
varchar(30) primary key,
cfg_value
varchar(50)
);
create table bmsql_warehouse (
w_id
integer
not null,
w_ytd
decimal(12,2),
w_tax
decimal(4,4),
w_name
varchar(10),
w_street_1
varchar(20),
w_street_2
varchar(20),
w_city
varchar(20),
w_state
char(2),
w_zip
char(9)

GBase 8c V5 开发者手册
南大通用数据技术股份有限公司
600
)with (fillfactor=80)
;
create table bmsql_district (
d_w_id
integer
not null,
d_id
integer
not null,
d_ytd
decimal(12,2),
d_tax
decimal(4,4),
d_next_o_id
integer,
d_name
varchar(10),
d_street_1
varchar(20),
d_street_2
varchar(20),
d_city
varchar(20),
d_state
char(2),
d_zip
char(9))with (fillfactor=80);
create table bmsql_customer (
c_w_id
integer
not null,
c_d_id
integer
not null,
c_id
integer
not null,
c_discount
decimal(4,4),
c_credit
char(2),
c_last
varchar(16),
c_first
varchar(16),
c_credit_lim
decimal(12,2),
c_balance
decimal(12,2),
c_ytd_payment
decimal(12,2),
c_payment_cnt
integer,
c_delivery_cnt integer,
c_street_1
varchar(20),
c_street_2
varchar(20),
c_city
varchar(20),
c_state
char(2),
c_zip
char(9),
c_phone
char(16),
c_since
timestamp,
c_middle
char(2),
c_data
varchar(500)
)with (fillfactor=80)
tablespace example2;

GBase 8c V5 开发者手册
南大通用数据技术股份有限公司
601
--create sequence bmsql_hist_id_seq cache 100;
create table bmsql_history (
hist_id
integer,
h_c_id
integer,
h_c_d_id integer,
h_c_w_id integer,
h_d_id
integer,
h_w_id
integer,
h_date
timestamp,
h_amount decimal(6,2),
h_data
varchar(24)
)with (fillfactor=80);
--DISTRIBUTE BY HASH(h_w_id);
create table bmsql_new_order (
no_w_id
integer
not null,
no_d_id
integer
not null,
no_o_id
integer
not null,
primary key (no_w_id, no_d_id, no_o_id)
)with (fillfactor=80);
--DISTRIBUTE BY HASH(no_w_id);
create table bmsql_oorder (
o_w_id
integer
not null,
o_d_id
integer
not null,
o_id
integer
not null,
o_c_id
integer,
o_carrier_id integer,
o_ol_cnt
integer,
o_all_local
integer,
o_entry_d
timestamp
)with (fillfactor=80) ;
--DISTRIBUTE BY HASH(o_w_id);
create table bmsql_order_line (
ol_w_id
integer
not null,
ol_d_id
integer
not null,
ol_o_id
integer
not null,
ol_number
integer
not null,
ol_i_id
integer
not null,

GBase 8c V5 开发者手册
南大通用数据技术股份有限公司
602
ol_delivery_d
timestamp,
ol_amount
decimal(6,2),
ol_supply_w_id
integer,
ol_quantity
integer,
ol_dist_info
char(24)
)with (fillfactor=80);
--DISTRIBUTE BY HASH(ol_w_id);
create table bmsql_item (
i_id
integer
not null,
i_name
varchar(24),
i_price
decimal(5,2),
i_data
varchar(50),
i_im_id
integer
)with (fillfactor=80);
create table bmsql_stock (
s_w_id
integer
not null,
s_i_id
integer
not null,
s_quantity
integer,
s_ytd
integer,
s_order_cnt
integer,
s_remote_cnt integer,
s_data
varchar(50),
s_dist_01
char(24),
s_dist_02
char(24),
s_dist_03
char(24),
s_dist_04
char(24),
s_dist_05
char(24),
s_dist_06
char(24),
s_dist_07
char(24),
s_dist_08
char(24),
s_dist_09
char(24),
s_dist_10
char(24)
)with (fillfactor=80)
tablespace example3;
--DISTRIBUTE BY HASH(s_w_id);

审计日志记录了数据库中与数据库操作相关的日志。要开启审计日志功
能,您需要打开当前所连接集群的查询编辑器,并在其中执行如下SQL 语句:
Set global audit_log=true ;
Set global log_output='TABLE';
开启审计日志后,集群会记录您所连接的节点的审计日志。
双击“审计日志”节点,您可以打开“审计日志管理”窗口。
您可以通过“过滤”按钮审计您所关注的日志内容,如下图所示:

GBase 8a MPP Cluster 管理工具手册

- 120 -

南大通用数据技术股份有限公司

图 7-109 审计日志
使用“查找”功能,您可以查找当前页中,“日志内容”列中的相关信
息,查找到的信息会高亮显示,如下图所示:



GBase 8a MPP Cluster 管理工具手册
南大通用数据技术股份有限公司

- 121 -

图 7-110 使用查找功能
使用“导出”功能,您可以将审计日志内容导出到本地的文本文件中。