how can i solve "ORA-12560: TNS:protocol adaptor error" - sql

Im getting this error installing oracle client-server at the same time
how can i solve it?

In the connection you show, you have not specified the name of the database you want to connect. Therefore, it is using the value indicated by the environment variable ORACLE_SID. Furher, it uses that as a value to connect to a local datatabase - a database running on the same machine as the requesting client. The error your report is most commonly resulting from ORACLE_SID not indicating a valid instance name for a local database.

Try to check your $PATH environment variable has the path to the server the first one. Like this.
For checking it go to This PC (right-click) -> Properties -> Advanced System Settings -> Environment Variables -> System Variables.
Solution here:

Related

How to find new server name and why the last not working

I have Microsoft SQL Server 2016. I used to go in with a server name and there was no problem.
Recently there was a problem with the boot file, also known as the 0x00000034 blue screen error.
After the patch, it does not let enter the local server name.
Before
but the result
I tried other names and also examined similar questions without any good results.
for example-
How to find server name of SQL Server Management Studio and also How to find server name of SQL Server Management Studio but without any success.
There might be an issue with the connection to the server instance. I would try the troubleshooting steps in the question and answer from this post How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'? or from this video https://www.youtube.com/watch?v=810cv3PunkA
The server name, that you enter there is the name of the computer, on which the SQL Server has been installed. This is called "default instance", because you do not specify a name of the instance, which is in the format "computer_name\instance_name". If you are trying to connect to an instance (either default or named) installed on your local computer, you can substitute computer_name with . (dot), i.e. you can connect to a default instance on your computer by giving ., or to a named instance as .\SQLEXPRESS for example.
So in your case if you specify only a dot for server name, you should be able to connect. If you don't connect, then the SQL Server instance is not working. You can check is the service started, but you may have to reinstall SQL Server.
If the connection is successful, then you can keep using . (or (local)). If you want to find your computer's name, from Windows Explorer right click This PC and select Properties, then look at Computer name:.
If you still can't connect to the SQL Server using this computer name, then you have issues not related to the SQL Server engine itself. Open a command prompt and try to ping the computer name: ping desktop-7t2s4sm. If you get an error, then you have a networking issue.
Press ⊞ Win + R or type run in start (open run)
Type services.msc
Look for SQL Server (MSSQLSERVER)
Right click on it
Click on start

file.exists always return false

I have an issue where file.exists aways returns false.
situation:
server 1 that executes file.exists has a mapped networkdrive to server 2 that is on a remote location.
Accessing and browsing the network drive is ok.
But when running the webpage, I always get a false.
Even the path is ok, and de file exists.
I tried both situations: U:/folders/file.txt and //ipadress/folders/file.txt
The shared folder on server2 even has permissions set to everyone full control.
Strange thing is that when running debug in visual studio, it works, and the file.exists return true.
Try parsing it to an Uri and check at LocalPath property. Uri has a "TryCreate" for this purpose if you don't want to handle a possible exception.
If you're accessing it from a webpage, it's possible the webpage doesn't have mappings (i.e. U:) and you will need to use the full name (like \\myserver\folder\etc). Check the 2nd answer in this thread for some very useful methods that will let you do this: How do I determine a mapped drive's actual path?
Drives are mapped per-user, not per-machine.
This means that if you mapped a drive using your own user account, but the server is using another, the server won't see your mapped drive.
I guess adding the following command in the user's logon script, who is set in "Log on As:" option of IIS or your application service should resolve the issue.
net use x: \\SERVERNAME\SHARENAME

Windows Application ignores app.config and uses something to connect to local database

The application sits on a virtual environment and when I remote in and run the application, it connects to the remote database. However, when I remote in with a service account and double click the same .exe, it tries to connect to the local host database and ignores the app.config. The code is the same, only the login name I use is different. The login I use is part of the local admin group. Any ideas?
You haven't indicated whether or not this is the case in your question, but my first suspicion is that you are storing the connection strings in settings, but the connection string has been marked as a user-specific setting.
In the logic of the code it was doing a comparison of the SQL server setting in the config (Settings), which was entered in lower case, against the list of SQL servers (all in upper case). Since it couldn't find any match, the datasource was blank [datasource=;],hence causing the code to look local. My fix was to use String.Compare and ignore the case, which created the match and I was able to connect to the remote SQL server.

Creating a connection string in an Indirect Environment Variable for SSIS

I have been scouring the internet for a clear answer to this question and I haven't been able to find one.
We currently have a SQL configuration enabled across packages which stores everything in a database, (dev or prod). It is a tricky process to execute packages, figuring out which configuration the packages are mapped to, and having to change them during testing. My hope is that we can use an environment variable to always use a specific connection string to the specific sql server configuration we want to use based on the machine.
I have seen ways to set up variables with the connection string hard coded as an environment variable with an additional SQL server configuration after to manage this. I have also seen ways to manipulate the connection string using XML and calling that from a variable, or from the package itself.
Both of these solutions work and very well may be viable solutions.
My question that I'm really trying to answer is; Is it possible to develop the entire SQL Server configuration connection through the environment variable? As in combining the connection string with the configuration string so that the one environment variable connects straight to the package configuration? Has anyone tried this? Does it make sense as a solution to the problem?
Yes, we have done this and it works fine. Each package has two configurations: the first is an environment variable and the second is a SQL Server table. The environment variable is the connection string for a database containing a table with all the configurations and it is applied to a connection manager. The SQL Server configuration uses that connection manager to connect to the configuration database and retrieve the individual settings.
Because configurations are applied in order, the connection string for the connection manager is set before the SQL Server configuration tries to use it. In summary:
Create your package
Add a connection manager called "Configuration Database" or whatever
Add a SQL Server configuration to the package, use the "Configuration Database" as the Connection, and choose the settings to be stored in the table
Create an environment variable such as SSIS_PKG_CONF with the connection string to be used for the "Configuration Database" connection manager
Add an environment variable configuration to the package, use the SSIS_PKG_CONF variable, and assign it to the connection string for the "Configuration Database" connection manager
Now when you run the package, the configuration proceeds as follows:
The package processes the environment variable configuration
It assigns the value of the environment variable to the "Configuration Database" connection manager's connection string
The package processes the SQL Server configuration
It uses the "Configuration Database" connection manager to retrieve individual settings from a database table
This has worked well for us because we can change the connection string to point at a different source database for the configuration, without changing anything inside the package or the launcher (i.e. the SQL Agent job or script that runs the packages). There are other ways to do it and some people feel strongly that .dtsConfig files are the better option, but we found it easier to manage environment variables than config files
But in the end managing package configurations is a preference and a lot depends on what is easier in your environment with the tools and practices you already have.

Installing SQL Server Express 2005 - but it already exists on the machine

I built an application for a client that requires SQL Server 2005 Express. Everything worked fine on all the machines except for one. On this one they already had an application that uses SQL Server Express, so it was already installed on the machine, but nobody knows which application uses it or any usernames/passwords.
Can I simply install another copy into a different folder? This just doesn't seem right to me, and I know this has to be a common scenario. Can someone point me in the right direction on how I should proceed?
Thanks!
Darvis
Yes you can just install into a different directory, as a new "named instance" of SQL Server Express.
To install, follow Step 8 on Microsoft's Install How-To:
On the Instance Name page, select a Default instance or a Named instance for your installation. If you select Default instance, an existing default instance will be upgraded. If you select Named Instance, specify an instance name
So what you need to do is specify the Named Instance and specify your own instance name, and connect to it using the URL format as above.
As the Microsoft How-To mentions, the default installation is a named instance as well, with the name "SQLExpress", which is why if you want to stop or start the service with net start or `net stop' you need to write something like:
net start mssql$sqlexpress
and the hostname part of the connection string for a default SQL named instance is:
.\SQLEXPRESS (or localhost\SQLEXPRESS)
You should be able to log into it using Integrated Windows Authentication using an administrator type account on the PC, and use that to reset passwords on any SQL server type logins.
Failing that, yes, you should be able install a "named instance". You connect to it by supplying "hostname\instancename" as the server name.
In all likelihood, the culprit is Outlook's Contact Manager.
You should just uninstall the "feature". If you can't, you can create an additional instance of SQL Express, which you can access as COMPUTERNAME\INSTANCENAME.