Home  >  Article  >  Database  >  oracle create tablespace statement

oracle create tablespace statement

王林
王林Original
2019-10-24 09:44:407096browse

oracle create tablespace statement

在创建用户之前,先要创建表空间:

格式:

create tablespace 表间名 datafile '数据文件名' size 表空间大小;

如:    

SQL> create tablespace news_tablespace datafile 'F:\oracle\product\10.1.0\oradata\news\news_data.dbf' size 500M;

其中'news_tablespace'是你自定义的表空间名称,可以任意取名。

'F:\oracle\product\10.1.0\oradata\news\news_data.dbf'是数据文件的存放位置。

'news_data.dbf'文件名也是任意取。

'size 500M'是指定该数据文件的大小,也就是表空间的大小。    。

现在建好了名为'news_tablespace'的表空间,下面就可以创建用户了。

格式: 

create user 用户名 identified by 密码 default tablespace 表空间表;

如:     

SQL> create user news identified by news default tablespace news_tablespace;

默认表空间'default tablespace'使用上面创建的表空间。   

接着授权给新建的用户: 

SQL> grant connect,resource to news; --表示把 connect,resource权限授予news用户 
 SQL> grant dba to news; --表示把 dba权限授予给news用户 授权成功

推荐教程:数据库教程

The above is the detailed content of oracle create tablespace statement. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Usage of oracle case whenNext article:Usage of oracle case when