web之家  

https://blog.csdn.net/qq877507054/article/details/81209967

oracle12c安装时会默认创建pdb数据库:pdborcl,可以修改名称

 

 

 

1、cmd命令

>sqlplus / as sysdba

>show pdbs

 

 >alter plugable database pdborcl open;

>alter session set container=PDBORCL;

>create user syspdb identified by syspdb;

>grant dba to syspdb;

 

2、修改listener.ora和tnsname.ora(安装目录下查找)

 

配置监听

这里假定CDB数据库名为ORCL,PDB在CDB下面名称为PDBORCL
listener.ora添加(#后面为注释,不要添加进去)

   
 SID_LIST_LISTENER =
    (SID_LIST =
        (SID_DESC =
            (GLOBAL_DBNAME = ORCL)
            (SID_NAME = ORCL)  #这里是SID名
         )
        (SID_DESC =
            (GLOBAL_DBNAME = PDBORCL)#这里是PDB数据库名
            (SID_NAME = ORCL)  #这里是SID名
         )
     )

  

  tnsname.ora添加,其中localhost可以改成自身对外访问ip,如:192.168.1.11
   
 PDBORCL=
    (DESCRIPTION =
        (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT =1521))
        )
        (CONNECT_DATA =
            (SERVICE_NAME = PDBORCL)  #这里是PDB数据库名
        )
    )

  

 3、重启监听服务

 

 

 

 

==================================================

 

https://blog.csdn.net/qq877507054/article/details/81209967

 

posted on 2021-12-06 23:00  路修远而求索  阅读(2182)  评论(0编辑  收藏  举报