欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

Oracle创建用户与授予表空间与权限

发布时间:2023/12/18 48 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Oracle创建用户与授予表空间与权限 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

Oracle建立用户     

建立:create user 用户名 identified by "密码";

oracle 表空间

一个数据库可以有多个表空间,一个表空间里可以有多个表。表空间就是存多个表的物理空间;   可以指定表空间的大小位置等。

建立表空间的定义

建立表空间(一般建N个存数据的表空间和一个索引空间): create tablespace 表空间名 datafile ' 路径(要先建好路径)\***.dbf ' size *M tempfile ' 路径\***.dbf ' size *M autoextend on --自动增长 --还有一些定义大小的命令,看需要default storage(initial 100K,next 100k, );

例子

创建表空间:create tablespace ts1 datafile 'C:\tablespace\ts1.dbf' size 50M; 自动扩展大小:create tablespace ts2 datafile 'C:\tablespace\ts2.dbf' size 50M autoextend on next 10M; 设置最大空间:create tablespace ts3 datafile 'C:\tablespace\ts3.dbf' size 50M autoextend on next 10M maxsize 1024M;更改用户默认表空间:alter database default tablespace ts1; 表空间改名:alter tablespace ts1 rename to tss1; 删除表空间:drop tablespace ts2 including contents and datafiles;

授予用户使用表空间的权利

alter user 用户名 quota unlimited on 表空间; 或 alter user 用户名 quota *M on 表空间

授予用户的基本权限

授权:grant create session to 用户名;grant create table to 用户名;grant create tablespace to 用户名;grant create view to 用户名; grant connect,resource to demo; grant create any sequence to demo; grant create any table to demo; grant delete any table to demo; grant insert any table to demo; grant select any table to demo; grant unlimited tablespace to demo; grant execute any procedure to demo; grant update any table to demo; grant create any view to demo;

 

 

 

 

 

 

 

 

 

 

 

总结

以上是生活随笔为你收集整理的Oracle创建用户与授予表空间与权限的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。