如何创建oracle数据库



2017-09-16 20:34 
绿贝 
阅读(16685
评论(1
编辑 
收藏 
举报

–1创建数据库

–可以使用默认的orcl数据库

–或者使用配置和移植工具里面的Database Configuration Assistant帮助创建数据库。

–2创建表空间
–临时表空间
CREATE temporary TABLESPACE sdt_temp
tempfile \’D:\app\Administrator\virtual\oradata\orcl\ly_temp.dbf\’ size 128m
autoextend on next 32m maxsize 512m;
–表空间
CREATE TABLESPACE sdt_data
DATAFILE \’D:\app\Administrator\virtual\oradata\orcl\ly_data.dbf\’ size 256M
autoextend on next 32m maxsize 1024m;

–DROP TABLESPACE sdt_temp INCLUDING CONTENTS AND DATAFILES;

–3.创建用户
–Oracle 12C建用户要以c##开头 ,详情见Oracle 12C引入CDB与PDB的新特性,允许一个数据库容器(CDB)承载多个可插拔数据库(PDB)
–建立用户前要重启oracle server服务。不然无法创建用户。
create user c##feiyu identified by feiyu
default tablespace sdt_data
temporary tablespace sdt_temp;

–4.给用户赋权
grant connect,resource to c##feiyu;
grant create any sequence to c##feiyu;
grant create any table to c##feiyu;
grant delete any table to c##feiyu;
grant insert any table to c##feiyu;
grant select any table to c##feiyu;
grant unlimited tablespace to c##feiyu;
grant execute any procedure to c##feiyu;
grant update any table to c##feiyu;
grant create any view to c##feiyu;

版权声明:本文为feiyunaima原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/feiyunaima/p/7532841.html