Solved

SVRMGRL Command Line Parameters

Posted on 2002-07-17
7
1,741 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 34

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 34

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.

Join & Write a Comment

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now