作者·2011-07-16 20:31
·

WebSphere Portal 迁移数据库到db2 失败

字数 7260阅读 2434评论 0赞 1

环境:(产品,平台,机型,软件版本,等)

 

    产品: WebSphere Portal server

    平台: 跨平台

    版本: 6.0.x,

 

问题描述:

 

迁移数据库到db2 失败

 

在ConfigTrace.log 中发现下面错误提示

 

Target finished: action-pre-process-wmm

     [echo] /export/home/IBM/WebSphere/PortalServer/config/work/wmm/bin/wmm_database_transfer_create.sh

     [exec] Federation: Database and LDAP Adapter with Look Aside

     [exec] create database for database repository....

     [exec] java.lang.ClassNotFoundException: wmmx

     [exec]   at java.net.URLClassLoader$1.run(URLClassLoader.java:199)

     [exec]   at java.security.AccessController.doPrivileged(Native Method)

     [exec]   at java.net.URLClassLoader.findClass(URLClassLoader.java:187)

     [exec]   at java.lang.ClassLoader.loadClass(ClassLoader.java:289)

     [exec]   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)

     [exec]   at java.lang.ClassLoader.loadClass(ClassLoader.java:235)

     [exec]   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

     [exec]   at java.lang.Class.forName0(Native Method)

     [exec]   at java.lang.Class.forName(Class.java:141)

     [exec]   at com.ibm.ws.wmm.db.schema.JDBCConnection.getConnection(JDBCConnection.java:61)

     [exec]   at com.ibm.ws.wmm.db.schema.JDBCSqlImport.<init>(JDBCSqlImport.java:58)

     [exec]   at com.ibm.ws.wmm.db.schema.JDBCSqlImport.main(JDBCSqlImport.java:163)

     [exec] java.sql.SQLException: No suitable driver

     [exec]   at java.sql.DriverManager.getConnection(DriverManager.java:532)

     [exec]   at java.sql.DriverManager.getConnection(DriverManager.java:140)

     [exec]   at com.ibm.ws.wmm.db.schema.JDBCConnection.getConnection(JDBCConnection.java:66)

     [exec]   at com.ibm.ws.wmm.db.schema.JDBCSqlImport.<init>(JDBCSqlImport.java:58)

     [exec]   at com.ibm.ws.wmm.db.schema.JDBCSqlImport.main(JDBCSqlImport.java:163)

     [exec] java.lang.ClassNotFoundException: wmmx

     [exec]   at java.net.URLClassLoader$1.run(URLClassLoader.java:199)

     [exec]   at java.security.AccessController.doPrivileged(Native Method)

     [exec]   at java.net.URLClassLoader.findClass(URLClassLoader.java:187)

     [exec]   at java.lang.ClassLoader.loadClass(ClassLoader.java:289)

     [exec]   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)

     [exec]   at java.lang.ClassLoader.loadClass(ClassLoader.java:235)

     [exec]   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

     [exec]   at java.lang.Class.forName0(Native Method)

     [exec]   at java.lang.Class.forName(Class.java:141)

     [exec]   at action-drop-constraints:

     [java] Reading file /export/home/IBM/WebSphere/PortalServer/config/DBTransfer/wps/disableConstraints.sql

     [java] Setting database autocommit to:true

     [java] Restoring database autocommit to original setting:true

     [java] Connected to jdbc:db2: wmmx

Target finished: action-drop-constraints

     [echo] Transfer Data :: MaxMemory is 512M

     [java] [08/31/07 11:07:01.234 CST] Attempting to make connection using: jdbc:db2: wmmx :: db2inst1 :: PASSWORD_REMOVED

     [java] [08/31/07 11:07:01.373 CST] Connection successfully made

     [java] [08/31/07 11:07:01.374 CST] Attempting to make connection using: jdbc:db2j:wpsdb;create=true :: db2admin :: PASSWORD_REMOVED

     [java] [08/31/07 11:07:01.765 CST] Connection successfully made

     [java] [08/31/07 11:07:01.771 CST] Transfer started

     [java] [08/31/07 11:07:02.866 CST] Transferring table --{ DB2ADMIN.WMMDBMBR}-- to table --{DB2INST1.WMMDBMBR }--

     [java] [08/31/07 11:07:02.890 CST] error.executing.transfer

     [java] err.dbtransfer.exception.labelclass java.sql.BatchUpdateException: [IBM][CLI Driver][DB2/AIX64] SQL0803N  One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "2" constrains table "DB2INST1.WMMDBMBR" from having duplicate rows for those columns.  SQLSTATE=23505

 

     [java] java.sql.BatchUpdateException: [IBM][CLI Driver][DB2/AIX64] SQL0803N  One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "2" constrains table "DB2INST1.WMMDBMBR" from having duplicate rows for those columns.  SQLSTATE=23505

 

     [java]    at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)

     [java]    at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_batch_return_code(Unknown Source)

     [java]    at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeBatch(Unknown Source)

     [java]    at com.ibm.wps.config.db.transfer.DefaultTableHandler.execute(DefaultTableHandler.java:130)

     [java]    at com.ibm.wps.config.db.transfer.TransferEngine.execute(TransferEngine.java:57)

     [java]    at com.ibm.wps.config.db.transfer.CmdLineTransfer.execute(CmdLineTransfer.java:93)

     [java]    at com.ibm.wps.config.db.transfer.CmdLineTransfer.main(CmdLineTransfer.java:43)

 

 

 

解决方案:

 

检查配置文件信息如下:

wpconfig_dbdomain.properties

wmm.DbName=wmmx

 

# **Required for DB2 for z/OS and OS/390 only**

# DbNameOnZos:

# If running db2_zos as remote database, the name of the remote

# WebSphere WebSphere Member Manager database.

# If portal is running on z/OS with db2_zos, must be set equal to DbName.

wmm.DbNameOnZos=WPSTST02

 

# DataSourceName: The name of datasource to be used for WebSphere WebSphere

# Member Manager

wmm.DataSourceName=wmmxDS

 

# DbUrl: The wmm database URL

wmm.DbUrl=jdbc:db2: wmmx

 

# DbUser: The database administrator user ID

wmm.DbUser=db2inst1

 

 

修改wmm.DbUrl=jdbc:db2: wmmx

为wmm.DbUrl=jdbc:db2:wmmx

重新执行迁移数据库任务,问题解决。

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

1

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广