?
Solved

SVRMGRL Command Line Parameters

Posted on 2002-07-17
7
Medium Priority
?
1,980 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

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

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!

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup
Suggested Courses

762 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