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:
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 |