Oracle12c: How to create PDB in manually

Pre-condition: Go through my last blog.

Install:

  1. Mount and open CDB
    sqlplus / as sysdba;
    
    startup nomount ;
    
    alter database open ;
    
    conn sys@NDLNE as sysdba ;
  2. Create PDB
    create pluggable database pdb1
    admin user pdb1_admin identified by pdb1_admin
    /
  3. Open PDB
    alter pluggable database pdb1 open ;
  4. Create common user
    1. Make sure current user is "SYS" and current container is "CDB$ROOT"
      SQL> show user
      USER is "SYS"
      SQL> show con_name
      
      CON_NAME
      ------------------------------
      CDB$ROOT
      
    2. Create common user
      create user c##cdbuser identified by common 
      container = all ;
    3. Grant privilege
      grant connect to c##cdbuser ;
      grant create session to c##cdbuser ;
    4. Test
      SQL> connect c##cdbuser/common@NDLNE ;
      Warning:  Product user profile information not loaded!
      You may need to run PUPBLD.SQL as SYSTEM
      Connected.
      
      SQL> show user
      USER is "C##CDBUSER"
      
  5. Create Net Service Name in tnsnames.ora
    # tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
    # Generated by Oracle configuration tools.
    
    PDB1 =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = centos8.linuxvmimages.local)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = PDB1)
        )
      )
    
  6. Test Net Service by tnsping
    [oracle@centos8 ~]$ tnsping PDB1
    
    TNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 10-MAR-2021 22:23:36
    
    Copyright (c) 1997, 2016, Oracle.  All rights reserved.
    
    Used parameter files:
    /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/sqlnet.ora
    
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = centos8.linuxvmimages.local)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PDB1)))
    OK (0 msec)
    
  7. sdf
  8. sdf
  9. sdf
  10. sdf
  11.  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yexianyi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值