It seems to me I found a better solution
Ilia Vinikovetsky, April 18, 2016 - 5:46 am UTC
Some time after submitting my question I found that with following definitions:
export ORACLE_SID=<my_db_sid>
export TWO_TASK=<my_cont_name>
I solved the problem:
[cust1@my-host ~]$ sqlplus /
SQL*Plus: Release 12.1.0.2.0 Production on Mon Apr 18 08:40:35 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Sun Apr 17 2016 17:08:01 +03:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
SQL>
This way I don't need to modify our maintenance scripts utilizing OS identification for connecting to Oracle.
Thank you anyway,
Ilia
April 18, 2016 - 11:24 am UTC
Setting TWO_TASK=xxx is pretty much equivalent to sqlplus /@xxx
Glad you got it working as you need
Remote Auth Disclaimer
Laurent Schneider, December 14, 2020 - 10:51 am UTC
Hi
Remote OS allows any server to connect to the pluggable, defeating the server security. The parameter is deprecated and should only be used in exceptional cases.
As the OS-authentication works in the container, simply create an OS user C##USER01 and grant SET CONTAINER to that user to set the database. This could even be done in a logon trigger
alter system set os_authent_prefix='C##' scope=spfile;
create user c##user01 identified externally container=all;
grant alter session, create session to c##user01 container=all;
alter session set container=pdb01;
grant set container to c##user01 container=current;
Cheers
Laurent
PS: I apologize for the bad rating. The answer is accurate, but the security issue is huge
December 17, 2020 - 4:31 am UTC
Fair point - we should have highlighted the risks
alternative has problems too
Nicole, April 28, 2022 - 6:27 pm UTC
The downside to Laurent's suggested way is that you now end up creating a common user in all of your pluggable databases (and your root container) whether you need one or not. That's a security issue as well. And also this means your username has to start with C## which may be problematic if your unix accounts have naming standards, unless you circumvent that requirement.
Anyway to do this without setting REMOTE_OS_AUTHENT to true and with only a local user?