backup 备份失败

问题:想要backup数据库!

[db2inst2@cognoswithdb2 backupfordb2]$ db2 backup db sample to /backupfordb2/
SQL1035N  The operation failed because the specified database cannot be 
connected to in the mode requested.  SQLSTATE=57019

看官当

SQL1035N

操作失败,这是因为无法以请求的方式来连接指定的数据库。

说明

当用户连接至数据库时,缺省情况下,该连接处于共享方式。如果另一个用户已经以互斥方式连接至同一数据库,那么共享连接尝试将失败并返回此消息。类似地,如果用户尝试以互斥方式访问数据库,但是已经以共享方式访问该数据库,那么连接尝试将失败并返回此消息。

在下列类型的情况下也会返回此消息:

  • 已达到数据库的最大连接数。
  • 请求了独占使用数据库,但另一个用户已经在以互斥方式使用该数据库。
  • 已显式激活数据库(共享访问),这会阻止该操作建立与该数据库的互斥连接。

在 pureScale 环境中,当发生以下事件系列时,可能会返回此消息:

  1. 对数据库启动了脱机操作(例如,备份、复原或前滚),并且该操作获得了与数据库的互斥连接。
  2. 未释放启动该脱机操作失败(例如,由于发生了硬件或软件故障)的成员和该脱机操作所拥有的互斥连接。
  3. 启动该脱机操作的成员未能自动重新启动。

用户响应

请执行下列故障诊断步骤:

  1. 通过使用带有 SHOW DETAIL 参数和 GLOBAL 参数的 LIST APPLICATIONS 命令,确定哪些用户应用程序或系统应用程序已打开与数据库的连接。
  2. 等待那些已打开与数据库的连接的应用程序关闭其连接。
  3. 通过使用下列命令或语句来终止任何剩余的与数据库的连接:
    • QUIESCE DATABASE 命令
    • CONNECT RESET 语句
    • FORCE APPLICATION ALL 命令
    • DEACTIVATE DATABASE 命令
  4. 在 DB2 pureScale 环境中,重新启动在执行脱机操作时关闭的任何成员。
  5. 再次连接。

sqlcode:-1035

sqlstate:57019



解决问题

根据文档

[db2inst2@cognoswithdb2 backupfordb2]$ db2 force application all
DB20000I  The FORCE APPLICATION command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

[db2inst2@cognoswithdb2 backupfordb2]$ db2 backup db sample to /backupfordb2/
SQL1035N  The operation failed because the specified database cannot be 
connected to in the mode requested.  SQLSTATE=57019
不行

connect reset--------不行

呵呵

重启数据库,OK!



然后

我想查看下备份情况

[db2inst2@cognoswithdb2 backupfordb2]$ db2 list history backup all for sample
SQL1224N  The database manager is not able to accept new requests, has 
terminated all requests in progress, or has terminated the specified request 
because of an error or a forced interrupt.  SQLSTATE=55032

失败

[db2inst2@cognoswithdb2 backupfordb2]$ db2 connect to sample

   Database Connection Information

 Database server        = DB2/LINUXX8664 10.5.1
 SQL authorization ID   = DB2INST2
 Local database alias   = SAMPLE

[db2inst2@cognoswithdb2 backupfordb2]$ db2 list history backup all for sample

                    List History File for sample

Number of matching file entries = 2


 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20140419191405000   F       S0000000.LOG S0000000.LOG                
 ----------------------------------------------------------------------------
  Contains 5 tablespace(s):

 00001 SYSCATSPACE
 00002 USERSPACE1
 00003 IBMDB2SAMPLEREL
 00004 IBMDB2SAMPLEXML
 00005 SYSTOOLSPACE
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP SAMPLE OFFLINE
 Start Time: 20140419191405
   End Time: 20140419191406
     Status: A
 ----------------------------------------------------------------------------
  EID: 4 Location: 

SQLCA Information

 sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -2061   sqlerrml: 14

 sqlerrmc: /backupfordb2/
 sqlerrp : sqlubMWR
 sqlerrd : (1) 0                (2) 0                (3) 0
           (4) 0                (5) 0                (6) 0
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)
           (7)      (8)      (9)      (10)       (11)
 sqlstate:

 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20140419191436001   F    D  S0000000.LOG S0000000.LOG                
 ----------------------------------------------------------------------------
  Contains 5 tablespace(s):

 00001 SYSCATSPACE
 00002 USERSPACE1
 00003 IBMDB2SAMPLEREL
 00004 IBMDB2SAMPLEXML
 00005 SYSTOOLSPACE
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP SAMPLE OFFLINE
 Start Time: 20140419191436
   End Time: 20140419191457
     Status: A
 ----------------------------------------------------------------------------
  EID: 5 Location: /backupfordb2

[db2inst2@cognoswithdb2 backupfordb2]$ 























你可能感兴趣的:(backup,SQLSTATE57019,SQL1035N)