Or if you are using shell scripts...then:
/bin/cat <<EOF | $ORACLE_HOME/bin/sqlplus -s "sys/manager@$ORACLE_SID as sysdba" > /dev/null
shutdown immediate
exit
EOF
Main Topics
Browse All TopicsHi All,
How to write following into to one script?
ORACLE920>>sqlplus
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Feb 24 18:04:39 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Enter user-name: sys as sysdba
Enter password: manager
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL-SYS>shutdown abort
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: catchmeifuwantPosted on 2004-02-24 at 02:29:20ID: 10439660
---Start of Script
sqlplus "sys/manager@<sid> as sysdba" @shutdown.sql
-- End of Script
--- Start of SQL Script(shutdown.sql)
shutdown immediate
exit
-- End of sql script
================
Save all your queries in a sql file and execute it from the script that connects to sqlplus