oracle 密码文件文件
密码文件作用:
密码文件用于dba用户的登录认证。
dba用户:具备sysdba和sysoper权限的用户,即oracle的sys和system用户。
本地登录:
1)操作系统认证:
[oracle@localhost ~]$ sqlplus "/as sysdba"
[oracle@localhost ~]$ sqlplus / as sysdba
[oracle@localhost ~]$ sqlplus sys/tiger as sysdba
2)密码文件认证:
[oracle@localhost ~]$ sqlplus sys/tiger@rezin as sysdba
远程密码文件登录:
[oracle@localhost ~]$ sqlplus sys/tiger@192.168.96.141:1521/orcl as sysdba
密码文件位置:
linux/unix:[oracle@localhost ~]$ ls $ORACLE_HOME/dbs/orapw$ORACLE_SID
/u01/oracle/10g/dbs/orapworcl
/u01/oracle/10g/dbs/orapwrezin
windows:$ORACLE_HOME/oradate/orapw$ORACLE_SID
密码文件查找顺序:
1)opapw<sid>
2)orapw
以上两个都查找不到,验证失败。
密码文件认证还是OS认证:
1)参数文件:remote_login_passwordfile=none|exclusive|shared
none:不使用密码文件认证
exclusive:使用密码文件认证,自己独占使用(默认)
shared:使用密码文件认证,不同实例dba用户可以共享密码文件(asm下必须使用)
2)$ORACLE_HOME/network/admin/sqlnet.ora文件下:
SQLNET.AUTHENTICATION_SERVICES =none|all|nts(linux下默认没有设置)
none:关闭OS认证,只能密码文件认证
all:linux平台关闭本机密码文件认证,采用操作系统认证,但是远程(异机)可以密码文件认证
nts:windows下使用(桶linux下all)
练习:
1)配置:remote_login_passwordfile=exclusive
SQLNET.AUTHENTICATION_SERVICES =none
结果:可以密码文件认证(本地/远超),不可以操作系统认证
[oracle@localhost ~]$ sqlplus sys/tiger as sysdba(本地密码文件登录)
[oracle@localhost ~]$ sqlplus sys/tiger@rezin as sysdba(本地密码文件登录)
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 19:00:39 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
???:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
? Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options ??
[oracle@localhost ~]$ sqlplus / as sysdba(OS认证)
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 19:00:51 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name:
或
[oracle@localhost ~]$ sqlplus "/as sysdba"(OS认证)
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 19:01:04 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name:
2)配置:remote_login_passwordfile=exclusive
SQLNET.AUTHENTICATION_SERVICES =all
结果:本机密码文件认证不可用,但是远程密码文件认证可用,本机OS认证可用
[oracle@localhost ~]$ sqlplus "/as sysdba"(本机OS认证登录成功)
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 19:45:35 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@localhost ~]$ sqlplus sys/tiger@orcl as sysdba(本机密码文件认证失败)
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 19:46:52 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12641: Authentication service failed to initialize
Enter user-name:
C: >sqlplus sys/tiger@192.168.96.141:1521/orcl as sysdba(远程密码文件登录成功)
SQL*Plus: Release 11.2.0.1.0 Production on 星期六 3月 14 11:58:38 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
[oracle@localhost ~]$ sqlplus scott/tiger(普通用户本地OS登录成功)
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 20:01:57 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
[oracle@localhost ~]$ sqlplus scott/tiger@orcl(登录失败)
[oracle@localhost ~]$ sqlplus scott/t (登录失败)
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 20:02:52 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12641: Authentication service failed to initialize
Enter user-name:
密码文件管理:
密码文件建立:orapwd命令用法(不建议使用)
[oracle@localhost ~]$ orapwd
Usage: orapwd file=<fname> password=<password> entries=<users> force=<y/n>
where
file - name of password file (mand), -->创建密码文件名字:orapw<sid>
password - password for SYS (mand), -->sys用户密码
entries - maximum number of distinct DBA and -->可以有多少个sysdba和sysoper用户可以放到密码文件里边去(采用二进制方式,即输入1表示最少存放4个,去除重复的)
force - whether to overwrite existing file (opt), -->oracle 10g后新加的参数,用法:force=n或force=y,表示密码文件存在是否覆盖,10g之前只能删除原有的密码文件,再创建。
OPERs (opt),
There are no spaces around the equal-to (=) character.
例如:[oracle@localhost ~]$orapwd file=orapworcl password=rezin entries=1 force=y
密码文件修改:例如 修改sys用户密码或授予sysdba、sysoper权限
orapwd重建密码文件:不建议使用,可能会让其他sys用户不能登录
alter user sys identified by <new password>
grant sysdba|sysoper to <user>;
revoke sysdba|sysoper from <user>
查看密码文件内容:strings指令查看二进制文件内容。
[oracle@localhost dbs]$ strings orapworcl
]\[Z
ORACLE Remote Password file
INTERNAL
9D9FF9FDAFB17385
E6BAA2164C375C09
sysdba和sysoper具体区别:查看官方文档
通过system_privilege_map视图查看系统权限:
SQL> select * from system_privilege_map
2 where name like '%SYS%';
PRIVILEGE NAME PROPERTY
---------- ---------------------------------------- ----------------------------------------------------------
-3 ALTER SYSTEM 0
-4 AUDIT SYSTEM 0
-83 SYSDBA 0
-84 SYSOPER 0
查看用户系统权限通过密码文件视图v$pwfile_user查看:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE
通过以上查询可以知道,sys用户登录方式既可以通过as sysdba登录schema显示‘SYS’,也可以通过as sysoper登录schema显示‘PUBLIC’。
LAST验证:需要配合参数文件知识练习
1、按照组合:
1)remote_login_passwordfile=none sqlnet.authentication_services=none
2)remote_login_passwordfile=exclusive sqlnet.authentication_services=none
3)remote_login_passwordfile=none sqlnet.authentication_services=all
如果是win,请你把all改为nts
4)remote_login_passwordfile=exclusive sqlnet.authentication_services=all
分别测试:
本机:sqlplus / as sysdba
sqlplus sys/<pswd> as sysdba
sqlplus sys/<pswd>@<sid> as sysdba
远程:sqlplus sys/<pswd>@<sid> as sysdba
sqlplus sys/<pswd>@ip:port/<sid> as sysdba
测试哪些组合可以登录成功,哪些不能登录成功。
总结出如果关闭OS验证;如何关闭密码文件验证;如何关闭本地密码文件验证;如何关闭远程密码文件验证。
2、修改remote_login_passwordfile=shated然后使用alter user sys identified by <pswd>;修改密码,测试能否修改成功。
不允许修改
3、如果sys密码丢失或不对,你如何做?
alter user sys identified by tiger;修改密码
4、sysdba、sysoper区别在哪,普通用户如何使用密码文件已sysdba或sysoper登录。
答案:
1)remote_login_passwordfile=none sqlnet.authentication_services=none
关闭密码文件认证,关闭OS认证。
本机:sqlplus / as sysdba
[oracle@localhost dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 15 08:06:22 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name:
本机:sqlplus sys/tiger as sysdba
[oracle@localhost dbs]$ sqlplus sys/tiger as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 15 08:14:24 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
本机:sqlplus sys/tiger@orcl as sysdba
[oracle@localhost dbs]$ sqlplus sys/tiger@orcl as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 15 08:15:39 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
远程:sqlplus sys/tiger@orcl as sysdba
C:\Users\WCWEN>sqlplus sys/tiger@orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 3月 15 00:16:11 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS: 无法解析指定的连接标识符
请输入用户名:
远程:sqlplus sys/tiger@192.168.96.141:1521/orcl as sysdba
C:\Users\WCWEN>sqlplus sys/tiger@192.168.96.141:1521/orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 3月 15 00:17:35 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
请输入用户名:
2)remote_login_passwordfile=exclusive sqlnet.authentication_services=none
关闭OS认证,只能使用密码文件认证,自己独占使用。
本机:sqlplus / as sysdba
[oracle@localhost dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 22:38:23 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name:
本机: sqlplus sys/<pswd> as sysdba
[oracle@localhost dbs]$ sqlplus sys/tiger as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 22:39:24 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
本机: sqlplus sys/<pswd>@<sid> as sysdba
[oracle@localhost dbs]$ sqlplus sys/tiger@orcl as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 22:41:00 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
远程:sqlplus sys/<pswd>@<sid> as sysdba
C:\Users\WCWEN>sqlplus sys/tiger@orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期六 3月 14 14:41:52 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS: 无法解析指定的连接标识符
请输入用户名:
远程: sqlplus sys/<pswd>@ip:port/<sid> as sysdba
C:\Users\WCWEN>sqlplus sys/tiger@192.168.96.141:1521/orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期六 3月 14 14:44:07 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
3)remote_login_passwordfile=none sqlnet.authentication_services=all
关闭密码文件认证,采用OS认证。
本机:sqlplus / as sysdba
[oracle@localhost dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 15 08:22:24 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
本机:sqlplus sys/tiger as sysdba
[oracle@localhost dbs]$ sqlplus sys/tiger as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 15 08:23:10 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
本机:sqlplus sys/tiger@orcl as sysdba
[oracle@localhost dbs]$ sqlplus sys/tiger@orcl as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 15 08:24:01 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12641: Authentication service failed to initialize
Enter user-name:
远程:sqlplus sys/tiger@orcl as sysdba
C:\Users\WCWEN>sqlplus sys/tiger@orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 3月 15 00:24:47 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS: 无法解析指定的连接标识符
请输入用户名:
远程:sqlplus sys/tiger@192.168.96.141:1521/orcl as sysdba
C:\Users\WCWEN>sqlplus sys/tiger@192.168.96.141:1521/orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 3月 15 00:25:33 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
请输入用户名:
4)remote_login_passwordfile=exclusive sqlnet.authentication_services=all
linux平台关闭本机密码文件认证,采用OS认证,但是远程(异机)可以密码文件认证,自己独占使用。
本机:sqlplus / as sysdba
[oracle@localhost dbs]$ sql / as sysdba
[uniread] Loaded history (12 lines)
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 22:57:20 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
本机: sqlplus sys/<pswd> as sysdba
[oracle@localhost dbs]$ sqlplus sys/tiger as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 22:59:16 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
本机:sqlplus sys/<pswd>@<sid> as sysdba
[oracle@localhost dbs]$ sqlplus sys/tiger@orcl as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 14 23:00:44 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12641: Authentication service failed to initialize
Enter user-name:
远程:sqlplus sys/<pswd>@<sid> as sysdba
C:\Users\WCWEN>sqlplus sys/tiger@orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期六 3月 14 15:01:18 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS: 无法解析指定的连接标识符
请输入用户名:
远程:sqlplus sys/<pswd>@ip:prot/<sid> as sysdba
C:\Users\WCWEN>sqlplus sys/tiger@192.168.96.141:1521/orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期六 3月 14 15:02:56 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
http://www.cnblogs.com/wcwen1990/p/4337422.html
oracle 密码文件文件的更多相关文章
- Oracle密码概要文件,密码过期时间180天修改为3天,相关用户密码是否过期
#Oracle用户密码,概要文件修改测试 #默认的用户使用概要文件,默认概要文件密码过期时间参数180天,修改为3天,对于老的用户来说,是密码过期,还是未发生改变, 对于新用户来说,新设置的密码过期时 ...
- 用cmd导入oracle的.dmp文件和修改oracle管理员密码
1,首先创建用户 语法[创建用户]: create user 用户名 identified by 口令[即密码]: 例子:create user zhengxin identified by zhen ...
- Oracle----SQL语句积累 (Oracle 导入 dmp文件)
Oracle----SQL语句积累 (Oracle 导入 dmp文件) Oracle SQL PL 导入dum文件 1.数据库DBA权限: 注意:这个是在cmd命令行中直接输入,不需要进入Oracl ...
- Linux下oracle11gR2系统安装到数据库建立配置及最后oracle的dmp文件导入一站式操作记录
简介 之前也在linux下安装过oralce,可每次都是迷迷糊糊的,因为大脑一片空白,网上随便看见一个文档就直接复制,最后搞了乱七八糟,虽然装上了,却乱得很,现在记录下来,希望能给其他网上朋友遇到问题 ...
- oracle使用口令文件验证和os验证
一.Oracle安装之后默认情况下是启用了OS认证的,这里提到的os认证是指服务器端os认证.OS认证的意思把登录数据库的用户和口令校验放在了操作系统一级.如果以安装Oracle时的用户登录OS,那么 ...
- Oracle学习——dmp文件(表)导入与导出
Oracle学习——dmp文件(表)导入与导出 2014-12-28 0个评论 来源:张文康 廊坊师范学院信息技术提高班 第九期 收藏 我要投稿 前言 关于dmp文件我们用的 ...
- oracle导入sql文件
oracle导入sql文件: 1.进入到sql文件目录下,登录需要导入文件的用户 打开cmd,输入以下命令,进入oracle, sqlplus username/password username:需 ...
- Linux服务器磁盘扩展和oracle表空间文件迁移操作记录
1.环境介绍 服务器硬件:Dell R710 服务器OS:红帽子Linux RHEL4.8 数据库:Oracle 10g 2.出现的问题 因为数据表每天有上百万的数据写入表,加上建立索引,导致表空 ...
- oracle表分区、表分析及oracle数据泵文件导入导出开心版
1.先说oracle表分区是什么吧,这样吧我们来举个桃子,栗子太小,我们就不举了,我们来举个桃子. 你有500万份文件,你要把他存在磁盘上,好嘛,我们就一个文件夹,500万分文件在那儿杵着,我们想找到 ...
- Oracle表空间数据文件移动的方法
最近遇到这样的一个问题,Oracle存放表空间文件的盘符 空间不够了,必须把部分表空间迁移出去, [转]http://www.jb51.net/article/77026.htm 实现把用户表空间中的 ...
随机推荐
- Atitit.Gui控件and面板----web server区----- web服务器监控面板and控制台条目
Atitit.Gui控件and面板----web server区----- web服务器监控面板and控制台条目 1. Resin4.0.22 1 2. 查看http连接数::Summary>& ...
- 更改ORACLE 用户的 expired状态
oracle中, 经常用户的状态会变成locked, expired 等状态, 这种情况下怎么处理呢? 首先, 如果是locked状态还好办, DBA直接执行alter user scott acco ...
- WSGI详解
WSGI接口 了解了HTTP协议和HTML文档,我们其实就明白了一个Web应用的本质就是: 浏览器发送一个HTTP请求: 服务器收到请求,生成一个HTML文档: 服务器把HTML文档作为HTTP响应的 ...
- Determine whether an integer is a palindrome. Do this without extra space.
看到这个题目的时候,首先不认识 Determine这个单词.英文不好没办法,查了下是确认的意思,然后不懂 palindrome这个单词, 查了下是回文的意思. 问题是 回文是个什么东西,官方解释: A ...
- JAVA学习笔记 -- 数据结构
一.数据结构的接口 在Java中全部类的鼻祖是Object类,可是全部有关数据结构处理的鼻祖就是Collection和Iterator接口,也就是集合与遍历. 1.Collection接口 Colle ...
- 我在北京找工作(五):备战阿里巴巴java笔试<1>:筑基
@@@2013年9月11日 还在北京昌平区@@@ 好几天没有往博客上贴我的面试备战笔记了,今天开始分享一下备战阿里巴巴校招的笔经,当然重点是java方向的题目~. 插一段2014年阿里巴巴校招的消息: ...
- netduino第一步,环境配置
在netduino.com的官网介绍下,我很快就入门,现在的最新netduino的版本是4.3,但4.3是运行在win8下的,在codeplex.net上有,大部分人还使用的是win7,因此我现在采用 ...
- ASP.NET - 多文件上传,纯代码,不使用插件
解决方案: 前段代码: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Mu ...
- span设置固定宽度
<span> 标签是被用来组合文档中的行内元素.相信对一般的网页设计师来讲是非常熟悉的朋友了,使用相当频繁,但我们往往很少对SPAN设定样式,一般也没什么必要,大多数都留给DIV老朋友了. ...
- uva 12096
优先队列,主要是STL应用所以复制一下 #include <iostream> #include <cstdio> #include <cstdlib> #incl ...