sowraaj has asked for the wisdom of the Perl Monks concerning the following question:

hi friends,

I'm new to perl programming give me one best DB(MSSQL,MySQl or Oracle)which is access from perl programs. I need to insert the log data into DB i don't know how perl could reduce my time from .Net parsing(Which is currently i used)

  • Comment on give me one best DB(MSSQL,MySQl or Oracle)which is access from perl programs

Replies are listed 'Best First'.
Re: give me one best DB(MSSQL,MySQl or Oracle)which is access from perl programs
by davido (Cardinal) on Aug 06, 2011 at 16:51 UTC

    If you're asking which database to use with Perl, that's a decision that is constrained by any of the following: you, your team, your boss, your DBA, your service provider, and your financial capacity.

    There are number of OpenSource or otherwise free databases out there. MySQL, and PostgreSQL are among the common ones in this category. PostgreSQL seems to be more advanced, while MySQL is more likely to already be installed on your Linux system. For lightweight work there is also SQLite, which stores its databases as single files.

    Instead of getting into the nearly religious zealotry pitching one DB over another, I can point you to Wikipedia's article comparing relational databases. You would have to also check the CPAN to verify that there is a Perl Database Driver (DBD::???) for the database you're considering.

    The canonical way to access a database with Perl is to install DBI, as well as the DBD for the specific database you're targeting (DBD::mysql, for example). If you want an object-oriented approach to dealing with the database, also install DBIx::Class and start reading its POD.

    Hope this helps...


    Dave

Re: give me one best DB(MSSQL,MySQl or Oracle)which is access from perl programs
by Perlbotics (Archbishop) on Aug 06, 2011 at 15:55 UTC

    I am not sure, if I completely understand your question, but I think you should study the documentation of the following modules: DBI and - depending on your DB backend - DBD::Oracle, DBD::MySQL, etc.

    PM also has a Database Programming tutorial section and the DBI-Homepage is also a good starting point.

    Maybe you should start with:

    • create a DB
    • parse log file line by line (loop over log file)
    • extract and format log-data
    • put log data into DB

    The DBI interface makes it easy to change DB backends later, so you could start using a simple file based SQLite DB (DBD::SQLite). Then, I also recommend Databases made easy.

    Come back with a concrete code sample if you have problems.

    HTH

Re: give me one best DB(MSSQL,MySQl or Oracle)which is access from perl programs
by cjb (Friar) on Aug 06, 2011 at 16:14 UTC

    All are fairly easy to use via DBI, however there are downsides to all of them. Access to MSSQL can be problematic on none Windows systems. Oracle is not cheap. MySQL has some interesting foibles. If all you are doing is logging you might want to consider the light weight DBD::SQLite

    There are of course plenty of other RDBMS platforms

Re: give me one best DB(MSSQL,MySQl or Oracle)which is access from perl programs
by Anonymous Monk on Aug 06, 2011 at 15:50 UTC