oracle 12 c 创建表空间,用户名,及表

时间:2022-06-30 21:33:54
-- 创建表空间
create tablespace tbschedule_data
datafile '/u01/oracle/oradata/qglmnc/tbs_tbschedule_data01.dbf' 
size 50M 
autoextend on next 50m maxsize 2048m 
extent management local;
--创建临时表空间
create temporary tablespace tbschedule_data_temp
tempfile '/u01/oracle/oradata/qglmnc/tbs_tbschedule_data_temp01.dbf'
size 32m
autoextend on next 32m maxsize 1024m
extent management local;

--创建用户
create user tbschedule identified by tbschedule# default tablespace tbschedule_data
temporary tablespace tbschedule_data_temp;
--创建角色
create role tbscheduleroles container = CURRENT;
grant dba to tbscheduleroles container = CURRENT;
--授权
grant tbscheduleroles to tbschedule container = CURRENT;
grant connect,resource to tbscheduleroles;
grant restricted session to tbscheduleroles;
alter user tbschedule account unlock identified by tbschedule#;
 ALTER USER tbschedule QUOTA UNLIMITED ON tbschedule_data;

 

-- 创建表空间
create tablespace oncefee_data
datafile '/u01/oracle/oradata/qglmnc/tbs_oncefee_data01.dbf' 
size 50M 
autoextend on next 50m maxsize 2048m 
extent management local;
--创建临时表空间
create temporary tablespace oncefee_data_temp
tempfile '/u01/oracle/oradata/qglmnc/tbs_oncefee_data_temp01.dbf'
size 32m
autoextend on next 32m maxsize 1024m
extent management local;

--创建用户
create user na_oncefee identified by oncefee_pwd default tablespace oncefee_data
temporary tablespace oncefee_data_temp;
--创建角色
create role oncefee_roles container = CURRENT;
grant dba to oncefee_roles container = CURRENT;
--授权
grant oncefee_roles to na_oncefee container = CURRENT;
grant connect,resource to oncefee_roles;
grant restricted session to oncefee_roles;
alter user na_oncefee account unlock identified by oncefee_pwd;
 ALTER USER na_oncefee QUOTA UNLIMITED ON oncefee_data;