oracle基本的一些命令
1.创建用户,具有dba的一些权限
进入cmd命令
输入命令:sqlplus(<——)
使用system/manager ;登录
创建用户语句:
create user[用户名] identified by password[密码];
创建后一定要给用户授权:(这里给个登录授权)
grant connect to user[用户名];
切换新建用户看是否登录成功:
conn user[新建用户]/password[新建密码];
2.用户被锁定,无法登陆,需要解锁:the account is locked
这里使用:conn system/manager; 登录去解锁
alter user 用户名 account unlock;
3.用户权限的二级传递(即:奥运火炬传递形式)
①.对象权限
后面加:with grant option
例:grant select on emp to xiaoming with grant option;
②.系统权限
后面加:with admin option
例:grant connect to xiaoming with admin option;
4.撤销用户权限
revoke connect from user[用户名];
5.使用profile管理用户口令(红色代表固定语句)
①账户锁定
创建profile文件
sql>create profile lock_account limit failed_login_attempts 3
password_lock_time 2;
sql>alter user xiaoming profile lock_account;
6.终止口令
例:每隔10天要修改自家的登陆密码,宽限期为2天
sql>create profile myprofile limit password_life_time 10
password_grace_time 2;
sql>alter user tea profile myprofile
进入cmd命令
输入命令:sqlplus(<——)
使用system/manager ;登录
创建用户语句:
create user[用户名] identified by password[密码];
创建后一定要给用户授权:(这里给个登录授权)
grant connect to user[用户名];
切换新建用户看是否登录成功:
conn user[新建用户]/password[新建密码];
2.用户被锁定,无法登陆,需要解锁:the account is locked
这里使用:conn system/manager; 登录去解锁
alter user 用户名 account unlock;
3.用户权限的二级传递(即:奥运火炬传递形式)
①.对象权限
后面加:with grant option
例:grant select on emp to xiaoming with grant option;
②.系统权限
后面加:with admin option
例:grant connect to xiaoming with admin option;
4.撤销用户权限
revoke connect from user[用户名];
5.使用profile管理用户口令(红色代表固定语句)
①账户锁定
创建profile文件
sql>create profile lock_account limit failed_login_attempts 3
password_lock_time 2;
sql>alter user xiaoming profile lock_account;
6.终止口令
例:每隔10天要修改自家的登陆密码,宽限期为2天
sql>create profile myprofile limit password_life_time 10
password_grace_time 2;
sql>alter user tea profile myprofile