如何创建oracle数据库


--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;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM