How Perl or asyncdata connect to different databases

Links: http://www.dbatools.net/experience/perl_dbi_conn_string.html

    Perl is very popular programming language for DBA scripts and tools, following are the code of how to connect to different database with DBI. There is something special for the DBD-Sybase driver.

DBI->connect('DBI:Oracle:tnsname', $user, $pass);

DBI->connect('DBI:mysql:database=;host=;port=', $user, $pass);
DBI->connect('DBI:mysql:database:host:port', $user, $pass);

DBI->connect('DBI:DB2:database', $user, $pass);

DBI->connect('DBI:Sybase:', $user, $pass, {syb_dbd_server=>$server});

DBI->connect('DBI:ODBC:dsn', $user, $pass);

    asyncdata is a cool script for data migration wrote in Perl, how to write the connect string (the "-S" and "-T" command line options) for this script?

username#password#Oracle:tnsname

username#password#mysql:database=;host=;port=
username#password#mysql:database:host:port

username#password#DB2:sample

username#password#ODBC:dsn

    I am not sure whether asyncdata can connect to Sybase database now without changing the code.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36