ModbusPoll手册

ModbusPoll手册
ModbusPoll手册

Witte Software Modbus Poll User manual

Modbus Master Simulator

February 2014

Modbus Poll version 6.0

Copyright: Witte Software, 2002 -2014

https://www.360docs.net/doc/9314309231.html,

Table of content

1 Modbus Poll (5)

2 Modbus Poll Features (6)

2.1 Connections (6)

2.2 Supported Modbus Functions (6)

2.3 Data logging (6)

2.4 Display formats (6)

2.5 Miscellaneous features (6)

3 Overview (7)

3.1 Help from anywhere (7)

3.2 Alias cells (7)

3.3 Value cells (8)

3.4 Change color and font (8)

3.5 Open a new window (9)

4 Connection dialog (10)

4.1 Connection (10)

4.2 Serial Settings (11)

4.3 Mode (11)

4.4 Response timeout (11)

4.5 Min delay between polls (11)

4.6 Remote Server (11)

4.7 Advanced settings (11)

4.7.1 RTS Toggle (11)

4.7.2 DSR (11)

4.7.3 CTS (12)

4.7.4 Remove Echo (12)

5 Read/Write definition (13)

5.1 Slave ID (13)

5.2 Function code (13)

5.2.1 Read functions (13)

5.2.2 Write functions (14)

5.3 Address (14)

5.3.1 Protocol/message address (14)

5.3.2 Device address (14)

5.3.3 5 digits vs. 6 digits addressing (14)

5.4 Address examples (14)

5.4.1 Read Holding Registers (14)

5.4.2 Read Discrete Inputs (15)

5.5 Scan rate (15)

5.6 Read/Write Disabled (15)

5.6.1 Disable on error (15)

5.7 Hide alias columns (15)

5.8 Address in cell (15)

5.9 PLC Addresses (Base 1) (16)

5.10 Rows (16)

6 Display formats (17)

6.1 Native Modbus registers (17)

6.2 32 bit long (17)

6.3 32 bit floating (17)

6.4 64 bit double (17)

7 Save/Open Workspace (18)

8 Test center (19)

8.3.1 Content of a string list (19)

8.4 Copy (19)

9 Modbus Data logging (20)

9.1 Text file (20)

9.1.1 Log Rate (20)

9.1.2 Delimiters (20)

9.1.3 Log if data changed only (20)

9.1.4 Log Errors (20)

9.1.5 Log Date (21)

9.1.6 Start Log when ok is pressed (21)

9.1.7 Start Log when *mbp is opened (21)

9.1.8 Flush to file immediately (21)

9.1.9 Append (21)

9.2 Microsoft Excel (22)

9.2.1 Log Rate (22)

9.2.2 Header information (22)

10 Communication traffic (24)

11 OLE/Automation (25)

11.1 Excel example (25)

11.1.1 Excel 2007 (25)

11.1.2 Excel 2010 (25)

11.1.3 Excel sample code (26)

11.2 Connection Functions/Properties (27)

11.2.1 Connection (27)

11.2.2 BaudRate (27)

11.2.3 DataBits (27)

11.2.4 Parity (28)

11.2.5 StopBits (28)

11.2.6 SerialPort (28)

11.2.7 ResponseTimeout (28)

11.2.8 ServerPort (28)

11.2.9 ConnectTimeout (29)

11.2.10 IPVersion (29)

11.2.11 OpenConnection (29)

11.2.12 CloseConnection (30)

11.3 Read Functions (31)

11.3.1 ReadCoils (31)

11.3.2 ReadDiscreteInputs (31)

11.3.3 HoldingRegisters (31)

11.3.4 InputRegisters (32)

11.3.5 ShowWindow (32)

11.3.6 Byte order (32)

11.3.7 ReadResult (33)

11.3.8 WriteResult (33)

11.4 Automation data properties (34)

11.4.1 Coil (34)

11.4.2 Signed Register (34)

11.4.3 Unsigned Register (34)

11.4.4 Long (35)

11.5.1 WriteSingleCoil (36)

11.5.2 WriteSingleRegister (36)

11.5.3 WriteMultipleCoils (36)

11.5.4 WriteMultipleRegisters (37)

12 Exception and error messages (38)

12.1 Modbus Exceptions (38)

12.2 Modbus Poll error messages (39)

1Modbus Poll

Modbus Poll is an easy to use Modbus master simulator developed for many purposes. Among others:

?Designers of Modbus slave devices for quick and easy testing of protocol interface

?Automation engineers that need to test Modbus devices or networks on site

?Service engineers that want to read out and/or change specific service data from a device ?Change Modbus registers in a slave device

?Log data from Modbus devices

?Troubleshooting and compliance testing

2Modbus Poll Features

2.1Connections

Modbus Poll read/write data from devices using:

?Modbus RTU or ASCII on RS232 or RS485 networks. (USB/RS232/485 Converter) ?Modbus TCP/IP

?Modbus Over TCP/IP. (Modbus RTU/ASCII encapsulated in a TCP packet)

?Modbus UDP/IP

?Modbus over UDP/IP. (Modbus RTU/ASCII encapsulated in a UDP packet)

2.2Supported Modbus Functions

?01: Read coils

?02: Read discrete inputs

?03: Read holding registers

?04: Read input registers

?05: Write single coil

?06: Write single register

?15: Write multiple coils

?16: Write multiple registers

?17: Report slave ID

?22: Mask write register

?23: Read/Write registers

2.3Data logging

?Log data to a text file

?Log data direct into Excel

2.4Display formats

Each cell can be individual formatted.

?Signed 16 bit register

?Unsigned 16 bit register

?Hex

?Binary

?32 bit long with any word/byte order

?32 bit float with any word/byte order

?64 bit double float with any word/byte order

2.5Miscellaneous features

?OLE/Automation for interfacing with Excel VB etc.

?Monitoring of data traffic

?Print and print preview

?Font and color selection

3Overview

Modbus Poll uses a multiple document interface. That means several windows can be opened. Each one with different data contents from different slave devices at the same time.

This picture shows two open windows. One reading 10 Holding registers from address 4000 (44001) and another reading 10 Holding registers from address 2000 (42001).

3.1Help from anywhere

Press F1 and get context sensitive help on a topic associated with the current selected item.

SHIFT + F1invokes a special “help mode” in which the courser turns into a help courser (arrow + question mark). The user can then select a visible object in the user interface, such as a menu item, toolbar button, or window. This opens help on a topic that describes the selected item.

3.2Alias cells

Here you can type any text for designation of the value cells. You can also copy/paste text from Excel cells.

3.3Value cells

Show the data values of the Modbus registers. If you double click a value cell a dialog box lets you write a new value to the slave device. Typing a number in a value cell shows the dialog as well. It is possible to select the used Modbus function used to write the value.

The check box “Close dialog on Response ok” is used to automatically close the dialog box when a value is successfully sent. This is convenient when a lot of values are to be changed. In that way it is fast to select a new cell and then type a new value again.

3.4Change color and font

Select the cells to be changed and then right click. Then a context menu is shown with 3 options to change colors and font.

Colorize for better overview.

3.5Open a new window

To open another window you have 3 options: ?Press CTRL+N

?Select new in the file menu

?Press on the tool bar

4Connection dialog

To open the connection dialog you have 2 options:

?Press F3

?Select connect from the connection menu

4.1Connection

There are 5 different connection types:

1.Serial:

Modbus over serial line. RS232 or RS485. A USB serial converter can be used.

2.Modbus TCP/IP:

Select TCP/IP if you want to communicate with a MODBUS TCP/IP network. In this case, slave ID is the same as the Unit ID used in MODBUS TCP/IP.

The port number is default 502.

If the connection fails then try if you can ping your device at the command prompt. If the ping

command fails then Modbus Poll fails too.

3.Modbus UDP/IP:

Select UDP/IP if you want to communicate with a MODBUS UDP/IP network. This is the same as Modbus TCP/IP but the connection less UDP protocol is used instead.

4.Modbus RTU/ASCII over TCP/IP:

This is a RTU or ASCII message send over a TCP/IP network instead of serial lines.

5.Modbus RTU/ASCII over UDP/IP:

This is a RTU or ASCII message send over a UDP/IP network instead of serial lines.

Note: Connection type 3-5 is not standard Modbus as specified by https://www.360docs.net/doc/9314309231.html, but they are added for convenience.

Depending on your selection some other settings will be grayed.

4.2Serial Settings

Use these parameters to set serial port settings. They are only available if connection type is “Serial Port”.

4.3Mode

Use this option to select RTU or ASCII mode. Default RTU.

4.4Response timeout

Response timeout specifies the length of time that Modbus Poll should wait for a response from a slave device before giving up. Default is 1000ms.

4.5Min delay between polls

This setting ensures a minimum delay until next request is transmitted no matter of the scan rate.

The resolution of this setting is approximately 15ms. It's possible on some computers to obtain better resolution but not all.

Important: If you set this value lower than 20ms the 3.5 char time gap between response and a new request can’t be guaranteed. This is because the Windows scheduler switch task s every 10 - 20ms.

1.If you Polls several slaves in a serial RS485 network you should NOT set the value lower than 20ms.

This is to ensure the 3.5 char time gap.

2.In a TCP/IP network less than 20ms is ok.

3.Serial connection to only one slave device less than 20ms is ok.

4.6Remote Server

Remote server settings are only available when use an Ethernet connection.

?IP Address: Servers IP address. Default is local host 127.0.0.1

?Port: Server port number. Default 502

?Connect Timeout: Max time to use to establish a connection. Default 1000

4.7Advanced settings

4.7.1RTS Toggle

RTS Toggle specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line will be low.

You can use this to switch direction if you have a 232/485 converter without automatic direction switch.

Warning:

The use of RTS controlled RS232/RS485 converters should be avoided if possible. It is difficult to

determine the exact time when to switch off the transmitter with non real-time operating systems like Windows and Linux. If it is switched off to early characters might still sit in the FIFO or the transmit register of the UART and these characters will be lost. Hence the slave will not recognize the message.

On the other hand if it is switched off too late then the slave's message is corrupted and the master will not recognize the message.

4.7.2DSR

DSR specify whether the DSR (data-set-ready) signal is monitored for output flow control. If this member is TRUE and DSR is turned off, output is suspended until DSR is sent again.

4.7.3CTS

CTS specify whether the CTS (clear-to-send) signal is monitored for output flow control. If this checkbox is enabled and CTS is turned off, output is suspended until CTS is sent again.

The DTR will be enabled whenever the port is opened and disabled when the port is closed.

4.7.4Remove Echo

If your device or RS232/RS485 converter echoes the chars just sent.

5Read/Write definition

Use this command to define the data to be monitored for the active window.

To open the Read/Write Definition dialog you have 3 options:

?Press F8

?Select “Read/Write Definition” from the Setup menu

?Press on the tool bar

5.1Slave ID

Range 1 to 255. (MODBUS protocol specifications say 247). The value 0 is also accepted to communicate directly to a MODBUS/TCP or MODBUS/UDP device.

5.2Function code

You can select 1 of 8 function codes.

5.2.1Read functions

The data returned by the read functions are displayed on the grid window.

?01: Read coils (0x)

?02: Read discrete inputs (1x)

?03: Read holding registers (4x)

?04: Read input registers (3x)

5.2.2Write functions

The write functions write the data displayed on the grid window.

?05: Write single coil (Writes to Coil status)

?06: Write single register (Writes to Holding registers)

?15: Write multiple coils (Writes to Coils)

?16: Write multiple registers (Writes to Holding registers)

5.3Address

Addresses in the Modbus protocol are confusing! Some protocol specifications use the protocol/message address and others use device addressing.

5.3.1Protocol/message address

Some protocol specifications use the protocol/message address counting from 0 to 65535 along with a function code. This is also what the new Modbus specifications use. This is the address inside the message sent on the wire.

Modbus Poll use protocol/message address counting from 0 to 65535.

5.3.2Device address

Some protocol specifications use device address/registers. Registers counts from 1. The first digit describes the function to be used. That means the device address 40101 is identified by address 100. The “4” means Holding registers and 4x registers counts from 1. And even more confusing: 4x means function code 03 and 3x means function code 04!

5.3.35 digits vs. 6 digits addressing

The address format 4x counts from 40001 to 49999. The next address is not 50000. In old days 9999 addresses was enough. There are cases where 9999 is not enough. Then a zero is added. 40101 become 400101 and so on. This is called 6 digits addressing or extended addressing.

This is not a problem with Modbus Poll. 410001 become 10000. The “4” is thrown away and the rest 10001 is decremented by 1 as we count from 0 instead of 1.

5.4Address examples

These examples show how to setup Modbus Poll if a specification use device addresses.

5.4.1Read Holding Registers

You want to read 20 registers from device address 40011 from slave ID 2 every 1000ms. From the “4” we know this is function 03 “Read Holding Registers”.

-Slave ID = 2

-Function = ”03 Read Holding Registers (4x)”

-Address = 10 (11 minus 1)

-Quantity = 20

-Scan rate = 1000

5.4.2Read Discrete Inputs

You want to read 1000 coils from address 110201 from slave ID 4 every 500ms. From the “1” we know this is function 02 “Read Discrete Inputs”

-Slave ID = 5

-Function = ”02 Read Discrete Inputs (1x)”

-Address = 10200 (10201 - 1)

-Quantity = 1000

-Scan rate = 500

5.5Scan rate

The scan rate can be set from 0 to 3600000ms. Note that setting the scan rate lower than the transaction time does not make sense. If a serial connection at 9600baud is used and 125 registers are requested the transaction time is roughly 8 + 2 + 250 + 2 = 262ms + the gap (>3.5 char time) between the request and the response. In this case setting the scan rate at e.g. 100ms do not make sense as the transaction time is at least 262ms + delay in the slave (gap) + min time between polls. (Set in the connection dialog).

5.6Read/Write Disabled

The ‘Read/Write Disabled’ check box can be used to temporary enable or disable the communication for this window. A text (Disabled) is then shown along with the Tx and Error counters.

If 'Read/Write' is disabled you can make single requests with the ‘Read/Write Once’ button or press F6.

5.6.1Disable on error

The ‘Disable on error’ check box is used to di sable Read/Write in case of error.

5.7Hide alias columns

The ‘Hide Alias Columns’ is used to hide all alias columns. This is convenient to make more space if they are not used.

5.8Address in cell

If enabled, the address is also shown in the value cell like: 2000 = 00000

5.9PLC Addresses (Base 1)

This option will show the addresses as device address.

5.10Rows

Specify the number of rows in the grid you prefer.

6Display formats

Mark the cells to be formatted. Select one of the 16 display formats from the display menu.

6.1Native Modbus registers

The 16 bit Modbus registers can be displayed in 4 different modes.

?Signed.

?Unsigned.

?Hex.

?Binary.

6.232 bit long

This combines 2 16bit Modbus registers. It can be displayed in 4 different word/byte orders.

?Long AB CD

?Long CD AB

?Long BA DC

?Long DC BA

Example:

Byte Order: AB CD

The decimal number 123456789 or in hexadecimal 07 5B CD 15

Order as they come over the wire in a Modbus message: 07 5B CD 15

6.332 bit floating

This combines 2 16bit Modbus registers. It can be displayed in 4 different word/byte orders.

?Float AB CD

?Float CD AB

?Float BA DC

?Float DC BA

Example:

Byte Order: AB CD

The floating point number 123456.00 or in hexadecimal 47 F1 20 00

Order as they come over the wire in a Modbus message: 47 F1 20 00

6.464 bit double

This combines 2 16bit Modbus registers. It can be displayed in 4 different word/byte orders.

?Double AB CD EF GH

?Double GH EF CD AB

?Double BA DC FE HG

?Double HG FE DC BA

Example:

Byte Order: AB CD EF GH

The floating point number 123456789.00 or in hexadecimal 41 9D 6F 34 54 00 00 00 Order as they come over the wire in a Modbus message: 41 9D 6F 34 54 00 00 00

7Save/Open Workspace

If you open many related Modbus windows it is convenient to save a snapshot of the current layout of all open and arranged Modbus Windows in one workspace.

A workspace (*mbw) is a file that contains display information and file names of all open windows. Not the actual contents. To do this, go to File-> Save Workspace.

When you open a workspace file, Modbus Poll opens all Modbus Windows and displays them in the layout that you saved.

8Test center

The purpose of this test dialog is to help MODBUS slave device developers to test the device with any string of their own composition.

The list box displays the transmitted data as well as the received data.

You can have several test strings in the pull down list box. When you have entered a string then press the "Add to List" button then the string is added to the list.

The selected string is sent when the "Send" button is pressed.

With the "Save list" button you can store the strings in a text file.

Check the "Add Check” check box if you want to add a CRC or LRC to the end of the input string.

When using the test center you may want to disable communication from other windows. Check the “Read/Write disable” check box in “Read/Write Definition” dialog. Setup->Read/Write Definition.

8.1ASCII Example

String in the combo box:

3A 30 31 30 33 30 30 30 30 30 30 30 41

The transmitted string if LRC is added

3A 30 31 30 33 30 30 30 30 30 30 30 41 46 32 0D 0A

A CR LF pair are also added.

8.2TCP/IP Example

Read 10 holding registers.

00 00 00 00 00 06 01 03 00 00 00 0A

The first 6 bytes are the TCP/IP header.

8.3Test center string file

With a text editor such as notepad or similar you can prepare strings to be used in the test.

The first line in the file must be the string ‘Test Center’. This is how Modbus Poll know s that the file is the correct format. Press “Open list” to open the prepared text file.

8.3.1Content of a string list

Modbus Poll

3A 30 31 30 33 30 30 30 30 30 30 30 41

3A 30 32 30 33 30 30 30 30 30 30 30 41

3A 30 33 30 33 30 30 30 30 30 30 30 41

8.4Copy

Use the Copy button to copy selected Tx/Rx strings to the clipboard.

The SHIFT and CTRL keys can be used together with the mouse to select and deselect strings, select groups of strings, and select non-adjacent strings.

Hint:

Leave this window open while doing other commands.

9Modbus Data logging

You can log data to either a text file or direct to Microsoft Excel.

9.1Text file

Select Log from the setup menu or use short cut keys: Alt+L

Each Modbus Window logs to its individual text file.

When you want to stop the data logging then select the logging off command on the setup menu.

9.1.1Log Rate

?Each read: Write a log line for all Modbus requests. Log frequency as scan rate.

?Select: Specify the log rate in seconds. Independent of scan rate.

Remark: If the scan rate is e.g. 10000ms it makes no sense to set a 1 sec log rate as data are logged only when new data are ready.

9.1.2Delimiters

As delimiter you can use one of following options:

?Fixed width: Means that the values are organized in columns.

?Comma: Values separated by a comma.

?Tab: Values separated by a tab.

9.1.3Log if data changed only

Specify that a new log line is written only if any data is changed since last log.

9.1.4Log Errors

Specify that errors such a timeout etc. are logged.

堡垒主机用户操作手册运维管理

堡垒主机用户操作手册 运维管理 版本2.3.2 2011-06 目录1.前言...................................................... 1.1.系统简介 .............................................. 1.2.文档目的 .............................................. 1.3.读者对象 .............................................. 2.登录系统.................................................. 2.1.静态口令认证登录 (3) 2.2.字证书认证登录 ........................................ 2.3.动态口令认证登录 ...................................... 2.4.LDAP域认证登录........................................ 2.5.单点登录工具 ..........................................

3.单点登录(SS0)........................................... 3.1.安装控件 .............................................. 3.2.单点登录工具支持列表 .................................. 3.3.单点登录授权资源查询 .................................. 3.4.单点登录操作 .......................................... Windows资源类(域内主机\域控制器 \windows2003\2008) Unix\Linux资源类............................... 数据库(独立)资源类 ........................... ORACLE_PLSQL单点登录........................... ORACLE_SQLDeveleper单点登录.................... MSSQLServer2000查询分析器单点登录.............. MSSQLServer2000企业管理器单点登录.............. SQLServer2005ManagementStudio单点登录.......... SQLServer2008ManagementStudio单点登录.......... SybaseDbisqlg单点登录..........................

db2top工具详解(翻译)

Database (d) Figure 2. Database screen 在数据库屏幕,db2top提供了一组对整个数据库的性能监控单元。 用户可以监视活动会话(MaxActSess),排序内存(SortMemory)和日志空间(LogUsed)。这些监测元素可以帮助用户确定这些元素的当前使用百分比。如果这些因素中的一个开始达到很高甚至100%时,用户应该开始调查发生了什么事。 当前时间和数据库开始时间(Start Time)相比能让我们了解数据库运行了多久。这个值结合其他检测元素去调查那些已存在一段时间的问题是非常有用的。 锁的使用(LockUsed)和升级(LockEscals)对缩小锁定问题非常有帮助。如果LockEscals 数量很大时,则增加LOCKLIST和MAXLOCKS数据库参数是一个好主意或者寻找那些引起这个问题的不良查询语句。 L_Reads,P_Reads和A_Reads代表逻辑读,物理读和异步读取。结合的命中率(HitRatio)值,这些变量对于评估大多数的读取发生在存储器中还是磁盘I / O里是非常重要的。因为磁盘的I / O比存储器存取慢得多,用户更喜欢访问在内存中的数据。当用户看到HitRatio 下降低则可以查看缓冲池(bufferpools)是不是不够大了,或是不是有查询进行了太多的全白扫描而导致页面数据从内存洗冲到磁盘。 和读类似,A_Writes代表异步写入,这表明数据页是由异步页清洁剂之前写的缓冲池空间是必需的。通过db2top 刷新频率这段时间内的写数量我们还能知道有多少写请求发生了。还能计算每次写入的平均花费时间这对分析I/O瓶颈引起的一些性能问题有所帮助。当A_Writes/Writes的比值越高则写I/O性能越高。 SortOvf代表排序溢出。如果用户发现这个数字变为非常高,就需要寻找查询了。排序溢出发生在SORTHEAP不足够大,导致排序(Sort)或HashJoin操作可能会溢出数据到临时空间。有时该值随着SORTHEAP增加而降低,但在其他情况下,可能没有多大帮助,如果进行排序的数据集比可分配给SORTHEAP内存大得多。如果请求的数据量超过缓冲池可容纳的临时空间大小那么就可能需要物理I/O来进行SORT或哈希链接在这种情况下排序溢出将是很大的瓶颈。因此优化查询来减少排序溢出的数量能显著提高系统的性能。

db2top

DB2TOP(1) User Manuals DB2TOP(1) NAME db2top ? DB2 performance monitor SYNOPSIS db2top [?d dbname] [?n nodename] [?u username] [?p pass?- word] [?V schema] [?i interval] [?P ] [?b option] [?a] [?B] [?k] [?R] [?x] [?f file <+offset> ] [?D delimiter] [?C

commvault 操作手册

CommVault备份系统安装配置手册

目录 第一章湛江港备份应用环境描述 (3) 1.1 CommVault服务器环境 (3) 1.2 CommVault软件安装信息 (3) 1.3 Exchange环境 (3) 第二章备份系统安装及配置 (3) 2.1安装前准备(Windows操作系统) (4) 2.2 Commvault软件安装 (4) 2.3 客户端安装 (8) 2.3.1虚拟机客户端安装(Vitual Server Agent) (8) 2.3.2 Exchange客户端安装 (9) 2.4许可证管理 (14) 2.5存储介质管理 (16) 2.6存储策略配置 (18) 第三章VMware备份配置及恢复 (21) 3.1虚拟机备份配置 (21) 3.2虚拟机备份 (23) 3.3虚拟机恢复 (24) 第四章 Exchange备份配置及恢复 (26) 4.1 Exchange邮箱备份配置 (26) 4.2 Exchange邮箱备份 (28) 4.3 Exchange邮箱恢复 (30) 4.4 Exchange数据库备份配置 (31) 4.5 Exchange数据库备份 (32) 4.6 Exchange数据库恢复 (34)

第一章应用环境描述 1.1 CommVault服务器环境 CommVault服务器型号:IBM-3650-M2 CommVault服务器名称:cv Commvault服务器域名:https://www.360docs.net/doc/9314309231.html, CommVault服务器IP地址:xxx.xxx.xxx.xxx CommVault服务器操作系统:Windows2008 (64位) Web访问路径:http://xxx.xxx.xxx.xxx/console 1.2 CommVault软件安装信息 CV-SQL密码:xxxx Commvault客户端名:cv Commvault登录用户名:xxxx Commvault登录密码:xxxxx DR备份设置:D:\CVDR 1.3 Exchange环境 一、Exchange备份架构 二、Exchange架构环境描述 Exchange服务器操作系统:Windows2008 R2 (X64)Exchange版本:2010 现有5台虚拟服务器作为Exchange环境, 2台作为Exchange数据库服务器,采用DAG技术(Exdb1, Exdb2), 2台作为客户端服务器做了负载均衡 (Excas1, Excas2), 1台作为边缘服务器(Exedge1) 第二章备份系统安装及配置

sqc基础库使用手册

SqcLib库接口定义 新的sqc基础库采用c++封装,开发人员只需要从基础类Db2Tools派生自己的业务类。然后重载基础类的busiLogic方法,就可以完成自己业务逻辑处理。具体的处理流程为: 1、在基础类Db2Tools的run方法中完成对具体应用参数的解析。 2、run方法调用busiLogic方法,完成具体的业务逻辑 3、busiLogic方法中调用基础类的常用数据库访问方法,完成对数据库的操作。 4、在基础类的数据库访问方法中,除完成指定的数据库操作外,同时完成日志输出和相关事务控制。[日志的输出目录为profile文件中定义的AGENTTRACEDIR目录,如果没有定义,取默认路径] 1函数列表 1.1数据库类(Db2Tools) 该类有两个主要功能: 1、实现数据库访问 2、完成对具体业务逻辑调用和事务控制 ●connDb 函数原形:int connDb(const char *m_para_conn) 用途:连接数据库 参数:m_para_conn:数据库名dbname 返回:1.输入的数据库参数不对 2.密码参数环境变量设置错误 3.数据库连接失败 0.数据库连接成功 ●busiLogic 函数原形:int busiLogic(void) 用途:业务逻辑入口 参数: 返回: ●run 函数原形:int run(int argc,char *argv[]) 用途:实例开始入口 参数:argc:参数个数

Argv:参数数组 (通常取main函数入口参数) 返回:0:成功,其它:失败 ●db2RunstatTab 函数原形:int db2RunstatTab(char *tabname,char *file,int line) 用途:对表做runstats 参数:tabname:输入需要runstats的表名,schema.tabname或者tabname(schema默认为用户名) 返回:-1:失败 0:成功 ●db2Insert 函数原形:int db2Insert(char *sqlstr,char *tabname,char *file,int line) 用途:提交insert语句 参数: sqlstr:insert sql语句 file: line: 返回:-1:失败 0:成功 ●db2Update 函数原形:int db2Update(char *sqlstr,char *tabname,char *file,int line) 用途:提交update语句 参数: sqlstr:update sql语句 file: line: 返回:-1:失败 0:成功 ●db2Delete 函数原形:int db2Delete(char *sqlstr,char *tabname,char *file,int line) 用途:提交delete语句 参数: sqlstr:delete sql语句 file: line: 返回:-1.失败 0.成功 ●db2DropTab 函数原形:int db2DropTab(char *tabname,char *file,int line) 用途:删除表 参数: tabname:需要删除的表名,schema.tabname file:

用户操作手册

用户操作手册 1、引言 [ 阐明编写手册的目的,指明读者对象。] 2、系统概述 2.1 目标 2.2 功能 2.3 性能 a.数据精确度[ 包括输入、输出及处理数据的精确度] b.时间特性[ 如响应时间、处理时间、数据传输时间等] c.灵活性[杂财政仪方式、运行环境需做某些变更是软件的适应能力] 3、运行环境 3.1 硬件[列出系统中的每种硬件的数量、名称、主要功能及性能。] 3.2 软件 3.2.1 支持软件 [ 如: a.操作系统名称及版本号; b.语言编译系统或汇编系统的名称及版本号; c.管理系统的名称及版本号; d.其他必要的支持软件。] 3.2.2 运行软件 [ 列出在系统中每种运行软件的名称、版本号及主要功能描述] 4、使用说明 4.1 硬件安装 [ 列出在系统中各硬件之间的接线图及安装说明] 4.2 软件安装 4.2.1 安装和初始化 [ 给出程序的存储形式、操作命令、反馈信息及其含义、表明安装完成的标志 及安装所需的软件工具等] 4.2.2 输入[ 给出输入数据或参数的要求。] 4.2.2.1 数据背景[ 说明数据来源、存储媒体、出现频度、限制和质量管理等。] 4.2.2.2 数据格式 [ 如: a.长度; b. 格式基准; c. 标号; d. 顺序; e. 分隔符; f. 词汇 表;g. 省略和重复;h. 控制] 4.2.2.3 输入举例 4.2.3 输出[ 给出每项输出数据的说明。] 4.2.3.1 数据背景[ 说明输出数据的去向、使用频度、存放媒体及质量管理等。] 4.2.3.2 数据格式[ 详细阐明每一输出数据的格式。如首部、主体和尾部的具体 形式。] 4.2.3.3 举例 4.2.4 出错和恢复 [ 给出:a. 出错信息及其含义; b. 用户应采取的措施,如修改、恢复、再启动。]

DB2 简明运维手册

DB2 简明运维手册 数据库启动 数据库正常启动的流程包括两个步骤, 首先启动数据库实例,在root用户下切换到实例用户su - db2inst1,执行命令db2start 然后激活对应的数据库,执行命令: db2 activate db 数据库名。 直到出现: 则数据库成功启动。 数据库停止 停止数据库使用如下命令: 在root用户下切换到实例用户su - db2inst1,执行命令db2stop force, 直到出现: 则数据库停止成功。 数据库参数 DB2的参数分为实例级参数和数据库级参数,以及实例注册变量 实例级参数:

主要设置实例使用的TCP/IP端口,查看实例端口通过命令:db2 get dbm cfg 数据库实例注册变量: 确认设置了通信协议为TCPIP,命令如下: 如果没有设置则通过命令db2set DB2COMM=tcpip进行设置。 数据库参数 确认内存自动调整已经打开, 否则连接到数据库并执行db2 update db cfg for sample using SELF_TUNING_MEM ON设置 数据库的缺省日志参数为

如果需要修改日志参数,可以通过命令 db2 udpate db cfg for 数据库名using 参数名参数值 例如增大备用日志文件数量到50,则可以通过命令修改 创建数据库 在实例用户下,执行 db2 "create <数据库名> on <目标路径> using codeset UTF-8 territory cn" 这样创建的数据库缺省页面大小(pagesize)为4K(4096),字符集为UTF-8,如果要使用GBK字符集,则把UTF-8修改为GBK即可。 创建缓冲池(bufferpool) 为了使用与缺省页面大小不一致的表空间,例如缺省页面大小为4K,但是需要使用32K页的表空间,就必须先创建页面大小为32K的缓冲池,命令如下:db2 "create bufferpool bp32k pagesize 32768" bp32k为缓冲池的名字,通常每种页面大小创建一个缓冲池即可,例如8K页面的缓冲池可以命名为bp8k。缓冲池缺省为自动调整大小,如果需要限定使用内存,则使用alter命令,如下: db2 "alter bufferpool bp32k size <页面数量> " <页面数量>为目标内存大小/页面大小,例如要为32K的bufferpool分配2GB内存,则: <页面数量>=2 * 1024 * 1024 / 32 = 65536 创建表空间 如果创建数据库默认页面大小的表空间,并且选择系统自动管理的模式,则使用命令: db2 "create tablespace <表空间名>"

IBP中文操作手册

PPC 中文操作手冊 IBP 機型 上海譯本2005年9月ANGUS

1.0 安全資訊 机台设计安全為首要考慮,设计符合工业安全标准,每台干燥机在出厂时都检查了安全性和运行操作,每个压力容器在ASME Section VIII范围以下通过静力流体的测试,以保证符合最新的安全标准.每台干燥机出厂都配备了安全阀. 警告-为了保证机台安全运行必须遵守以下安全规范,否则会造成机台损坏和人员伤亡,并此损坏不在保固范围内. 1 不要安装或维修在运输时已经损坏的干燥机 2 不要让干燥机在超过最高设计压力或温度下运行,做维修时要先泄压 3 安装机台时要符合当地的供电模式,维修时应切断主电源 4 机台的某些部件没有绝缘,正常运行时温度就会很高,没有确定表面温度时不要随便触摸 5 使用原厂的备品和配件 机台指示标志: DANGER-立刻产生危险,造成严重的伤害或死亡 WARNING-危险或不安全的动作会造成严重伤害或死亡; CAUTION-危险或不安全的动作会造成较小的伤害或产品和财产的损坏 2.0 接收,储置,搬運 2.1 接收并检查 运输时上船前我们已经检查和包装,是被运送人员承认和接收的,业主收到机台以后,立即检查在运输途中可能造成的损坏.如果有,坚决追究货运代理的责任,否则,原厂不负责索赔.也要检查隐藏的损坏,货物运达时表面上是好的,打开后发现有损坏,就要立即通知货运公司坚持要货运检查证明,除了检查确认损坏,货运代理是不会考虑索赔的.如果你接收了损坏的货物,你就要承担风险和费用.我们把货物运到FOB 点,隐藏损坏的索赔就不是我们的责任了,干燥机索赔不包括运输损坏. 2.2 储置 室内储置机台,避免电子和机械元件的损坏.确认机台到达安装位置后再拆除包装. 2.3 搬運 干燥机的设计时移动要借助垫木和基座槽,干燥机有方便起重机的起重环,起重时保证接触到所有的起重环点,避免对干燥机造成损坏 注意:機台管路部份并非起吊點,請勿隨意吊起机台,否则会造成机台严重损坏 3.0 说明 3.1 功能 外加热再生干燥机经济可靠,干燥压缩空气到露点温度.吸附式干燥机吸附压缩空气中的水气在干燥剂的表面,当空气中水气的部分压力和干燥剂表面的压力达到平衡时,说明吸附完全. 干燥机用两个相同的桶槽持续干燥压缩空气,每个都有干燥床,一个桶槽干燥,另一个再生,桶槽干燥和再生的切换可以保证持续提供干燥气体到后端.桶槽开关的切换由电磁阀控制. 当一个桶槽干燥完毕,会缓慢泄压,干燥剂再生.首先,鼓风机抽周围空气加热,加热过的气体通过干燥床,带走干燥剂的湿气,当干燥床完全干燥后鼓风机和加热器停止动作,干燥床冷却时,干燥完的一部分气体以接近大气压力通过热的桶槽冷却干燥床,冷却结束后,桶槽建压到保压状态,这避免了桶槽切换后干燥剂移动和后端压力损失.

DB2数据库SQL语法参考手册

DB2数据库SQL语法参考手册 DB2提供了关连式资料库的查询语言SQL (Structured Query Language),是一种非常口语化、既易学又易懂的语法。此一语言几乎是每个资料库系统都必须提供的,用以表示关连式的操作,包含了资料的定义(DDL)以及资料的处理(DML)。SQL原来拼成SEQUEL,这语言的原型以"系统R"的名字在IBM 圣荷西实验室完成,经过IBM内部及其他的许多使用性及效率测试,其结果相当令人满意,并决定在系统R 的技术基础发展出来IBM 的产品。而且美国国家标准学会(ANSI)及国际标准化组织(ISO)在1987遵循一个几乎是以IBM SQL 为基础的标准关连式资料语言定义。 一、资料定义DDL(Data Definition Language) 资料定义语言是指对资料的格式和形态下定义的语言,他是每个资料库要建立时候时首先要面对的,举凡资料分哪些表格关系、表格内的有什麽栏位主键、表格和表格之间互相参考的关系等等,都是在开始的时候所必须规划好的。 1.建表格: CREATE TABLE table_name( column1 DATATYPE [NOT NULL] [NOT NULL PRIMARY KEY], column2 DATATYPE [NOT NULL], ...) 说明: DATATYPE是资料的格式,详见表。 NUT NULL可不可以允许资料有空的(尚未有资料填入)。 PRIMARY KEY是本表的主键。 2.更改表格 ALTER TABLE table_name ADD COLUMN column_name DATATYPE 说明:增加一个栏位(没有删除某个栏位的语法。 ALTER TABLE table_name ADD PRIMARY KEY (column_name) 说明:更改表得的定义把某个栏位设为主键。 ALTER TABLE table_name DROP PRIMARY KEY (column_name)

DB2(常用工具)具体实用

题目: 1、熟练使用db2look工具导出数据库结构 2、使用db2pd监控表空间、锁的使用情况 3、使用db2mtrk 检查数据库内存的分配情况 4、练习使用db2top工具 5、使用db2batch测试SQL语句的性能 解答: 1、熟练使用db2look工具导出数据库结构 [myinst@ye ~]$ db2look -d mydb3 -l -e -o mydb3.dll -- No userid was specified, db2look tries to use Environment variable USER -- USER is: MYINST -- Creating DDL for table(s) -- Output is sent to file: mydb3.dll -- Binding package automatically ... -- Bind is successful -- Binding package automatically ... -- Bind is successful 2、使用db2pd监控表空间、锁的使用情况 #db2pd监控表空间 [myinst@ye ~]$ db2pd -db mydb3 -tablespace Database Member 0 -- Database MYDB3 -- Active -- Up 0 days 00:29:31 -- Date 2015-08-24-11.36.10.344000 Tablespace Configuration: Address Id Type Content PageSz ExtentSz Auto Prefetch BufID BufIDDisk FSC NumCntrs MaxStripe LastConsecPg RSE Name 0x00007F9AC71E0080 0 DMS Regular 32768 4 Yes 4 1 1 Off 1 0 3 Yes SYSCATSPACE 0x00007F9AC71ED220 1 SMS SysTmp 32768 32 Yes 32 1 1 On 1 0 31 No TEMPSPACE1 0x00007F9AC71FA3C0 2 DMS Large 32768 32 Yes 32 1 1 Off 1 0 31 Yes USERSPACE1 0x00007F9AC7207560 3 DMS Large 32768 4 Yes 4 1 1 Off 1 0 3 Yes SYSTOOLSPACE 0x00007F9AC7214700 4 DMS Large 32768 32 Yes 32 2 2 Off 1 0 31 Yes MYSPACE3 Tablespace Statistics:

DB2性能指标及监控

DB2数据库性能优化 第2课
-DB2性能指标及监控
DATAGURU专业数据分析社区

本课目标
完成本课后,你应该能够

理解OLTP系统关键性能指标是指什么

性能与哪些因素相关

如何监控SQL语句性能

了解数据库层面关键性能指标及获取方法
DATAGURU专业数据分析社区

OLTP系统关键指标:事务吞吐量,平均响应时间
事务吞吐量:指单位时间内数据库所能完成的事务处理或查询的笔数 平均响应时间:平均完成每笔事务或查询需要的时间 这两项指标通常作为系统的非功能需求被提出;基准性能测试指标:TPC-C
DATAGURU专业数据分析社区

性能与哪些因素相关?
数据库服务器硬件配置及应用部署架构
– – 硬件配置:CPU,Memory, Storage(IOPS, Throughput),Network 数据库与应用服务器距离
事务/查询本身复杂度 数据量大小及数据库相关设计
– – – 表及索引 表空间 数据库参数
代码质量
– – 处理逻辑 SQL语句
DATAGURU专业数据分析社区

如何获取TPS, Response Time
性能测试工具如Load Runner, 但仅在模拟性能测试时用 应用层如有日志,可从中统计出来 数据库层
– 下面命令可获取到当前时间为止, 数据库总的TPS及Response Time; 如需要了解TPS及Response Time 在不同时段的变化,需要按一定时间间隔获取数据,然后计算出来 db2 “SELECT current time as CURRENT_TIME, TOTAL_APP_COMMITS, TOTAL_ACT_TIME, TOTAL_APP_COMMITS/TIMESTAMPDIFF(2,CURRENT TIMESTAMP - DB_CONN_TIME) as TPS, TOTAL_ACT_TIME/TOTAL_APP_COMMITS as RESPONSE_TIME FROM TABLE (MON_GET_DATABASE(-2))“ CURRENT_TIME TOTAL_APP_COMMITS TOTAL_ACT_TIME TPS RESPONSE_TIME ------------ -------------------- -------------------- -------------------- -------------------17:46:30 276817 2168651 56 7 … 17:49:00 281127 2202164 55 7
DATAGURU专业数据分析社区
17:46:30 至 17:49:00之间 TPS=(281127-276817)/150 =28

DB2日常维护手册

DB2 日常维护手册

目录 DB2日常维护手册 ............................................................................................................... - 1 - 一、DB2日常维护操作 ............................................................................................ - 1 - 1.检查管理服务器是否启动.................................................................................... - 1 - 2.检查DB2实例是否已经启动 ............................................................................... - 1 - 3.查看表空间状态是否正常.................................................................................... - 1 - 4.查看表的状态........................................................................................................ - 2 - 5.查看磁盘空间........................................................................................................ - 2 - 6.检查存储管理软件是否正常................................................................................ - 2 - 7.检查数据库备份是否正常.................................................................................... - 2 - 8.检查归档日志是否正确归档了............................................................................ - 3 - 9.查看缓冲池的命中率............................................................................................ - 3 - 10.查看当前运行最频繁的SQL,其命中率是否正常 ......................................... - 3 - 11.查看当前连接的应用程序,有没有非法连接 ................................................ - 3 - 12.检查有没有死锁 ................................................................................................ - 3 - 13.对表和索引进行runstats .................................................................................. - 3 - 14.检查表是否需要重组 ........................................................................................ - 4 - 15.对需要重组的表进行重组 ................................................................................ - 4 - 二、DB2日常维护月操作 ........................................................................................ - 4 - 1.查看DB2日志 ....................................................................................................... - 4 - 2.检查备份和日志是否都保存好了........................................................................ - 4 - 三、DB2日常维护季度操作 .................................................................................... - 5 - 1.通过快照监控器,查看系统性能如何 ................................................................ - 5 - 2.数据库补丁级别.................................................................................................... - 5 - 四、注意事项............................................................................................................ - 5 - 1.不要删除活动日志文件........................................................................................ - 5 - 2.注意交易日志存储空间........................................................................................ - 5 - 3.按照系统的实际工作量配置日志空间 ................................................................ - 5 - 4.设置正确数据库代码页........................................................................................ - 6 -

DB2 HADR操作手册

1.HACMP配置 Hosts文件主机,备机/etc/hosts如下: 主机:10.60.3.1(BootIP) 备机:10.60.3.2(BootIP) /usr/es/sbin/cluster/etc/rhosts文件如下:

在配置HACMP的过程中设定了两个资源组,分别为appa和appb,其中appa的脚本为:Start Script:/usr/es/sbin/cluster/script/appastart.sh Stop Script:/usr/es/sbin/cluster/script/appastop.sh 资源组appb的脚本如下: Start Script:/usr/es/sbin/cluster/script/appbstart.sh Stop Script:/usr/es/sbin/cluster/script/appbstop.sh

在HACMP的监控中设定了两个监控事件分别为mona,monb,其中mona的脚本为:/usr/es/sbin/cluster/script/db2mon.sh Cleanup Method为:/usr/es/sbin/cluster/script/appastop.sh Restart Method为:/usr/es/sbin/cluster/script/appastart.sh 其中时间间隔以及稳定时间建议值如图所示: monb的脚本为: /usr/es/sbin/cluster/script/db2mon2.sh 其中时间间隔以及稳定时间建议值如图所示:

2.HADR配置 2.1HADR准备工作 1.安装DB2,更新补丁,版本和主服务器一致 2.创建相同的实例erpdbprd,服务端口:50000 /usr/opt/db2_08_01/instance/db2icrt -a server -w 64 -p db2c_erpdbprd -u erpfusr erpdbprd 3.更新DBM参数:db2 update dbm cfg using TP_MON_NAME CICS 4.设置DB2的环境变量 db2set DB2_PINNED_BP=YES db2set AUTOSTART=NO db2set DB2_HASH_JOIN=ON db2set DB2COUNTRY=86 db2set DB2COMM=TCPIP db2set DB2CODEPAGE=1386 db2set DB2AUTOSTART=NO db2set DB2_SKIPINSERTED=ON

相关主题
相关文档
最新文档