How to dump data to flat file?
Posted in 2004
Topics: Installation, Setup & Upgrades, Storage & Space Management, Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration
I am an Oracle DBA but a tyro at Informix. [1]
Need to get some data out of tables with names like:
informix.sometable
root.another_table
...etcetera. Evidently it's <owner>.<tablename> as in Oracle, and
I've determined that these are all in the same "dbspace" (there's only
one).
WHAT I'VE TRIED: Figured out how to get into the menu-driven
"onmonitor," but when I choose to display Dbspaces -> Info it just
gives me the name of the dbspace, and Status-> Databases just gives me
the names of three databases. "esql" just prints out the help page
for esql. (I was going to try a DESCRIBE on these tables to get
column descriptions, and then SELECT * FROM ...). I am timorous about
trying any of the options for fear of doing something to this
production system.
THE QUESTION: How to get to the table information so I can do a
SELECT * FROM <tablename> and dump it into a flat file?
Everything in your FAQ is already over my head. I downloaded the
manuals in *.pdf format and have been pouring over the "Informix Guide
to SQL: Reference" and "Administrator's Guide" to no avail. ("Getting
Started" was about installation.)
As a reward for help, you all can hit me up by e-mail with any Oracle
questions you may have now or in the future.
-----------------------------
[1] Tyro is the "real" word for "newbie." Look: http://www.m-w.com
John Doe wrote:
> I am an Oracle DBA but a tyro at Informix. [1]
>
> Need to get some data out of tables with names like:
> informix.sometable
> root.another_table
> ...etcetera. Evidently it's <owner>.<tablename> as in Oracle, and
> I've determined that these are all in the same "dbspace" (there's only
> one).
Using <owner>. is only required if you've got an ANSI database, otherwise
<tablename> is sufficient.
> WHAT I'VE TRIED: [snipped]
>
> THE QUESTION: How to get to the table information so I can do a
> SELECT * FROM <tablename> and dump it into a flat file?
Take a look at DB-Access. See the IBM Informix DB-Access User's Guide for
specifics, but I think it is fairly self-explanatory. (If you are
comfortable with SQL-Plus, DB-Access is a piece of cake. Just my personal
opinion, anyway.)
DB-Access will allow you to get information on the tables, indexes, etc.
You could use the Query-Language option to enter an SQL statement to unload
a table. For example:
UNLOAD TO "<filename>"
SELECT * FROM <tablename>
This will give you a pipe-delimited file. You can change the delimiters if
you like. (See the UNLOAD command in the SQL: Syntax manual for more
information on that.)
> Everything in your FAQ is already over my head. I downloaded the
> manuals in *.pdf format and have been pouring over the "Informix Guide
> to SQL: Reference" and "Administrator's Guide" to no avail. ("Getting
> Started" was about installation.)
Just in case, below is the link to the on-line Informix documentation.
http://www.ibm.com/informix/pubs/library/lists.html
(Mark - I used this one just for you!!)
> As a reward for help, you all can hit me up by e-mail with any Oracle
> questions you may have now or in the future.
Be careful in what you promise. Might just take you up on it!!
--
June Hunt
On Wed, 25 Feb 2004 14:34:07 -0500, John Doe wrote:
To everyone else's comments, let me add a suggestion that you take a look at
the Informix schema utility, dbschema.
Art S. Kagel
> I am an Oracle DBA but a tyro at Informix. [1]
>
> Need to get some data out of tables with names like: informix.sometable
> root.another_table
> ...etcetera. Evidently it's <owner>.<tablename> as in Oracle, and I've
> determined that these are all in the same "dbspace" (there's only one).
>
> WHAT I'VE TRIED: Figured out how to get into the menu-driven "onmonitor,"
> but when I choose to display Dbspaces -> Info it just gives me the name of
> the dbspace, and Status-> Databases just gives me the names of three
> databases. "esql" just prints out the help page for esql. (I was going to
> try a DESCRIBE on these tables to get column descriptions, and then SELECT *
> FROM ...). I am timorous about trying any of the options for fear of doing
> something to this production system.
>
> THE QUESTION: How to get to the table information so I can do a SELECT *
> FROM <tablename> and dump it into a flat file?
>
> Everything in your FAQ is already over my head. I downloaded the manuals in
> *.pdf format and have been pouring over the "Informix Guide to SQL:
> Reference" and "Administrator's Guide" to no avail. ("Getting Started" was
> about installation.)
>
> As a reward for help, you all can hit me up by e-mail with any Oracle
> questions you may have now or in the future.
>
> -----------------------------
> [1] Tyro is the "real" word for "newbie." Look: http://www.m-w.com