dbisql 是什么? 怎么用?
dbisql 能够nogui的使用吗?怎么用?
dbisql 能够用loader的方式,把资料吃进去吗?怎么用?
dbisql 是什么?
在所有Sybase 产品裏,都使用dbisql。
产品有
SQL Anywhere (ASA), Sybase Enterprise Server( ASE), Sybase IQ
针对不能的需求而设计
1.线上交易的系统,存在密集的新增、删除及修改等行为;
2.但是当资料转入资料仓储作为分析之用,显少有删除与修改的需要,取而代之的则是大量、动态的查询活动。
dbisql介面
打开app介面,在画面里,执行query
dbisql -c "uid=sa;pwd=sa;eng=db;links=tcpip(host=myPC;port=2638);AutoPreCommit=YES" -q
dbisql 不要介面 - 执行query
run.batdbisql -c "uid=sa;pwd=sa;eng=db;links=tcpip(host=myPC;port=2638);AutoPreCommit=YES" -nogui "select top 1 * from tablename "
汇出捞取结果dbisql -c "uid=sa;pwd=sa;eng=db;links=tcpip(host=myPC;port=2638);AutoPreCommit=YES" -nogui "select top 1 * from tablename ; OUTPUT TO zZENObject.txt FORMAT ASCII "
dbisql 不要介面 - 执行外部sql
準备2个档案,放在一起,内容如下,然后执行bat,就会执行script.sql里的东西
1.script.sqlcreate table tablename (ID int ,name varchar(30))
2.run.batdbisql -c "uid=sa;pwd=sa;eng=db;links=tcpip(host=myPC;port=2638);AutoPreCommit=YES" -nogui script.sql
用loader(待完成)
sybase loader
要有2个档案
一个是控制档,filename.out.ctl
在控制档里指定资料档位置,与log位置.
一个是资料档,filename.out
控制档 .out.ctl
资料档 .out
log档 .out.ldrlog
control file
filename.out.ctl
/*
*Sybase IQ Load Script
*/
SET TEMPORARY OPTION ON_ERROR=EXIT;
SET TEMPORARY OPTION ISQL_LOG='e:\filename.out.ldrlog';
SET TEMPORARY OPTION DATE_ORDER='MDY';
truncate table tablename;
LOAD TABLE tablename
(
col1 ASCII( 7) NULL('* ') ,
col2 ASCII( 11) NULL('* ') ,
FILLER(2))
using client file 'e:\filename.out'
WITH CHECKPOINT OFF
BLOCK FACTOR 10000
NOTIFY 100000
ESCAPES OFF
QUOTES OFF
ON FILE ERROR ROLLBACK
/* End of Control File */
ref
https://sqlanywhere-forum.sap.com/questions/13475/running-a-script-file-with-dbisql-command-line
http://fecbob.pixnet.net/blog/post/39251081-sybase-dbisql%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%9A%84%E5%85%A7%E9%83%A8%E5%B0%8F%E5%A5%A7%E7%A7%98
key word
Running a script file with dbisql