ora-12560 :TNS: protocol adapter error after installing ODP.NET - oracle

I have installed Oracle Database 11.2.0.1 Win64 and also Client 11.2.0.1 Win64 in my windows 7 Ultimate and I was able to access Oracle database using Sql*plus
using sqlplus / as sysdba. After that I installed ODP.NET ODTwithODAC1120320_32bit to work with Oracle using C# in Visual Studio 2010. When i tried to add connection to Oracle database using ODP it pops out ora-12560 :TNS: protocol adapter error and even during logging to Oracle using SqlPlus / as sysdba.
I have read several articles that say stopped service will cause but mine is running.
What could be the problem???

The main problem that I faced Connecting to Oracle 11g using Server explorer in VS 2010 was not version compatibility of ODP with Oracle database but it's architecture. After such errors I uninstalled Oracle Database 11g using deinstall.bat file then cleaned Registry Key ../Software/Oracle and cleaned up temp files, did a system restart. Then installed Oracle 11g Database x32 Database server, ODP.NET x32, checked Env vars.
First success was that I was able to connect to DB using SQL*Plus. After that started VS 2010 and tried to connect ..... Connected! wow has worked in VS IDE. I was so happy :)
I remember how many times I reinstalled Oracle(cleaning,configuring checking listeners, restarting services). Then my hard work really paid off.
here is a screenshot

Generally, I advise to install Oracle server under different credentials than what you usually use. The Oracle server (under Windows) makes use of a few environment variables; and the same is the case with ODP.NET as well. And while you can't easily switch between different sets of env variables in your user profile, you can assign different env var values to a (different) user under which the Oracle server is installed and/or being run.
If you already have your Oracle server installed (which, I suspect, is your case), then try:
Create a new user in your Windows, make him sufficiently privileged. ("Admin" rights will do fine. :-))
Log in as the new user.
Set up ORACLE_HOME, ORACLE_SID, NLS_LANGUAGE and PATH environment variables for that particular user (not globally for the whole Windows!) to point to your Oracle server.
Log in as the original user.
Start the Services management console ("services.msc").
Change "Log On" credentials for the OracleServiceSOMETHING and Oracle SOMETHING VSS Writer Service and OracleJobSchedulerSOMETHING and OracleOraDb11g_home1TNSListener to that new user+password you just created. (... where SOMETHING is usually the name of your instance)
Stop all Oracle services.
Set up ORACLE_HOME and PATH env var to point to your ODP.NET root and root\bin folders respectively; set up the ORACLE_SID and NLS_LANGUAGE vars to whatever values you need.
Start all Oracle services. (After this moment they should be running under their own credentials.)
Let's pray that it works.
I myself would have to improvise, too, if this scenario didn't work. But so far I have successfully run two Oracle servers and one Oracle client on the same machine this way with no problems, so I hope it works for you too. If it does not, then there's still the option of reinstalling your Oracle server completely.
Don't forget about backing up your database ... just in case something horrible happens.

Related

Directory Location is not writable

I had installed oracle database 11g XE then started to create database by using DBCA but at step 6 (Database configuration assistant) of 12 it is saying "Directory location D:\app\user\oradata\test is not writable.
I tried so many times but its always the same.How can I solve this problem?
This dialog is appearing
You can stop doing what you are doing as it won't work.
11g Express Edition (XE) database is installed during (initial) installation process. As XE allows only one instance, you can't create another database anyway so - stop trying.
If you want to practice such things (which is perfectly OK), switch to e.g. Standard Edition. It is dowloadable (for free, for education purposes) from the Oracle Technology Network.

Toad for Oracle, No valid Oracle clients found. You need at least one 64-bit client properly configured

I get this error when I launch Toad for Oracle.
No valid Oracle clients found. You need at least one 64-bit client properly configured.
This has been happening since I upgraded the Oracle Client to Oracle 12c from 11g.
Here is what I have done so far to try to resolve it based on internet research:
I checked the path variable, it's currently set to C:\xyz\Oracle\ora12.1\client_2\bin, and there is an Oracle installation at this path.
I checked the TNS_ADMIN variable, it is currently set to C:\xyz\Oracle\ora12.1\client_2\network\admin. This also appears to be valid and correct, there is a tnsnames.ora file under this path.
SQL Plus works without issues, and Oracle SQL Developer also works without issues.
Is there anything else I can try to resolve this issue? Unfortunately, uninstalling and reinstalling Toad is not an option at this point as I do not have access to a new setup.
The issue is due to not having the Oracle Database installed on your computer.
You can download the database here: https://www.oracle.com/database/technologies/appdev/xe.html
Once the zip file is downloaded and extracted, run setup.exe. Once that is complete, the Oracle DB will be installed on your machine and the error will no longer appear.
With TOAD you need to have oracle client installed on your computer and you must configure the related TNSNAMES.ORA to connect to the server.
If you use SQLDeveloper you can do without oracle client installation.

Oracle Database 12c Installed, but no SQL developer showed up

I've been trying to use Oracle 12c and SQL Developer on a Virtual Machine running Oracle Linux for weeks now but the process gets worse and worse and this is the fifth time I do the same installation again.
I used oracle-rdbms-server-12cR1-preinstall for the preinstallation process, I also added the groups DBA, OPER, BACKUPDBA, DGDBA, KMDBA, and RACDBA.
I then used the./runInstaller file that comes with the Database and went through the installation process without any issues. But when the installation finished and I closed the installer, there is no trace of SQL Developer anywhere.
I'm not even sure if the Oracle Database was actually installed correctly, I've been running this command to see if it returns me anything in order to check if the database is actually installed but I don't know if i'm correct.
Don't give up. You can do it!
The daunting part of Oracle Database is that you are installing the exact same binaries for your learning environment as the largest bank on this planet has installed in their production environment! Oracle Database is a very sophisticated RDBMS and it takes years to learn it!
Oracle Database and SQL Developer
Oracle Database and SQL Developer are two separate products. You can download both from OTN and install them separately.
Database creation
Did you create a database (datafiles) while installing the binaries? There is a checkbox in the installer for that. You can create a database using the tool dbca (Database Creation Assistant) in the $ORACLE_HOME/bin folder.
Instance not running.
pmon is a vital process for the instance (processes + memory) which indicates it hasn't started. Check /etc/oratab if there is a database added to the file. If yes, fire up!
# set the environment
$. oraenv
ORCLDB
# login as sys and start the database
$sqlplus / as sysdba
SQL>startup
Best of luck!
Bjarte

Cognos 8.3 failing to connect to data source. Why?

I have installed Cognos BI 8.3 on my machine, which has a Windows 7 OS 64-bit. In IBM's supported environment list for Cognos 8.3, Windows 7 is not listed. On top of that, it says the product will only integrate with 32-bit 3rd party libraries. So, you can already see that I'm already starting on a bad foot. But anyways, this is the machine I have and that is the software I got, so I decided to see if they would work together..
I installed Oracle 10g Express database also in my machine and Apache 2.2 server. Up to there no problems.
Before moving further, I copied ojdbc14.jar to cognos/.../webapps/p2pd/WEB-INF/lib and added the Oracle database in Cognos Configuration. Tested, passed.
With the database started, the Apache server started, and Cognos started, I was successfully able to start Cognos Connection on the computer. So, it looks like the OS is not an issue.
(You can see everything I did by following the steps on this site, which since two days ago seems to be down but I'm thinking will eventually come back up)
Then I decided to try the samples, so I tried to create a data source connection from Cognos to the Oracle database. So, in the admin config console (i.e. Administer Cognos Contents > Configuration), I decided to create a new Oracle data source. I put the credentials, but BAM.. testing fails.
Fail Message:
QE-DEF-0285 The logon failed.
QE-DEF-0323 The DSN(ODBC)/ServiceName is invalid. Either the DSN is missing or the host is inaccessible.
RQP-DEF-0068 Unable to connect to at least one database during a multi-database attach to 1 database(s) in:
testDateSourceConnection
UDA-SQL-0031 Unable to access the "testDataSourceConnection" database.
UDA-SQL-0532 Data Source is not accessible: "XE".
ORA-12154: TNS:could not resolve the connect identifier specified
RSV-SRV-0042 Trace back:
...
From what I have researched, it could be a number of things, but nothing seems to work. Here is what I tried:
Adding ODBC driver. Added the Oracle XE driver, even making sure it was done in the 32-bit ODBC manager (i.e. Windows\SysWOW64\odbcad32.exe). That didn't work.
Added ORACLE_HOME, LD_LIBRARY_PATH, and TNS_ADMIN to my environment variables.
tnsping'ed the XE database and it the ping returned ok.
There are no tnsnames.ora duplicates in the computer.
I tried and I am able to connect to the database via sqlplus. Did I mention that Cognos Config database test also passed?
Installed Oracle XE client. But didn't do much with it because the Oracle server is installed in the computer and also has a client component.
Has anyone come across this problem? I haven't been able to diagnose the problem or make even the slight progress for days. If you would like me to provide more information on any of the solutions I tried, please do ask. If you have a potential solution or, even better, if you have been able to solve this problem before, please let me know how!
Thanks!
One thing to keep in mind : certain portions of Cognos BI are implemented via Java and other portions are implemented via native C++ processes (the BI Bus processes)
Cognos connects to the content store database from the Java process using JDBC.
The BI Bus processes will connect to Oracle using a native oracle client.
So based on your description, I'd say that the problem area is in the native oracle client configuration (or the Cognos service's perspective of it).
You mentioned adding the ORACLE_HOME, LD_LIBRARY_PATH, and TNS_ADMIN environment variables in windows, and the fact that Oracle Utilities like SQLPlus and TNSPing are working for you.
When you added the environment variables, did you add them to the SYSTEM area for environment variables or the User area...?
If you're running Cognos as a service, its going to be a child process of SERVICES.EXE, which is run as system (this process is also not restarted unless you reboot the machine).
I'd try this :
make sure the above environment variables are defined for the SYSTEM user (in the system area, not the user area)
once you've done this, reboot the machine
See if you can create the database connection now.
If that doesn't work, I'd suggest doing a "run as" of SQLPlus or TNSPING as the SYSTEM user (and see if that works).
In order to use oracle as data source, you must install 32 bit client.
64 bit client will not work.
So if you installed oracle express 64 bit, and you don't want to uninstall it,
you can just install additional 32 bit client, and make sure to set it as your default home.

Effects of changing NLS_LANG setting in the registry for Oracle Client

We are in the process of moving from the .NET Microsoft oracle driver to the ODP.NET driver.
One of the problems we have had is this error:
ORA-12705: Cannot access NLS data files or invalid environment specified
We were able to stop the error by modifying the registry and changing the setting (see this question)
In our case we changed
HKEY_LOCAL_MACHINE - SOFTWARE - ORACLE - NLS_LANG
which was set to NA
to be the same as
HKEY_LOCAL_MACHINE - SOFTWARE - ORACLE - HOME0 - NLS_LANG
which was set correctly
My question is why would there be different NLS_LANG settings in the registry, and might there be any knock on effects of changing this value?
Update:
I've just found in the Oracle NLS FAQ the following
For Oracle version 7:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
For Oracle Database versions 8, 8i and
9i:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEx\
where "x" is the unique number
identifying the Oracle home.
HOME0 is the first installation
For Oracle Database 10g:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_<oracle_home_name>
There you have an entry with name
NLS_LANG
OK, so there are different registry settings for different versions...
Note:
Some people are confused by finding a
NLS_LANG set to "NA" in
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
when no version 7 was installed. This
is used for backwards compatibility,
and can be ignored.
I have Oracle 9i, so now I'm even more confused - why is the ODP.NET dll looking at the Oracle 7 registry setting?
I had a similar problem with the;
ORA-12705: Cannot access NLS data files or invalid environment specified
The ODP.NET dll's or instant client were reading the registry;
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\NLS_LANG=NA
The value NA caused the error.
This was because I already had a client installation but I wanted to use the oracle instant client via network drive for the a VB.NET app with ODP.NET.
My simple fix in my vb.net solution was for example to adjust the environment for the application via:
Environment.SetEnvironmentVariable("NLS_LANG",
"AMERICAN_AMERICA.WE8MSWIN1252",
EnvironmentVariableTarget.Process)
nb. The Oracle "NLS FAQ" link is no longer valid (2012)
PER Oracle Notes on the 11g ODP release, the following can cause this error:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\NLS_LANG=NA <--- This NA does in fact cause this error if set to NA.
You can try DELETING the key if not needed or setting it to a valid NLS_LANG setting for your locale.
For us we set it to AMERICAN_AMERICA.WE8MSWIN1252.
In our case we did not want to make any potentially breaking changes to the Oracle registry because we were installing our web service on a production Oracle 9i server.
The solution was simply to prevent ODAC from being able to see any ORACLE registry keys by denying all access to that key for the user ID our web service was running as.
Start -> Run... regedit (as an administrator)
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
Right click on the ORACLE key -> Permissions...
Click the Add... button.
Add the web service user name configured in your web service's application pool identity (e.g. IUSR_MyWebService); this is the user name that appears against your w3wp.exe process in Task Manager.
Press OK.
For the new user permissions, check "Deny" against the Full Control permission and press OK.
This worked just fine and as a bonus we have ensured that our application is isolated from any future changes to the ORACLE registry keys.
Tip: you can prove to yourself that the user in question has no access to the keys in question by closing any running instances of the Registry Editor, start a CMD prompt as that user (using Run As...) and then launching regedit from the command prompt.
the Oracle Client (ORACLE_HOME\bin\ora*.dll) is looking for a file named "oracle.key" in the same directory. This file contains the name of the registry key which belongs to this Oracle client installation. (e.g. "Software\ORACLE\HOME3")
hth
Andreas
This was all resolved in the end by installing the ODAC 11 client components (downloaded from the Oracle website). I think the system was getting confused because we had copied the ODAC dlls across rather than fully installing the client. ODP.NET is expecting an Oracle 11 client and didn't know where to find the Oracle Home.
NB if you are installing the ODAC components using xCopy deployment then do not install them to an existing Oracle Home directory (eg c:\oracle\ora92 for 9i client). This causes a 'Provider is not compatible with the version of Oracle Client’ error.

Resources