zoukankan      html  css  js  c++  java
  • 在Linux环境下设置 ora-01031:insufficient privileges解决方法总结

    今天需要使用sys用户处理问题,但是报错上面ora-01031:insufficient privileges。

    在网上有很多方法,这个是自己经过测试的方法步骤。

    1:首先检查文件sqlnet.ora文件是否设置正确(文件地址就是你oracle安装的目录)

    [html] view plain copy
     
    1. # sqlnet.ora Network Configuration File: /app/oracle/product/10.2.0/network/admin/sqlnet.ora  
    2. # Generated by Oracle configuration tools.  
    3.   
    4. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME)  
    5. <span style="color:#FF0000;">SQLNET.AUTHENTICATION_SERVICES=(ALL)  
    6.   
    7. </span>  

    2:如果上面设置正确(为什么设置可以参考http://blog.csdn.net/huoyin/article/details/45544709)

    然后用ssh等连接工具访问Linux服务器这里注意了如果存在多个实例需要指定  

    登录oracle

    [java] view plain copy
     
    1. su - oracle  

    指定实例

    [java] view plain copy
     
    1. export ORACLE_SID=***  

    3:需要检查系统配置

    登录oracle

    [java] view plain copy
     
    1. sqlplus / as sysdba  

    查询

    [sql] view plain copy
     
    1. SQL> show parameter password  
    2.   
    3. NAME                         TYPE        VALUE  
    4. ------------------------------------ ----------- ------------------------------  
    5. remote_login_passwordfile            string      EXCLUSIVE  
    6. SQL>   


    2:检查有哪些用户

    [sql] view plain copy
     
    1. SQL> select * from v$pwfile_users;  
    2.   
    3. USERNAME                       SYSDB SYSOP  
    4. ------------------------------ ----- -----  
    5. SYS                    TRUE  TRUE  
    6.   
    7. SQL>   

    因为我已经操作过了现在显示是有sys的,没有设置的是空的

    [sql] view plain copy
     
    1. SQL> grant sysdba to sys;  
    2. grant sysdba to sys  
    3. *  
    4. ERROR at line 1:  
    5. ORA-01994: GRANT failed: password file missing or disabled  


    3:现在添加文件退出oracle用户

    [sql] view plain copy
     
    1. SQL> exit  
    2. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production  
    3. With the Partitioning, OLAP and Data Mining options  
    4. [oracle@dd ~]$   


    4:添加文件

    执行添加加密的建立password文件

    [java] view plain copy
     
    1. [oracle@dd ~]$orapwd file=/app/oracle/product/10.2.0/dbs/orapwprice.ora password=111111 entries=10 force=y  

    因为是linux所以文件明是orapw+实例.ora 
    window是pwd+实例.ora  

    5:重启服务,用sys登录

  • 相关阅读:
    输出1到100内前五个可以被3整除的数 while for
    Java:运用while()与do....while与for()
    break & continue
    while循环
    for循环例子
    if语句条件
    上位机开发二----第一个程序hallo world
    c语言获取数组长度的三种方法
    halcon标定后畸变校正与测量
    海康相机SDK联合c++标定
  • 原文地址:https://www.cnblogs.com/guzhanyu/p/7975897.html
Copyright © 2011-2022 走看看