Oracle 12c user creation, roles, permissions

Source: Internet
Author: User

First, create a user

Creating a user By default is Container=all, where only global users (C # #开头) can be created in CDB, and that user is created in CDB and all PDB (but global users in the PDB need additional authorization to be accessible in the PDB). Users that can only be created in the PDB are local users

Sql>show Con_name; Con_name------------------------------Cdb$rootsql> Create UserUser1 identified byuser1;Create UserUser1 identified byUser1*Section1line error: ORA-65096: The public user name or role name is invalid for SQL> Create UserC # #user1 identified byuser1; The user has created. SQL> SELECTUSERNAME,CON_ID,user_id  fromCdb_usersWHEREUSERNAME='C # #USER1'; USERNAME con_id user_id
-------------------------C # #USER11 102
C # #USER13 103C # #USER14 103SQL> AlterSessionSetContainer=PDB1; The session has changed. SQL> Create UserC # #user2 identified byUser2;Create UserC # #user2 identified byUser2*Section1line error: ORA-65094: Invalid local user name or role name SQL> Create UserUser2 identified byUser2; The user has created. SQL> SELECTUSERNAME,CON_ID,user_id fromCdb_usersWHEREUSERNAME='USER2'; USERNAME con_id user_id-------------------------USER23 104
Ii. role, user authorization

User authorization By default is only given to the current container, in CDB can also be specified Container=all, for all open PDB and the existence of the user is authorized

Sql>Show Con_namecon_name------------------------------Cdb$rootsql> GrantConnect toC # #user1; authorization succeeded. SQL> Selectgrantee,con_id fromCdb_role_privswhereGranted_role='CONNECT'  andGRANTEE='C # #USER1'; GRANTEE con_id------------------------------------------------------------------------------------------------------------- ------------------- ----------C # #USER11SQL> GrantResource toC # #user1 Container=all, Authorization is successful. SQL> Selectgrantee,con_id fromCdb_role_privswhereGranted_role='RESOURCE'  andGRANTEE='C # #USER1'; GRANTEE con_id------------------------------------------------------------------------------------------------------------- ------------------- ----------C # #USER11C # #USER13C # #USER14
Third, modify the parameters

Here you can see the changes in the CDB, the PDB will inherit, if the modification in the PDB overrides the meaning of the PDB inherited from the CDB,

Sql>Show Con_namecon_name------------------------------Cdb$rootsql> AlterSystemSetOpen_cursors= -Container=all; the system has changed. SQL>Show parameter Open_cursors;name TYPE VALUE------------------------------------ ----------- ------------------------------Open_cursorsinteger  -SQL> AlterSessionSetContainer=PDB1; The session has changed. SQL>Show parameter Open_cursors;name TYPE VALUE------------------------------------ ----------- ------------------------------Open_cursorsinteger  -SQL> AlterSystemSetOpen_cursors= -; the system has changed. SQL>Show parameter Open_cursors;name TYPE VALUE------------------------------------ ----------- ------------------------------Open_cursorsinteger  -SQL> AlterSessionSetContainer=Cdb$root; The session has changed. SQL>Show parameter Open_cursors;name TYPE VALUE------------------------------------ ----------- ------------------------------Open_cursorsinteger  -
Reference

Oracle-base-multitenant:overview of Container Databases (CDB) and pluggable Databases (PDB)

Oracle 12c PDB Foundation-coveting-Blog channel-csdn.net

CDB and PDB basic management-Ziyoo-Blog Park

Oracle 12C Multi-tenancy (Oracle Multitenant)-Basic Concept-zerocool88888888-chinaunix Blog

Oracle 12C PDB Maintenance Basics – Providing professional Oracle technical advice and support @phone:13429648788-flying

Oracle 12c CDB PDB-Ding-Blog Park

Oracle 12c Getting Started third: Oracle 12c Basic Architecture (3) pdb,cdb metadata relationship ..., Data intelligence network, Oracle 12C

On Oracle Database 12c PDB technology-Oracle installation and upgrade-TechTarget database

Oracle 12c user creation, roles, permissions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.