新特性:CDB/PDB的维护命令:sqlplus直接登录pdb的方法

1、配置TNS

[oracle@cat1 ~]$ cd $ORACLE_HOME
[oracle@cat1 db_1]$ cd network/admin/
[oracle@cat1 admin]$ vi tnsnames.ora 

插入:
pdb1_whs =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = catscanip)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pdb1_whs)
    )
  )

2、开启pdb:

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1_WHS                       MOUNTED
SQL> alter pluggable database PDB1_WHS open;

Pluggable database altered.

3、sqlplus直接登录pdb

[oracle@cat1 trace]$ sqlplus system/oracle@pdb1_whs

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 24 15:23:22 2020
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> 

Related Posts