bash_profile

All posts relating to Oracle database administration.

Moderator: Tim...

bash_profile

Postby syedhafeez69 » Thu Dec 27, 2012 11:46 am

hello.. I have oracle 10g on linux platform. After the installation of oracle i configured bash profile.I configured it correctly, after configuring when i run bash profile by the statement {. .bash_profile} its giving the following errors..
/home/oracle/app/oracle/product/11.1.0/db_1': not a valid identifier
bash: export: `=test': not a valid identifier
PLEASE HELP ME WITH THIS....
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Thu Dec 27, 2012 12:16 pm

Hi.

It sounds like you've made a mistake in the file.

Please post the contents of the file, so I can see where the mistake is.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Thu Dec 27, 2012 4:19 pm

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
export $ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0/db_1
export $ORACLE_SID=test
PATH=$PATH:$ORACLE_HOME/bin

export PATH
unset USERNAME
~

OK here is my bash profile.... after this when i run bash profile by the statement {. .bash_profile} its giving the following errors..
/home/oracle/app/oracle/product/11.1.0/db_1': not a valid identifier
bash: export: `=test': not a valid identifier
PLEASE HELP ME WITH THIS....
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Thu Dec 27, 2012 9:06 pm

Hi.

These two lines are incorrect:

Code: Select all
export $ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0/db_1
export $ORACLE_SID=test


They should be:

Code: Select all
export ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0/db_1
export ORACLE_SID=test


You only use the $ prefix when you are referencing a value from an existing variable. Bot when you are creating a new one or exporting a variable.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Fri Dec 28, 2012 3:05 pm

ok tom thanks for that i got the bash profile correct.. now when i am switching to oracle user by the command { su - oracle } its giving the same error
[-bash: export: `=/home/oracle/app/oracle/product/11.1.0./db_1': not a valid identifier
-bash: export: `=test': not a valid identifier]
but its switching to the oracle user... and after this when i am running sqlplus its again giving the error as
[ -bash: sqlplus: command not found ]..

sorry for inconvenience.. and thanks a lot for the help....
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Fri Dec 28, 2012 3:26 pm

Hi.

I doesn't look like you've changed anything to me.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Sat Dec 29, 2012 3:36 am

ok tim here is my bash profile after the changes

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
export ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0/db_1
export ORACLE_SID=test
PATH=$PATH:$ORACLE_HOME/bin

export PATH
unset USERNAME
~
~
~
~
~
~
~
~
~
".bash_profile" 14L, 283C ...

i seems to get it right.. i need u to have a look at once... thanx
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Sat Dec 29, 2012 9:24 am

Hi.

It looks fine. Not sure what can be wrong. What happens if you switch the two lines to:

Code: Select all
ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0/db_1; export ORACLE_HOME
ORACLE_SID=test; export ORACLE_SID


Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Sat Dec 29, 2012 12:31 pm

its giving the same error tim when i am switching to the oracle user [su - oracle]
-bash: export: `=/home/oracle/app/oracle/product/11.1.0./db_1': not a valid identifier
-bash: export: `=test': not a valid identifier
i think bash profile would have given the error there itself if its not properly configured.... it would have given error at the time of running it{. .bash_profile}
thanks
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Sat Dec 29, 2012 1:55 pm

Hi.

This does not make sense. I can only assume you are editing the wrong .bash_profile file. Please post the output from the following command:

Code: Select all
cat /home/oracle/.bash_profile


Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Sat Dec 29, 2012 2:49 pm

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
export $ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0./db_1
export $ORACLE_SID=test
PATH=$PATH:$ORACLE_HOME/bin

export PATH
unset USERNAME

{ this is the output of the command cat /home/oracle/.bash_profile }
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Sat Dec 29, 2012 3:59 pm

Hi.

So that is the answer. All the changes I've been asking you to do should have been done in the "/home/oracle/.bash_profile" file, but as you can see you still have the old entries.

Edit this file, changing those two entries to:

Code: Select all
export ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0./db_1
export ORACLE_SID=test


You still have the $ in front of the variables, which is causing the error message.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Sun Dec 30, 2012 12:56 pm

ok Tim i now i got the output of the command [cat /home/oracle/.bash_profile] as : -

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
export ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0./db_1
export ORACLE_SID=test
PATH=$PATH:$ORACLE_HOME/bin

export PATH
unset USERNAME

after this when i am running sqlplus by the command [sqlplus / as sysdba] its giving the error as
{-bash: sqlplus: command not found}
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Sun Dec 30, 2012 5:07 pm

Hi.

Your PATH has been set to include "$ORACLE_HOME/bin", which should be the location of the sqlplus binary. If it is not it means one of two things:

1) You've not installed the Oracle software yet.
2) You've installed it, but not into the location you've set your ORACLE_HOME to.

To check you have used the correct path in the ORACLE_HOME definition, run the following command as the "root" user.

Code: Select all
find / -name sqlplus


Post the output of this command here.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Mon Dec 31, 2012 12:11 pm

hi tim..
the output of the command [find / -name sqlplus] is

find: /proc/26431/task: No such file or directory
/home/oracle/app/oracle/product/11.1.0/db_1/sqlplus
/home/oracle/app/oracle/product/11.1.0/db_1/bin/sqlplus
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Next

Return to Oracle Database Administration

Who is online

Users browsing this forum: No registered users and 6 guests