如何解决ORA-01031:Windows安装上权限不足错误?


12

我在Windows 2008 R2 Server上安装了Oracle 11G。我还使用单独的安装介质安装了Oracle Client Libraries。客户端安装后,当我尝试使用以下方法登录数据库时:

C:\>sqlplus / as sysdba

我收到以下错误:

ORA-01031:权限不足

这在客户端安装之前有效。我的帐户在ORA_DBA群组中。我的帐户也位于管理员组中。ORACLE_SID我的环境变量列表中没有设置。一定要吗?这在客户端安装之前有效,当时我也没有该变量。

UAC处于最低级别,我始终cmd以管理员身份运行。

sqlnet.ora在文件夹中有一个像这样的文件:

C:\app\myaccount\product\11.2.0\dbhome_1\NETWORK\ADMIN

sqlnet.ora

# sqlnet.ora Network Configuration File: C:\app\myaccount\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to 
# install "Software Only", this file wont exist and without the native 
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

tnsnames.ora

# tnsnames.ora Network Configuration File: C:\app\myaccount\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.mydb.com)
    )
  )

listener.ora

# listener.ora Network Configuration File: C:\app\myaccount\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\app\myaccount\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\myaccount\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = C:\app\myaccount

从Windows注册表(使用regedit),从路径中,Computer > HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > ORACLE我可以找到两个键:

KEY_OraClient11g_home1
KEY_OraDb11g_home1

在这些键下,我可以找到ORACLE_HOME变量。因此,似乎也生成了客户端安装,ORACLE_HOME因此我现在有两个ORACLE_HOME。我不知道这是否与这个问题有关?

如何在Windows计算机上解决此错误?

Answers:


7

问题在于,Oracle客户端安装在安装Oracle Server之前在系统PATH中(实际上,您甚至提到它在安装客户端之前就可以使用)。

进行如下:

  1. 删除Oracle Client,因为这只会使您感到困惑。使用卸载选项,但随后检查目录和Oracle Client注册表项是否消失,并在需要时手动删除。

    (可以通过将Oracle客户端主目录放置在服务器主目录之后的路径中来使其工作,但是仅进行一次安装要简单得多。无论如何,Oracle服务器安装中已经包含了一个完整的Oracle客户端)。

  2. 确保到服务器主目录的路径在您的PATH中。而且,没有其他Oracle主目录可言。

  3. 确保您的帐户在ORA_DBA组中。请仔细检查,尤其是在使用域的情况下。

  4. 如果所有其他方法均失败,则可以SQLNET.AUTHENTICATION_SERVICES=(NTS)从sqlnet.ora中删除,因为这将迫使您使用密码身份验证。


帮助我将OracleXE文件箱放在PATH中的客户端文件箱之前
mmey,2015年

我的问题是SQLNET.AUTHENTICATION_SERVICES =(NONE)而不是NTS
jcho360

0

我的笔记本电脑上同时安装了10g和11g,以及最近安装的OBIEE客户端。我曾经能够以sysdb身份登录到11g实例,但是今天早上得到了以下信息:

SQL> conn / as sysdba
ERROR:
ORA-01031: insufficient privileges

我通过执行以下操作解决了该问题:

  1. 启动数据库和监听器;
  2. 确保tnsname通过tnsping orcl; 然后
  3. set ORACLE_SID=orcl
  4. sqlplus sys/"passwd"@orcl as sysdba

希望这可以帮助。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.