This may seem as weird question:
If i have user called demo
with password Pass1234
When connecting to oracle 11g I can run sqlplus
like this with password in command line:
on DB host:
C:\> sqlplus demo/Pass1234
Or remote machine
C:\> sqlplus demo/Pass1234@<ip>:1521/orcl
I can do so without give the password in command line and expose it like this:
C:\> sqlplus demo
Then I get:
SQL*Plus: Release 11.1.0.7.0 bla bla bla
Copyright (c) bla bla bla
Enter password:
Then I can enter the password manually.
When connecting to Oracle 12c I can connect like this from any machine (with password):
C:\> sqlplus demo/Pass1234@<ip>:1521/pdborcl
My question is: How to connect to Oracle 12c without tnsnames.ora
edit and without write the password in the command line?
I also havn't figured out yet if it is possible to connect to Oracle 12c from sqlplus on the DB host machine without give the IP or localhost, and without editing the tnsnames.ora, like I can do in Oracle 11g?
And more thing, can I do so from a remote machine (even to Oracle 11g) without using a full connect?
(means to give user and db connection in command line and password manually, not like use /NOLOG
in command and then: SQL> connect demo/Pass1234@<ip>:1521/pdborcl
)
Thanks!
Best Answer
This answer based on a1ex07 comment:
given the folowing detailes:
connect to core db from db host as sysdba:
sqlplus / as sysdba
sqlplus sys as sysdba
sqlplus sys/Pass1234 as sysdba
connect to core db from db host or remote as sysdba:
sqlplus sys@\"1.2.3.4:1521/orcl\" as sysdba
sqlplus sys/Pass1234@1.2.3.4:1521/orcl as sysdba
connect to pdb from db host or remote as sysdba:
sqlplus sys@\"1.2.3.4:1521/pdborcl\" as sysdba
sqlplus sys/Pass1234@1.2.3.4:1521/pdborcl as sysdba
connect to pdb from db host or remote as demo (regular user):
sqlplus demo@\"1.2.3.4:1521/pdborcl\"
sqlplus demo/Pass1234@1.2.3.4:1521/pdborcl