Oracle、Sybase和SQL Server如何追踪JDBC调用
在本文中,我们将了解如何使用面向 Oracle、Sybase 和 SQL Server 的 DataDirect Spy for JDBC 来追踪 IBM 数据复制产品 InfoSphere Change Data Capture (CDC) 中的 JDBC 调用。
DataDirect Spy 支持 JDBC 驱动程序跟踪,这对于解决客户问题是非常有用的。IBM InfoSphere Change Data Capture 引擎使用 DataDirect JDBC 驱动程序来实现仅针对 Oracle、SQL Server 和 Sybase 的 JDBC 访问。
DataDirect Spy 是一个在运行程序中跟踪调用的工具。该工具将应用程序发出的调用传递给基础 DataDirect JDBC 驱动程序,并记录关于这些调用的详细信息。从数据库向应用程序传回的结果也会被记录。如果问题被怀疑是出现在驱动程序和数据库之间(也就是,应用程序到驱动程序问题已排除),那么结果日志可用于解决故障问题。
先决条件
要理解本文内容,应具备以下基础知识:
- Windows®
- UNIX®
- 使用 IBM InfoSphere CDC Management Console
- 使用面向 Oracle, Sybase, SQL Server 的 IBM InfoSphere CDC
关于 DataDirect Spy
JDBC API 支持查看数据库和 JDBC 驱动程序生成的警告和异常。一个 SQLException 对象包含一个错误描述、X/Open SQLState 和驱动程序供应商的错误代码编号。要查看异常,可以使用一个 catch 块将它们打印出来。警告属于 SQLException 的一个子类,用来处理数据库访问警告。警告不能阻止应用程序的执行;只是警告用户有些事情没有按计划进行,比如特权没按要求撤回。警告将在 Connection 对象、Statement 对象(包括 PreparedStatement 和 CallableStatement 对象)和 ResultSet 对象中报告。可使用 getWarnings 方法检索这些对象中的警告。
DataDirect Technologies 通过提供一个 JDBC Developer 的 Kit (SDK) 使得 JDBC 应用程序调试和故障排除变得更为容易,JDBC Developer's Kit (SDK) 在运行的应用程序中提供 DataDirect Spy for JDBC 跟踪和调用。该实用程序将应用程序发出的调用传递给基础 DataDirect JDBC 驱动程序并记录详细的调用信息。从数据库传回到应用程序的结果也被记录。DataDirect Spy 与正在运行的应用程序一起试用以跟踪该应用程序发出的 JDBC 调用。
DataDirect Spy 提供以下优势:
- 日志记录是 JDBC 4.0 兼容的。
- 日志记录是一致的,与所用的 DataDirect Connect for JDBC 驱动程序无关。
- 可记录 JDBC 调用的所有参数和函数结果。
- 日志记录与所有 DataDirect Connect for JDBC 驱动程序一起使用。
- 无需更改应用程序就可以启用日志记录。
DataDirect Spy 属性
DataDirect Spy 支持以下属性。
表 1. DataDirect Spy 属性及描述
属性 | 描述 |
---|---|
log=System.out | 定向日志到 Java™ 输出标准:System.out。 |
log=(file)filename | 重定向日志到文件名指定的文件。 |
linelimit=numberofchars | 设置 DataDirect Spy 可在任何一行记录的最大字符数。默认是 0(没有最大值限制)。 |
logIS={yes | no | nosingleread} | 指定 DataDirect Spy 是否记录 InputStream 和 Reader 对象上的活动。当为 logIS=nosingleread 时,InputStream 和 Reader 对象上的日志记录是活动的。然而,单字节读取 InputStream.read 或单字符 Reader.read 的日志记录将被抑制,以防止生成大量包含单字节或单字符读取消息的日志文件,默认值是 no。 |
logTName={yes | no} | 指定 DataDirect Spy 是否记录当前线程的名称。默认值是 no。 |
timestamp={yes | no} | 指定每行 DataDirect Spy 日志是否包含一个时间戳,默认值是 no。 |

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

Oracle views can be exported through the EXP utility: Log in to the Oracle database. Start the EXP utility, specifying the view name and export directory. Enter export parameters, including target mode, file format, and tablespace. Start exporting. Verify the export using the impdp utility.

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.
