1 配置文件

create profile 配置文件名 limit

配置参数1 值1

配置参数2 值2

……;

启动参数resource_limit设置后, 只对profile文件中的资源部分生效. 口令管理部分不依赖于这个参数.

2 口令管理

2.1 failed_login_attempts

failed_login_attempts指定在帐户被锁定之前所允许尝试登陆的的最大次数。

SQL> select * from dba_profiles where profile='DEFAULT' and resource_name='FAILED_LOGIN_ATTEMPTS';

PROFILE    RESOURCE_NAME                    RESOURCE LIMIT

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

DEFAULT    FAILED_LOGIN_ATTEMPTS            PASSWORD 10

// 改成不受限

SQL> alter profile default limit failed_login_attempts unlimited;

Profile altered.

// 改成受限3次

SQL> alter profile default limit failed_login_attempts 3;

Profile altered.

SQL> select * from dba_profiles where profile='DEFAULT' and resource_name='FAILED_LOGIN_ATTEMPTS';

PROFILE    RESOURCE_NAME                    RESOURCE LIMIT

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

DEFAULT    FAILED_LOGIN_ATTEMPTS            PASSWORD 3

// 登录系统密码错误3次后, 再登录就会提示用户已锁定.

[oracle@cent4 ~]$ sqlplus hr/hr

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 6月 6 16:00:26 2011

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

ERROR:

ORA-28000: the account is locked

SQL> select a.username, a.account_status, a.lock_date from dba_users a where a.username = 'HR';

USERNAME   ACCOUNT_STATUS                   LOCK_DATE

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

HR         LOCKED(TIMED)                    2011-06-06 16:00:23

// 解除用户锁定

SQL> alter user hr account unlock;

User altered.

SQL> select a.username, a.account_status, a.lock_date from dba_users a where a.username = 'HR';

USERNAME   ACCOUNT_STATUS                    LOCK_DATE

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

HR         OPEN

2.2 password_lock_time

password_lock_time指定帐户被锁定的天数. 1/24/60对应的是1分钟. 但是, 1分钟后只有密码正确了, 才可以自动解锁. 如果该参数最后的值是UNLIMITED, 或需要立即给帐户解锁, 就需要DBA用手动方式来给帐户解锁.

SQL> select a.username, a.account_status, a.lock_date from dba_users a where a.username = 'HR';

USERNAME   ACCOUNT_STATUS                   LOCK_DATE

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

HR         LOCKED(TIMED)                    2011-06-06 16:13:07

SQL> alter profile default limit password_lock_time 1/24/60;

Profile altered.

SQL> conn hr/hr

Connected.

SQL> conn sys/sys as sysdba

Connected.

SQL> select a.username, a.account_status, a.lock_date from dba_users a where a.username = 'HR';

USERNAME   ACCOUNT_STATUS                    LOCK_DATE

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

HR         OPEN

2.3 password_life_time与password_grace_time

password_life_time指定用户帐户的有效期, 达到这个天数的帐户叫做到期帐户. 到期帐户在登陆时会被提示口令将在多少天过期,但仍可以使用该口令, 最多宽限的天数由password_grace_time参数指定. 如果在宽限期中没有更改帐户的口令, 则帐户过期, 即叫过期帐户. 如果不更改到期帐户的口令, 就不能登陆数据库.

{1}                  {2}     {3}      到期          {4}      过期

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

|---à life_time ß---|       |---à grace_time ß---|

{1} 创建用户或修改配置文件的时间

{2} life_time的结束时间

{3} life_time的结束时间后, 用户第一次的登陆时间. 此后用户称为到期帐户, 用户状态由open变成了expire(grace), 但此时用户仍可以登陆系统.

{4} grace_time的结束时间. 此后用户称为过期帐户, 用户状态由expire(grace)变成了expire, 但此时用户登陆系统时要求要改新的密码. 改完密码后, 用户状态由expire变成了open.

l   初始状态

SQL> create user u1 identified by u1;

User created.

SQL> col username format a10;

SQL> col account_status format a15;

SQL> select username, account_status, lock_date, expiry_date from dba_users a where a.username = 'U1';

USERNAME   ACCOUNT_STATUS  LOCK_DATE           EXPIRY_DATE

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

U1         OPEN

l   修改配置文件的password_life_time的值后(或者password_life_time的值不为unlimited, 创建用户后), 用户属性中的EXPIRY_DATE字段将有值生成

SQL> set time on;

19:38:42 SQL> alter profile default limit password_grace_time 10 password_life_time 3;

Profile altered.

19:38:48 SQL> select username, account_status, lock_date, expiry_date from dba_users a where a.username = 'U1';

USERNAME   ACCOUNT_STATUS  LOCK_DATE           EXPIRY_DATE

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

U1         OPEN                                2011-06-10 19:38:42

注意: expiry_date = alter profile语句的调用的时间(19:38:42) + password_life_time(3)

l   将系统时间调到expiry_date之后, 发现用户的状态并不会发生变化, 仍然是open.

[root@cent4 ~]# date '06111200'

六  6月 11 12:00:00 CST 2011

[oracle@cent4 ~]$ sqlplus / as sysdba

SQL> col username format a10;

SQL> col account_status format a15;

SQL> select username, account_status, lock_date, expiry_date from dba_users a where a.username = 'U1';

USERNAME   ACCOUNT_STATUS  LOCK_DATE           EXPIRY_DATE

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

U1         OPEN                                2011-06-10 19:38:42

l   将系统时间调到expiry_date之后, 用户登陆后, 该时间点才是password_grace_time的起始时间.

[root@cent4 ~]# date '06201200'

一  6月 20 12:00:00 CST 2011

[oracle@cent4 ~]$ sqlplus u1/u1

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 6月 20 12:00:23 2011

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

ERROR:

ORA-28002: the password will expire within 10 days

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL>

[oracle@cent4 ~]$ sqlplus / as sysdba

SQL> select username, account_status, lock_date, expiry_date from dba_users a where a.username = 'U1';

USERNAME   ACCOUNT_STATUS  LOCK_DATE           EXPIRY_DATE

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

U1         EXPIRED(GRACE)                      2011-06-30 12:00:23

注意: 此时的expiry_date = 上面expiry_date的时间后第一次运行sqlplus u1/u1语句调用的时候(6月 20 12:00:23 2011) + password_grace_time(10)

l   将系统时间调到password_grace_time之后, 用户要求输入新密码, 此时用户状态为expire; 输入密码后, 用户状态为open;

[oracle@cent4 ~]$ sqlplus u1/u1

SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 7月 6 12:03:56 2011

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

ERROR:

ORA-28001: the password has expired

Changing password for u1

New password: **

Retype new password: **

Password changed

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL>

// 输密码前

SQL> select username, account_status, lock_date, expiry_date from dba_users a where a.username = 'U1';

USERNAME   ACCOUNT_STATUS  LOCK_DATE           EXPIRY_DATE

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

U1         EXPIRED                             2011-06-30 12:00:23

12:02:07 SQL> host date

三  7月  6 12:02:16 CST 2011

// 输密码后

SQL> select username, account_status, lock_date, expiry_date from dba_users a where a.username = 'U1';

USERNAME   ACCOUNT_STATUS  LOCK_DATE           EXPIRY_DATE

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

U1         OPEN                                2011-07-09 12:04:02

2.4 password_reuse_time和password_reuse_max

使用这两个参数后, ORACLE会将各个用户的历史记录存放到SYS用户的USER_HISTORY$表中.

SQL> alter profile default limit password_reuse_time 30 password_reuse_max 10;

Profile altered.

l   第一次登陆

[oracle@cent4 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 6月 7 11:40:46 2011

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> alter user hr identified by hr1;

User altered.

SQL> alter user hr identified by hr2;

User altered.

l   第二次登陆

[oracle@cent4 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 6月 7 12:06:40 2011

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> alter user hr identified by hr1;

ORA-28007: the password cannot be reused

2.5 password_verify_function

使用系统口令校验函数verify_function, 改成校验函数后实现以下口令规则:

口令不能少于4个字符

口令不能与用户名相同

口令至少包含一个字符, 一个数字和一个特殊字符($, _, #, !等)

要使用校验函数verify_function, 必须运行脚本 @$ORACLE_HOME/rdbms/admin/utlpwdmg.sql

SQL> alter user hr identified by hr40;

ORA-28003: password verification for the specified password failed

ORA-20003: Password should contain at least one digit, one character and one punctuation

3 资源管理

session_per_user

指定限制用户的并发会话的数目

cpu_per_session

指定会话的cpu时间限制, 单位为百分之一秒

cpu_per_call

指定一次调用(解析、执行和提取)的cpu时间限制, 单位为百分之一秒

connect_time

指定会话的总的连接时间, 以分钟为单位

idle_time

指定会话允许连续不活动的总的时间, 以分钟为单位, 超过该时间, 会话将断开。但是长时间运行查询和其他操作的不受此限制

logical_reads_per_session

指定一个会话允许读的数据块的数目, 包括从内存和磁盘读的所有数据块

logical_read_per_call

指定一次执行sql(解析、执行和提取)调用所允许读的数据块的最大数目

private_sga

指定一个会话可以在共享池(sga)中所允许分配的最大空间, 以字节为单位。(该限制只在使用共享服务器结构时才有效, 会话在sga中的私有空间包括私有的sql和pl/sql, 但不包括共享的sql和pl/sql)

composite_limit

指定一个会话的总的资源消耗, 以service units单位表示。oracle数据库以有利的方式计算cpu_per_session, connect_time, logical_reads_per_session和private-sga总的service units

oracle配置文件(profile文件)相关推荐

  1. Oracle用户Profile详解

    ORACLE的PROFILE文件是限制数据库用户使用的资源的一种手段.例如可以用Profile做如下限制:控制session或sql能使用的CPU.控制用户的密码管理策略等.         数据库创 ...

  2. 配置文件占位符||Profile——1、多Profile文件 2、yml支持多文档块方式 3、激活指定profile

    配置文件占位符 1.随机数 2.占位符获取之前配置的值,如果没有可以是用:指定默认值 Profile 1.多Profile文件 我们在主配置文件编写的时候,文件名可以是 application-{pr ...

  3. ubuntu etc目录下配置文件profile和profile.d的区别?(文件解析)

    文章目录 区别 profile文件解析 临时使库搜索路径生效示例 profile.d里.sh文件 区别 /etc/profile 是文件, /etc/profile.d/ 是目录,用在设置环境变量方面 ...

  4. linux /etc/profile文件,Linux 配置文件 /etc/profile

    Linux 配置文件 /etc/profile 1. 显示环境变量HOME $ echo $HOME /home/redbooks 2. 设置一个新的环境变量hello $ export HELLO= ...

  5. linux刷新profile文件,linux的/etc/profile、~/.profile、~/.bashrc、~./bash_profile这几个配置文件...

    在添加环境变量的时候,我们会去修改配置文件 如果留意过,网上博文,有些在/etc/profile文件中配置的,有些是在~./bash_profile文件中配置的,等等 那么,/etc/profile. ...

  6. Oracle 体系结构(8)—— Oracle 的审计文件(Audit files)

    Oracle 体系结构(8)-- Oracle 的审计文件(Audit files) 文章目录 Oracle 体系结构(8)-- Oracle 的审计文件(Audit files) 一.查看审计信息 ...

  7. Spring boot的profile文件

    Profile Spring对不同环境,提供不同配置功能的支持 可以通过激活.指定参数等方式快速的切换环境 环境就是平常的开发环境.测试环境.生产环境等 多profile文件方式 在主配置文件编写的时 ...

  8. Maven 进行多环境配置,使用profile文件进行配置

    说明:Spring和Maven都可以进行profile配置多环境,这里只介绍Maven进行管理.我的开发环境:eclipse+maven 文件结构目录: 步骤: 一.在pom.xml文件中,添加如下: ...

  9. oracle配置的监听文件,配置oracle监听文件

    配置oracle监听文件 如果自己配置的监听文件总是出错,可以复制线面的信息进到自己配置文件中更改主机信息即可 [[email protected] admin]$ cat tnsnames.ora ...

最新文章

  1. 编程字典keras.layers API方法
  2. 多伦多大学2020春季CSC311课程「机器学习导论」课件PPT
  3. 算法----两数之和
  4. D语言与C语言的互相调用
  5. Nginx深入了解-基础(一)
  6. asin c语言中 返回值范围_大学C语言考试易错知识点总结
  7. Linux下的tree命令 --Linux下目录树查看
  8. python执行命令并返回结果集_如何执行python脚本然后将结果存储为Power BI中的pandas数据集?...
  9. linux检测系统是否被入侵(下)
  10. 1371. 每个元音包含偶数次的最长子字符串
  11. Linux使用pyinstaller 编译py成可执行程序
  12. 房友软件注册码暴力输入程序
  13. 迅为iTOP-IMX6ULL开发板Pinctrl和GPIO子系统实验-修改设备树文件
  14. 加拿大布兰登大学计算机专业,加拿大布兰登大学有哪些专业?
  15. 鸡蛋,必须放在合适的篮子里
  16. 影集制作php源码_php 源码编译
  17. c语言中begin用法,C++ set cbegin() 使用方法及示例
  18. 在线手写汉字识别工具
  19. 世界易学大会副主席孙志华斩获非全日制易学博士,倾情分享易学奥妙
  20. Ubuntu 16.04 系统 gflags glog 安装

热门文章

  1. 2016年linux认证,2016年Linux认证考试练习题及答案
  2. 连续分布——正态分布、卡方分布、t分布、F分布
  3. 窗体内公用的数据表,在使用视图和行过滤时的有趣现象
  4. 深度学习之数据集标注
  5. 计算机读取数据的接囗教程,八爪鱼采集怎样获取数据API链接 八爪鱼采集获取数据API链接的方法...
  6. npy文件的打开,读取
  7. 浅谈---设计接口测试用例
  8. pprint和print区别
  9. opencv imread函数
  10. mysql客户端与服务端的区别,终于彻底把握了