I have an embedded device which takes the time in the format of:
0.europe.pool.ntp.org
1.europe.pool.ntp.org
2.europe.pool.ntp.org
3.europe.pool.ntp.org
I asked the customer about an NTP server from their side as the solution is on-site, they gave me the NTP server as an IP only, since I have 4 fields and timezone on the embedded device, what is the practice of changing this IP to fit the NTP server format above?
Your current list is a server pool - each one refers to a single NTP server. For example if you ping each one for example:
> ping 3.europe.pool.ntp.org
Pinging 3.europe.pool.ntp.org [185.51.192.34] with 32 bytes of data:
Reply from 185.51.192.34: bytes=32 time=11ms TTL=57
...
>ping 0.europe.pool.ntp.org
Pinging 0.europe.pool.ntp.org [91.121.7.182] with 32 bytes of data:
Reply from 91.121.7.182: bytes=32 time=15ms TTL=55
...
Or perform a DNS look-up you will see that the each resolve to a different IP address. Your local server is probably no different except that you have a pool of one. You can probably simply place the single IP address where currently you define the pool.
Related
I would like to start monitoring our system closely as to see who and at what time did a user run a query.
Currently, on the tables from HIST DB, we are able to see the query Texts, username, date, time, and client IP. But what we are more interested in is to see the client host machine name.
When we run a query requesting client hostname, the output comes as unknown.
Below is the query that we are running to get our required information:
SELECT *
FROM NZ_QUERY_HISTORY
Is there anything else that we can look at or implement for us to be able to see client machine name.
FYI: When we run: show session all; we do infact see the client host machine.
We did our own view on top of the query history database when we started using netezza a few years ago, and it does not include the DNS name (hostname) of the client. I guess we left it out because it is empty most of the time. Another guess is that our DNS setup doesn’t not allow reverse DNS lookups for all IP addresses from the netezza host.
Instead we rely on:
the clien IP address and netezza username
the username&ip address on the client machine
In total that is quite powerfull
Furthermore we add a bit if ‘pre sql’ to the connection configuration of the client tools we use (sas, powercenter, business objects, etc) and add as much info as we can to the 4 ‘client_application_*’ variables. See here for syntax: https://www.ibm.com/support/knowledgecenter/en/SSULQD_7.2.1/com.ibm.nz.dbu.doc/r_dbuser_set.html
For powercenter we add the workflow,session and other -names...
How to read the Server Name and / or SID (SAP System Identification) via SQL in SAP HANA?
the system monitoring view M_HOST_INFORMATION should hold the information you are looking for.
SELECT HOST, KEY, VALUE FROM SYS.M_HOST_INFORMATION WHERE KEY IN ('sid', 'net_publicname');
See the following link for a full documentation:
https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.04/en-US/20b10028751910148c1c9de602d771de.html
Cheers
The SELECT FROM M_HOST_INFORMATION statement in the previous answer returns different host names. Depending on your use case you should use:
The HOST column showing the logical host name, as the HANA instance was installed
The net_publicname property showing the effective hostname or ip-address used for network communication, when additional connections are opened by client libraries
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.
Im trying to execute a stored procedure and simply insert its results in a temporary table, and I'm getting the following message:
The operation could not be performed because OLE DB provider "SQLNCLI"
for linked server "MyServerName" was unable to begin a distributed
transaction. OLE DB provider "SQLNCLI" for linked server
"MyServerName" returned message "No transaction is active.".
My query looks like this:
INSERT INTO #TABLE
EXEC MyServerName.MyDatabase.dbo.MyStoredProcedure Param1, Param2, Param3
Exact column number, names, the problem is not the result.
MSDTC is allowed and started in both computers, Remote procedure calling too.
The machines are not in the same domain, but I can execute remote queries from my machine and get the result. I can even execute the stored procedure and see its results, I just can't insert it in another table.
EDIT
Oh I forgot to mention, the stored procedure doesn't fire any trigger. It only inserts records in temporary tables which it creates itself for data treating.
Well, after following lots of tutorials and researching a lot about it, I had changed all the configuration I thought was necessary for it to work, but it still didn't.
Today we had to force a power reboot on our development server because of a faulty no-break, and when we booted up the server, guess what? It works!
So just for the record, I've changed some specific MSDTC configuration, added it as a linked server and allowed RPC IN and OUT, and changed the RPC configuration for 'NO AUTHENTICATION REQUIRED' or something like that.
I remember reading somewhere that after you changed this configuration, a reboot was required, even though Windows says that it has already restarted the service.
I had rebooted my server like... twice since I changed it, and it still didn't work. But as today, after a complete turn off and turn on, it works!
As for the syntax, I kept the same.
You also have to check the DNS name resolution in the IP network configuration.
For example, you have a server called server-a.mydomain.com and another one called server-b.otherdomain.com, log in the server-a and do a "ping server-b" (without the domain).
If it responds "Ping request could not find host server-b. Please check the name and try again." that is the problem.
Go to the Control Pannel > Network Connections > Right click in the network card > properties > Internet Protocol > Properties > Advanced > DNS > Append this DNS suffix in order.
And here add the local domain: mydomain.com and then add the remote domain: otherdomain.com
Click OK until you exit
Now if you do the "ping server-b" it should repond something like:
Pinging server-b.otherdomain.com [192.168.1.2] with 32 bytes of data:
Reply from 192.168.1.2: bytes=32 time=12ms TTL=64 Reply from
192.168.1.2: bytes=32 time=9ms TTL=64
Now try to again to execute the distributed transaction.
I had the luxury of safely restarting the SQL Server services on both sides of the Linked Server connection. I did not have to reboot the machines.
Have you tried using openquery?
insert into table select * from openquery(myservername, 'exec mydatabase.dbo.mystoredproc param1, param2, param3')
i need to clearly see what IP address made what sql query to SQL server.
I am trying to use SQL Profiler, but it seems there is no way i can somehow to differentiate the machine (browser) where the query came from. It only has the communication details between the web server and the sql server. Is there ANY way for me (any unknown log?) that will allow me to see the identification of the original machine where the query came from?
Thanks for any suggestion.
HF
You can get the hostname of the current connection, or really any information from the sysprocesses table
SELECT hostname FROM sys.sysprocesses WHERE spid = ##SPID
This obviously won't work to get the ip address of web hosts if that's what you're looking for.
Like #joshperry said, you can retrieve client address and server address with
SELECT client_net_address, local_net_address
FROM sys.dm_exec_connections
WHERE session_id = ##SPID
As far as SQL Server is concerned the request will always come from your webserver. You need to capture and log the IP address in your web app.
SELECT r.client_net_address,sqltext.Text
FROM sys.dm_exec_requests req left join sys.dm_exec_connections as r on req.session_id=r.session_id
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
If you do not write code in the application to pass the client address from the web server to the database you will have to look at the web logs - they will give the ip address of the client.
SELECT * FROM sys.dm_exec_connections returns information about the connections established to this instance of SQL Server and the details of each connection (https://msdn.microsoft.com/en-us/library/ms181509%28v=sql.120%29.aspx)