博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
DB2 SQL7008问题
阅读量:4059 次
发布时间:2019-05-25

本文共 2972 字,大约阅读时间需要 9 分钟。

这是由于尝试对DB2中的表做修改操作时引发的日志的问题:

查询与解决方案:

Q: IBM AS400 Database SQLCODE: SQL7008 when updating table

A: The exception is something like:

java.sql.SQLException: [SQL7008] table_name in database_name not valid for operation.

The problem is usually a journaling issue. When you use the SQL statement

SQL CREATE SCHEMA (or CREATE COLLECTION)

a library is created and a journal is automatically created (QSQJRN) into the library.

When you subsequently use CREATE TABLE and specify that schema (implicitly or explicitly),
the created table is automatically journaled to QSQJRN in the schema.

If you have existing libraries/databases that were created through standard OS/400 commands

(like CRTLIB or CRTPF), journalling is not enabled by default. You should remove them and
re-create them using the above SQL statement.

For information only, you can use the following three steps to journal an OS/400 file:

Step 1

Create the journal receiver by using the Create Journal Receiver (CRTJRNRCV) command, as follows:

CRTJRNRCV JRNRCV(lib/jrnrcvname) THRESHOLD(100000)                       TEXT('Description text')

The receiver will hold the journal entries for your files, and it’s important to set a threshold

value for your receivers. If you set your THRESHOLD value at 100,000 or above, it makes it easier
to set up system change journal management support for the journal that this receiver is attached
to. When automatic change support is enabled on a journal, OS/400 automatically creates a new
journal receiver and swaps out the old journal receiver when it fills up.

Step 2

Create a journal for your file by using the Create Journal (CRTJRN) command:

CRTJRN JRN(lib/jrnname) JRNRCV(lib/jrnrcvname)

MNGRCV(*SYSTEM) DLTRCV(*YES) TEXT(‘Description text’)

The Journal (JRN) parameter contains the library and name of the journal file you’re creating,

and Journal Receiver (JRNRCV) specifies the name of the journal receiver you created in step 1.
The Manage Receivers (MNGRCV) parameter value of *SYSTEM tells OS/400 to automatically create
a new journal receiver and change the journal’s current receiver when the current receiver exceeds
its allocated storage space, as specified by the THRESHOLD parameter in the CRTJRNRCV command.

The Delete Receivers (DLTRCV) parameter tells OS/400 to automatically delete detached journal

receivers as needed. This is an optional parameter that can only be activated when MNGRCV is
equal to *SYSTEM, but it’s extremely handy in limiting the amount of journal receiver DASD used
in your system.

Step 3

Start journaling your physical file by using the Start Journal Physical File (STRJRNPF) command:

STRJRNPF FILE(lib/filename) JRN(lib/jrnname)

OMTJRNE(*OPNCLO)

The JOURNAL (JRN) parameter contains the name of the journal you created in step 2. You may also

want to consider setting the Journal Entries to be Omitted (OMTJRNE) parameter to *OPNCLO, which
tells OS/400 not to record file open and close entries in your journal receiver.

Source:

转载地址:http://zxwji.baihongyu.com/

你可能感兴趣的文章
dba 常用查询
查看>>
Oracle 异机恢复
查看>>
Oracle 12C DG 搭建(RAC-RAC/RAC-单机)
查看>>
Truncate 表之恢复
查看>>
Oracle DG failover 后恢复
查看>>
mysql 主从同步配置
查看>>
为什么很多程序员都选择跳槽?
查看>>
mongdb介绍
查看>>
mongdb在java中的应用
查看>>
区块链技术让Yotta企业云盘为行政事业服务助力
查看>>
Yotta企业云盘更好的为媒体广告业服务
查看>>
Yotta企业云盘助力科技行业创高峰
查看>>
Yotta企业云盘更好地为教育行业服务
查看>>
Yotta企业云盘怎么帮助到能源化工行业
查看>>
企业云盘如何助力商业新发展
查看>>
医疗行业运用企业云盘可以带来什么样的提升
查看>>
媒体广告业如何将内容资产进行高效地综合管理与利用
查看>>
能源化工要怎么管控核心数据
查看>>
媒体广告业如何运用云盘提升效率
查看>>
企业如何运用企业云盘进行数字化转型-实现新发展
查看>>