xa_open failure with SQLCODE=-1032 - db2

I am using a Tuxedo(v12.2.2.0.0) on Linux(x64) to access DB2 on mainframe through DB2 Connect Server(v9.7).
Now i meet a problem that the TMS_UDB can not start up。
From Tuxedo ULOG, it says:
ERROR: tpopen TPERMERR xa_open returned XAER_RMERR
I checked db2dial log it shows:
2018-XX-XX-xxxx E4387E703 LEVEL: Error
PID : 12673 TID: 139892007870912 PROC: TMS_UDB
INSTANCE: db2inst1
HOSTNAME: XXXX
FUNCTOIN: DB2 UDB, XA DTP Support, sqlxaConnect, probe: 5329
MESSAGE : XA Interface SQLCA
DATA #1 : SQLCA, PD_DB2TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -1032 sqlerrml:0
sqlerrmc:
sqlerrp : SQLJCMN
sqlerrd : (1) 0x81360012 (2) 0x00000012 (3) 0x00000000
(4) 0x00000002 (5) 0x00000004 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate: 00000
Any DB2 export, how can i make it fixed ? thanks
I have verified DB2 client CONNECT command($ db2 connect to DBXX user USERxx using PASSXX), and query out data using SELECT statement.
and also have following the Tuxedo guide to set DB2 configuration items.
https://docs.oracle.com/cd/E26665_01/artrt/docs11gr1/cicsref/db2conn.html

Converting the comment thread to an answer.
For a new installation of Tuxedo where XA transactions are required (managed by Tuxedo as TP monitor) with one leg being Db2 for Z/OS, it is necessary to configure both Tuxedo and Db2-connect to support XA transactions, in addition to basic actions for Db2 connectivity and in addition to any Db2 licensing activities.
Note that Linux/AIX/Windows: command-line connections (from the workstation to Db2 for Z via Db2-connect) will only verify connectivity and userid/password access, but this will not test XA. Command-line connections are Type-1 connections (i.e they are not using distributed units of work).
The configuration details can be version specific so always consult the version-specific documentation for both Tuxedo and Db2-connect products.
For Tuxedo, the documentation page is
https://docs.oracle.com/cd/E26665_01/artrt/docs11gr1/cicsref/db2conn.html
For Db2-Connect v9.7 (later versions are also accessible from here) the page is:
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.7.0/com.ibm.db2.luw.qb.dbconn.doc/doc/t0006168.html
Typical configuration for Db2-connect includes:
`db2 update dbm cfg using tp_mon_name TUXEDO
db2 update dbm cfg using spm_name bjaix # hostname of the node running Db2-connect
db2 update dbm cfg using max_connections 500
db2 update dbm cfg using max_coordagents 200
// You may also want to enable the Db2-connect connection-concentrator depdending on your peak concurrency needs and the available resources
db2stop
db2start`
Additional configuration of Tuxedo is required, in part referencing some of the Db2-configuration, refer to the Oracle Tuxedo documentation for details.

Related

Goldengate 19 Postgres to AWS

Ok, so I have one I can't crack. I am testing on-prem GG to AWS. I have it set up in a hub config on-prem. I have my Postgres DB on AWS set with rds.force_ssl=1. I have copied down the certificate bundles from AWS.
I basically followed these steps from Oracle.
GG documentation
And AWS steps here.
AWS PostGres SSL Steps
My ODBCINI has as follows:
sbpgdb=PostgreSQL on sbpgdb [ODBC]
IANAAppCodePage=4
InstallDir=/u01/app/oracle/product/ggpgsdb
[sbpgdb]Driver=/u01/app/oracle/product/ggpgsdb/lib/GGpsql25.so
Description=DataDirect 7.1 PostgreSQL Wire Protocol
BatchMechanism=2
Database=bob_test
HostName=my_rds_instance.us-east-1.rds.amazonaws.com
PortNumber=5432
TransactionErrorBehavior=2
EncryptionMethod=1
ValidateServerCertificate=1
TrustStore=/home/oracle/certs/us-east-1-bundle.pem
My replicat is this.
REPLICAT intrepg
ASSUMETARGETDEFS
HANDLECOLLISIONS
SETENV (NLSLANG=AL32UTF8)
SETENV (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
SETENV ( PGCLIENTENCODING = "UTF8" )
SETENV (ODBCINI="/u01/app/oracle/product/ggpgsdb/odbc.ini" )
targetdb sbpgdb, USERIDALIAS pg_postgresdb
discardfile ./dirrpt/bob.dsc, APPEND, megabytes 20
reportcount every 60 seconds, rate
map mypdb.bob.*, target bob_test.*;
I can run this command and it connects to the DB.
dblogin sourcedb sbpgdb useridalias pg_postgresdb
but if I start my replicat I get this and it abends after a few seconds.
2021-06-23T09:46:53.835-0500 ERROR OGG-00551 Oracle GoldenGate Delivery for PostgreSQL, intrepg.prm: Database operation failed: Couldn't connect to sbpgdb. ODBC error: SQLSTATE 08001 native database error 7570. [Oracle][ODBC PostgreSQL Wire Protocol driver]SSL Handshake Failure reason [EOF observed which violates protocol].
Now I can disable the whole SSL thing and it connects and the replicat starts right up. What have I done wrong?

DB2 REORG command is not able to start

I am trying to reorg a table in DB2 as the number of alters on a table has exceeded more than 3 times.
DB2 CALL SYSPROC.ADMIN_CMD('REORG TABLE WASADMIN.EXCHANGERATES');
It is not giving any response and looks like it is hanged . I checked the status by running the command .
db2pd -db UB602 -reorgs
but there is no active Reorg process .
Database Member 0 -- Database UB602 -- Active -- Up 0 days 02:14:45 -- Date 2018-11-26-19.34.15.256000
Table Reorg Information:
Address TbspaceID TableID PartID MasterTbs MasterTab TableName Type IndexID TempSpaceID
Table Reorg Stats:
Address TableName Start End PhaseStart MaxPhase Phase CurCount MaxCount Status Completion
What could have gone wrong?
Edit:
I checked the logs but nothing is printed. but when I am pressing ctrl+c to terminate . I get some message in the logs .
2018-11-26-20.19.53.459000+330 I1F1191 LEVEL: Event
PID : 5176 TID : 4928 PROC : db2syscs.exe
INSTANCE: DB2_01 NODE : 000 DB : UB602
APPHDL : 0-1186 APPID: *LOCAL.DB2_01.181126124159
AUTHID : DB2ADMIN HOSTNAME: BLR2DEVLP0434
EDUID : 4928 EDUNAME: db2agent (UB602) 0
FUNCTION: DB2 UDB, RAS/PD component, pdLogInternal, probe:120
START : New Diagnostic Log file
DATA #1 : Build Level, 232 bytes
Instance "DB2_01" uses "64" bits and DB2 code release "SQL11010"
with level identifier "0201010F".
Informational tokens are "DB2 v11.1.0.1527", "s1606081100", "DYN1606081100WIN64", Fix Pack "0".
DATA #2 : System Info, 1760 bytes
System: WIN32_NT BLR2DEVLP0434 10.0 AMD64 Family 6, model 78, stepping 3
CPU: total:4 online:4 Cores per socket:2 Threading degree per core:2 SIMD:Y
CPU binding: not in use
Physical Memory(MB): total:16049 free:6448 available:6448
Virtual Memory(MB): total:28849 free:19248
Swap Memory(MB): total:12800 free:12800
Information in this record is only valid at the time when this file was
created (see this record's time stamp)
2018-11-26-20.19.53.469000+330 I1195F968 LEVEL: Info
PID : 5176 TID : 4928 PROC : db2syscs.exe
INSTANCE: DB2_01 NODE : 000 DB : UB602
APPHDL : 0-1186 APPID: *LOCAL.DB2_01.181126124159
AUTHID : DB2ADMIN HOSTNAME: BLR2DEVLP0434
EDUID : 4928 EDUNAME: db2agent (UB602) 0
FUNCTION: DB2 UDB, relation data serv, sqlrr_rds_common_post, probe:1700
MESSAGE : Severe TERMINATE err at nest lvl 1, in SQL from rtn SYSPROC.ADMIN_CMD
DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -952 sqlerrml: 0
sqlerrmc:
sqlerrp : SQLRL04B
sqlerrd : (1) 0x80100003 (2) 0x00000003 (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate: 57014
To perform an offline reorg, you have to ensure that nothing is using the table before the reorg command starts to run.
If an offline reorg is not possible, check if an inplace reorg can work instead.
If there are other reasons preventing the action, consult the db2diag.log file for more details. In your question it shows only sqlcode -952 which tells us that you cancelled the job with the control-C.
You can check if there are any row-locks or table-locks on the target table by using one of many different methods. You can use dsmtop or db2top, or dsm, or a command line (db2 get snapshot for locks and then parsing the output for your table name), or by using the MON_GET_LOCKS table function or equivalents.
The documentation states "
Be sure to complete all database operations and release all locks
before you invoke REORG TABLE. This step can be done by issuing a
COMMIT after you close all cursors opened WITH HOLD, or by issuing a
ROLLBACK. After you reorganize a table, use RUNSTATS to update the
table statistics, and REBIND to rebind the packages that use this
table. The reorganize utility implicitly closes all the cursors. "

Logstash JDBC Input Plugin - DB2

I am trying to connect to DB2 database on Mainframe from my local machine. I am using JDBC input plugin. It seems the jdbc driver license file is not getting loaded. Can someone please tell me how can I load the db2jcc_license_cisuz-1.4.2.jar file.
I am using logstash version 6.2.2
I am able to connect to DB2 using the same license file from other Java applications.
My config file is as follows:
input {
beats {
port => 5044
}
jdbc {
jdbc_connection_string => "jdbc:db2://XX.XX.XX.XX:1304/DB91"
jdbc_user => "username"
jdbc_password => "password"
jdbc_driver_library => "C:\logstash-6.2.2\logstash-6.2.2\vendor\jruby\lib\jdbc\db2jcc-1.4.2.jar"
jdbc_driver_class => "com.ibm.db2.jcc.DB2Driver"
statement => "SELECT * from DBTPS29.NPSXTEI"
}
}
output {
stdout {codec => json_lines}
}
log file :
[2018-08-21T11:19:24,334][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::ComIbmDb2JccAm::SqlSyntaxErrorException: [jcc][t4][10509][13454][3.61.96] Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid \r\nor was not activated for the DB2 for z/OS subsystem. If you are connecting directly to \r\nthe data server and using DB2 Connect Unlimited Edition for System z, perform the \r\nactivation step by running the activation program in the license activation kit. \r\nIf you are using any other edition of DB2 Connect, obtain the license file, \r\ndb2jcc_license_cisuz.jar, from the license activation kit, and follow the installation \r\ndirections to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968"}
[2018-08-21T11:19:24,338][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_connection_string=>"jdbc:db2://xx.xx.xx.xx:1304/DB91", jdbc_user=>"username", jdbc_password=>, jdbc_driver_library=>"C:\logstash-6.2.2\logstash-6.2.2\vendor\jruby\lib\jdbc\db2jcc-1.4.2.jar", jdbc_driver_class=>"com.ibm.db2.jcc.DB2Driver", statement=>"SELECT * from DBTPS29.NPSXTEI", id=>"f63556360d1928aaaf73cf6a06df9ec2cc1f8252c016d62da5830f446521927e", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_bad95943-2146-4d84-a312-0be5db02acef", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>1970-01-01 00:00:00 UTC}, last_run_metadata_path=>"C:\Users\vipul.parikh/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: Java::ComIbmDb2JccAm::SqlSyntaxErrorException: [jcc][t4][10509][13454][3.61.96] Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid
or was not activated for the DB2 for z/OS subsystem. If you are connecting directly to
the data server and using DB2 Connect Unlimited Edition for System z, perform the
activation step by running the activation program in the license activation kit.
If you are using any other edition of DB2 Connect, obtain the license file,
db2jcc_license_cisuz.jar, from the license activation kit, and follow the installation
directions to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968
Exception: Sequel::DatabaseConnectionError
Stack: com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:676)
com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:60)
com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:120)
com.ibm.db2.jcc.am.jb.Qb(com/ibm/db2/jcc/am/jb.java:4339)
com.ibm.db2.jcc.am.jb.b(com/ibm/db2/jcc/am/jb.java:4248)
com.ibm.db2.jcc.t4.b.b(com/ibm/db2/jcc/t4/b.java:537)
com.ibm.db2.jcc.t4.b.a(com/ibm/db2/jcc/t4/b.java:366)
com.ibm.db2.jcc.t4.b.(com/ibm/db2/jcc/t4/b.java:305)
com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(com/ibm/db2/jcc/DB2SimpleDataSource.java:214)
com.ibm.db2.jcc.DB2Driver.connect(com/ibm/db2/jcc/DB2Driver.java:460)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)
org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:326)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.adapters.jdbc.connect(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/adapters/jdbc.rb:203)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.connection_pool.make_new(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool.rb:126)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.connection_pool.threaded.assign_connection(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:192)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.connection_pool.threaded.acquire(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:133)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.connection_pool.threaded.hold(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:90)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.database.connecting.synchronize(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:269)
`C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.database.connecting.test_connection(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:279)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.database.connecting.connect(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:58)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.core.connect(C:/logstash-`
The license file name should be db2jcc_license_cisuz.jar and it should be in the same directory location as the db2jcc.jar or db2jcc4.jar. If these two are already verified to be true, then talk with your Z/OS DB2 DBA and ensure that the activation step has been performed for ...by running the activation program in the license activation kit. Your Z/OS DB2 DBA should know what that means and how to do it.

Windows client error for DB2 10.5 fp3 DATA BASE Connection refused:Error:SQL30081N and SQLSTATE IS 08001

When we connect to database we got error in windows client machine.
Error:SQL30081N and SQLSTATE IS 08001.
SERVER:HP-UX DB2 10.5 FP3
Please suggest on this.
A quick Google suggests this may be the result of a firewall blocking the connection: http://www-01.ibm.com/support/docview.wss?uid=swg21503305

db2 Error sqlcode: -1224

Has anyone seen this type pf error msg before. I cannot find documentation on sql code -1224?
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQLCA Information
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -1224 sqlerrml: 0
sqlerrmc:
sqlerrp : SQLJRERM
sqlerrd : (1) -2143879059 (2) 0 (3) 0
(4) 0 (5) 0 (6) 0
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate: 55032
Always try to check IBM infocenter with such errors:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.messages.sql.doc/doc/msql01224n.html
Short comment from my side:
A reboot could fix your problem, if you can in your environment.
If it's a production server, I suggest a db2stop and afterwards a db2start , this could also help
Normally, -1224 is a trap which comes from memory corruption.
If you run the function unfenced, try to switch to fenced.
Also, take a look at your trap files.
Also, this can happen if you have an invalid JVM level. Make sure you use a supported jdk level => move to the latest version