Oracle12c: How to create PDB in manually

Posted yexianyi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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.  

以上是关于Oracle12c: How to create PDB in manually的主要内容,如果未能解决你的问题,请参考以下文章

Oracle12c: How to create CDB in manually

Oracle12c: How to create CDB in manually

How to deploy Oracle 12c Release 2 Grid and RAC Database on RHEL 7.x

Oracle Net 12c: How to enable Clients using SID to connect to PDB? (Doc ID 1644355.1)

Oracle 12c how to purge the FGA audit records before a certain date

Learn How To Create Trigger In Oracle Forms