I want to import data from another machine to pgAdmin using IP address in Postgresql. I then have to create an excel file in pgAdmin and import data into it with timestamp.
I am facing problems in connecting the database through IP address.
Related
I need to connect to a remote database (Oracle) using a MS SQL Server (2019) linked server. What I did so far:
Installed Oracle Instant Client x64 and the ODBC drivers on the machine where the SQL server is running
Created a symlink to the central TNSNAMES.ORA (on a file share in the network) inside the Oracle Instant client folder.
Set the necessary environment variables
Created an ODBC connection to the database on the Oracle server on this machine
Restarted MS SQL Server
Created a linked server (Microsoft OLEDB Provider for ODBC Drivers) in the SQL instance
When connecting to the SQL Server using sqlcmd on this machine (I did not install SSMS there), I can query the linked database using OPENQUERY(). I can also read the file TNSNAMES.ORA using this command (note, the given file is the symlink, but it displays the contents of the linked file, as it should):
SELECT * FROM OPENROWSET(BULK 'C:\InstantClientx64\tnsnames.ora', SINGLE_CLOB) TNSNames
So far, everything is fine.
Now, when I connect to the SQL Server from my workstation using SSMS, i get the following error when trying to read TNSNAMES.ORA using the command above:
Cannot bulk load because the file "C:\InstantClientx64\tnsnames.ora" could not be opened. Operating system error code 5(Access is denied.).
I created a file test.txt in the instant client folder containing something like "Am I allowed to read this?" - and I was, no problems.
I started procmon on the server to find out what happens. When using the above command on the SQL server, I get a REPARSE (because it's a link!), and then SUCCESS, the file is displayed in the sqlcmd console.
When using this command in SSMS (on my local workstation), first appears the REPARSE (OK), then ACCESS DENIED.
In both cases it is the same user account which is displayed as "Impersonating" in the procmon's details. There is definitely no problem with a firewall, and the read permissions on the tnsnames.ora file on the network share are granted for Everyone. I am also able to create an ODBC item on the local workstation, and can connect and query the database from here.
I have done this in the past I don't know how often, and never had problems. What am I missing?
Why are you trying to read the tnsnames.ora file via SQL? The Oracle libraries will (should) internally open it and use it when your app connects to the DB.
The default location for network config files is shown in the Instant Client installation doc. In your case it will be C:\InstantClientx64\network\admin. Unless you have set the TNS_ADMIN variable, then start by creating this subdirectory and putting tnsnames.ora in it.
(A future version of Instant Client on Windows will create the network\admin subdirectory automatically, similar to the way it is created with the Linux Instant Client packages).
I made a database using PostgreSQL (using pgAdmin III as the SQL client), and it is filled with shapefiles.
Then i connected that database to Qgis. Now I want to export this database to someone else so they can import it on their PostgreSQL server on their own PC and also get to connect it with Qgis.
How can I do that?
I need to import dataset from a remote SQL Server using a VPN connection. I would like to know how to proceed. I have no experience in servers.
I am using a shiny app to read and process csv files. Now I am getting a bit more ambitious and I would like to upload directly my data from a remote SQL server. I communicate to this server via a VPN connection.
When you have access to the database via SSMS, You can import file.
you choose the database that you want to import file into.
right click the database and find "Import Data" option under
tasks.
You will be able to choose file type that you are
trying to import. For the Txt, and csv file, please use Flat File
Source as Data Source.
I am trying to connect to my local instance of SQL Server using a linux Docker container running on my Windows machine. I can connect successfully using Data Source=localhost when running under Windows. I've discovered that localhost is not supported in a connection string on linux, so here is what I've also tried and failed with:
Data Source=localhost
Data Source=localhost,1433
Data Source=127.0.0.1
Data Source=127.0.0.1,1433
Data Source=127.0.0.11
Data Source=127.0.0.11,1433
Data Source=172.23.0.1 - My local IP Address
Data Source=172.23.0.1,1433
My local SQL Server instance does not allow remote connections. I suspect this is why I cannot connect. Do I need to allow remote connections to get this to work? Can I get this working without doing so?
Also, if I have to provide an IP address, is there a way to work out what that address should be programmatically?
You can try Data Source=host.docker.internal as mentioned here.
I have a database server with ip xxx.xxx.xxx.xxx and there is a natting ip to it.
When I am trying to access the Oracle database server via toad using the natting ip, I am getting TNS timeout error.
Whenever, I go and access it from the unix server (The DB server is installed in unix system), I am able to access it.
The database is properly configured and is working from another ips. But, not from my ip.
This problem I am facing from both database on unix and linux server