windows安装oracle后创建PDB命令

--进入数据库
sqlplus / as sysdba

---查看pdb位置
SELECT name FROM v$datafile;
---创建PDB
CREATE PLUGGABLE DATABASE cndbapdb ADMIN USER cndbaadm IDENTIFIED BY cndbaadm STORAGE (MAXSIZE 2G) DEFAULT TABLESPACE cndba DATAFILE 'E:\ORACLE\Install\ORACLE_DATA\ORCL\cndbapdb\cndba01.DBF' SIZE 150M AUTOEXTEND ON
PATH_PREFIX = 'E:\ORACLE\Install\ORACLE_DATA\ORCL\cndbapdb\' FILE_NAME_CONVERT = ('E:\ORACLE\Install\ORACLE_DATA\ORCL\pdbseed\', 'E:\ORACLE\Install\ORACLE_DATA\ORCL\cndbapdb\');
---打开PDB
ALTER PLUGGABLE DATABASE cndbapdb OPEN;
--切换空间位置CDB——》PDB
alter session set container=cndbapdb;
--创建表空间
create tablespace orms_TBS datafile 'E:\ORACLE\ORACLE_DATA\ORCL\CNDBAPDB\orms1.DBF' size 1G autoextend on next 100M maxsize unlimited extent management local AUTOALLOCATE SEGMENT space MANAGEMENT AUTO;
---创建索引表空间
create tablespace orms_TBS_INDEX datafile 'E:\ORACLE\ORACLE_DATA\ORCL\CNDBAPDB\orms1_index.DBF' size 100M autoextend on next 100M maxsize unlimited extent management local AUTOALLOCATE SEGMENT space MANAGEMENT AUTO;
---创建临时表空间
create temporary tablespace temp_data tempfile 'E:\ORACLE\ORACLE_DATA\ORCL\CNDBAPDB\orms1_temp.DBF' size 100M reuse autoextend on next 100M maxsize unlimited ;
---创建用户
create user orms identified by orms123 default tablespace orms_TBS temporary tablespace temp_data;
---赋予角色
grant connect,resource to orms;

---分配权限
grant create procedure to orms with admin option;
grant create sequence to orms;
grant create session to orms;
grant create synonym to orms;
grant create table to orms;
grant create trigger to orms;
grant create type to orms;
grant create view to orms;
grant unlimited tablespace to orms;
grant create job to orms;
grant select on V_$SQLAREA to orms;
grant select on V_$SESSION to orms;
grant select on V_$LOCKED_OBJECT to orms;
grant select on V_$PARAMETER to orms;
grant select on V_$PROCESS to orms;
grant select on V_$RECOVERY_FILE_DEST to orms;
grant select on DBA_FREE_SPACE to orms;
grant select on DBA_DATA_FILES to orms;

posted @   KLAPT  阅读(0)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 推荐几款开源且免费的 .NET MAUI 组件库
· 实操Deepseek接入个人知识库
· 易语言 —— 开山篇
· Trae初体验
点击右上角即可分享
微信分享提示