473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

export to pipe

I am attempting to move data between 2 DB2 Linux databases using a
pipe. I can't seem to get it working. Any assistance is appreciated.

I first issue:

mkfifo -m777 mypipe
db2 "connect to src_db"
db2 "export to mypipe of DEL MODIFIED BY COLDEL, MESSAGES exp.msg
select * from myschema.old_table"

Followed by:

db2 "connect to target_db"
db2 "import from mypipe of DEL MODIFIED BY COLDEL, MESSAGES imp.msg
replace into myschema.new_tbl"

The pipe gets created with proper permissions. I can issue a unix
"cat" command and the data comes back to the screen nice. The export
even completes successful when I issue the "cat".

However, When I issue the import commadn, I get the following on the
export side "

SQL3001C An I/O error (reason = "sqlofopn -2029060074") occurred while

opening the output file.

If I set up my test using an actual file instead of a pipe, it works
fine as well.

Any ideas are appreciated. Thanks.

Dec 29 '06 #1
2 16688
Ian
mike_dba wrote:
I am attempting to move data between 2 DB2 Linux databases using a
pipe. I can't seem to get it working. Any assistance is appreciated.

I first issue:

mkfifo -m777 mypipe
db2 "connect to src_db"
db2 "export to mypipe of DEL MODIFIED BY COLDEL, MESSAGES exp.msg
select * from myschema.old_table"

Followed by:

db2 "connect to target_db"
db2 "import from mypipe of DEL MODIFIED BY COLDEL, MESSAGES imp.msg
replace into myschema.new_tbl"

The pipe gets created with proper permissions. I can issue a unix
"cat" command and the data comes back to the screen nice. The export
even completes successful when I issue the "cat".

However, When I issue the import commadn, I get the following on the
export side "

SQL3001C An I/O error (reason = "sqlofopn -2029060074") occurred while

opening the output file.

If I set up my test using an actual file instead of a pipe, it works
fine as well.

Any ideas are appreciated. Thanks.
The error occurs because of how DB2 opens the file (pipe) for the
import utility. You can do:

mkfifo exportpipe
mkfifo importpipe

db2 "export to exportpipe ... "
cat < exportpipe importpipe &
db2 "import from importpipe ..."

Note, you'll have to execute the import and export from separate shells
because of the architecture of the DB2 CLP.

Exporting/importing through pipes is a kludge, however.

If you're moving a small amount of data (and I expect you are, if you
are using IMPORT), just export to a file and then import from the file.

If you're moving a large amount of data, try setting up a nickname in
the target database that points to your source database and then use the
LOAD FROM CURSOR functionality. Much better.

Dec 29 '06 #2
Ian,

Thanks for the reply. I suspected something on the open as you point
out. I think I will try the latter proposal of Federating the two
databases.

Much appreciated !

Ian wrote:
mike_dba wrote:
I am attempting to move data between 2 DB2 Linux databases using a
pipe. I can't seem to get it working. Any assistance is appreciated.

I first issue:

mkfifo -m777 mypipe
db2 "connect to src_db"
db2 "export to mypipe of DEL MODIFIED BY COLDEL, MESSAGES exp.msg
select * from myschema.old_table"

Followed by:

db2 "connect to target_db"
db2 "import from mypipe of DEL MODIFIED BY COLDEL, MESSAGES imp.msg
replace into myschema.new_tbl"

The pipe gets created with proper permissions. I can issue a unix
"cat" command and the data comes back to the screen nice. The export
even completes successful when I issue the "cat".

However, When I issue the import commadn, I get the following on the
export side "

SQL3001C An I/O error (reason = "sqlofopn -2029060074") occurred while

opening the output file.

If I set up my test using an actual file instead of a pipe, it works
fine as well.

Any ideas are appreciated. Thanks.

The error occurs because of how DB2 opens the file (pipe) for the
import utility. You can do:

mkfifo exportpipe
mkfifo importpipe

db2 "export to exportpipe ... "
cat < exportpipe importpipe &
db2 "import from importpipe ..."

Note, you'll have to execute the import and export from separate shells
because of the architecture of the DB2 CLP.

Exporting/importing through pipes is a kludge, however.

If you're moving a small amount of data (and I expect you are, if you
are using IMPORT), just export to a file and then import from the file.

If you're moving a large amount of data, try setting up a nickname in
the target database that points to your source database and then use the
LOAD FROM CURSOR functionality. Much better.
Jan 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex | last post by:
Hi, is there a way to display the table in CSV format or write a query in csv to a file ? Alex ---------------------------(end of broadcast)--------------------------- TIP 2: you can get...
1
by: mark.heyden | last post by:
Hi Frends, I am facing problems while trying to export data into pipe format. In fact I am fetching records from mysql database and then trying to create a text file ( using pipe as delimeter) ,...
3
by: chudson007 | last post by:
Can somebody help me with a delimiter problem I have. I have several PIPE (|) delimted text files which I need to import to SQL. With one of the files I keep encountering the following error;...
6
by: jefftyzzer | last post by:
Friends: Let's say I'd like perform a delete, but before I delete, I'd like to export the target rows. I could use an export whose SELECT clause references the OLD TABLE of a DELETE, but the...
2
by: dogman_2000 | last post by:
Hi All I am using the docmd.transfertext to export my query as a .csv file. I am using an export spec which is seperated by a pipe. The problem I have is that I added an extra column onto the...
1
by: bhapate1 | last post by:
Hi all, I Have a Table with 10 Columns, Among those i have Data in just 3 Columns. Rest of columns wil be blank. I want to Export that Table as a Pipe Delimited Text File. I am using...
1
by: db2admin | last post by:
Hello, I am wondering if someone have done comparison of loading data using cursor VS. Pipe. Please share your experience. which one is faster ? regards
5
by: The Pipe | last post by:
Hello I have a table that I need to export to a .asc file format. I have had several attempts at getting this to work but with no luck. Basically the file would need to have every record...
4
by: klaul | last post by:
I'm hoping that this is going to be an easy one to solve, but I've been trawling google and have had no luck at all! I'm using Access 2003, and am trying to export the contents of a table into a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.