• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 577
  • Last Modified:

how to stop askking parameter yes when executing srvctl remove service


I am using script to remove the service.  But when i am removing the service it is aksing for y/n.
So, the script stops at that point.

How to pass the parameter yes to the command  it self.

srvctl remove service -d <dbname> -s <service_name>

asking for y/n

How to stop asking the parameter y/n.


Thanks,
0
gopisera
Asked:
gopisera
  • 3
  • 2
5 Solutions
 
slightwv (䄆 Netminder) Commented:
There doesn't appear to be a document flag like -y for remove database but I would try it to see if it is undocumented.

http://download.oracle.com/docs/cd/E14072_01/server.112/e10595/restart005.htm#i1010691

If it doesn't work, what OS?  You might be able to pipe the 'Y' into the command or use redirects.
0
 
PilouteCommented:
Hi,

Isn't that only an approval request ? Like 'do you really want to remove it ?'.

In that case, have you tryed adding '-f' flag, that forces the remove action ?

Cheers,
P
0
 
slightwv (䄆 Netminder) Commented:
Probably to script it without human intervention.

Didn't think about trying -f.  My guess is it will still prompt for confirmation.
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!

 
PilouteCommented:
Quote from the 10g RAC Admin doc :

If you do not use the force flag (-f), then Oracle prompts you to confirm whether to proceed. If you use the force (-f) option, then the remove operation proceeds without prompting and continues processing even when it encounters errors. Even when the CRS resources cannot be removed, the OCR configuration is removed, so that the object now appears not to exist, but there are still CRS resources. Use the -f option with extreme caution because this could result in an inconsistent OCR.

Have no environment to test it right now, but it is supposed to work ;)

P
0
 
slightwv (䄆 Netminder) Commented:
You would think they would add that little note to the reference doc.
0
 
Chakravarthi AyyalaDatabase AdministratorCommented:
Yes. I personally used this in the past and it worked.
Please use the -f force option.
===================================================
srvctl remove service -h

Removes the service from Oracle Clusterware management.

Usage: srvctl remove service -d <db_unique_name> -s <service_name> [-f]
    -d <db_unique_name>      Unique name for the database
    -s <service>             Service name
    -f                       Force remove
    -h                       Print usage
====================================================
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now