DB2数据库日志调整

更新时间:2023-12-29 23:03:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

[db2inst3@CentOS5 ~]$ db2 get db cfg |grep LOGFI

Log file size (4KB) (LOGFILSIZ) = 1000 [db2inst3@CentOS5 ~]$ db2 get db cfg |grep LOGPR

Number of primary log files (LOGPRIMARY) = 3 [db2inst3@CentOS5 ~]$ db2 get db cfg |grep LOGS

Number of secondary log files (LOGSECOND) = 10

Path to log files = /db2data/db2inst3/NODE0000/SQL00001/LOGSTREAM0000/

[db2inst3@CentOS5 ~]$ db2 \DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully. SQL1363W One or more of the parameters submitted for immediate modification were not changed dynamically. For these configuration parameters, the database must be shutdown and reactivated before the configuration parameter changes become effective.

[db2inst3@CentOS5 ~]$ db2 get db cfg |grep LOGAR

First log archive method (LOGARCHMETH1) = OFF Archive compression for logarchmeth1 (LOGARCHCOMPR1) = OFF Options for logarchmeth1 (LOGARCHOPT1) = Second log archive method (LOGARCHMETH2) = OFF Archive compression for logarchmeth2 (LOGARCHCOMPR2) = OFF Options for logarchmeth2 (LOGARCHOPT2) = [db2inst3@CentOS5 ~]$ cd /db2data [db2inst3@CentOS5 db2data]$ ls db2inst3

[db2inst3@CentOS5 db2data]$ mkdir db2archlog [db2inst3@CentOS5 db2data]$ disk:/db2data/db2archlog\

db2

\

db

cfg

using

logarchmeth1

DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully. SQL1363W One or more of the parameters submitted for immediate modification were not changed dynamically. For these configuration parameters, the database must be shutdown and reactivated before the configuration parameter changes become effective.

[db2inst3@CentOS5 db2data]$ db2 terminate

DB20000I The TERMINATE command completed successfully. [db2inst3@CentOS5 db2data]$ db2 \

Backup successful. The timestamp for this backup image is : 20141111144643

[db2inst3@CentOS5 db2data]$ db2 connect to testdb

Database Connection Information

Database server = DB2/LINUXX8664 10.1.4 SQL authorization ID = DB2INST3

Local database alias = TESTDB

[db2inst3@CentOS5 db2data]$ pwd /db2data

[db2inst3@CentOS5 db2data]$ db2 get db cfg |grep LOG

Catalog cache size (4KB) (CATALOGCACHE_SZ) = (MAXAPPLS*5) Log buffer size (4KB) (LOGBUFSZ) = 256 Log file size (4KB) (LOGFILSIZ) = 25000 Number of primary log files (LOGPRIMARY) = 5 Number of secondary log files (LOGSECOND) = 1 Changed path to log files (NEWLOGPATH) =

Path to log files = /db2data/db2inst3/NODE0000/SQL00001/LOGSTREAM0000/

Overflow log path (OVERFLOWLOGPATH) = Mirror log path (MIRRORLOGPATH) =

First active log file = S0000000.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

First log archive method (LOGARCHMETH1) = DISK:/db2data/db2archlog/ Archive compression for logarchmeth1 (LOGARCHCOMPR1) = OFF Options for logarchmeth1 (LOGARCHOPT1) = Second log archive method (LOGARCHMETH2) = OFF Archive compression for logarchmeth2 (LOGARCHCOMPR2) = OFF Options for logarchmeth2 (LOGARCHOPT2) = Log pages during index build (LOGINDEXBUILD) = OFF Log DDL Statements (LOG_DDL_STMTS) = NO Log Application Information (LOG_APPL_INFO) = NO [db2inst3@CentOS5 db2data]$ cd /db2data/db2inst3 [db2inst3@CentOS5 db2inst3]$ cd *

[db2inst3@CentOS5 NODE0000]$ cd SQ*1 [db2inst3@CentOS5 SQL00001]$ cd LOG* [db2inst3@CentOS5 LOGSTREAM0000]$ ls -l

total 500044

-rw------- 1 db2inst3 db2grp 102408192 Nov 11 14:46 S0000000.LOG -rw------- 1 db2inst3 db2grp 102408192 Nov 11 14:46 S0000001.LOG -rw------- 1 db2inst3 db2grp 102408192 Nov 11 14:46 S0000002.LOG -rw------- 1 db2inst3 db2grp 102408192 Nov 11 14:46 S0000003.LOG -rw------- 1 db2inst3 db2grp 102408192 Nov 11 14:46 S0000004.LOG [db2inst3@CentOS5 LOGSTREAM0000]$

[db2inst3@CentOS5 LOGSTREAM0000]$ [db2inst3@CentOS5 LOGSTREAM0000]$ pwd

/db2data/db2inst3/NODE0000/SQL00001/LOGSTREAM0000

[db2inst3@CentOS5 LOGSTREAM0000]$ [db2inst3@CentOS5 LOGSTREAM0000]$ [db2inst3@CentOS5 LOGSTREAM0000]$ cd [db2inst3@CentOS5 ~]$ db2 list db directory

System Database Directory

Number of entries in the directory = 1

Database 1 entry:

Database alias = TESTDB Database name = TESTDB Local database directory = /db2data Database release level = f.00 Comment = Directory entry type = Indirect Catalog database partition number = 0 Alternate server hostname = Alternate server port number =

[db2inst3@CentOS5 ~]$ db2 get db cfg |grep LOGAR

First log archive method (LOGARCHMETH1) = DISK:/db2data/db2archlog/ Archive compression for logarchmeth1 (LOGARCHCOMPR1) = OFF Options for logarchmeth1 (LOGARCHOPT1) = Second log archive method (LOGARCHMETH2) = OFF Archive compression for logarchmeth2 (LOGARCHCOMPR2) = OFF Options for logarchmeth2 (LOGARCHOPT2) = [db2inst3@CentOS5 ~]$ db2 terminate

DB20000I The TERMINATE command completed successfully.

[db2inst3@CentOS5 ~]$ db2 \

SQL0104N An unexpected token \ Expected tokens may include: \ SQLSTATE=42601 [db2inst3@CentOS5 ~]$ db2 \

[db2inst3@CentOS5 ~]$ db2 \

ARCHIVE LOG FOR DATABASE database-alias [USER username [USING password]] [On-DbPartitionNum-Clause]

On-DbPartitionNum-Clause:

ON {{DBPARTITIONNUM | DBPARTITIONNUMS} (db-partition-number [TO db-partition-number] , ... ) | ALL DBPARTITIONNUMS [EXCEPT {DBPARTITIONNUM | DBPARTITIONNUMS} (db-partition-number [TO db-partition-number] , ...)]}

NOTE: From the operating system prompt, prefix commands with 'db2'. Special characters MAY require an escape sequence (\\), for example: db2 \\? change database

db2 ? change database xxx comment with \\\[db2inst3@CentOS5 ~]$ db2 \DB20000I The ARCHIVE LOG command completed successfully. [db2inst3@CentOS5 ~]$ cd /db2data/db2archlog [db2inst3@CentOS5 db2archlog]$ ls db2inst3

[db2inst3@CentOS5 db2archlog]$ cd * [db2inst3@CentOS5 db2inst3]$ cd * [db2inst3@CentOS5 TESTDB]$ ls NODE0000

[db2inst3@CentOS5 TESTDB]$ cd * [db2inst3@CentOS5 NODE0000]$ ls LOGSTREAM0000

[db2inst3@CentOS5 NODE0000]$ cd * [db2inst3@CentOS5 LOGSTREAM0000]$ ll total 4

drwxr-x--- 2 db2inst3 db2grp 4096 Nov 11 14:46 C0000000 [db2inst3@CentOS5 LOGSTREAM0000]$ cd *

[db2inst3@CentOS5 C0000000]$ ll total 0

[db2inst3@CentOS5 C0000000]$ pwd

/db2data/db2archlog/db2inst3/TESTDB/NODE0000/LOGSTREAM0000/C0000000 [db2inst3@CentOS5 C0000000]$ db2 \

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 [db2inst3@CentOS5 C0000000]$ db2 connect to testdb

Database Connection Information

Database server = DB2/LINUXX8664 10.1.4 SQL authorization ID = DB2INST3 Local database alias = TESTDB

[db2inst3@CentOS5 C0000000]$

[db2inst3@CentOS5 C0000000]$ db2 \dbDB20000I The SQL command completed successfully.

[db2inst3@CentOS5 C0000000]$ db2 \

DB20000I The SQL command completed successfully. [db2inst3@CentOS5 C0000000]$ pwd

/db2data/db2archlog/db2inst3/TESTDB/NODE0000/LOGSTREAM0000/C0000000

[db2inst3@CentOS5 C0000000]$ db2 terminate

^[/DB20000I The TERMINATE command completed successfully. [db2inst3@CentOS5 C0000000]$

[db2inst3@CentOS5 C0000000]$ db2 \ DB20000I The ARCHIVE LOG command completed successfully. [db2inst3@CentOS5 C0000000]$ ll total 44

-rw-r----- 1 db2inst3 db2grp 12288 Nov 11 14:49 S0000000.LOG -rw-r----- 1 db2inst3 db2grp 12288 Nov 11 14:49 S0000001.LOG -rw-r----- 1 db2inst3 db2grp 20480 Nov 11 14:49 S0000002.LOG

本文来源:https://www.bwwdw.com/article/87ex.html

Top