Chinaunix首页 | 论坛 | 博客
  • 博客访问: 211040
  • 博文数量: 55
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1126
  • 用 户 组: 普通用户
  • 注册时间: 2014-01-22 15:15
个人简介

积累经验

文章分类

全部博文(55)

文章存档

2014年(55)

分类: Oracle

2014-01-23 01:02:44

在会话级设置资源限制
CPU_PER_SESSION       以百分之一秒衡量的CPU 总时间
SESSIONS_PER_USER   允许每个用户名打开的并发会话数
CONNECT_TIME           以分钟衡量的连接持续的时间
IDLE_TIME                    以分钟衡量的不活动时间段
LOGICAL_READS_PER_SESSION 数据块数(物理读取数和逻辑读取数)          
PRIVATE_SGA               以字节衡量的SGA 中的专用空间(仅限共享服务器)

口令帐户锁定参数
FAILED_LOGIN_ATTEMPTS 锁定帐户前登录失败的次数
PASSWORD_LOCK_TIME    达到指定的登录失败次数后,要锁定帐户的天数

口令失效和过期
PASSWORD_LIFE_TIME      口令在失效前的生存期,单位是天
PASSWORD_GRACE_TIME 口令失效后从第一次成功登录算起的更改口令的宽限期,单位是天

select * from dba_profiles;
查看所有profile

实验1:修改scott的session连接数为2
sys
1.create profile zzg_profile limit sessions_per_user 2; 创建profile会话连接数为2
2.alter user scott profile zzg_profile; 修改scott用户
---alter profile zzg_profile limit sessions_per_user 10; 修改profile会话连接数为10

SQL> select username,profile from dba_users;

USERNAME        PROFILE
------------------------------ ------------------------------
SYS        DEFAULT
HP        DEFAULT
UP        DEFAULT
SCOTT                    ZZG_PROFILE

show parameter resource 
NAME      TYPE  VALUE
------------------------------------ ----------- ------------------------------
resource_limit      boolean  FALSE
resource_manager_plan  string

3.alter system set resource_limit=true  启用资源限制参数
4.另起会话,查看conn scott/tiger到第3个是否可以登录
SQL> conn scott/tiger
ERROR:
ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit
Warning: You are no longer connected to ORACLE.

----------------------------------------
实验2:
show parameter process  查看进程数
aq_tm_processes       integer  0
db_writer_processes      integer  1
gcs_server_processes      integer  0
job_queue_processes      integer  10
log_archive_max_processes      integer  2
processes      integer  150

alter system set processes=20 scope=spfile; 修改进程连接数 scope=spfile 重启生效
startup force
SQL> ho ps -ef|grep ora_ -c  查看当前进程连接数
另起会话查看是否可以登录,并查看进程数
SQL> conn scott/tiger
ERROR:
ORA-24315: illegal attribute type
---------------------------------------

实验3:
orapwr$SID 口令文件
sys用户密码是放在口令文件内

修改实例密码
orapwd file= password= entries= force=

1.mv orapwrsytong1 orapw_bakup 备份
sqlplus / as sysdba 会报错,无密码文件
3.orapwd file=$ORALCE_HOME/dbs/orapwrsytong1 
创建后登录成功

阅读(1938) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~