Oracle 12c创建表空间,用户以及授权

  1. 创建表空间

    格式: create tablespace 表间名 datafile ‘数据文件名’ size 表空间大小

    使用sysdba用户登录在这里插入图片描述

    create tablespace kettle_repository datafile 'D:\oracle\oradata\ts_kettle_rep.dbf' size 1024M; 
    

    在这里插入图片描述

  2. 创建用户和授权

    2.1. 创建用户

    说明:Oracle 12C引入了CDB与PDB的新特性,CDB容器中创建一个通用用户,用户名必须以C##或者c##开头,因为CDB中默认创建的是common user,可以创建完后改用户名!
    格式:create user C##用户名 identified by 密码;

    create user C##kettle identified by 123456 DEFAULT TABLESPACE kettle_repository ;
    UPDATE USER$ SET NAME='KETTLE' where USER# = (select USER# FROM user$ where NAME='C##KETTLE');
    commit;	
    

    2.2. 用户授权
    首先连接到库
    在这里插入图片描述

    grant connect to KETTLE;  
    grant create table to KETTLE;  
    grant create tablespace to KETTLE;  
    grant create view to KETTLE;
    
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章