非tns方式登录pdb方法

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:非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 分类目录,贴了 标签。将固定链接加入收藏夹。

评论功能已关闭。