Topic
  • 4 replies
  • Latest Post - ‏2013-03-28T16:29:34Z by SystemAdmin
SystemAdmin
SystemAdmin
5837 Posts

Pinned topic (Backup, Restore) Database

‏2013-03-26T22:55:55Z |
.

Backup Database :

BACKUP DATABASE <DB Name> TO 'C:\' WITH 2 BUFFERS
BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING;

Restore Database :

RESTORE DATABASE <DB Name> FROM 'C:\' TAKEN AT <Serial Backup> INTO DB_COPY REPLACE EXISTING;

The Question :

How backup and restore from <asp> ???

Example not Works :
Dim Cn
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.Execute "BACKUP DATABASE Data1 TO 'C:\' WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING"
Updated on 2013-03-28T16:29:34Z at 2013-03-28T16:29:34Z by SystemAdmin
  • nivanov1
    nivanov1
    53 Posts

    Re: (Backup, Restore) Database

    ‏2013-03-27T13:53:00Z  
    BACKUP and RESTORE are not SQL statements, therefore you cannot execute them via ADODB. They are the commands performed by the DB2 Command Line Processor.

    You can use the ADMIN_CMD() stored procedure, which you invoke using ADODB, to run these utilities. Details are, as usual, available in the manual: http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.sql.rtn.doc/doc/r0012547.html
  • SystemAdmin
    SystemAdmin
    5837 Posts

    Re: (Backup, Restore) Database

    ‏2013-03-28T07:15:29Z  
    • nivanov1
    • ‏2013-03-27T13:53:00Z
    BACKUP and RESTORE are not SQL statements, therefore you cannot execute them via ADODB. They are the commands performed by the DB2 Command Line Processor.

    You can use the ADMIN_CMD() stored procedure, which you invoke using ADODB, to run these utilities. Details are, as usual, available in the manual: http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.sql.rtn.doc/doc/r0012547.html
    Example :

    Cn.Execute "CALL SYSPROC.ADMIN_CMD('BACKUP DATABASE DB_MAN TO ""C:\"" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING')"

    Results :

    Error --> DB2/NT SQL2413N Online backup is not allowed because the database is not recoverable or a backup pending condition is in effect.

    .

    .

    I'm sorry, but i want backup and restore database from my project !!!

    why ?

    I want facility the backup and restore processor in my users !!!

    Path Example :

    http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.rtn.doc%2Fdoc%2Fr0012547.html
  • nivanov1
    nivanov1
    53 Posts

    Re: (Backup, Restore) Database

    ‏2013-03-28T14:03:21Z  
    Example :

    Cn.Execute "CALL SYSPROC.ADMIN_CMD('BACKUP DATABASE DB_MAN TO ""C:\"" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING')"

    Results :

    Error --> DB2/NT SQL2413N Online backup is not allowed because the database is not recoverable or a backup pending condition is in effect.

    .

    .

    I'm sorry, but i want backup and restore database from my project !!!

    why ?

    I want facility the backup and restore processor in my users !!!

    Path Example :

    http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.rtn.doc%2Fdoc%2Fr0012547.html
    Check the explanation for SQL2413N in the manual.
  • SystemAdmin
    SystemAdmin
    5837 Posts

    Re: (Backup, Restore) Database

    ‏2013-03-28T16:29:34Z  
    • nivanov1
    • ‏2013-03-28T14:03:21Z
    Check the explanation for SQL2413N in the manual.
    How??
    Please example !!!

    I'm Sorry, I new with db2 !!!
    I'm programmer (oracle, access, sql server) database