Oracle 19c 新建库基础流程

1.创建用户表空间

CREATE TABLESPACE user_data logging DATAFILE '/opt/oracle/oradata/ORA19C/user_data.dbf' SIZE 100M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED extent management local; 

2.创建临时表空间

create temporary tablespace user_temp tempfile '/opt/oracle/oradata/ORA19C/user_temp.dbf' size 100M autoextend on next 10M maxsize 100M extent management local;

3.创建用户

CREATE USER username IDENTIFIED BY password DEFAULT TABLESPACE user_data temporary tablespace user_temp; 

如果出现如下报错:

ORA-65048: error encountered when processing the current DDL statement in pluggable database ORA19CPDB
ORA-00959: tablespace 'user_temp' does not exist

需要将容器切换至"ORA19CPDB"并再次创建user_data和user_temp,注意tempFile路径不能相同.

如执行成功,直接做第四步.

alter session set container=ORA19CPDB;
CREATE TABLESPACE user_data logging DATAFILE '/opt/oracle/oradata/ORA19C/user_data.dbf' SIZE 100M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED extent management local; 
create temporary tablespace user_temp tempfile '/opt/oracle/oradata/ORA19C/user_temp02.dbf' size 100M autoextend on next 10M maxsize 100M extent management local;

切回root容器并再次创建用户

alter session set container=CDB$ROOT;
CREATE USER username IDENTIFIED BY password DEFAULT TABLESPACE user_data temporary tablespace user_temp; 

4.赋予权限

grant connect,resource,dba to username;

你可能感兴趣的:(Oracle 19c 新建库基础流程)