1. 创建用户
在创建用户时,可以为用户指定表空间、临时表空间和资源文件等。另外还可以使用password expire子句和account子句对用户
进行管理。
create user user_name 创建的用户名user_name
identified by password_default 为创建的用户指定口令
[default tablespace default_tablespace| 可选的指定默认表空间
temporary tablespace tmp_tablespace| 可选的指定临时表空间
profile profile_name指定资源文件
quota [integer k|m]|unlimited on tablespace| 用户在相应的表空间上可以使用的空间量
password expire| 表示用户在每次登录数据库时,都得先修改口令
account lock|unlock] 锁定和解锁用户
2. 修改用户(alter user)
alter user user_name
identified by password
[default tablespace tablespace| 修改用户的默认表空间
temporary tablespace tem_tablespace|修改临时表空间
profile profile_name 修改相对应的资源文件
quota [integer k|m] 修改可用表空间中的空量大小
|unlimited on tablespace
|password expire 修改是否需要每次登录时修改密码
|account lock|unlock 修改是否解锁/锁定
]
一般情况下之修改用户的部分信息。
a. 修改用户口令
alter user user_name identified by user_password;
grant connect to user_name identified by new_password;
b。 需改默认表空间
alter user user_name default tablespace new_default_tablespace
c。 对用户锁定/解锁
alter user user_name account lock;
alter user user_name account unlock;
....
3. 资源文件限制参数
sessions_per_user表示同一用户可以同时连接的会话数量
cpu_per_session限制用户在一次数据库会话期间可以使用的cpu时间。
cpu_per_call限制每条sql语句所能使用的cpu时间
logical_reads_per_sess 限制每个会话所能读取的数据库数量,包括从内存中和从磁盘中读取数据块。
logical_reads_per_call 现在每条SQL语句所能读取的数据块
connet_time限制每个用户能够连接到数据库的最长时间。
idle_time指定用户在数据库被终止之前,可以让连接处于多长的空闲状态。
可用通过视图dba_profiles查询资源文件参数
4 口令限制参数()
a.账户的锁定(其策略是指用户在连续输入多少次错误口令后,Oracle会自动锁定用户的账户,并且可以规定锁定时长。)
b.口令的过期时间(强制用户定期修改自己的口令。当口令过期后,Oracle会随时提醒用户修改口令。)
c. 口令的复杂度(在配置文件中,用户通过指定的函数来强制用户口令必须具有一定的复杂度)
failed_login_attempts 限制用户在登录Oracle数据库是容许连续失败的次数。
password_life_time 设置用户口令有效时间。
password_reuse_time 设置用户口令失效前,重新设置口令的天数。
password_reuse_max 设置口令在下次被重新使用之前,期间必须经历的口令改变次数
passowrd_lock_time 设置用户口令锁定时间
password_grace_time 设置口令实现的"宽限时间"
password_verify_function 用来设定用于判断口令复杂性的函数。
查看当前数据库口令限制参数
select * from dba_profiles
where profile='DEFAULT'
and resource_type='PASSWORD'