db2 online backup 設定

imlihj2007發表於2011-11-27
--db2影像安裝基本學會 結構基本瞭解 詳細東西 還需要一步一步學習
--線上備份設定
[db2inst2@localhost ~]$ db2 get db cfg for ts|grep -i log
Log retain for recovery status = NO
User exit for logging status = NO
Catalog cache size (4KB) (CATALOGCACHE_SZ) = 300
Log buffer size (4KB) (LOGBUFSZ) = 256
Log file size (4KB) (LOGFILSIZ) = 1024
Number of primary log files (LOGPRIMARY) = 13
Number of secondary log files (LOGSECOND) = 4
Changed path to log files (NEWLOGPATH) =
Path to log files = /home/db2inst2/db2inst2/NODE0000/SQL00002/SQLOGDIR/
Overflow log path (OVERFLOWLOGPATH) =
Mirror log path (MIRRORLOGPATH) =
First active log file =
Block log on disk full (BLK_LOG_DSK_FUL) = NO
Block non logged operations (BLOCKNONLOGGED) = NO
Percent max primary log space by transaction (MAX_LOG) = 0
Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0
Percent log file reclaimed before soft chckpt (SOFTMAX) = 520
Log retain for recovery enabled (LOGRETAIN) = OFF
User exit for logging enabled (USEREXIT) = OFF
HADR log write synchronization mode (HADR_SYNCMODE) = NEARSYNC
First log archive method (LOGARCHMETH1) = OFF
Options for logarchmeth1 (LOGARCHOPT1) =
Second log archive method (LOGARCHMETH2) = OFF
Options for logarchmeth2 (LOGARCHOPT2) =
Failover log archive path (FAILARCHPATH) =
Number of log archive retries on error (NUMARCHRETRY) = 5
Log archive retry Delay (secs) (ARCHRETRYDELAY) = 20
Log pages during index build (LOGINDEXBUILD) = OFF
[db2inst2@localhost ~]$ db2 update db cfg for ts using LOGRETAIN ON
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst2@localhost ~]$ db2 update db cfg for ts using LOGARCHMETH1 "disk:/home/db2inst2/arch"
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst2@localhost ~]$ db2 update db cfg for ts using USEREXIT on
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst2@localhost ~]$ db2 update db cfg for ts using trackmod on
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst2@localhost ~]$ db2 update db cfg for ts using mirrorlogpath /home/db2inst2/arch
SQL5099N The value "/home/db2inst2/arch/NODE0000/" indicated by the database
configuration parameter "MIRRORLOGPATH" is not valid, reason code "4".
SQLSTATE=08004
[db2inst2@localhost ~]$ db2stop force
11/28/2011 03:08:45 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
[db2inst2@localhost ~]$ db2start
11/28/2011 03:09:00 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
[db2inst2@localhost ~]$ db2 backup database ts online
SQL2413N Online backup is not allowed because the database is not recoverable
or a backup pending condition is in effect.
[db2inst2@localhost ~]$ db2 backup database ts
Backup successful. The timestamp for this backup image is : 20111128030926
[db2inst2@localhost ~]$ db2 backup database ts online
Backup successful. The timestamp for this backup image is : 20111128030949
[db2inst2@localhost ~]$ db2 connnect to ts
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL1024N A database connection does not exist. SQLSTATE=08003
[db2inst2@localhost ~]$ db2 connect to ts
Database Connection Information
Database server = DB2/LINUX 9.7.4
SQL authorization ID = DB2INST2
Local database alias = TS
[db2inst2@localhost ~]$ db2 backup database ts online
Backup successful. The timestamp for this backup image is : 20111128031033
[db2inst2@localhost ~]$ db2 get db cfg for ts|grep -i log
Log retain for recovery status = RECOVERY
User exit for logging status = YES
Catalog cache size (4KB) (CATALOGCACHE_SZ) = 300
Log buffer size (4KB) (LOGBUFSZ) = 256
Log file size (4KB) (LOGFILSIZ) = 1024
Number of primary log files (LOGPRIMARY) = 13
Number of secondary log files (LOGSECOND) = 4
Changed path to log files (NEWLOGPATH) =
Path to log files = /home/db2inst2/db2inst2/NODE0000/SQL00002/SQLOGDIR/
Overflow log path (OVERFLOWLOGPATH) =
Mirror log path (MIRRORLOGPATH) =
First active log file = S0000002.LOG
Block log on disk full (BLK_LOG_DSK_FUL) = NO
Block non logged operations (BLOCKNONLOGGED) = NO
Percent max primary log space by transaction (MAX_LOG) = 0
Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0
Percent log file reclaimed before soft chckpt (SOFTMAX) = 520
Log retain for recovery enabled (LOGRETAIN) = RECOVERY
User exit for logging enabled (USEREXIT) = ON
HADR log write synchronization mode (HADR_SYNCMODE) = NEARSYNC
First log archive method (LOGARCHMETH1) = USEREXIT
Options for logarchmeth1 (LOGARCHOPT1) =
Second log archive method (LOGARCHMETH2) = OFF
Options for logarchmeth2 (LOGARCHOPT2) =
Failover log archive path (FAILARCHPATH) =
Number of log archive retries on error (NUMARCHRETRY) = 5
Log archive retry Delay (secs) (ARCHRETRYDELAY) = 20
Log pages during index build (LOGINDEXBUILD) = OFF
[db2inst2@localhost ~]$[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9879835/viewspace-1056576/,如需轉載,請註明出處,否則將追究法律責任。

相關文章