Home » Infrastructure » Linux » Script Not Working (RHE 6.3 64bit, 11g)
Script Not Working [message #563909] Fri, 17 August 2012 15:50 Go to next message
maverick34
Messages: 4
Registered: August 2012
Location: South Coast UK
Junior Member
Installed 11g for the first time last week and trying to get myself up to speed with Oracle as part of a week need. I have a database, tables with data in and trying to amend a script to perform some automation.

On a command line if I
Quote:

[oracle@mark-rh6-oracle XXXXXXX]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 17 21:11:16 2012

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter system switch logfile ;

System altered.

SQL>


all is good. However, from the same terminal if I run ( a cut down part of the script ) with the same SID/HOME that has already been previously ...

#!/bin/sh

export ORACLE_SID=markdb1
export ORACLE_HOME=/oracle/product/11.2.0/dbhome_1

echo "Switching logfiles"

sqlplus -S <<+++
/ as sysdba

    alter system switch logfile;
    alter system switch logfile;
    alter system switch logfile;
    alter system switch logfile;
    alter system switch logfile;
+++


The result is ...

Quote:
[oracle@mark-rh6-oracle MIGRATOR]$ ./mark1.sh
Switching logfiles
alter system switch logfile
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0


alter system switch logfile
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0


alter system switch logfile
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0


alter system switch logfile
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0


alter system switch logfile
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0


I know the database is running and I think the script is ok but suspect that something else is not correctly set. Would appreciate some advice on why I'm seeing this problem.

Thanks in advance.... Mark
Re: Script Not Working [message #563910 is a reply to message #563909] Fri, 17 August 2012 16:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
PATH is not set (at the same value).

Regards
Michel
Re: Script Not Working [message #563912 is a reply to message #563910] Fri, 17 August 2012 16:42 Go to previous messageGo to next message
maverick34
Messages: 4
Registered: August 2012
Location: South Coast UK
Junior Member
Michel
Thank you for taking the time to respond. This is something I looked at previously and checked the path from the command line and during execution of the script and they are the same. Just reran the script with the addition of setting the PATH variable to the same as a "echo $PATH" command line response and it makes no difference.
Re: Script Not Working [message #563913 is a reply to message #563912] Fri, 17 August 2012 16:54 Go to previous messageGo to next message
maverick34
Messages: 4
Registered: August 2012
Location: South Coast UK
Junior Member
Michel
Appended a "/" to the ORACLE_HOME setting and the script started to work. Will amend the main script in the morning and see what happens
Thanks
Mark
Re: Script Not Working [message #563914 is a reply to message #563913] Fri, 17 August 2012 17:16 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>[oracle@mark-rh6-oracle XXXXXXX]$ sqlplus / as sysdba
>SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 17 21:11:16 2012

V11.2.0.1 is NOT certified on RH6!
bcm@bcm-laptop:~$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
bcm@bcm-laptop:~$ sqlplus user1/user1

SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 17 15:14:58 2012

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

15:14:58 SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
bcm@bcm-laptop:~$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/
bcm@bcm-laptop:~$ sqlplus user1/user1

SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 17 15:15:35 2012

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

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0


Enter user-name: ^C
bcm@bcm-laptop:~$ 

Re: Script Not Working [message #563915 is a reply to message #563914] Fri, 17 August 2012 17:29 Go to previous messageGo to next message
maverick34
Messages: 4
Registered: August 2012
Location: South Coast UK
Junior Member
BlackSwan

Thanks for the info.

Have altered the script and it is running now and will cycle through adding data, updating it and taking backups for the next few hours. I'll review the output in the morning along with hunting down a support matrix.
Re: Script Not Working [message #563916 is a reply to message #563915] Fri, 17 August 2012 17:35 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
IMO, when ORACLE_HOME has rightmost character being a slash ("/") [as shown in my previous post], errors do result.

we have no idea what you have or do since you only tell us what you think exists,
instead of actually SHOWING us via COPY & PASTE what really exists (or not).

>Have altered the script and it is running now and will cycle through adding data,
new script could be used strictly for testing & simply does

SELECT SYSDATE FROM DUAL;
EXIT

since actual content of the script is not entirely relevant.

[Updated on: Fri, 17 August 2012 17:54]

Report message to a moderator

Previous Topic: Insufficient disk space for Oracle installation
Next Topic: not able to ping from host to guest os nor guest to host os (2 Merged)
Goto Forum:
  


Current Time: Thu Mar 28 10:55:14 CDT 2024