Couldn't run restore database command from perl DBI

  • hi,

    i am trying to execute restore database command from perl dbi connection.

    it errors out..

    [Microsoft][ODBC SQL Server Driver][SQL Server]Processed 168 pages for database 'aks1', file 'Test' on file 1. (SQL-01000)

    actually restore command generates following information.

    Processed 168 pages for database 'aks1', file 'Test' on file 1.

    Processed 1 pages for database 'aks1', file 'Test_log' on file 1.

    RESTORE DATABASE successfully processed 169 pages in 0.165 seconds (8.390 MB/sec).

    so dbi handle , thins first message is error and exits.

    Somewhere i read, restore command requires the client alive for completion.

    This causes database restore hangs in partial . log is not applied and i cann't recover toand i get this error to bring online

    Msg 4333, Level 16, State 1, Line 1

    The database cannot be recovered because the log was not restored

    any idea, how can i keep dbi handle alive or ignore these informational messages or other method to run the command from perl?

    thanks

    AK

  • I'm not a Perl user so, sorry, no joy there. I am curious, though... why are you using Perl to execute restores?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • i am creating a script to refresh devlopment database from production.

    it will be called from a front end screen that lists source/target server and developer can refresh any dev database

  • i changed prepare to include an option solved the problem

    my $sth = $db->prepare( $sql, { odbc_exec_direct => 1})

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply