how to stop askking parameter yes when executing srvctl remove service

Posted on 2011-04-29
Last Modified: 2013-12-18

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.

Question by:gopisera
    LVL 76

    Accepted Solution

    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.

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

    Assisted Solution


    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 ?

    LVL 76

    Assisted Solution

    by:slightwv (䄆 Netminder)
    Probably to script it without human intervention.

    Didn't think about trying -f.  My guess is it will still prompt for confirmation.
    LVL 7

    Assisted Solution

    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 ;)

    LVL 76

    Expert Comment

    by:slightwv (䄆 Netminder)
    You would think they would add that little note to the reference doc.
    LVL 8

    Assisted Solution

    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

    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

    Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: 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…
    Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
    This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
    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.

    728 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

    20 Experts available now in Live!

    Get 1:1 Help Now