Solved

SVRMGRL Command Line Parameters

Posted on 2002-07-17
7
1,837 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

829 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