Oracle常用语句

--创建用户(随着用户的创建,自动产生与用户同名的schema)

create user username identified by password
profile default
default tablespace tablespace_name
temporary tablespace temporary_tablespace_name
account unlock;

--修改用户密码

alter user username identified by "newpassword"

--创建表空间

create tablespace tablespace_name
datafile 'E:\oracle\oradata\amop\amop_support.dbf' 
size 500M 
autoextend on next 100M 
maxsize unlimited;

--创建临时表空间

create temporary tablespace temporary_tablespace_name
tempfile 'E:\oracle\oradata\amop\amop_support_temp.dbf' 
size 500M 
autoextend on next 100M maxsize unlimited
extent management local;

--删除表空间及数据库文件
drop tablespace tablespace_name including contents and datafiles;

--给用户赋予权限

grant connect,resource to username;    //connect是赋予连接数据库的权限,resource 是赋予用户只可以创建实体但是没有创建数据结构的权限。
grant create any sequence to username;  
grant create any table to username;  
grant delete any table to username;  
grant insert any table to username;  
grant select any table to username;                           //给该用户赋予查看任何表的权限
grant unlimited tablespace to username;                  //给用户赋予表空间操作的权限
grant execute any procedure to username;  
grant update any table to username;  
grant create any view to username;  
grant dba to username;                                               //给用户赋予所有权限,

--撤销权限

基本语法同grant,关键字为revoke 如: revoke create any  tabel to username  就是取消这个用户创建表的权限。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值