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

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
pause


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.

-
Which part are you having trouble with, setting the variable, or picking the name? –  Ignacio Vazquez-Abrams Nov 17 '11 at 7:55
@Ignacio Vazquez-Abrams I found that I have to set ORACLE_UNQNAME to some value before invocation of the line call C:\app\Edifixio\product\11.2.0\dbhome_1\BIN\emctl.bat start dbconsole. But what is the value which is to be set? –  Tapas Bose Nov 17 '11 at 8:01

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:

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!

-

To access the Oracle Enterprise Manager Console from a client browser, the dbconsole process needs to be running on the server. This process is automatically started after installation.

However, if the process is not running because of a system restart or other event, you can manually start it at the command line.

To start the dbconsole process:

• Navigate into your $ORACLE_HOME/bin directory • Run the following statement: ./emctl start dbconsole  Additionally, you can stop the process and view its status. To stop the dbconsole process: ./emctl stop dbconsole  To view the status of the dbconsole process: ./emctl status dbconsole  Now you put the URL into your browser. If you get a "page can't be displayed" error, then you go to set your ORACLE_HOME and ORACLE_SID. And check your database is up and running. - Please always quote parts you did not write yourself, and properly attribute the original source. Anything else will be considered plagiarism and is strictly not allowed here. Thank you. – slhck Jun 10 '13 at 11:23 You need to set your global SID [1]. Your SID seems to be ORCL. from below line. OracleServiceORCL  try using SET ORACLE_UNQNAME=ORCL  if it fails SET ORACLE_UNQNAME=ORCL.yourdomain.com  According to [2] "I suspect ... that this was added to handle the situation where the SID and the unique name are different." You can find db name and db_unique name with following SQL Select name,DB_UNIQUE_NAME from v$database;


References :

Thanks for reply. I name and DB_UNIQUE_NAME is ORCL and orcl respectively. I have added SET ORACLE_UNQNAME=ORCL before call C:\app\Edifixio\product\11.2.0\dbhome_1\BIN\emctl.bat start dbconsole but I am getting OC4J Configuration issue. C:\app\Edifixio\product\11.2.0\dbhome_1/oc4j/j2ee/OC4J_DBConsole_EDFX-LAPTOP-16_‌​orcl not found. –  Tapas Bose Nov 17 '11 at 9:35
Just go to \$ORACLE_HOME/bin and run:
emca -config dbcontrol db -repos recreate