Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQLPlus from AIX - Where to spool to

Status
Not open for further replies.

MCubitt

Programmer
Mar 14, 2002
1,081
GB
I am writing a script on AIX to SQLPLUS with /nolog and to run a script.

Within AIX I specifiy the location and file of the script by /unix/format/path.

How do I SPOOL (within the SQL script) to /the/same/place ? /this/is/an/illegal/filename


SP2-0333: Illegal spool file name: "/home/oracle/keymed/IFSTtoIFSD/IFSD.log
# Start log file" (bad character: ' ')
SP2-0306: Invalid option.

Sorry if this is an ORACLE question, it kind of falls between the two.
 
Are you including "'s in the spool file name? It's not necessary AFAIK, so taking the quotes out might work. Let us know.
 
Ken - Here are the small scripts

Unix script:
set ORACLE_SID=IFSD; export ORACLE_SID
sqlplus /nolog @/home/oracle/keymed/IFSTtoIFSD/shutdownIFSD.sql


The SQL script is:
spool /home/oracle/keymed/IFSTtoIFSD/IFSD.log
connect internal
select * from v$database;
spool off;
exit
 
I don't see anything wrong with what you have apart from

Why are you connecting internal ?

You do not need the ';' after spool off

here is an example that I use daily

sqlplus -s / << EOF
set pages 500
set feedback off
spool /tmp/showtbs1
select tablespace_name from dba_tablespaces;
spool off
EOF

Alex
 
Thanks Alex. In actual fact I am directing ourput from sqlplus command to the log file, from the UNIX shell. This was the suggestion from another post in the Oracle forum.

Ironic really, in the AIX forum the suggested method is within Oracle's SQLPlus and in the Oracle forum it is within AIX.

As always, more than one way to skin a cat - depending just what you want to do with that skin (or cat!)

Thank you again.
 
Yes, I saw the other post - I have come across quite a few UNIX admins who insist on making code as compact as possible - sometimes it does become very hard to read though :)

Alex
 
i believe the &quot;connect internal&quot; must be left over from using svrmgrl! generally i do 'sqlplus &quot;/ as sysdba&quot;' and go right in. however please do not imagine that i am a DBA.

IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top