SQL>; connect / as sysdba

ERROR:

ORA-01031: insufficient privileges

什么情况下可以不输入用户名/密码?

zorrol 回复于:2003-08-07 10:19:46

小弟有些总结请参考,并提宝贵意见

#############################################

#

# NAME: troubleshoot connect internal.txt

#

# DESCRIPTION:

#  connect internal

# connect / as sysdba 要口令问题:

# refer (METALINK,ORACLEDOC),

# metalink search words(connect internal)

# NOTE:

#

# modifiy (MM/DD/YY)  AUTHOR

# 05/03/03 ZORROL

#############################################

————————————————————

1。检查sqlnet.ora 文件.

sqlnet.ora 文件损坏或格式不对可以导致出现该问题。

sqlnet.ora 文件可能存放路径为

$TNS_ADMIN/sqlnet.ora

如果没有设置$TNS_ADMIN默认在$ORACLE_HOME/network/admin/sqlnet.ora

$HOME/sqlnet.ora

(1).   可以从别的机器拷贝一个文件过来,注意备份原来的sqlnet.ora。

---检查sqlnet.ora 文件内容

(2).   检查SQLNET.AUTHENTICATION_SERVICES

如果没有使用dblink.检查该行并设置

SQLNET.AUTHENTICATION_SERVICES = (BEQ,NONE)

(3).   SQLNET.CRYPTO_SEED

在unix 下不需要该参数。如果存在该行,注释掉或删掉

(4).AUTOMATIC_IPC

如果该参数为 ON,将强制使用"TWO_TASK" 连接

最好设置为OFF

AUTOMATIC_IPC = OFF

2.检查相关文件的权限配置。

找到$TNS_ADMIN/*

$ cd $TNS_ADMIN

$ chmod 644 sqlnet.ora tnsnames.ora listener.ora

$ ls -l sqlnet.ora tnsnames.ora listener.ora

-rw-r--r--   1 oracle dba        1628 Jul 12 15:25 listener.ora

-rw-r--r--   1 oracle dba         586 Jun  1 12:07 sqlnet.ora

-rw-r--r--   1 oracle dba       82274 Jul 12 15:23 tnsnames.ora

3.检查操作系统相关设置。

(1).  $ORACLE_HOME环境变量是否设置正确

% cd $ORACLE_HOME

% pwd

如果错误,请重新设置:

sh or ksh:    ----------

$ ORACLE_HOME=;

$ export ORACLE_HOME

Example:

$ ORACLE_HOME=/u01/app/oracle/product/7.3.3

$ export ORACLE_HOME

csh:     ----

% setenv ORACLE_HOME ;       Example:

% setenv ORACLE_HOME /u01/app/oracle/product/7.3.3

另外$ORACLE_HOME路径应为实际路径,不应是目录连接(ln -s)

(2)  $ORACLE_SID是否设置正确;

% echo $ORACLE_SID

(3).确信没有设置$TWO_TASK

检查 "TWO_TASK" 是否设置:

sh, ksh or on HP/UX only csh:

-----------------------------------

env |grep -i two

- or -

echo $TWO_TASK

csh:

----

setenv |grep -i two

如果有返回行比如:

TWO_TASK=

- or -

TWO_TASK=PROD

就需要取消着这些环境变量设置 :

sh or ksh:

----------

unset TWO_TASK

csh:

----

unsetenv TWO_TASK

(4) 检查oracle 文件的权限:

% cd $ORACLE_HOME/bin

% ls -l oracle

权限应为:rwsr-s--x, or 6751.

如果不是:

% chmod 6751 oracle

(5). 检查当前所连接的操作系统用户是否是"osdba" 并且已经定义在:

"$ORACLE_HOME/rdbms/lib/config.s"

or

"$ORACLE_HOME/rdbms/lib/config.c".

通常应为dba

% id     uid=1030(oracle) gid=1030(dba)

可以如果"gid" 是 "dba" , "config.s" or "config.c"

里面应该有:           /* 0x0008         15 */         .ascii  "dba\0"

如果没有添加目前的操作系统用户到dba 组,或则手工编辑更改config.c并且:%relink oracle

(6).所需要的文件系统是否正确mount

%mount

(7) 目前身份是否是"root" 并且操作系统环境变量 "USER", "USERNAME", and "LOGNAME" 没有设置成"root".

root用户是特例,除非当前组是dba 组,否则不能connect internal.

把root用户当前组改为dba组:

# newgrp dba

-----最好不要以root管理数据库;

(8).检查"/etc/group" :

是否存在重复行

% grep dba /etc/group

dba::1010:

dba::1100:

如果有,删掉没有用的。

(9).确信停掉的instance没有占用内存资源

比如:ipcs -b

T         ID       KEY        MODE    OWNER      GROUP   SEGSZ

Shared Memory:

m          0   0x50000ffe --rw-r--r-- root       root         68

m       1601   0x0eedcdb8 --rw-r----- oracle      dba    4530176

可以看到1601 被oracle 使用,删掉.

-------注意是否启动了多个instance

% ipcrm -m 1601

(10).如果同时还有ora-12705 错误检查一下环境变量:

"ORA_NLS", "ORA_NLS32", "ORA_NLS33" ,"NLS_LANG".

(11).检查 "ORACLE_HOME" and "LD_LIBRARY_PATH 环境变量:

$ LD_LIBRARY_PATH=$ORACLE_HOME/lib

$ export LD_LIBRARY_PATH

$ ORACLE_HOME=/u01/app/oracle/product/8.0.4

$ export ORACLE_HOME

(12).当前的instance 所再的磁盘是否有足够的磁盘空间

df -k

(13).用户对/etc/passwd 是否有读权限。

(14).如果使用mts 方式,确信你的连接使用dedicade server 方式。

(15).安装ORACLE所需操作系统补丁是否打全。ORACLE 是否已经补丁到最新

txfy 回复于:2003-08-07 10:25:15

最简单方法将init(sid).ora里的remote_login_passwordfile = exclusive改为remote_login_passwordfile = none重起数据库应该就可以了利用操作系统权限认证来进入sqlplus不用输用户名口令了。

airlily 回复于:2003-08-07 14:55:02

select * from v$parameter;

O7_DICTIONARY_ACCESSIBILITY的值应该是 TRUE。

二二 回复于:2003-08-07 17:50:41

Solving ORA-01031 errors

In order to start up an Oracle database using the connect internal or connect / as sysdba syntax, the currently logged in user must be in the ORA_DBA Windows group, if the operating system is Windows NT or 2000, or in the "dba" group if the operating system is Unix.

This error message frequently occurs after an initial installation of Oracle on Windows NT or 2000 as, if you've followed the Oracle installation instructions correctly, you've probably installed Oracle using the Windows userid Administrator, so this userid will have been automatically added to the ORA_DBA group, but your normal login userid won't have been.

If you are not in the appropriate group you will get the following error when you try to start Oracle:

C:\>;sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on Mon Sep 17 10:12:32 2001

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

SQL>; connect / as sysdba

ERROR:

ORA-01031: insufficient privileges

or maybe an Enter password prompt.

See also What does connect / as sysdba mean for information about other variants of this syntax which may also give Enter password prompts.

To add yourself (or someone else) to the ORA_DBA group on Windows.

Select the Windows Control Panel, then Users and Passwords

If you're not currently logged in as Administrator, or as a user in the local Administrator group on this PC/server, you will be prompted to enter the userid and password of Administrator, or someone in this group, to obtain sufficient rights to perform user administration tasks. (Hint: some organisations to do not set local administrator passwords, so leaving it blank may work. Other organisations might use the password: administrator !)

You will be presented with a panel showing currently defined users for this PC/server. Click the Advanced tab, and select Advanced User Management.

You will be presented with a panel showing a tree structure of local users and groups. Click on the Groups folder.

This displays a list of the currently defined groups. There should be an ORA_DBA group. Double-click this. Select Add member.

You will be presented with a panel of locally defined userids. If the userid you want to add to the group is defined here, just select it.

If the userid you want is not defined here, it may be a network-defined userid you need. Change the location used to select users from by selecting a new location from the pull-down menu for the "Look in" entry field. Select the network you normally log in to.

As you're currently working as the local Administrator id, you may now need to enter your own network userid and password to prove that you belong to that network and are therefore authorised to select names from it.

You will now be presented with a list of network names, which (hopefully) should contain yours. Select it.

OK everything and close all windows.

You should now be able to connect internal or connect / as sysdba when logged in normally, and so should be able to stop and start the database etc.

To add yourself (or someone else) to the "dba" group on Unix.

This is easy: just edit the /etc/passwd file to change the default group for the user to be the groupid of the "dba" group, or edit the /etc/group file to add the specified userid to the list of users under the "dba" group entry.

You will need to be root to do this.

What does connect / as sysdba mean?

connect / as sysdba is current (Oracle 8i, and later) syntax which replaces the older connect internal syntax, and has exactly the same function.

This syntax is used to connect to the Oracle database with very powerful privileges. In particular, it allows the user to stop and start the database.

When it is used, Oracle does not check the password held for the user in the database's data-dictionary but instead checks that the current operating system userid is defined in the ORA_DBA group (if the OS is Windows NT/2000) or the "dba" group (if the OS is Unix). If the user is in this group, then he is allowed to connect. If he isn't in this group, he will get a ORA-01031: insufficient privileges error message, or an Enter password prompt.

The reason the data dictionary password is not used is that Oracle needs some mechanism of checking that the user is sufficiently authorised to start the database which works even when the database is down. Being a member of this group is sufficient proof that you are authorised to stop and start the database, since only the system administrator (Administrator on Windows, root on Unix) can add users to this group.

The connect / as sysdba technique can therefore be used as a method of logging in as SYS or SYSTEM when you've forgotten both their passwords: Use connect / as sysdba to connect as SYS, (assuming that your operating system userid is in the Windows ORA_DBA or Unix dba group), then change the SYS and SYSTEM passwords.

Note that there are other variants of the connect / as sysdba syntax, which I recommend you do not use, as they have misleading syntax

The statement:

connect anything/anything as sysdba

has exactly the same effect as connect / as sysdba, ie. it logs you in as SYS with stop and start database privileges. The supplied userid and password are ignored. No password prompt is given providing the current operating system userid is in the appropriate group.)

The statement:

connect sys as sysdba

(or, indeed, connect anything as sysdba) causes an Enter password prompt to be issued (even if the operating system userid is in the appropriate group), and the password held in the data-dictionary must then be entered to complete the login. This is probably a bug: I suspect the command parser detects that there is no / in the command and therefore that no password has been supplied, before it recognises that no password is, in fact, necessary because the as sysdba syntax has been used.) If the database is up, the valid password for the user must be entered. I suspect, but haven't tested it yet, that if the database is down, then whatever is entered as the password will be rejected because Oracle will be unable to validate it.

oracle 01031 dblink,解决Ora-01031的问题完美解决办法,可惜我的失败了。。相关推荐

  1. cad2014卡顿的解决方法_cad卡顿完美解决(AutoCAD运行卡顿怎么办)

    如何解决CAD绘图界面卡顿的问题 1,电脑配置太差, 3,通常只打开对象捕捉,另外有一个捕捉打开了,光标也会出现卡顿, 2,调用他人的图档,图档太大, 块,标注,打印样式等建立的很多, 做cad经常卡 ...

  2. redis rua解决库存问题_Redis锁完美解决高并发秒杀问题

    场景:一家网上商城做商品限量秒杀. 1 单机环境下的锁 将商品的数量存到Redis中.每个用户抢购前都需要到Redis中查询商品数量(代替mysql数据库.不考虑事务),如果商品数量大于0,则证明商品 ...

  3. android 虚拟按键遮挡布局,完美解决虚拟按键遮盖底部视图的问题

    Android部分手机会有虚拟按键,而没有实体按键,例如华为系列的手机. 然而在开发过程中,有时候会涉及底部视图的开发,最终的结果却因为虚拟按键的关系,结果底部视图被虚拟按键给遮盖住了. 在这里,分为 ...

  4. axios请求跨域前端解决_完美解决axios跨域请求出错的问题

    错误信息: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Orig ...

  5. oracle-12154 dblink,oracle连接DBLINK报错:ORA-12154: TNS:could not resolve service name的解决方法(转)...

    文章出自:http://blog.csdn.net/xulei_19850322/article/details/8219023 注意:最好用命令的方式创建dblink . 配置DBLINK细节很重要 ...

  6. [Oracle- MySQL] Oracle通过dblink连接MySQL

    [Oracle -> MySQL]  Oracle通过dblink连接MySQL  业务上有这么一个需求,需要把Oracle的一些数据同步到MySQL,如果每次都是手动同步的话,实在太麻烦,因此 ...

  7. 记一次oracle通过dblink连接mysql实施

    本周由于公司一个系统的oracle数据库需要采集另一个系统mysql数据库的数据,于是对oracle通过dblink连接mysql进行了研究,测试环境是单实例oracle 10g 64位,折腾了半天搞 ...

  8. Oracle表空间文件损坏后的排查及解决

    我们在操作Oracle的时候,如果出现Oracle无法正常启动或停止,或者Oracle的导入导出命令执行错误, 通常是由于Oracle的实例下的表空间出现了问题造成的. 以下解决办法,摘自网络,适用于 ...

  9. oracle 如何边看表中字段信息_【Oracle移行到Sqlserver完美解决案】④sqluldr2+bulk 32H=3H...

    在[Oracle移行到Sqlserver完美解决案]③执行时间改善案bcp+bulk 一文中,移行实现了,但数据600多万件,占内存3G多的操作log表,移行需要32H,这个时间我们是无法接受的. 原 ...

  10. oracle中dblink怎么用,Oracle中建立了dblink怎么使用

    Oracle应用服务器OS 1.查看数据库的global_name SELECT * FROM GLOBAL_NAME; 2.查看global_name参数是true还是false show para ...

最新文章

  1. mysql 插入删除操作_MySQL——增删改操作
  2. java泛型 简书_一文带你认识Java泛型基础
  3. ie禁止html复制元素,JavaScript_禁止选中文字兼容IE、Chrome、FF等,复制代码 代码如下: $(el).attr('u - phpStudy...
  4. 趣学python3(45)--调用C库-加解密
  5. 前端技术公众号运营心得记录
  6. 高品质静物空间海报模板PSD分层素材
  7. Flutter布局锦囊---简单的应用栏
  8. java NIO入门小记
  9. 如果我是决策者,我会决策做CPU吗?
  10. 基于java的网上书店系统设计(含源文件)
  11. H3C核心交换机故障处理通用流程
  12. python圣斗士修炼(十八):访问mysql数据库
  13. 【枚举的定义;枚举变量的定义、初始化和赋值】(学习笔记16--枚举)
  14. ReleaseCapture 以及 SetCapture 函数 及其应用
  15. 数据库的IOPS计算
  16. 微信小程序自带地图_微信小程序获取当前位置并调用微信内置地图打开
  17. 虚拟机命令里面的光标不动了怎么办_Linux 中实用但很小众的 11 个炫酷终端命令...
  18. js两行代码获取ip地址
  19. 毕业设计 STM32平衡车设计与实现
  20. vgg16 清华镜像_Caffe vgg16网络结构

热门文章

  1. SAP销售订单创建与销售开票定价日期取值逻辑
  2. python数组做参数_python函数传递数组参数吗
  3. 新东方基于Hologres实时离线一体化数仓建设实践
  4. 为什么微信打开小程序很慢_微信小程序发布后安卓慢 为什么小程序打开很慢...
  5. ubuntu如何修改hostname
  6. 分享一个统计代码块耗时的小工具
  7. spdlog 日志库学习,简易封装
  8. TS复习---typeScript介绍
  9. Dubbo与Nacos的区别
  10. 【原创】MATLAB/Simulink电动助力转向EPS模型