Oracle创建数据库表空间

https://github.com/hd19940104
https://blog.csdn.net/qq_38873248
https://gitee.com/hd19940104
https://my.oschina.net/u/3855614

 

1.首先,创建(新)用户:

 

 create userusername identified by password;
    username:新用户名的用户名

password: 新用户的密码

也可以不创建新用户,而仍然用以前的用户,如:继续利用scott用户
2.创建表空间:

    createtablespace tablespacename datafile 'd:\data.dbf' size xxxm;

    tablespacename:表空间的名字

    d:\data.dbf':表空间的存储位置

    xxx表空间的大小,m单位为兆(M)

 3.将空间分配给用户:

   alter userusername default tablespace tablespacename;

   将名字为tablespacename的表空间分配给username


4.给用户授权:

   grant createsession,create table,unlimited tablespace to username;

5.然后再以楼主自己创建的用户登录,登录之后创建表即可。

conn username/password;

 

 

 

 

 

 

--删除用户

drop user OSOADATA_NEWcascade;

 

--删除表空间

drop tablespace OSOADATA_NEW_TEMP including contents and datafiles;

drop tablespace OSOADATA_NEW  including contents anddatafiles;

 

--创建临时表空间

create temporary tablespace certCMSUser_new_TEMPtempfile ' certCMSUser_new_TEMP.DBF'

      size 500M autoextend on;

 

--创建表空间

create tablespace certCMSUser_new loggingdatafile ' certCMSUser_new.DBF'

      size 500M autoextend on;

 

--创建用户并指定表空间

create user certCMSUser_new

      identified by certCMSUser_new

    default tablespace certCMSUser_new

    temporary tablespace certCMSUser_new_TEMP

     profile default;

 

 

--给用户授予角色权限

grant connect to certCMSUser_new;

grant resource to certCMSUser_new;

grant dba to certCMSUser_new;

 

 

--给用户授予系统权限

grant unlimited tablespace to certCMSUser_new;

 

--cmd执行下面语句

--impcertCMSUser/certCMSUser@127.0.0.1:1521/ORCL file=F:\workplace\思迪工具包\数据库相关文档\certCMSUser.dmpfull=y

转载于:https://my.oschina.net/u/3855614/blog/1809522

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值