This discussion is archived
1 2 Previous Next 22 Replies Latest reply: Jul 26, 2013 1:28 PM by John Spencer RSS

Automatic restart services in 10gR2

BobKodomo Newbie
Currently Being Moderated

Hello all,

 

I'm more familiar with services in 11g using "srvctl add" command to add services to start istener, database, asm, crs, etc  automatically.

I was researching the web and found that in 10g, some guys are creating a script in /etc/init.d to automate the services to start automatically.

My question is:  command "srvctl add <service_name>" works the same in 10g as in 11g?

I need to automate the services start (asm, listener, crs and database) in 10gR2.

 

Thanks in advance.

  • 1. Re: Automatic restart services in 10gR2
    Asif Muhammad Guru
    Currently Being Moderated

    Hi Bob,

     

    Command srvctl was introduced from 9i onwards, and without a doubt it is used on 10g release. But as far as I know svrctl commands are used on RAC environment and I have not personally worked with automating services to start in LINUX, and I personally think that is not what srvctl tool server.

     

    But as you correctly pin pointed, if you wish to automate Oracle service startup during every OS startup then you will have to have startup script define in the /etc/init.d directory so that automatically the scripts are read and started.

     

    Please also note, you can also automatically shutdown Oracle services during OS shutdown process

     

    For further reading please refer:

    http://www.oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux.php

     

    Hope this helps!

    Best regards

  • 2. Re: Automatic restart services in 10gR2
    EdStevens Guru
    Currently Being Moderated

    ARM.Asif wrote:

     

    Hi Bob,

     

    Command srvctl was introduced from 9i onwards, and without a doubt it is used on 10g release. But as far as I know svrctl commands are used on RAC environment and I have not personally worked with automating services to start in LINUX, and I personally think that is not what srvctl tool server.

     

    But as you correctly pin pointed, if you wish to automate Oracle service startup during every OS startup then you will have to have startup script define in the /etc/init.d directory so that automatically the scripts are read and started.

     

    No.  If one is using Oracle Restart (as implied by the use of srvctl to register a service) then oracle restart takes care of this and you do NOT need the old scripts in init.d

    And it is not necessarily a RAC feature.  I have two servers running Grid Infrastructure to support a stand-alone (non-RAC) ASM instance, and Oracle Restart is part-and-parcel of GI.

     

    Please also note, you can also automatically shutdown Oracle services during OS shutdown process

     

    For further reading please refer:

    http://www.oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux.php

     

    Hope this helps!

    Best regards

  • 3. Re: Automatic restart services in 10gR2
    EdStevens Guru
    Currently Being Moderated

    BobKodomo wrote:

     

    Hello all,

     

    I'm more familiar with services in 11g using "srvctl add" command to add services to start istener, database, asm, crs, etc  automatically.

    I was researching the web and found that in 10g, some guys are creating a script in /etc/init.d to automate the services to start automatically.

    My question is:  command "srvctl add <service_name>" works the same in 10g as in 11g?

    I need to automate the services start (asm, listener, crs and database) in 10gR2.

     

    Thanks in advance.

    If you are registering services with srvctl, that is evidence that you are using Oracle Restart, a part of the Grid Infrastructure.  Since that is the case, oracle restart takes care of what those init.d scripts do ... automatic startup and shutdown when the os starts and stops.  The init.d scripts are for non-Oracle Restart installations.

  • 4. Re: Automatic restart services in 10gR2
    BobKodomo Newbie
    Currently Being Moderated

    I forgot to say that it's a stand alone non RAC database.

    Also, which profile of user should I use in 10g, root? I tried oracle user and I had some errors.  In 11g I user grid11g profile.

     

    Cheers.

  • 5. Re: Automatic restart services in 10gR2
    Asif Muhammad Guru
    Currently Being Moderated

    Hi,

     

    But as far as I know svrctl commands are used on RAC

     

    I have not worked on restart service using srvctl for automation apart from RAC. I have used /etc/init.d directories which has done the job for me on Non-Rac Installation.

     

    Anyways thanks for pointing out and correcting me on th respective thread Edstevens.

     

    Apologies for misconception...

     

    Best Regards

  • 6. Re: Automatic restart services in 10gR2
    BobKodomo Newbie
    Currently Being Moderated

    Thanks Asif and Ed for the quick response.

     

    Ed,

    1.) I'm a little confused with one thing: I knew about Oracle Restart, but in 10g, should I have to install it? Or it's part of Oracle Enterprise installation?

     

    2.) In 11g I used with grid11g profile:

    ASM start

    srvctl add asm -d (DG_NAME>

     

    Listener start

    srvctl add listener -l LISTENER

     

    I had errors running above cmds, which user or profile should I use in 10g?

     

    Thanks.

  • 7. Re: Automatic restart services in 10gR2
    Asif Muhammad Guru
    Currently Being Moderated

    Hi,

     

    Oracle restart is available in 11g onward. Please see doc:

    http://docs.oracle.com/cd/E11882_01/server.112/e22487/chapter1.htm

     

    But in the case of 10g, it is unavailable by default installation. I believe you will be able to work on the respective feature only if GI and/or RAC environment is configured.

     

    Best Regards,

  • 8. Re: Automatic restart services in 10gR2
    BobKodomo Newbie
    Currently Being Moderated

    Hi Asif,

    So it seems in 10g I'll have to use the scripts as I asked before? Can't I use srvctl to add these serices to auto start when OS reboots? As it's single instance and don't have RAC, just grid and crs?

    I guess I can use it but don't know how.

     

    If anyone have additional info that can give a light on this will be appreciated!

     

    Thanks.

  • 9. Re: Automatic restart services in 10gR2
    EdStevens Guru
    Currently Being Moderated

    BobKodomo wrote:

     

    I forgot to say that it's a stand alone non RAC database.

    So are mine.  Grid Infrastructure is necessary for RAC, but it is also used with stand-alone systems to support ASM.  I suppose one could install it just to get Oracle Restart, but that seems overkill to me and I've never heard of anyone doing that.

     

    Also, which profile of user should I use in 10g, root?

     

    Never, ever do anything with oracle while connected as root.

     

     

    I tried oracle user and I had some errors.  In 11g I user grid11g profile.

     

    "some errors"?   Now we start to see that you are asking us to play a game of "guess what's in my pocket".

     

    What errors?

     

     

    Could be a 10g issue.  I've been working with oracle since 7.3, but only used GI on 11.2

     

     

     

     

     

     

    Cheers.

  • 10. Re: Automatic restart services in 10gR2
    EdStevens Guru
    Currently Being Moderated

    ARM.Asif wrote:

     

    Hi,

     

    Oracle restart is available in 11g onward. Please see doc:

    http://docs.oracle.com/cd/E11882_01/server.112/e22487/chapter1.htm

     

    But in the case of 10g, it is unavailable by default installation. I believe you will be able to work on the respective feature only if GI and/or RAC environment is configured.

     

    Best Regards,

    My bad.  I didn't realize that restart was a new feature with 11g. 

  • 11. Re: Automatic restart services in 10gR2
    BobKodomo Newbie
    Currently Being Moderated

    Can someone that knows "how to" could POLITELY answer these questions ?

     

    1. Add ASM  service

    In 11g I used with grid11g profile:

    ASM start

    srvctl add asm -d <DG_NAME>

     

    When I try to execute it in 10g I had the following error:

    srvctl add asm -d DGDATA

    PRKO-2002 : Invalid command line option: -d

     

    2. Adding listener service

    In 11g, I was able to run this command:

    srvctl add listener -l LISTENER

    But in 10g I had the error:

    srvctl add listener -l LISTENER

    Usage: srvctl <command> <object> [<options>]

     

    What is the right command in 10g? I was able to run the both commands in 11g.

     

    Thanks in advance.

  • 12. Re: Automatic restart services in 10gR2
    rp0428 Guru
    Currently Being Moderated

    >

    Can someone that knows "how to" could POLITELY answer these questions ?

    >

    People that know "how to" are already trying to 'POLITELY answer these questions'.

     

    All you said was 'I had some errors'. How is anyone supposed to know what errors you are talking about?

     

    Oracle NEVER responds to a command with a statement like 'There were errors'. It provides an exception or error message or some descriptive text that describes the error or exception that occurred. When that happens then that is what you need to post: an EXACT copy of the exception or error message that you got along with an EXACT copy of the commands you were trying to execute.

     

    Now that you have started to do that you will likely get more helpful responses.

  • 13. Re: Automatic restart services in 10gR2
    EdStevens Guru
    Currently Being Moderated

    BobKodomo wrote:

     

    Can someone that knows "how to" could POLITELY answer these questions ?

     

    1. Add ASM  service

    In 11g I used with grid11g profile:

    ASM start

    srvctl add asm -d <DG_NAME>

     

    When I try to execute it in 10g I had the following error:

    srvctl add asm -d DGDATA

    PRKO-2002 : Invalid command line option: -d

     

    2. Adding listener service

    In 11g, I was able to run this command:

    srvctl add listener -l LISTENER

    But in 10g I had the error:

    srvctl add listener -l LISTENER

    Usage: srvctl <command> <object> [<options>]

     

    What is the right command in 10g? I was able to run the both commands in 11g.

     

    Thanks in advance.

    Well, since you are having trouble with 10g specifically, I will politely point you to the 10g reference at Server Control Utility Reference

    where you can see the valid options for the srvctl command under 10g.   I see that '-d' is not listed as a valid option for 'add asm'.  And 'listener' is not a valid option for the 'add' command.  Exactly as the error messages said.

  • 14. Re: Automatic restart services in 10gR2
    BobKodomo Newbie
    Currently Being Moderated

    Let me tell you one thing Ed Stevens. If you knew the simple answer of the question "what is the right command" you would answer with the command itself, not with these nonsense words. The case is that you don't know the answer,

1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points