1

when reading the Oracle APEX documentation, I did not understand the reason it asks to connect to the database through sqlplus using sqlplus /nolog then connect sys as sysdba. If it will eventually connect with sys as sysdba, why not doing it from the beginning with sqlplus sys as sysdba command? Here is what I am talking about: https://docs.oracle.com/en/database/oracle/application-express/20.1/htmig/downloading-installing-Oracle-AE.html#GUID-7E432C6D-CECC-4977-B183-3C654380F7BF

Eslam
  • 323
  • 3
  • 20
  • These are the way to connect to database. there is not certain reason except password or security hole. :) – Osamazx Oct 11 '20 at 15:29
  • Why not just connecting using "sqlplus sys as sysdba" then right the password when prompted? – Eslam Oct 11 '20 at 16:06
  • 1
    As you said, both work equally well and are in effect identical. The author seems prefer, as a matter of choice, the way he wrote it. If had written it they way you prefer, you can be certain someone, somewhere, would be asking why he didn't specify 'sqlplus /nolog' followed by 'connect sys as sysdba'. When writing docs like that its easier to just specify "a" sequence of commands and not get twisted up explaining all the possible variations. – EdStevens Oct 11 '20 at 16:44

1 Answers1

1

I would suspect its historical. In older releases on SQL Plus, if you ran:

sqlplus my_user/my_pass 

on the command line, then on unix environments someone running the 'ps' command could see those details. Even in modern versions of SQL Plus where we remove that from obvious view, then digging into things like command history could expose it.

So always best never to type user or password details on the command line.

Connor McDonald
  • 10,418
  • 1
  • 11
  • 16
  • I did not mean to enter the password explicitly, I am just saying it can be replaced with "sqlplus sys as sysdba" then user will be asked to enter the password. What is the difference then? – Eslam Oct 12 '20 at 11:35