[oracle] steps to connect to oracle 11g via sqlplus

Steps:

  1. ensure variable ORACLE_HOME points to oracle installation path:
    echo $ORACLE_HOME
    /u01/app/oracle/product/11.2.0/xe

    if not set, set variable to appropriate path via:

    export ORACLE_HOME=<path_to_oracle>
  2. ensure variable ORACLE_SID is set up to correct value (XE in this case):
    echo $ORACLE_SID
    XE

    if not set, set variable to appropriate path via:

    export ORACLE_HOME=<path_to_oracle>
  3. connect as admin user via:
    $ORACLE_HOME/bin/sqlplus sys as sysadmin
    <enter password>

That should be it.

Note: to permanently add env variables, simply add them to ~/.bashrc as per below:

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=XE

Upon new login, such variable will be loaded automatically

Post a Comment

Your email is never published nor shared. You're allow to say what you want...