A small tool to know how fast your database responds.
name | sample value | description |
---|---|---|
-a | seus_01 | an alias of the server |
-h | 10.10.20.30 | database host like localhost, 127.0.0.1, an ip, etc |
-p | 1521 | database port: 1521 for oracle, 3306 for mysql, etc |
-u | root | database connection user |
-n | employee_db | database name. For oracle set the service name |
-r | /tmp/database_connection_report.csv | a location to the desired csv report |
-i | 15 | value in seconds to be used a interval of execution |
The password is a special and sensible value, so we cannot set it directly. You will
For linux/mac
export sql_tracer_database_password=admin123
And for windows you can use the Environment Variable Manager
- Dowload the latest release from here
- Configure the password as was explained previously
- Open a shell and run this
Linux/Mac
./sql_tracer -a seus_01 -p 1521 -h 10.10.20.30 -u system -n xe -r /tmp/database_connection_report.csv -i 5
Windows
sql_tracer.exe -a seus_01 -p 1521 -h 10.10.20.30 -u system -n xe -r C:\\Users\\Jane\\Desktop\\database_connection_report.csv -i 5
- client ip
- client alias
- ping start datetime
- ping end datetime
- status (success or error)
- elapsed time in millis
- error summary (one line)
All the metrics will be stored in the provided report location. Example:
![](https://private-user-images.githubusercontent.com/3322836/311820044-5665ee58-cb9f-4057-9dd1-d2317743b647.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTQzNTIsIm5iZiI6MTczOTE1NDA1MiwicGF0aCI6Ii8zMzIyODM2LzMxMTgyMDA0NC01NjY1ZWU1OC1jYjlmLTQwNTctOWRkMS1kMjMxNzc0M2I2NDcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDIyMDUyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGNhNWVmZTlkZTJjNWM3NmVmMDU1YzRkNzg0Nzc5YmIyNjljY2JmYWVhNGY3NDc4MTMyMjJiYjVhMjRjZWU2MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.-aW9J0C7qTSsJYGx76By82l0VKv80aKUnmTa1TRuMVc)
go get github.com/sijms/go-ora/v2
Set the database password as was explained.
Then execute for Linux/Mac
go run src/main/go/sql_tracer.go -a seus_01 -p 1521 -h 10.10.20.30 -u system -n xe -r /tmp/database_connection_report.csv -i 5
And for windows
go run src/main/go/sql_tracer.go -a seus_01 -p 1521 -h 10.10.20.30 -u system -n xe -r C:\\Users\\Jane\\Desktop\\database_connection_report.csv -i 5
Linux/Mac
go build -o build/sql_tracer src/main/go/sql_tracer.go
Windows
env GOOS=windows GOARCH=amd64 go build -o build/sql_tracer.exe src/main/go/sql_tracer.go
If no errors, you will find the executable in the build folder. Then you could use it in a machine without go
code | description |
---|---|
6660 | I was not able to enter to that catch :/ |
6661 | usually bad host or credentials |
6662 | Connected but query validation got an error |
66650 | report exist but cannot be accesed to append it |
For notitifations, templates, plugins, etc go to the wiki
JRichardsz |