oracle创建数据库database有以下三步:
1,创建两个数据库的文件(.dbf | _temp.dbf)
2,创建用户映射上面的两个文件
3,给用户添加权限
example:(给用户monitor绑定到数据库并添加权限)
//创建两个数据库文件
CREATE TABLESPACE monitor LOGGING DATAFILE ' E:\app\owner\oradata\orcl\monitor.dbf' SIZE 100M AUTOEXTEND ON NEXT 32M MAXSIZE 500M EXTENT MANAGEMENT LOCAL;
create temporary tablespace monitor_temp tempfile 'E:\app\owner\oradata\orcl\monitor_temp.dbf' size 100m autoextend on next 32m maxsize 500m extent management local;
//创建用户并关联上面的两个数据文件
CREATE USER monitor IDENTIFIED BY monitor DEFAULT TABLESPACE monitor TEMPORARY TABLESPACE monitor_temp;
//授权
grant connect,resource,dba to monitor;
grant create session to monitor;
//删除数据库
DROP TABLESPACE monitor INCLUDING CONTENTS AND DATAFILES;
//删除用户
drop user monitor cascade;
网友评论