bash_profile

All posts relating to Oracle database administration.

Moderator: Tim...

Re: bash_profile

Postby Tim... » Mon Dec 31, 2012 4:42 pm

Hi.

Well, I'm not sure why you have an sqlplus in the ORACLE_HOME, but I can see now why your path is not working.

You have your ORACLE_HOME set to this.

Code: Select all
/home/oracle/app/oracle/product/11.1.0./db_1


The path from the find command is this.

Code: Select all
/home/oracle/app/oracle/product/11.1.0/db_1


You have an extra "." after the "11.1.0" in the value.

Fix than and it should work.

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: 17950
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Tue Jan 01, 2013 1:52 pm

ok tim sir i got it right with the dot(.)
and now when i am running sqlplus and after that when i want to go the the parameter file location with the command (cd $ORACLE_HOME/dbs)
the error is
{SP2-0734: unknown command beginning "cd $ORACLE..." - rest of line ignored.}

and when i want to see my redolog and control files with the command {select name from v$controlfiles;} and {select name from v$datafiles;}
the error is

ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

thanks for helping and very sorry for troubling u sir..
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Tue Jan 01, 2013 5:34 pm

Hi.

Regarding the first error, it looks like you are trying to run "cd $ORACLE_HOME/dbs" from inside sqlplus. You can't do that as this is a UNIX/Linux command, not a sqlplus command.

If you want to move into that directory, switch to it before opening sqlplus.

Regarding the second error, it looks to me like Oracle is not started yet. Make sure you have edited the "/etc/oratab" file as described in this article.

http://www.oracle-base.com/articles/11g ... stallation

Then start and stop the database using the following command line utilities. This is *not* from within sqlplus.

Code: Select all
$ dbstart $ORACLE_HOME
$ dbshut $ORACLE_HOME


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: 17950
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Thu Jan 03, 2013 4:30 am

thanks a lot sir, thanks a lott...
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby syedhafeez69 » Thu Jan 03, 2013 7:09 am

Tim sir, when i am starting sqlplus and when i want to see the redolog and control files with the command {select name from v$controlfiles;} and {select name from v$datafiles;}
i am getting the same error

{ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0}

even after starting and shutting the database...
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Thu Jan 03, 2013 8:21 am

Hi.

That means the database has not started. What is the result of this command?

Code: Select all
ps -ef | grep smon


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: 17950
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Fri Jan 04, 2013 7:50 pm

The result of the command { ps -ef | grep smon } is

oracle 11624 11564 0 02:07 pts/1 00:00:00 grep smon
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Fri Jan 04, 2013 7:59 pm

Hi.

That means you didn't actually start the database. This means one of a couple of things:

1) You did not edit your "/etc/oratab" file correctly.
2) You didn't call dbstart correctly.

Please post the contents of your "/etc/oratab" file. Making sure it has the correct path to the ORACLE_HOME and the correct ORACLE_SID defined in it.

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: 17950
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Fri Jan 04, 2013 8:25 pm

The contents of /etc/oratab are...

{#



# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
prd:/home/oracle/app/oracle/product/11.1.0/db_1:Y
"/etc/oratab" 23L, 728C }
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby syedhafeez69 » Fri Jan 04, 2013 8:45 pm

The above are the contents of /etc/oratab.. Again i have started and shut the database with the commands { $ dbstart $ORACLE_HOME $ dbshut $ORACLE_HOME } respectively.. I get the same error...
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Fri Jan 04, 2013 8:57 pm

Hi.

Look at the first entry in this file. You have a SID of prd, when previously you said your SID was test.

Looks to me like you have the wrong information in the file, which is why the database won't start properly.

You must pay attention if you ever want to understand how to use oracle.

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: 17950
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Fri Jan 04, 2013 9:08 pm

ok here is my /etc/oratab file after editing

#



# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
test:/home/oracle/app/oracle/product/11.1.0/db_1:Y
"/etc/oratab" 23L, 729C


after that i have start and shut database then i run sqlplus and then when i want to see my redolg files its the same error as above..
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby syedhafeez69 » Fri Jan 04, 2013 9:37 pm

Tim sir... my SID is "test" and when i type {echo $ORACLE_SID} its giving the name as {test}.. and when i see my parameter file with the command {$ORACLE_HOME/dbs}
my pfile is {spfileprd.ora}... I think it should be {spfiletest.ora} acccording to my SID name.. How to change it.. ? ? ?
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

Re: bash_profile

Postby Tim... » Fri Jan 04, 2013 9:55 pm

Hi.

Create a pfile from the spfile. Create a new spfile from the pfile.

create pfile='/tmp/pfile.txt' from spfile='/path/to/prdspfile.ora';
create spfile from pfile='/tmp/pfile.txt';

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: 17950
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: bash_profile

Postby syedhafeez69 » Sat Jan 05, 2013 5:39 am

When i go with the first one {create pfile='/tmp/pfile.txt' from spfile='/path/to/prdspfile.ora';} the error is

ERROR at line 1:
ORA-01565: error in identifying file '/path/to/prdspfile.ora'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

and for the second {create spfile from pfile='/tmp/pfile.txt';} the error is

ERROR at line 1:
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/tmp/pfile.txt'..

I am extremely sorry for troubling you Tim sir, as I don't have any source of help other than you... Please help me...
syedhafeez69
Senior Member
 
Posts: 51
Joined: Thu Dec 27, 2012 11:37 am

PreviousNext

Return to Oracle Database Administration

Who is online

Users browsing this forum: No registered users and 1 guest