Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SVRMGRL Command Line Parameters

Posted on 2002-07-17
7
Medium Priority
?
2,042 Views
Last Modified: 2012-05-04
I am trying to pass both the logon and the command to svrmgrl from the command line.

ie.

set oracle_sid=orcl
svrmgrl "connect system/manager" "shutdown immediate"

This fails with a too many parameters error.

Does anyone know if it is possible to pass two commands?

P.S. I know the following works but I need to pass TWO parameters!

ie.

set oracle_sid=orcl
svrmgrl "connect system/manager"
0
Comment
Question by:WHITER99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 7160346
You may need to use two files:
1. an operating system script (batch) file
2. an SQL file that is passed as a parameter to svrmgrl

Your O/S file should look like this:
set oracle_sid=orcl
svrmgrl @myscript

And the file "myscript.sql" looks like this:
connect system/manager
shutdown immediate;
exit;

Then you only need one parameter (the name of your O/S script file) wherever you are trying to do this.
0
 
LVL 2

Expert Comment

by:stmontgo
ID: 7160579
markgeer has provided a good suggestion,

also, consider using sqlplus to this instead, svrmgr is no more in 9i and if you ever upgrade you'll have to change all your scripts.

you can connect in 8i and higher through sqlplus like  sqlplus "/as sysdba"
...same as connect internal
0
 

Author Comment

by:WHITER99
ID: 7161646
I am aware that I could pass an SQL file to svrmgrl.

I am using a third party piece of scheduling software and would like to dynamically pass the command through from this software.  Now I could simply ECHO statements to a .SQL and use that but this struck my as a bit tacky and that I would prefer simply to pass the connect string and the command directly to svrmgrl.

So anyone got any ideas how to pass both a connect string and a command to svrmgrl from the command line?

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:baliga
ID: 7161791
Could you be more specific , how you would be scheduling
these commands. i.e. what is ur frontend / application
0
 

Author Comment

by:WHITER99
ID: 7161950
My front end application is a bespoke schedule written in house.  It handles VBA, Batch Files and SQL files...it communicates directly with Oracle 8i.  

But forgetting the front end application for a moment..can you send (from the command line) both the connect string and a shutdown command without using .SQL files.

You can all the DOS pipes and redirections you want or maybe svrmgrl will accept more than one parameter from the command line.
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 150 total points
ID: 7162955
I don't know of a way to pass the connect string and a shutdown command to svrmgrl/sql*plus.  I always use the SQL file approach.
0
 

Author Comment

by:WHITER99
ID: 7190159
After all this time I figured that you may as well have the points...you, at least, told me what I already suspected that it couldn't be done.

Worth asking though.

Cheers,
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Via a live example, show how to take different types of Oracle backups using RMAN.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question