Solved

SVRMGRL Command Line Parameters

Posted on 2002-07-17
7
1,925 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

717 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