当前位置:网站首页>How to create new user for ORACLE 19c (CDB & PDB)
How to create new user for ORACLE 19c (CDB & PDB)
2022-06-29 12:25:00 【Dreamer DBA】
ORACLE 19c A new user
Data base 、 user 、CDB And PDB The relationship between

Usually in CDB Built on User is common user, Add... Before creating a new user name C##. stay PDB The user created on is local user.
stay CDB Create users on
1.Guarante this action under the CDB enviroment.
[[email protected] ~]$ sqlplus system/system as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 29 10:12:29 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select name,cdb from v$database;
NAME CDB
--------- ---
ORCLCDB YES
2. Create New User
SQL> create user C##test identified by testpass;
User created.
3.setting authority
SQL> grant dba,connect,resource,create view to C##test;
Grant succeeded.
SQL> grant create session to C##test;
Grant succeeded.
SQL> grant select any table to C##test;
Grant succeeded.
SQL> grant update any table to C##test;
Grant succeeded.
SQL> grant insert any table to C##test;
Grant succeeded.
SQL> grant delete any table to C##test;
Grant succeeded.
4. Drop user
SQL> drop user C##test cascade;
User dropped.
SQL>
Create new user on PDB
- check the PDB name
SQL> select pdb_id,pdb_name,dbid,status,creation_scn from dba_pdbs;
PDB_ID
----------
PDB_NAME
--------------------------------------------------------------------------------
DBID STATUS CREATION_SCN
---------- ---------- ------------
3
ORCLPDB1
634705280 NORMAL 2156143
2
PDB$SEED
1473614105 NORMAL 2014329
PDB_ID
----------
PDB_NAME
--------------------------------------------------------------------------------
DBID STATUS CREATION_SCN
---------- ---------- ------------
SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
CON_ID DBID
---------- ----------
NAME
--------------------------------------------------------------------------------
OPEN_MODE
----------
2 1473614105
PDB$SEED
READ ONLY
3 634705280
ORCLPDB1
READ WRITE
CON_ID DBID
---------- ----------
NAME
--------------------------------------------------------------------------------
OPEN_MODE
----------
Local User PDB Name is ORCLPDB1
Enter into the PDB enviroment
SQL> alter session set container=ORCLPDB1;
SQL> alter session set container=ORCLPDB1
2 ;
Session altered.New User
SQL> create user test2 identified by test2pass;
User created.
SQL> Setting authority
grant dba,connect,resource,create view to test2;
grant select any table to test2;
grant update any table to test2;
grant insert any table to test2;
grant delete any table to test2;
grant create session to test2;Setting the TNS
If not setting the TNS, it will be failed . error message is user/password error , due to the user on CDB defaultly. need to change the file tnsname.ora on remote linux oracle path network/admin(/opt/oracle/product/19c/dbhome_1/network/admin)

# tnsnames.ora Network Configuration File: /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCLCDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = MaxwellDBA)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCLCDB)
)
)
LISTENER_ORCLCDB =
(ADDRESS = (PROTOCOL = TCP)(HOST = MaxwellDBA)(PORT = 1521))
ORCLPDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = MaxwellDBA)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCLPDB1)
)
)
LISTENER_ORCLPDB1 =
(ADDRESS = (PROTOCOL = TCP)(HOST = MaxwellDBA)(PORT = 1521))
Login user:

边栏推荐
- ERP preparation of bill of materials Huaxia
- Gbase8s database select has order by Clause 1
- Serving millions of developers, the first techo day Tencent technology open day released 7 "lightweight" products
- oracle 19c : change the user sys/system username pasword under Linux
- TTChat x Zadig 开源共创 Helm 接入场景,环境治理搞得定!
- Sofaregistry source code | data synchronization module analysis
- Imile uses Zadig's multi cloud environment to deploy thousands of times a week to continuously deliver global business across clouds and regions
- GBase 8s 扩展外连接1
- DALL-E 2背后的工程实践:确保模型的输出符合内容政策
- nvtmpp
猜你喜欢

高校如何基于云原生构建面向未来的智慧校园?全栈云原生架构VS传统IT架构

百度云盘不限速下载大文件(2021-11亲测有效)

Ensure drinking water safety! Panyu Shawan waterway water quality online monitoring system passed the acceptance

速看|期待已久的2022年广州助理检测工程师真题解析终于出炉

MySQL 主从复制原理以及流程

&4 express框架

什么是外链和内链?
![Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cycle functions [chapter]](/img/d7/f73e748ada302440326a8b1a46f916.png)
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cycle functions [chapter]

TTChat x Zadig 开源共创 Helm 接入场景,环境治理搞得定!

Weekly recommended short video: How did Einstein think?
随机推荐
Gbase8s database into table clause
现在怎么开户?有没有更快又安全的开通渠道
Wonderful! Miaoying technology fully implements Zadig to help container construction, and fully embraces kubernetes and Yunyuan
Codeforces Round #803 (Div. 2)
SOFARegistry 源码|数据同步模块解析
MySQL主从同步之 异步复制 半同步复制 全同步复制
MySQL数据库主从同步,一致性解决方案
智能垃圾桶(四)——树莓派pico实现超声波测距(HC-SR04)
Jerry's manual pairing method [chapter]
How can colleges and universities build future oriented smart campus based on cloud native? Full stack cloud native architecture vs traditional IT architecture
Jerry's about TWS pairing mode configuration [chapter]
torch.load加载模型报错:Can‘t get attribute ‘vae_vc‘ on <module ‘__main__‘ from ‘xxxx()运行文件路径‘
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
AutoCAD - text display mode and how CAD can directly open Tianzheng drawings
Li Kou daily question - day 31 -13 Maximum perimeter of triangle
GBase8s数据库FOR READ ONLY 子句
这个EMR-SparkSQL节点,他查询的表是不是ODPS的啊?
Jerry's configuration of TWS cross pairing [chapter]
每周推荐短视频:爱因斯坦是怎样思考问题的?
联想领像 lenovoimage 部分打印机 驱动 PPD 文件