Monday, May 11, 2020

Hi All,

In this post we are going to see how to connect as SYSDBA without password into a PDB database.

Have you ever asked the question: Can you connect as SYSDBA without password into a PDB directly? Of course with the usual way of “sqlplus / as sysdba”.

There is an environment variable available: ORACLE_PDB_SID.

Of course, at first we checked the documentation. And this is not a real surprise: it is not documented. Which is not the fault of our doc writers because they can only documented what they’ve get told.

Next step: MyOracle Support. And there are several hits. Even though I couldn’t find any explanation note, I found a lot of 19c EBS notes – and a bug report, too. In one of the most important EBS MOS Notes: 2552181.1 – Interoperability Notes: Oracle E-Business Suite Release 12.2 with Oracle Database 19c under section 2.5 you can read:

For the PDB database, source the $ORACLE_HOME/<PDB SID>_<HOST>.env/cmd file. If you are on UNIX/Linux, set the ORACLE_PDB_SID environment variable to <PDB SID>. Then, run sqlplus <user>/<password>@<PDB SID> or connect as SYSDBA.
This looks strange. But of course, I’ve had to try it out.

Try it out!

Quick test in our hands-on lab environment.

At first, I set the environment variable:

export ORACLE_PDB_SID=PDBTEST

And then I connect with / as sysdba and see what happens.

$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu May 7 22:30:05 2020
Version 19.7.0.0.0

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

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

SQL> show con_name

CON_NAME
------------------------------
PDBTEST

Wow! It works.


Post a Comment: