|
| This chapter describes
the general usage of TG. It assumes that you have already installed
TG in the "C:\tg08X" directory. |
| To begin with, startup TGC that is the management tool of TG. Double-click "tgc.exe" or Enter at the command line as follows. |
| |
* COMMAND-LINE SAMPLE
|
C:\> cd tg08X
C:\tg08X> tgc
|
|
| |
| The window of TGC is displayed, and the start message of TG is displayed on the "TG Console screen" . Look at the sample below. |
| |
TG - Transaction Generator - [ Version 0.80 ] Sat Jun 16 01:05:59 JST 2007
Checking specified address & Port is possible to use... .OK.
Now TG is running in "Slave Mode".
- Listening Address : 0.0.0.0
- Port : 11111
TG - Transaction Generator - [ Version 0.80 ] Sat Jun 16 01:06:00 JST 2007
logged in.
TG> autoexec on
Autoexec "ON".
TG> masterserver on
MasterServer "ON".
TG> spool off
Spool function is already "OFF".
TG> set tpsmonitor true
TPS-monitor signal has been enabled.
TG> |
|
| |
  |
|
Step2 |
- Load the sample configuration - |
                                  |
Load the sample configration file. Click "File" and select "Open". Next, choose "C:\tg08X\sample.tgp" file. |
When the configration file has been loaded successfully, the following message will be displayed in the "TG Console". The configrations of TG and TGC are syncronized automatically. |
| |
TG> Syncronization has completed succesfully.
TG> reload config
Loading configration file... .OK.
Registered transactions:4 , variables:5 , jobs:1 , slave servers:0
TG> |
|
| |
  |
|
Step3 |
- Edit and confirm the configuration - |
                                  |
Click "Agent" and select "Configure Agents...". You can confirm and edit a configration here. |
The content of the "Database" tab is as follows. In this tab, you can defaine target database information. For example, JDBC driver and JDBC driver type, hostname, port number, SID name...
|
The content of the "Agents" tab is as follows. In this tab, you can define username and password, the number of sessions, Thinktime, etc.. Agents connect to the database using these parameters. |
The content of the "Variables" tab is as follows. On the left side of the window, the list of variable names registered in TGC is displayed. When you click the name, the propaties of specified variable are displayed on the right side. You can define the type (Variable type) and the range (Minimum value, Maximum value, values) of the specified variable. |
The content of the "Transactions" tab is as follows. On the left side of the window, the list of transaction names registered in TGC is displayed. When you click the name, the propaties of specified transaction are displayed. You can define the execution ratio (Average of execution) and SQL statements (SQL Statement) of the specified transaction. |
Incidentally, in this sample (sample.tgp), it is necessary to make the following objects for the schema of the target database. |
| |
|
|
Table |
create table test (
id number,
ndata number,
ddata date,
cdata varchar2(255));
|
Sequence |
create sequence idseq start with 1 increment by 1
nomaxvalue nominvalue nocycle nocache;
|
Index |
alter table test add constraint pk_test_id primary key (id); |
|
| |
The content of the "Jobs" tab is as follows. On the left side of the window, the list of job names registered in TGC is displayed. When you click the name, the propaties of specified job are displayed. You can define the type (Job type) and the script which is executed as a job (Command path or Script text).
Finally, click "OK" and close "Configure TG" window. |
When you close the window, automatically the configrations of TG and TGC will be syncronized. |
| |
TG> Syncronization has completed succesfully.
TG> reload config
Loading configration file... .OK.
Registered transactions:4 , variables:5 , jobs:1 , slave servers:0
TG> |
|
| |
  |
|
Step4 |
- Check the current configuration - |
                                  |
Click "Agent" and select "Check Configration". You can test if agents can connect to the target database using a current configration.
|
When agents connect to the database successfully, JDBC URL and JDBC driver information will be displayed as follows.
|
| |
TG> check config
Using driver class : oracle.jdbc.driver.OracleDriver
Tring URL : jdbc:oracle:thin:@192.168.100.100:1521:testdb
Now checking to connect to the database... ...OK.
Driver information
~~~~~~~~~~~~~~~~~~
- Driver name : Oracle JDBC driver
- Product name : Oracle
- Product version : 10.2.0.2.0
TG> |
|
| |
  |
|
Step5 |
- Start transactions - |
                                  |
Click "Agent" and select "Make agnets connect to database". Now you can make agents connect to the target database.
|
See "TG Status" sub window on the left side of the main window of TGC. "Agent status" value changes from "DISC (disconnected)" to "WAIT", and "Sessions" value begins to increase. "Sessions" value stop at "10", because the parameter of "Sessions" is set to "10" at this point in time.
|
Next, Click "Agent" and select "Activate agents". You can begin to send queries ( agents call SQL statements ) on the database server.
|
"Agent Status" value changes from "WAIT" to "ACTV(Active)", and "TPC" value begins to change. The value of "TPC" shows the number of execution of the transaction for one second.
|
The transaction statistics can be confirmed by "TPS Monitor" tab. It prints additional statistics once a second.
|
| |
03:39:20 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:43
03:39:21 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:47
03:39:22 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:44
03:39:23 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:46
03:39:24 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:44
03:39:25 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:44
03:39:26 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:47
03:39:27 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:44
03:39:28 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:46
03:39:29 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:43
03:39:30 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:43
03:39:31 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:45
03:39:32 AgS:ACTV Act:10/10 SES:10/10 ErD:0/10 ERR:0 TPS:46 |
|
| |
If you want to stop the transaction, Click "Agent" and select "Freeze agents". Under this condition, Agents stop activity but the session between agents and target database remains. If you restart transactions, select "Activate agents" again.
|
If you want to stop transactions and disconnect agents from the database, Click "Agent" and select "Make agents disconnect from the target database".
|
"Agent status" value change from "WAIT" to "DISC(disconnected)", and "Sessions" value begins to decrease.
|
  |
|
Step6 |
- Terminate TG/TGC - |
                                  |
Click "File" and select "Exit" at TGC main window.
|
At the center part of TGC, "Terminate TG Controller" window is displayed. Click "YES" and terminate TGC and TG. |
|