Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

oracle-sqlplus-linux

Posted on 2011-05-02
15
Medium Priority
?
929 Views
Last Modified: 2012-05-11
in my linux terminal
it is like this
mathew@mathew-Inspiron-1501:

I want to change to one like this
for running sqlplus

oracle@mathew-Inspiron-1501:/home/mathew$ export ORACLE_SID=orcl

could you please help me
how would we achieve oracle@mathew
in the beginning..................
0
Comment
Question by:nobleit
  • 5
  • 4
  • 3
  • +2
15 Comments
 
LVL 12

Expert Comment

by:upanwar
ID: 35503815
This is showing.

mathew@mathew-Inspiron-1501

Because you are logged in with user mathew. This get changed with different user. Like if you would login with root then it would be

root@mathew-Inspiron-1501
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35503833
If you still want to change your command prompt then below given url would be useful for you. If you still require further help for the same then update us.

http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
0
 

Author Comment

by:nobleit
ID: 35503854
can i use

echo $ORACLE_HOME
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35503880
- hope this link helps you to get started.:
http://rene.bz/oracle-sqlplus-and-linux/
http://www.phppop.net/d/node/147 (skip the instant client installation and directly to step 3 and 4)
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35503914
0
 

Author Comment

by:nobleit
ID: 35503964
This is what I did,

mathew@mathew-Inspiron-1501:~$ export ORACLE_SID=orcl
mathew@mathew-Inspiron-1501:~$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
mathew@mathew-Inspiron-1501:~$ export PATH=$PATH:ORACLE_HOME/bin
mathew@mathew-Inspiron-1501:~$ sqlplus /nolog
sqlplus: command not found
mathew@mathew-Inspiron-1501:~$ sqlplus
sqlplus: command not found
mathew@mathew-Inspiron-1501:~$

for sure I did sqlplus last boot and this time I cannot
Could you please help me to resolve...
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35503988
can you check and confirm that ORACLE_HOME(the u01/....)/bin path is correct? and does sqlplus application exist in there?
0
 

Author Comment

by:nobleit
ID: 35504058
/u01/app/oracle/product/11.2.0/dbhome_1

I could see every thing in this path
including bin

is this the one which you are expecting
everything is here


mathew@mathew-Inspiron-1501:~$ cd /
mathew@mathew-Inspiron-1501:/$ ls
bin    etc             lib         opt   selinux  u01      vmlinuz.old
boot   home            lost+found  proc  srv      usr
cdrom  initrd.img      media       root  sys      var
dev    initrd.img.old  mnt         sbin  tmp      vmlinuz
mathew@mathew-Inspiron-1501:/$ cd /u01/app/oracle/product/11.2.0/dbhome_1
mathew@mathew-Inspiron-1501:/u01/app/oracle/product/11.2.0/dbhome_1$ ls
apex         emcli                      md           precomp
assistants   EMStagePatches_orcl        mesg         racg
bin          has                        mgw          rdbms
ccr          hs                         network      relnotes
cdata        ide                        nls          root.sh
cfgtoollogs  install                    oc4j         scheduler
clone        install.platform           odbc         slax
config       instantclient              olap         sqldeveloper
crs          inventory                  ons          sqlj
csmig        j2ee                       OPatch       sqlplus
css          javavm                     opmn         srvm
ctx          jdbc                       oracore      sysman
cv           jdev                       oraInst.loc  timingframework
dbs          jdk                        ord          ucp
dc_ocm       jlib                       oui          uix
deinstall    ldap                       owb          utl
demo         lib                        owm          wwg
diagnostics  log                        perl         xdk
dv           mathew-Inspiron-1501_orcl  plsql
mathew@mathew-Inspiron-1501:/u01/app/oracle/product/11.2.0/dbhome_1$
0
 

Author Comment

by:nobleit
ID: 35504114
Also


mathew@mathew-Inspiron-1501:/u01/app/oracle/product/11.2.0/dbhome_1$ ls -l
total 316
drwxr-xr-x  8 oracle oinstall  4096 2011-04-25 04:10 apex
drwxr-xr-x  8 oracle oinstall  4096 2011-04-25 04:07 assistants
drwxr-xr-x  2 oracle oinstall 12288 2011-04-25 04:13 bin
drwxr-xr-x  7 oracle oinstall  4096 2011-04-25 04:11 ccr
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:11 cdata
drwx------  4 oracle oinstall  4096 2011-04-25 04:34 cfgtoollogs
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:10 clone
drwxr-xr-x  2 oracle oinstall  4096 2011-04-25 04:11 config
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:07 crs
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:07 csmig
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:11 css
drwxr-xr-x 10 oracle oinstall  4096 2011-04-25 04:11 ctx
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:07 cv
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:27 dbs
drwxr-xr-x  2 oracle oinstall  4096 2011-04-25 04:10 dc_ocm
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:13 deinstall
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:07 demo
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:07 diagnostics
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:07 dv
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:07 emcli
drwxr-x--- 68 oracle oinstall  4096 2011-04-25 04:31 EMStagePatches_orcl
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:07 has
drwxr-xr-x  5 oracle oinstall  4096 2011-04-25 04:13 hs
drwxr-xr-x  8 oracle oinstall  4096 2011-04-25 04:07 ide
drwxr-xr-x  8 oracle oinstall  4096 2011-04-25 04:32 install
-rw-r--r--  1 oracle oinstall    37 2011-04-25 04:07 install.platform
drwxr-xr-x  2 oracle oinstall  4096 2011-04-25 04:09 instantclient
drwxrwx--- 13 oracle oinstall  4096 2011-04-25 04:17 inventory
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:10 j2ee
drwxr-xr-x  8 oracle oinstall  4096 2011-04-25 04:07 javavm
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:11 jdbc
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:07 jdev
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:11 jdk
drwxr-xr-x  2 oracle oinstall  4096 2011-04-25 04:10 jlib
drwxr-xr-x 12 oracle oinstall  4096 2011-04-25 04:11 ldap
drwxr-xr-x  4 oracle oinstall 12288 2011-04-25 04:13 lib
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:18 log
drwxr-----  3 oracle oinstall  4096 2011-04-25 04:31 mathew-Inspiron-1501_orcl
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:07 md
drwxr-xr-x  2 oracle oinstall  4096 2011-04-25 04:08 mesg
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:11 mgw
drwxr-xr-x 11 oracle oinstall  4096 2011-04-25 04:13 network
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:07 nls
drwxr-xr-x 20 oracle oinstall  4096 2011-04-25 04:09 oc4j
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:07 odbc
drwxr-xr-x  5 oracle oinstall  4096 2011-04-25 04:07 olap
drwxr-xr-x  5 oracle oinstall  4096 2011-04-25 04:07 ons
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:11 OPatch
drwxr-xr-x  7 oracle oinstall  4096 2011-04-25 04:11 opmn
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:07 oracore
-rw-r-----  1 oracle oinstall    56 2011-04-25 04:07 oraInst.loc
drwxr-xr-x  8 oracle oinstall  4096 2011-04-25 04:07 ord
drwxr-xr-x  7 oracle oinstall  4096 2011-04-25 04:11 oui
drwxr-xr-x 26 oracle oinstall  4096 2011-04-25 04:11 owb
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:07 owm
drwxr-xr-x  5 oracle oinstall  4096 2011-04-25 04:13 perl
drwxr-xr-x  6 oracle oinstall  4096 2011-04-25 04:07 plsql
drwxr-xr-x  7 oracle oinstall  4096 2011-04-25 04:07 precomp
drwxr-xr-x  7 oracle oinstall  4096 2011-04-25 04:11 racg
drwxr-xr-x 13 oracle oinstall  4096 2011-04-25 04:13 rdbms
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:11 relnotes
-rwxr-x---  1 oracle oinstall   518 2011-04-25 04:13 root.sh
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:07 scheduler
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:07 slax
drwxr-xr-x 13 oracle oinstall  4096 2011-04-25 04:10 sqldeveloper
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:07 sqlj
drwxr-xr-x  7 oracle oinstall  4096 2011-04-25 04:12 sqlplus
drwxr-xr-x 10 oracle oinstall  4096 2011-04-25 04:11 srvm
drwxr-xr-x 15 oracle oinstall  4096 2011-04-25 04:11 sysman
drwxr-xr-x  2 oracle oinstall  4096 2011-04-25 04:09 timingframework
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:11 ucp
drwxr-xr-x  4 oracle oinstall  4096 2011-04-25 04:07 uix
drwxr-xr-x  2 oracle oinstall  4096 2011-04-25 04:08 utl
drwxr-xr-x  3 oracle oinstall  4096 2011-04-25 04:07 wwg
drwxr-xr-x  7 oracle oinstall  4096 2011-04-25 04:09 xdk
mathew@mathew-Inspiron-1501:/u01/app/oracle/product/11.2.0/dbhome_1$
0
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 35504230
>>export PATH=$PATH:ORACLE_HOME/bin


Should be:
export PATH=$PATH:$ORACLE_HOME/bin
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35504277
- sorry the correct link is: http://www.experts-exchange.com/Database/Oracle/11.x/Q_24392991.html?sfQueryTermInfo=1+10+30+linux+plu+sql

- yes the export path pointed by slightwv should work.
0
 
LVL 4

Expert Comment

by:undersky
ID: 35506424
You can run it manualy:

look

sudo (or) su via root

# su oracle
cd $oraclehome (that must been home of your oracle directory)
and run:
bin/sqlplus
or sqlplus
(if you set export $oraclehome right, must work, if you get command not found: go to bin directory inside oracle home. and run

sqlplus  there


also you may be need RUN AS SYSDBA, for maintain bases.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35506451
>>cd $oraclehome (that must been home of your oracle directory)

I believe it is $ORACLE_HOME

There should also be no need to cd into the directory to run sqlplus.
0
 

Author Comment

by:nobleit
ID: 35506550
now the issue
is this

mathew@mathew-Inspiron-1501:~$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon May 2 10:27:17 2011

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

SQL> conn / as sysdba
ERROR:
ORA-01031: insufficient privileges


SQL>
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35506843
>>now the issue is this

Different question and if the below comment doesn't answer this, you should really ask it as a new question.

The user you are logged into is NOT a member of the dba unix group.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question