Environment variable ORACLE_UNQNAME not defined.

liztac 2013-06-28 10:23:04
大侠好,我刚开始学oracle看two day dba时遇到下列一连串的错误,还希望指教一下思路,如何解决

emctl start dbconsole
报错:
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to da
tabase unique name.



网上的解决方法:
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.解决办法如下~

C:\>sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on 星期二 11月 1 10:3

Copyright (c) 1982, 2010, Oracle. All rights reserved.

SQL> conn sys/admin as sysdba
已连接。
SQL> alter user dbsnmp identified by admin; /// 此处将DBSNMP的密码设置为admin

用户已更改。

SQL> drop role MGMT_USER;

角色已删除。

SQL> drop user MGMT_VIEW cascade;

用户已删除。

SQL> drop user sysman cascade;

用户已删除。

SQL> drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;

同义词已删除。

SQL> drop public synonym SETEMVIEWUSERCONTEXT;

同义词已删除。

SQL> $emca -config dbcontrol db -repos create

EMCA 开始于 2011-11-1 11:15:57
EM Configuration Assistant, 11.2.0.0.2 正式版
版权所有 (c) 2003, 2005, Oracle。保留所有权利。

输入以下信息:
数据库 SID: ODSEXDB
已为数据库 ODSEXDB 配置了 Database Control
您已选择配置 Database Control, 以便管理数据库 ODSEXDB
此操作将移去现有配置和默认设置, 并重新执行配置
是否继续? [是(Y)/否(N)]: y
监听程序 ORACLE_HOME [ D:\app\Administrator\product\11.2.0\dbhome_1 ]: 1521
SYS 用户的口令:
DBSNMP 用户的口令:
SYSMAN 用户的口令:
通知的电子邮件地址 (可选):
通知的发件 (SMTP) 服务器 (可选):
-----------------------------------------------------------------

已指定以下设置

数据库 ORACLE_HOME ................ D:\app\Administrator\product\11.2.0\dbhome_1

本地主机名 ................ 76481-640
监听程序 ORACLE_HOME ................ 1521
监听程序端口号 ................ 1521
数据库 SID ................ ODSEXDB
通知的电子邮件地址 ...............
通知的发件 (SMTP) 服务器 ...............

-----------------------------------------------------------------
是否继续? [是(Y)/否(N)]: y
2011-11-1 13:13:06 oracle.sysman.emcp.EMConfig perform
信息: 正在将此操作记录到 D:\app\Administrator\cfgtoollogs\emca\ODSEXDB\emca_2011_11_01_13_12_31.log

2011-11-1 13:13:08 oracle.sysman.emcp.EMReposConfig createRepository
信息: 正在创建 EM 资料档案库 (此操作可能需要一段时间)...
2011-11-1 13:28:25 oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功创建资料档案库
2011-11-1 13:28:42 oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
信息: 正在将配置数据上载到 EM 资料档案库 (此操作可能需要一段时间)...
2011-11-1 13:31:38 oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功上载配置数据
2011-11-1 13:31:45 oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
信息: 软件库已配置成功。
2011-11-1 13:31:45 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
信息: 正在部署预配档案...
2011-11-1 13:31:56 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
信息: 预配档案部署成功。
2011-11-1 13:31:56 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
信息: 正在保护 Database Control (此操作可能需要一段时间)...
2011-11-1 13:32:10 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
信息: 已成功保护 Database Control。
2011-11-1 13:32:10 oracle.sysman.emcp.util.DBControlUtil startOMS
信息: 正在启动 Database Control (此操作可能需要一段时间)...
2011-11-1 13:35:36 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: 已成功启动 Database Control
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.
解决办法~~
2011-11-1 13:35:37 oracle.sysman.emcp.EMDBPostConfig performConfiguration
信息: >>>>>>>>>>> Database Control URL 为 https://76481-640:5500/em <<<<<<<<<<<
2011-11-1 13:35:51 oracle.sysman.emcp.EMDBPostConfig invoke
警告:
************************ WARNING ************************

管理资料档案库已置于安全模式下, 在此模式下将对 Enterprise Manager 数据进行加密。加密密钥已放置在文件
D:/app/Administrator/product/11.2.0/dbhome_1/76481-640_ODSEXDB/sysman/config/emkey.ora 中。请务必备
份此文件, 因为如果此文件丢失, 则加密数据将不可用。

***********************************************************
已成功完成 Enterprise Manager 的配置
EMCA 结束于 2011-11-1 13:35:51



尝试后出现错误:

-----------------------------------------------------------------
是否继续? [是(Y)/否(N)]: y
2013-6-28 20:15:10 oracle.sysman.emcp.EMConfig perform
信息: 正在将此操作记录到 E:\app\Administrator\cfgtoollogs\emca\database_TIM\emca
_2013_06_28_20_13_46.log。
2013-6-28 20:15:23 oracle.sysman.emcp.util.DBControlUtil stopOMS
信息: 正在停止 Database Control (此操作可能需要一段时间)...
2013-6-28 20:15:27 oracle.sysman.emcp.EMReposConfig createRepository
信息: 正在创建 EM 资料档案库 (此操作可能需要一段时间)...
2013-6-28 20:18:06 oracle.sysman.emcp.EMReposConfig invoke
严重: 创建资料档案库时出错
2013-6-28 20:18:06 oracle.sysman.emcp.EMReposConfig invoke
信息: 有关详细资料, 请参阅 E:\app\Administrator\cfgtoollogs\emca\database_TIM\em
ca_repos_create_<日期>.log 中的日志文件。
2013-6-28 20:18:06 oracle.sysman.emcp.EMConfig perform
严重: 创建资料档案库时出错
有关详细资料, 请参阅 E:\app\Administrator\cfgtoollogs\emca\database_TIM\emca_201
3_06_28_20_13_46.log 中的日志文件。
无法完成配置。 有关详细资料, 请参阅 E:\app\Administrator\cfgtoollogs\emca\databa
se_TIM\emca_2013_06_28_20_13_46.log 中的日志文件。



E:\app\Administrator\cfgtoollogs\emca\database_TIM\emca_2013_06_28_20_13_46.log 中的日志文件连接。http://blog.sina.com.cn/s/blog_c2e4ec450101ka89.html


网上的解决方法:
在listener.ora中更改为:
(ADDRESS =(PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
在cmd中设置环境变量(注意:copydb为oracle实例的名称)
set ORACLE_HOSTNAME=localhost set oracle_sid=copydb set ORACLE_UNQNAME=copydb 重新启动listenerlsnrctl start在sqlplus中注册数据库服务alter system register;查看em状态:emctl status dbconsole若未打开,则启动em:emctl start dbconsole访问https://127.0.0.1:1158/em即可

依然报错:
emctl status dbconsole


Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to da
tabase unique name.





...全文
9579 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
赫赫哒哒 2015-06-08
  • 打赏
  • 举报
回复
刚刚遇到跟你一样的问题,我跑到oracle的安装目录app下的目录,逐个文件夹搜索,把名字为你的实例名的文件夹全部删除,然后点击安装就可以继续安装了
sean908 2014-12-11
  • 打赏
  • 举报
回复
先设置unqname: set ORACLE_UNQNAME=实例名 重新配置emctl: emca -config dbcontrol db 之后就可以用了, 我的问题是这么解决的
cspigpig 2014-01-02
  • 打赏
  • 举报
回复
解决方案: http://blog.mclaughlinsoftware.com/2012/08/23/whats-oracle_unqname/
linwaterbin 2013-06-29
  • 打赏
  • 举报
回复
你的db_name是 ODSEXDB 还是 copydb? windows: set ORACLE_SID=db_name 然后再 emctl start dbconsole
liztac 2013-06-29
  • 打赏
  • 举报
回复
谢谢你的指导!1) C:\Documents and Settings\Administrator>set ORACLE_SID=db_name 是输入错了,不知道这个语句有什么作用就一起复制过来了,我记得我的db_name是databaseTIM,但不知是不是记错了,为什么和下面的value值不一样,sqlplus和sql我还不懂,只是刚安装了oracle准备学习,就遇到了帖子上的错误。

SQL*Plus: Release 11.2.0.1.0 Production on 星期六 6月 29 22:19:14 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter db_name

NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
db_name string
database
SQL>





linwaterbin 2013-06-29
  • 打赏
  • 举报
回复
1) C:\Documents and Settings\Administrator>set ORACLE_SID=db_name 不明白你为什么要设置这一步?而且、也没有这样的写法! 2)看一下你的db_name是多少:
sys@ORCL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      orcl
3)到windows服务管理那边把dbconsole的这个服务确认是否打开 4)在浏览器里面输入 https://127.0.0.1:1158/em
liztac 2013-06-29
  • 打赏
  • 举报
回复
我的db_name是databaseTIM ODSEXDB,和copydb分别是我在网上找的两个解决方法的db_name,下面是我执行后的结果 Microsoft Windows XP [版本 5.1.2600] (C) 版权所有 1985-2001 Microsoft Corp. C:\Documents and Settings\Administrator>set ORACLE_SID=db_name C:\Documents and Settings\Administrator>set ORACLE_SID=databaseTIM C:\Documents and Settings\Administrator>emctl start dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. https://XP-201306261933:5500/em/console/aboutApplication Starting Oracle Enterprise Manager 11g Database Control ...服务名无效。 请键入 NET HELPMSG 2185 以获得更多的帮助。 C:\Documents and Settings\Administrator>NET HELPMSG 2185 服务名无效。 解释 试图启动系统中没有配置的服务。 操作 请检查服务名称是否正确,或者用服务器管理器中的“服务”选项来检测配置信息。 C:\Documents and Settings\Administrator>
New features SQL Window enhancements The result set toolbar has a new Compare records button to easily compare records in the result set: Other enhancements include: A Refresh result set button has been added to refresh (re-execute) the result set of the currently selected result tab page Column totals (sum, count, min, max, avg) are now persistent after re-executing a query Added Excel exporter (both xls and xlsx support) Support has been added for Oracle12c extended strings (> 4000 bytes) The align button has a new Hide editor option to show only the result set The align button has a new Window width option to resize the SQL Window width to match the result set width You can now use an AltRowColor=[RRGGBB | name] directive in a comment section of the SQL Window to control the alternate row color You can now use a Records=[all|page|] directive in a comment section of the SQL Window to control the number of initially fetched records You can now use a Totals=[mode:column] directive in a comment section of the SQL Window to display column totals Test Window enhancement New debugger button: Run to cursor line DBMS Output tab page now shows an indicator when output is available Variables can now be sorted by name, type or value Breakpoints form now has a Go to menu item (also double-click). When selected you will be taken to the source location in a Program Window. Program Window enhancements Code Contents sorting mode is remembered Support for NonEditionable program units Plan Window enhancements On Oracle11g and later you can view the execution plan in HTML, Text and XML format The Copy function now includes the headers Large number values are now formatted with digit groups Table Definition Editor enhancements Support added for identity columns (Oracle 12c) Support added for "default on null" columns (Oracle 12c) Support added for domain indexes Support added for Logging property of indexes Support added for Validated property of constraints Changing a constraint name will now lead to an "alter table rename constraint" command Changing an index name will now lead to an "alter index rename" command Editor enhancements Column names are highlighted when typing values for an insert or update statement Selection > Uppercase/Lowercase no longer affects quoted text Go to Bookmark now positions bookmark in the centre of the editor Code Assistant enhancements The Code Assistant now allows you to select multiple items for column lists and parameter lists Substitution variable enhancements New option "lines=" controls number of input lines on the form New option "editor=plain/sql/xml" adds a button that invokes a text editor with the given syntax highlighting New option "lowercase=yes" converts input to lowercase Template enhancements Templates now use the same substitution variable syntax as the SQL Window and Report Window. This adds the following features to the template functionality: Hints Typed variables Hidden variables Required option Uppercase option Lowercase option Descriptive lists Multi-select lists Variable references in queries The old syntax is still supported for backward compatibility. Recall Statement enhancements You can now select multiple statements The complete statement text can now be expanded/collapsed Semi-colon added when recalling a single SQL statement Recall directory preference now accepts environment variables Connection enhancements For each connection you can now define an initialization script that will be executed for each database session that is created for the connection Test Manager enhancements Notes tab page added Added support for LIKE 'VALUE' for output values Added support for IN (VALUE_LIST) for output values Disabled test items are now displayed grayed out in the list Table Export/Import enhancements User selector added, allowing you to export tables owned by another user. Added support for Oracle12c extended strings (> 4000 bytes) Added Statistics option for the Oracle Export format When exporting in Oracle Export format without rows, statistics will implicitly be excluded Session Window enhancements Support added for HTML text. Click on the cell button of the text to view its contents in an HTML Window. SQL Monitor detail tab page added (Oracle 11.2 and later) Queries in the can now be database version specific Object Browser enhancements The Object Browser has a new filter field where you can quickly enter filter expressions to limit the browser contents. You can for example enter DEPT% to show only objects that start with DEPT. You can additionally filter on the source text (for PL/SQL objects), status (valid/invalid), creation date and modification date. The filter expression can be entered or modified directly in the filter field above the Object Browser, or you can click on the filter field button to invoke the filter options form. The form has an option to recall the most recently used filters. The example above filters for Valid objects that have the word DeptRecord in the PL/SQL source. Other enhancements include: Indexes and constraints can now be renamed Triggers can now be created in the context of a table or view Folders added for Primary, Unique and Foreign key constraints for views Search Bar enhancements A new Search in files option allows you to search on the file system. Results are displayed in the Search List and will be opened in the IDE when clicked. Clicking on the arrow button next to the Search in files button will open the Search file dialog: Here you can either select one or more locations from the File Browser, select one or more previously defined custom selections, or enter the file selection directly. Window List enhancements Transaction indicator added for applicable window types Short Text in Window list for database objects shortened Windows are now always displayed in the same order as the Window menu Ctrl-Tab and Ctrl-Shift-Tab now always cycle through the windows in the Window List order Project enhancements Project folder history preference. When enabled the folder history when opening and saving files is project specific. When disabled, the general history will be used. Project file browser preference. When enabled the project has its own File Browser definitions so that you can easily find project specific files. When disabled, the general File Browser definitions will be used. Preference enhancements A new Export/Import function allows you to export specific preference sections to a file, and to import them on another PC. The following preferences options have been added: Files/Format/Encoding: Save with BOM (Unicode Byte Order Mark) User Interface/Options: Maximum recent files User Interface/Code Assistant: Align parameter values\ User Interface/Code Assistant: Maximum items on one line User Interface/Appearance: Connection List Sorting (Last used, Database, Username, Display name) Oracle/Logon History: Delete all items button added Tools/Recall Statement: Directory name now supports environment variables General IDE enhancements Full screen mode will now show minimized docking tools so that they can still be accessed Connection popup menu item "New Instance" added to open a new PL/SQL Developer instance for the selected connection When the read-only status of a file changes this will be propagated to a window associated with that file The logon form now has shortcuts for all fields, is sizeable to show long database names in the selection list For multi-monitor configurations the form positions will now be stored and restored per monitor Crash recovery and desktop files now saved in the user's Application Data directory instead of the Temp directory Command-line parameter NoLoadDesktop added to prevent loading layout on startup Command-line parameter InstanceName added to identify different instances for storing form positions Other enhancements Compare User Objects, Export User Objects and Compare Table Data now allow you to select a user after startup or connection change Compile Invalid Objects no longer implicitly refreshes the object list when the main connection is changed Copy function added to the Search List popup menu Refresh function added to the File Browser popup menu

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧