Last active
December 9, 2016 16:28
-
-
Save soapplied/5899230 to your computer and use it in GitHub Desktop.
DB2 export DB tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db2 connect to MYDB | |
db2 -x "select tabname from syscat.tables where TABSCHEMA='MYSCHEMA' | |
and type='T'" > tableNames | |
while read TABLE; do | |
db2 EXPORT TO ./exported/$TABLE.del OF DEL lobs to ./exported/lobs | |
lobfile $TABLE xml to ./exported/xml xmlfile $TABLE | |
modified by lobsinsepfiles xmlinsepfiles MESSAGES ./exported/$TABLE.txt | |
"SELECT * FROM MYSCHEMA.$TABLE" | |
done < tableNames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment