首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

Oracle 用户治理

2013-04-07 
Oracle 用户管理一、创建用户的Profile文件create profile student limit!--student为资源文件名--FAILED

Oracle 用户管理
一、创建用户的Profile文件create profile student limit<!--student为资源文件名-->FAILED_LOGIN_ATTEMPTS 3<!--指定锁定用户的登录失败次数-->PASSWORD_LOCK_TIME 5<!--指定用户被锁定天数-->PASSWORD_LIFE_TIME 30;<!--指定口令可用天数-->?二、创建用户create user 用户名称 identified by 密码 default tablespace 默认表空间 temporary tablespace 临时表空间 profile profile quota integer/unlimited on tablespace;例:create user Aliceidentified by hanweb // 如果密码是数字,请用双引号括起来default tablespace accounttemporary tablespace tempprofile defaultquota 50m on account;?--赋权grant connect, resource to Alice;?[*] 查询用户缺省表空间、临时表空间select username, default_tablespace, temporary_tablespace from dba_users;?[*] 查询系统资源文件名:select * from dba_profiles;资源文件类似表,一旦创建就会保存在数据库中。?select username, profile, default_tablespace, temporary_tablespace from dba_users;?create profile common limitfailed_login_attempts 5idle_time 5;alter user Alice profile common;?三、修改用户Alter User 用户名Identified 口令Default Tablespace tablespaceTemporary Tablespace tablespaceProfile profileQuota integer/unlimited on tablespace;1、修改口令字:Alter user acc01 identified by "12345";2、修改用户缺省表空间:Alter user acc01 default tablespace users;3、修改用户临时表空间Alter user acc01 temporary tablespace temp_data;4、强制用户修改口令字:Alter user acc01 password expire;5、将用户加锁Alter user acc01 account lock; // 加锁Alter user acc01 account unlock; // 解锁?四、删除用户drop user 用户名; //用户没有建任何实体drop user 用户名 CASCADE; // 将用户及其所建实体全部删除*1. 当前正连接的用户不得删除。?五、监视用户1、查询用户会话信息:select username, sid, serial#, machine from v$session;2、删除用户会话信息:Alter system kill session 'sid, serial#';3、查询用户SQL语句:select user_name, sql_text from v$open_cursor;

热点排行