先看有没有sqlnet.ora

[oracle@localhost ~]$ cd $ORACLE_HOME
[oracle@localhost dbhome_1]$ cd network
[oracle@localhost network]$ cd admin
[oracle@localhost admin]$ ls
listener.ora  samples  shrept.lst
[oracle@localhost admin]$

手动创建一个sqlnet.ora文件

[oracle@localhost admin]$ touch sqlnet.ora
[oracle@localhost admin]$ vim sqlnet.ora
[oracle@localhost admin]$ cat sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES=(none);
[oracle@localhost admin]$

试验登陆情况:

[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:26:25 2014

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

ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name:

*********************************

查看口令文件情况:

[oracle@localhost dbs]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
[oracle@localhost dbs]$ ls
hc_orcl.dat  init.ora  initorcl.ora  lkORCL  orapworcl  spfileorcl.ora
[oracle@localhost dbs]$

现在执行口令文件处理:

用老的口令文件改口令不被允许:

[oracle@localhost dbs]$ orapwd file=orapworcl password=gaojian

OPW-00005: File with same name exists - please delete or renam

只好再作一个新的:

[oracle@localhost dbs]$ orapwd file=orapwgaojian password=gaojian
[oracle@localhost dbs]$ ls
hc_orcl.dat  initorcl.ora  orapwgaojian  spfileorcl.ora
init.ora     lkORCL        orapworcl
[oracle@localhost dbs]$

用刚刚作好的口令,还是不行(因为它和oracle中的sys口令不一致,是我随便设的,所以不行,其实登陆到哪个实例,就会用哪个口令文件--orapw<SID>):

[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:32:23 2014

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

ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name: sys as sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name: sys
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@localhost admin]$

*******************************

考虑删除orapworcl (这个操作实际上有一定的危险性):

[oracle@localhost dbs]$ rm orapworcl
[oracle@localhost dbs]$

一样也是登陆不进去:

[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:34:24 2014

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

ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name: sys as sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name: sys
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@localhost admin]$

*******************************

把sqlnet.ora中的 SQLNET.AUTHENTICATION_SERVICES=(none); 注释掉,再试验:

[oracle@localhost admin]$ cat sqlnet.ora
#SQLNET.AUTHENTICATION_SERVICES=(none);
[oracle@localhost admin]$

[oracle@localhost dbs]$ strings orapwgaojian
]\[Z
ORACLE Remote Password file
INTERNAL
FE406C76B620912C
861BAF16E111B672
[oracle@localhost dbs]$

登陆到数据库中,来更改口令:

[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:44:08 2014

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

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

SQL> alter user sys identified by oracle;

User altered.

SQL>exit

[oracle@localhost dbs]$ strings orapwgaojian
]\[Z
ORACLE Remote Password file
INTERNAL
FE406C76B620912C
861BAF16E111B672
[oracle@localhost dbs]$

口令文件似乎无变化。

还是登陆不进去:

[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:45:41 2014

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

ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name: sys as sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name:

*******************************

看来还得用orapw<SID>的文件来对应。

[oracle@localhost dbs]$ orapwd file=orapworcl

Enter password for SYS:
[oracle@localhost dbs]$
输入的口令是刚才在数据库中设置的口令。

然后,再登陆看看:

此时,可以登陆成功了:

[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:47:58 2014

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

ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name: sys as sysdba
Enter password:

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

SQL>

Oracle的sqlnet.ora与password文件试验的更多相关文章

  1. Oracle 使用sqlnet.ora/trigger限制/允许某IP或IP段访问指定用户

    Oracle 使用sqlnet.ora/trigger限制/允许某IP或IP段访问指定用户 学习了:http://blog.itpub.net/28602568/viewspace-2092858/ ...

  2. [转帖]Oracle 使用sqlnet.ora/trigger限制/允许某IP或IP段访问指定用户

    Oracle 使用sqlnet.ora/trigger限制/允许某IP或IP段访问指定用户 原创 Oracle 作者:maohaiqing0304 时间:2016-05-03 17:05:46  17 ...

  3. Oracle的sqlnet.ora文件配置

    DBA对这个文件一定不会陌生,大家了解最多的也一定是sqlnet.ora用来决定oracle怎么解析一个连接中出现的字符串,例如: sqlplus sys/oracle@orcl 那么这个orcl怎么 ...

  4. oracle的sqlnet.ora , tnsnames.ora , Listener.ora 文件的作用(转)

    oracle网络配置三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora ,都是放在$ORACLE_HOME/network/admin目录下.1. sqlnet.o ...

  5. oracle的sqlnet.ora,tnsnames.ora,listener.ora三个配置文件

    总结: 1 .三个配置文件都是放在$ORACLE_HOME\network\admin目录下. 2 .sqlnet.ora确定解析方式 3 .listener.ora上设SID_NAME,通常用于JD ...

  6. Oracle 通过sqlnet.ora文件控制对Oracle数据库的访问

    一.通过sqlnet.ora文件控制对Oracle数据库的访问 出于数据安全考虑,对Oracle数据库的IP做一些限制,只有固定的IP才能访问.修改$JAVA_HOME/NETWORK/ADMIN/s ...

  7. oracle三个连接配置文件 listener.ora、sqlnet.ora、tnsnames.ora

    关于PLSQL连接ORACLE配置字符串 首先要讲一下下面的一些知识 1.ORACLE_SID:(ORACLE SYSTEM IDENTIFIER) Oracle实例是由SGA和一组后台进程组成的,实 ...

  8. Oracle非重要文件恢复,redo、暂时文件、索引文件、password文件

    增量备份的应用在recovery阶段.不再restore阶段 了解数据库设置表: SQL>desc database_properties  Name                       ...

  9. Oracle的tnsnames.ora配置(PLSQL Developer)

    首先打开tnsnames.ora的存放目录,一般为D:\app\Administrator\product\11.2.0\client_1\network\admin,就看安装具体位置了. 步骤阅读 ...

随机推荐

  1. 【摘】Chrome解决高版本Stable Beta扩展程序强制停用问题

    博客园插件遇到这个问题,下述摘自百度贴吧,原文地址http://tieba.baidu.com/p/3091171066 1]下载组策略模板 chrome.adm 2] Win+R gpedit.ms ...

  2. Sql Server 查询第30条数据到第40条记录数

    1.select top  10 *  from  (select top  40 * from tablename order by id desc);

  3. cocos2d-x 之 CCArray 的遍历(3)

    cocos2d-x中CCArray的遍历,需要几个宏.现代C++程序设计建议尽量不要使用宏,所以数组的遍历也可以自己写. 但cocos2d-x官方已经提供了几个方便数组遍历的几个宏,用好了,能方便许多 ...

  4. (Unity)Unity自定义Debug日志文件,利用VS生成Dll文件并使用Dotfuscated进展混淆,避免被反编译

    Unity自定义Debug日志文件,利用VS生成Dll文件并使用Dotfuscated进行混淆,避免被反编译. 1.打开VS,博主所用版本是Visual Studio 2013. 2.新建一个VC项目 ...

  5. weborm 简单控件

    Label - 显示文字,编译后是spanLiteral - 显示文字,编译后没有形成元素 只是文字 一般用来输出 js代码内容 TextBox - 文本框 TextMode -普通文本框 singl ...

  6. [keepalved]主从上同时出现VIP,无法消失情况

    双主架构中,keepalived日志出现: more /var/log/messageOct 9 03:16:22 mysql-dzg-60-148 Keepalived_vrrp[8526]: VR ...

  7. html写法对gzip压缩率的影响

    前几天在群里看到小杜分享一篇文章,<html写法对gzip压缩率的影响>,为此我也对这点分析了一下.不知道大家有没有看过这文章,作者是来自微博懒懒交流会,其内容我这里先简述一下. Gzip ...

  8. BZOJ3173 TJOI2013最长上升子序列(Treap+ZKW线段树)

    传送门 Description 给定一个序列,初始为空.现在我们将1到N的数字插入到序列中,每次将一个数字插入到一个特定的位置.每插入一个数字,我们都想知道此时最长上升子序列长度是多少? Input ...

  9. MVVM了解

    了解WPF要有两年,零零碎碎也做了几个项目,之前面试的时候面试官必问对MVVM的了解. 其实不太了解,只是做项目的时候一直采用这种模式,Model-View-ViewModel.以下是我在了解过程中的 ...

  10. [Leetcode][JAVA] Binary Tree Maximum Path Sum

    Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. ...