Script Not Working [message #563909] |
Fri, 17 August 2012 15:50 |
|
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 #563916 is a reply to message #563915] |
Fri, 17 August 2012 17:35 |
|
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
|
|
|