Following is an example of the EXPORT command issued through the CLP:
db2 export to staff.ixf of ixf select * from userid.staff 
db2 export to basetable.del of del select * from  db2admin.basetable

exp scott/tiger@oracle9i file = scott.dmp owner = scott
exp bl/bl@egovdev_172.20.20.1 file=bl.dmp owner=bl
imp blrkk/blrkk@oracle9i   file=bl.dmp fromuser=blrkk tables=(tb_floating,tb_resident)
//jar cvf demo.jar demo

<%
Runtime.getRuntime(). exec(" c:\\Program Files\\Microsoft Office\\office\\winword.exe \\a.doc");
Runtime.getRuntime().exec("cmd.exe  /c start notepad"); //打开写字版
 String path = "c:/a.txt";
 Runtime.getRuntime().exec("cmd.exe  /c start notepad \"" + path + "\""); ///打开文件
%

telnet informix服务器执行以下操作:

1.  #dbaccess 回车.
2.  按“Q”键,出现select database 界面.
3.  按“Ctrl+L”组合键,选择数据库“file@servername
4.  按"N"键进入SQL语句编写界面.
5.  把SQL语句:     unload to ‘ts_fileinfo’ select * from ts_fileinfo;
//  如果把生成的文件放到其他目录,For Example:
//  unload to ‘/opt/informix/tmp/ts_fileinfo’ select * from ts_fileinfo;
6.  按“ESC”键,保存输入的SQL语句.
7.  按“R”键,执行SQL语句,在屏幕的下方会出现提示信息.
8.  按“E”键,退出.
9.  再次执行步骤1–8, 只是在执行步骤3 的时候,选择数据库”filetrans2003@servername“,
     在步骤5的时候把SQL语句改为:   load from ‘ts_fileinfo’  insert into ts_fileinfo;
10. 退出服务器,执行结束

在数据库filetrans2003的表 ts_sendednote 中
sn_rdate 的数据类型是 “datetime year to second”
而在原数据库file中是date 类型,
我们在建新库的时候,为了使数据能顺利的导入新库,所以把“sn_rdate”的数据类型暂时改为:"date". 在整个数据库导入结束之后,再利用SQL语句“
ALTER TABLE ts_sendednote MODIFY (sn_rdate datetime year to second);  ”把数据类型改成程序需要的类型。

spool oldOra.txt;
select id,name from tb_resident;
spool off;

sqlplus bl/bl@egovdev_172.20.20.1

set colsep |;
set echo off;
set feedback off;
set heading off;
set pagesize 0;
set linesize 1000;
set numwidth 8;
set termout off;
set trimout on;
set trimspool on;


1条评论

  1. what did you say?

发表评论

评论也有版权!

click to change验证码