DBIDUMPER(1)

πŸ“¦
version 2.01 Β· 2 versions
, in fedora 43

πŸ’Ύ DBIDUMPER β€” dump database to delimited file πŸ’Ύ

okay bestie, gather round, because this little perl script is about to dump your whole database into a delimited file and honestly? it ate. it's called dbidumper, it lives in the User Contributed Perl Documentation corner of the manual, and it's giving very much "sql*loader but make it accessible." πŸŽ€


✨ SYNOPSIS ✨

dbidumper [OPTION]...

<< meanwhile in your control file >>
OPTIONS (export=100,rows=100)
EXPORT DATA REPLACE INTO FILE 'test.dat'
FIELDS TERMINATED BY TAB ENCLOSED BY '"' AND '"'
WITH HEADER FROM
SELECT * FROM MY_TABLE

like, you run it with options, or you let your control file do the talking. either way, slay. πŸ’…


🌸 DESCRIPTION 🌸

So here's the tea, bestie: dbidumper dumps data from a select statement into an output file. periodt. πŸ’–

It's lowkey trying to mirror the functionality and behavior of sql*loader β€” the control file syntax is similar, and dbidumper uses a subset of the sql*loader options. And plot twist: options can also be specified in the control file. But here's the rule β€” the command line versions take precedence. πŸ‘‘


🫢 The Options (yes, every single one)

  • userid=username/password@sid β€” your login info for the database connection.
Note: for security reasons, it is customary to place this option inside the control file. (bestie, pls don't put your password on the command line, the process list is NOT your friend 😭)

If the sid includes a colon, the full string will be used as the DBI dsn. For example:

userid=username/password@mysql:database

Will connect to mysql's 'database' database as username. iconic behavior honestly. ✨

If the environment variable ORACLE_SID is available, it will be used if not specified here.

  • control=filename β€” the input control filename. Defaults to standard input. See the CONTROL FILE section below for layout and description. πŸ“„
  • output=filename β€” the output filename for data. Defaults to standard output. If rows is given, it can contain a template consisting of three or more Xs. The Xs will be replaced with the file sequence number. If the template does not contain three or more Xs, the sequence number will be appended to the filename with a dot. Examples, because examples are everything:
    • rows=1000 output=outputXXXXX.dat Data will be written to output00001.dat, output00002.dat, etc.
    • rows=1000 output=output.dat Data will be written to output.dat.0001, output.dat.0002, etc.
    • output=outputXXXXX.dat Data will be written to outputXXXXX.dat

(yes, that last one just... stays. no rows means no numbering, and we respect that. πŸ™ˆ)

  • rows=n β€” number of rows per output file. Defaults to all rows in one output file.
  • export=n β€” total number of rows to export. Use this to limit output or restart a dump. 🏁
  • skip=n β€” number of rows to skip from the beginning. The file sequence number will be preserved, so if rows=n is set, this can be used to restart a job. (resume queen energy fr fr πŸ‘‘)
  • writesize=n β€” block size to write the file. Defaults to write each record as returned from the database. If set, dbidumper will collect rows into a buffer at most n bytes large before writing to file. 🧺
  • silent=true β€” suppress normal logging information. dbidumper will only report errors. the quiet luxury option. πŸ’…

πŸ¦‹ DEPENDENCIES πŸ¦‹

This program depends on the following perl modules, available from a CPAN mirror near you:

  • Parse::RecDescent β€” Recursive parser
  • DBI β€” Standard database interface

go give your CPAN mirror a little kiss, it's holding this whole thing together. πŸ’œ


🌈 CONTROL FILE 🌈

The control file used for dbidumper is very similar to sql*loader's. The full specification is:

[ OPTIONS ([option], ...) ]
EXPORT DATA [ REPLACE | APPEND ] [ INTO FILE 'filename' ]
[ FIELDS
        [ TERMINATED [BY] {TAB | 'string' | X'hexstring'} ] |
        [ ENCLOSED [BY] {'string' | X'hexstring'}
                [AND] ['string' | X'hexstring'] ]
]
[ WITH HEADER ]
FROM
select_statement

look at all those optional brackets. so much freedom. so many choices. main character energy. ⭐


πŸ‘‘ AUTHOR πŸ‘‘

Written by Warren Smith (warren.smith@acxiom.com)


πŸ’€ BUGS πŸ’€

None yet.

...bestie that is either the most iconic thing ever written in a manpage or the most ominous. no in-between. 😭


and that's the whole page, babe β€” this was DBIDUMPER(1) from the User Contributed Perl Documentation, running under perl v5.42.0, dated 2025-07-25. go dump something gorgeous. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from