Oracle用户管理

Oracle

1.使用前需启动OracleServiceORCL和后缀为listener的服务,否则会报协议适配器错误

用户

请分别写出sys、system、scott三个账户的登录语句:

Sys: sqlplus sys/change_on_install as sysdba;
System:sqlplus system/manager;
Scott:sqlplus scott/tiger;

创建用户:

create user test1 identified by 666666

授权:

grant connect(连接),resource(使用) to test1

收回helloepoint 的resource权限:

revoke resource from helloepoint;

修改helloepoint 用户的密码为654321:

alter user helloepoint identified by 654321;

锁定helloepoint用户:

alter user helloepoint account lock;

在sys账户登录的情形下,连接到用户的语句:

Conn scott/tiger;

给helloepoint用户解锁:

alter user helloepoint account unlock;

删除用户helloepoint:

drop user helloepoint cascade;

其他

1.设置显示
设置宽度:set linesize 300
分页显示:set pagesize 300
2.撤销:rollback
3.打开/关闭执行时间:set timing on/off
4.回收站
清空:purge recyclebin;
查看:show recyclebin;
还原:闪回
5.desc emp;查询emp表结构
6.host cls;清屏
7.修改默认日期格式

alter session set NLS_DATE_FORMAT='yyyy-mm-dd';

8.c/ed 可修改上条语句,确定用/

你可能感兴趣的:(Oracle用户管理)