OpenEdge SQL Statement Cache - per server or per connection? - sql

Is anyone able to confirm if the the SQL statement cache exists per SQL server or per connection.
The following states that is is per server:
http://knowledgebase.progress.com/articles/Article/P37596
The following states that it is per connection:
http://knowledgebase.progress.com/articles/Article/P25743

It is per connection.
The kbase entries do not actually conflict with each other -- they are saying that the parameters are specified per server. So you could setup different servers with different parameters. But the caches being configured are per connection as influenced by the server that the connection is associated with.

Related

What diagnostics can I collect with MariaDB Connector/C upon an error?

I would like to collect as many diagnostics as reasonable and possible when getting an error upon running a query to MariaDB/MySQL via Connector/C.
So far I am collecting mysql_errno() and mysql_error(). What else can I reasonably collect? (I.e. without dumping the whole database to a file, etc.)
I would collect anything that allows to reproduce the error:
the SQL query (if prepared statement with bound data values)
the database user
the database name
the database connection string (hostname, port number)
possibly session variables modified in the current session
the OS user
the OS machine
version of MySQL client.

In PostgreSQL, How to get all users who are logged into the session and also get their IP address and Query whenever they access databse?

I am using PostgreSQL. Nearly five people will be using the same database. I want to get the data about who are running which query both in HeidiSQL tool and Webapplication.
I tried using pg_stat_activity table to get the details. But it returns only one row per IP, which is the corresponding machine's query details.
to log who was connected use
https://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-CONNECTIONS
to log what statements were used, use
https://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-STATEMENT
pg_stat_activity shows connected session only:
https://www.postgresql.org/docs/current/static/monitoring-stats.html
One row per server process, showing information related to the current
activity of that process, such as state and current query.
https://www.postgresql.org/docs/current/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
you might also be interested in https://github.com/pgaudit/pgaudit and https://www.postgresql.org/docs/current/static/pgstatstatements.html

Run a Sql Query on multiple Servers and each server has different databases(database name is diff on each server) with same tables

Run a Sql Server Query on multiple Servers and each server has different databases(database name is diff on each server) with same tables
In the management studio, you can register multiple servers into one group. Then you can run query on the group.
In SSMS open Registered Servers and create a New Server Group under Local Server Groups.
Under this group create New Server Registration for each server you wish to query. If the DB names are different ensure to set a default for each in the properties. You can register a server/instance multiple times with different default DBs.
Now go back to the Group you created in the first step, right click and select New Query. A new query window will open and any query you run will be executed on each server in the group. The results are presented in a single data set with an extra column name indicating which server the record came from. If you use the status bar you will note the server name is replaced with multiple.

I'm trying to get a variable for local IP that the SQL Server Agent can use in a table

I'm writing an insert into a linked server table that includes the IP the of the local server. When SSMS into the server and exec the SP, it provides the correct information into the Linked table.
When the SQL Agent runs the job for itself its returning 'NULL' and inserting Null into the remote table instead of the local IP. I'm sure this is because there is no "local" IP being used as it is using its only ports ect.
Specifically talking about the Connectionproperty('local_net_address)
set #vcLocalIP= convert (varchar,CONNECTIONPROPERTY('local_net_address'))
Any Help or Ideas on this would be greatly appreciated. Just trying to craft this SP so it can be put on different servers and all return the relevant information with as little "manual" intervention as possible.

SQL Server linked-server - cannot see all of the rows in target server's database table

I can't see all of the rows in the linked-server's tables. So if I run select count(*) from cmrez.dbo.reservations on the target server itself it returns 809472, but if I run the same query from a remote (linked) server I only get 78324. What's up with that!?
I seem to have come up with a solution. The target server supports mixed-mode logins, so I created a new login and I specify for the linked server to use that login and it appears to work. I don't know why I couldn't use pass-through security, but that doesn't matter as long as it works ;-).