Windows – Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name

environment-variablesoracle-11gwindows 7

I have a batch file which starts the Oracle Services

net start OracleOraDb11g_home1TNSListener
net start OracleServiceORCL
call C:\app\Edifixio\product\11.2.0\dbhome_1\BIN\emctl.bat start dbconsole

But on executing the script I am getting:

C:\windows\system32>net start OracleOraDb11g_home1TNSListener
The requested service has already been started.

More help is available by typing NET HELPMSG 2182.

C:\windows\system32>net start OracleServiceORCL
The OracleServiceORCL service is starting.........
The OracleServiceORCL service was started successfully.

C:\windows\system32>call C:\app\Edifixio\product\11.2.0\dbhome_1\BIN\emctl.bat start dbconsole
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.
Press any key to continue . . .

I am using Windows 7 64 bit with Oracle 11gR2 64 bit. Any information will be very helpful.
Thanks and Regards.

Best Answer

Having installed Oracle about 20 times today, basically until I got it all working, and having experienced this problem, here are the two tips that really helped:

  1. If you have multiple IP addresses, ensure the static address adapter is the primary, or add a Microsoft Loopback adapter with a address per the Oracle pre-installation instructions. Oracle Pre-installation Reqs

  2. Add ORACLE_HOSTNAME and a value of [computer name] to your environment variables. This was the final step that finally fixed my em install. Note you need to check that you can resolve your machine to that address by both the qualified and unqualified machine name. You may need to tweak HOSTS to do this. Installing on Computers with Multiple IP Addresses

If these two things are correct, your listener.ora and tnsnames.ora will correctly match the separate em configuration, and you should avoid the requirement to set ORACLE_UNQNAME.

Best Wishes!

Related Question