Jump to content
VME

Exporting a pdb (12c) with os authentication

Recommended Posts

Hi everyone!

I'm happy to post there because there is a long time i solve my problem's by reading this forum but today, i need help and i m not able to find any solution... :(

 

Here is the perimeter:

I am on AIX, with Oracle RAC 12c and Oracle 11g environment.

Databases are backuped with some sh scripts.

On the Oracle 12c environnement, i have a cdb named db1 and i have a pdb named pdb1.

OS authentication is active (SQLNET.AUTHENTICATION=NTS) and i can log my user system with (in 11g and in 12c):

export ORACLE_SID=db1

sqlplus system/pwd

Today, the system's password is displayed into my sh script.

I have to hide the password in the sh script.

On Oracle 11c, no problem, i can export with the following command:

expdp \"/as sysdba\" full=Y directory=......

But on Oracle 12c, I'm not abble to run an expdp as sysdba in the same way, i got this errors:

UDE-01034: operation generated ORACLE error 1034

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist

IBM AIX RISC System/6000 Error: 2: No such file or directory

Additional information: 2311

Additional information: 1410328243

UDE-00003: all allowable logon attempts failed

 

Here is the var i set at the beginning of my (11g and 12c) scripts:
 

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/xxxx/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export OPATCH_LIB=/u01/app/oracle/xxx/dbhome_1/OPatch
export PATH=$ORACLE_HOME/bin:$PATH:$OPATCH_LIB
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

Same errors when i set ORACLE_SID=pdb1 or ORACLE_SID=db1

This export command is working on Oracle 11g 'cause i do not have cdb and pdb => I think this is the problem) its look like i have to alter session set container=pdb1 while exporting x)

 

Can someone help me??

 

Thank you in advance, and have a nice day!

 

best regards

VME

Share this post


Link to post
Share on other sites

Hi VME,

Sorry about the delay in responding!

It looks like you are exporting the PDB and not the CDB.

Are you able to connect to the CDB via sqlplus?

Sqlplus sys <password> @  newpdb as sysdba

 

Try adding a tnsnames entry for the PDB and then include it in your connect string:

expdp ‘\newpdb/ as sysdba\’

Let me know if this works. . . 

Share this post


Link to post
Share on other sites

Hello Mrs Burleson,

Thank a lot for your assistance.

 

Here are my answers:

pdb and cdb are already declared in my tnsnames.ora and i'm able to connect like this:

sqlplus sys/****@pdb as sysdba

sqlplus sys/****@cdb as sysdba

So i tried your command line but i got a syntax pb.

expdp '\pdb1/ as sysdba\' full=Y directory=...

LRM-00101: unknown parameter name 'sysdbafull'

But with this command, error messages are different:

expdp \"pdb1/as sysdba\" full=Y directory=...

Export: Release 12.1.0.2.0 - Production on Fri Mar 2 09:35:34 2018

Copyright (c) 1982, 2015, Oracle and/or its affiliates.  All rights reserved.

UDE-01005: operation generated ORACLE error 1005
ORA-01005: null password given; logon denied

Username:

But when i grab my credentials, i got again the

UDE-01034: operation generated ORACLE error 1034
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 2311
Additional information: 1975425287
UDE-00003: all allowable logon attempts failed

 

Then i tried something and the result seems to be a bad news:

export ORACLE_SID=pdb1
sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Mar 2 09:43:47 2018

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

Connected to an idle instance.


SQL> exit
Disconnected
export ORACLE_SID=cdb1
sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Mar 2 09:44:00 2018

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


Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option

SQL>

So i think my expdp as sysdba on a pdb and without credentials isn't possible... :(

I probably should try to export with the cdb wherewas pdb...

 

best regards

VME

 

 

Share this post


Link to post
Share on other sites

Hello,

After long searchs, it seams that there is no possibilities to use SQLNETAuthentication to connect as sysdba on a puggable database with impdp and expdp.

 

The below syntaxe doesn't work for connect to a pdb:

\"pdb1/as sysdba\"

 

So i decide to use Oracle Wallet to avoid password display in my scripts.

 

Have a nice day and thank you for your help!

 

VME

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×