标签归档:ORACLE_PDB_SID

非tns方式登录pdb方法

非tns方式登录pdb方法之—-alter session set container

[oracle@db01 ~]$ env|grep ORA
ORACLE_SID=DCXFF
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19c/db_1
[oracle@db01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Oct 9 22:10:34 2023
Version 19.20.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 XFFPDB1                        READ WRITE NO
SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> alter session set container=XFFPDB1;

Session altered.

SQL> show con_name;

CON_NAME
------------------------------
XFFPDB1
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0

非tns方式登录pdb方法之—-ORACLE_PDB_SID

[oracle@db01 ~]$ export ORACLE_PDB_SID=XFFPDB1
[oracle@db01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Oct 9 22:11:30 2023
Version 19.20.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0

SQL> SHOW pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 XFFPDB1                        READ WRITE NO
SQL> show con_name;

CON_NAME
------------------------------
XFFPDB1
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0

参考:How To Connect to PDB By OS Authentication In 19c Container Database Environment (Doc ID 2729416.1)

发表在 ORACLE 19C | 标签为 | 评论关闭