---
title: "timsten -ttBulkCp "
author: "zljpp"
date: "2012-07-13T16:57:27Z"
tags: []
categories: ["编程语言"]
slug: "timsten-ttbulkcp"
draft: false
lastmod: "2012-07-13T16:58:20Z"
id: 1591822
url: "https://zljpp.iteye.com/blog/1591822"
---

I need to insert million of records from flat file,

ttBulkCp -i C:\\TimesTen\\Database\\test.txt

what cmd i need to give ?

i am having the txt file in C:\\TimesTen\\Database\\test.txt  
i need to import into my\_ttdb database which is placed at C:\\TimesTen\\Database\\my\_ttdb.ds0/my\_ttdb.ds1/my\_ttdb.inval

Thanks

[]()Re: Bulk insert -ttBulkCp  
发布: 2012-6-14 上午3:30   [![回复： 933663](https://cn.forums.oracle.com/forums/images/up-10x10.gif "回复： 933663")](https://cn.forums.oracle.com/forums/message.jspa?messageID=10395678#10395678 "回复： 933663") 回复： [933663](https://cn.forums.oracle.com/forums/message.jspa?messageID=10395678#10395678 "转至帖子")

[![Click to report abuse...](https://cn.forums.oracle.com/forums/images/warn-16x16.gif)](https://cn.forums.oracle.com/forums/abuse%21default.jspa?messageID=10395689 "Click to report abuse...") [![点击回复此主题](https://cn.forums.oracle.com/forums/images/reply-16x16.gif)](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10395689 "点击回复此主题") [回复](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10395689 "点击回复此主题")

the documentation is here:

[http://docs.oracle.com/cd/E21901\_01/doc/timesten.1122/e21643/util.htm#autoId7](http://docs.oracle.com/cd/E21901_01/doc/timesten.1122/e21643/util.htm#autoId7)

Your command line would look something like this:

ttBulkCp -i DSN=my\_ttdb your\_table\_name C:\\TimesTen\\Database\\test.txt -xp 1000

With a million rows you want to break the insert down with commits say every 1000 rows with the -xp option

[]()Re: Bulk insert -ttBulkCp  
发布: 2012-6-14 上午4:15   [![回复： Tim Vincent](https://cn.forums.oracle.com/forums/images/up-10x10.gif "回复： Tim Vincent")](https://cn.forums.oracle.com/forums/message.jspa?messageID=10395689#10395689 "回复： Tim Vincent") 回复： [Tim Vincent](https://cn.forums.oracle.com/forums/message.jspa?messageID=10395689#10395689 "转至帖子")

[![Click to report abuse...](https://cn.forums.oracle.com/forums/images/warn-16x16.gif)](https://cn.forums.oracle.com/forums/abuse%21default.jspa?messageID=10395842 "Click to report abuse...") [![点击回复此主题](https://cn.forums.oracle.com/forums/images/reply-16x16.gif)](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10395842 "点击回复此主题") [回复](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10395842 "点击回复此主题")

I am getting below error

My table name is test and i am having test.txt file in C:\\TimesTen\\Database\\

Command&gt; ttBulkCp -i DSN=my\_ttdb test C:\\TimesTen\\Database\\test.txt;  
1001: Syntax error in SQL statement before or at: "TTBULKCP", character positio  
n: 1  
ttBulkCp -i DSN=my\_ttdb test C:\\TimesTen\\Database\\test.txt  
^^^^^^^^

Thanks!

[]()Re: Bulk insert -ttBulkCp  
发布: 2012-6-14 上午4:42   [![回复： 933663](https://cn.forums.oracle.com/forums/images/up-10x10.gif "回复： 933663")](https://cn.forums.oracle.com/forums/message.jspa?messageID=10395842#10395842 "回复： 933663") 回复： [933663](https://cn.forums.oracle.com/forums/message.jspa?messageID=10395842#10395842 "转至帖子")

[![Click to report abuse...](https://cn.forums.oracle.com/forums/images/warn-16x16.gif)](https://cn.forums.oracle.com/forums/abuse%21default.jspa?messageID=10395940 "Click to report abuse...") [![点击回复此主题](https://cn.forums.oracle.com/forums/images/reply-16x16.gif)](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10395940 "点击回复此主题") [回复](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10395940 "点击回复此主题")

Hi 933663,

ttBulkCp - it is not a ttisql command, it is a utility. You should run it on OS level.

For example, run the following in command line (in Windows)

```
ttBulkCp -i DSN=my_ttdb test C:\TimesTen\Database\test.txt


```

Regards,  
Gennady

[]()Re: Bulk insert -ttBulkCp  
发布: 2012-6-18 下午10:10   [![回复： Gennady Sigalaev](https://cn.forums.oracle.com/forums/images/up-10x10.gif "回复： Gennady Sigalaev")](https://cn.forums.oracle.com/forums/message.jspa?messageID=10395940#10395940 "回复： Gennady Sigalaev") 回复： [Gennady Sigalaev](https://cn.forums.oracle.com/forums/message.jspa?messageID=10395940#10395940 "转至帖子")

[![Click to report abuse...](https://cn.forums.oracle.com/forums/images/warn-16x16.gif)](https://cn.forums.oracle.com/forums/abuse%21default.jspa?messageID=10403597 "Click to report abuse...") [![点击回复此主题](https://cn.forums.oracle.com/forums/images/reply-16x16.gif)](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10403597 "点击回复此主题") [回复](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10403597 "点击回复此主题")

Hi,

I am not able to insert the data i am getting the below error

TimesTen error code = 6220  
TimesTen error code = 802

I have created setup of dsn as per the below path

C:\\TimesTen\\tt1122\_32\\quickstart\\html\\admin\\dsn\_setup\_windows.html

Command&gt; connect "dsn=my\_ttdb";

Connection successful: DSN=my\_ttdb;UID=\*\*\*\*\*\*\*\*;DataStore=C:\\TimesTen\\Database\\my\_ttdb;  
DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;  
DRIVER=C:\\TimesTen\\TT1122~1\\bin\\ttdv1122.dll;  
LogDir=D:\\TimesTen\\Log;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=orcl\_db;(Default setting AutoCommit=1)

**Insertion**

1st time

C:\\&gt;ttBulkCp -i DSN=my\_ttdb mytable C:\\TimesTen\\Database\\test2.txt

C:\\TimesTen\\Database\\test2.txt:  
100000 rows inserted  
100000 rows total

2nd time

C:\\&gt;ttBulkCp -i DSN=my\_ttdb mytable C:\\TimesTen\\Database\\test2.txt  
ttBulkCp: Error received in file C:\\TimesTen\\Database\\test2.txt, line 97280 -- S1000: \[TimesTen]\[TimesTen 11.2.2.2.0 ODBC Driver]\[TimesTen]TT0802: Database permanent space exhausted -- file "blk.c", lineno 3450, procedure "sbBlkAlloc" (TimesTen error code = 802).

ttBulkCp: Error received in file C:\\TimesTen\\Database\\test2.txt, line 97280 -- S1000: \[TimesTen]\[TimesTen 11.2.2.2.0 ODBC Driver]\[TimesTen]TT6220: Permanent data partition free space insufficient to allocate 42440 bytes of memory -- file "blk.c", lineno 3450, procedure "sbBlkAlloc" (TimesTen error code = 6220).

how to resolve it

Thanks!

[]()Re: Bulk insert -ttBulkCp  
发布: 2012-6-19 上午6:53   [![回复： 933663](https://cn.forums.oracle.com/forums/images/up-10x10.gif "回复： 933663")](https://cn.forums.oracle.com/forums/message.jspa?messageID=10403597#10403597 "回复： 933663") 回复： [933663](https://cn.forums.oracle.com/forums/message.jspa?messageID=10403597#10403597 "转至帖子")

[![Click to report abuse...](https://cn.forums.oracle.com/forums/images/warn-16x16.gif)](https://cn.forums.oracle.com/forums/abuse%21default.jspa?messageID=10405158 "Click to report abuse...") [![点击回复此主题](https://cn.forums.oracle.com/forums/images/reply-16x16.gif)](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10405158 "点击回复此主题") [回复](https://cn.forums.oracle.com/forums/post%21reply.jspa?messageID=10405158 "点击回复此主题")

Dear 933663,

You should increase the permanent partition size (PermSize attribute).

Best regards,  
Gennady