How do I set a password for the listener

Posted on 2006-04-10
Last Modified: 2013-12-11
Could someone tell me what the syntax is for setting a password for the listener and still enable the startup scripts (i.e. dbora) working whenever the server is rebooted?
Question by:sikyala
    LVL 47

    Expert Comment


    The information in this document is useful for system administrators and  
    database administrators trying to automate Oracle database startup and shutdown.
    The document describes the detailed steps for configuration on Red Hat Advanced  
    Server 2.1, SuSE SLES7 and United Linux 1.0 (SuSE SLES8 Edition).  
    The information may not apply to other Linux distributions.
    The following configuration is done to allow Oracle database be up and running
    in runlevels 3 (character mode) and 5 (X-Window system).  
    Since the configuration is based on dbstart and dbshut scripts provided by the
    Oracle Server installation, please see [NOTE:207508.1].
    The configuration also facilitates automated startup shutdown of Intelligent  
    Agent, Management Server and HTTP Server, which are available with Oracle Server.
    The information in this document does not apply to Oracle Internet Application
    Server. Still the script can be configured to handle starting up and shutting  
    down iAS processes.
    Configuring Linux for Automated Startup/Shutdown of Oracle Database
    1. Update 'oratab' (under /etc or /var/opt/oracle) as:
    where Y states that the database can be started up and shutdown using  
    2. Create the service script:
    Note: In Red Hat Advanced Server 2.1, the /etc/init.d is is a symbolic link to  
    Content of the script is as follows:
      # chkconfig: 35 99 10    
      # description: Starts and stops Oracle processes
      # Set ORA_HOME to be equivalent to the $ORACLE_HOME
      # from which you wish to execute dbstart and dbshut;
      # Set ORA_OWNER to the user id of the owner of the
      # Oracle database in ORA_HOME.
      ORA_HOME=<Type your ORACLE_HOME in full path here>
      ORA_OWNER=<Type your Oracle account name here>
      case "$1" in
           # Start the Oracle databases:
           # The following command assumes that the oracle login
           # will not prompt the user for any values
           su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
           # Start the TNS Listener
           su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
           # Start the Intelligent Agent
           if [ -f $ORA_HOME/bin/agentctl ]; then
              su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl start"
              su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_start"
           # Start Management Server
           if [ -f $ORA_HOME/bin/oemctl ]; then
              su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl start oms"
           # Start HTTP Server
           if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then
              su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl start"
           touch /var/lock/subsys/dbora
           # Stop HTTP Server
           if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then
              su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl stop"
           # Stop the Intelligent Agent
           if [ -f $ORA_HOME/bin/agentctl ]; then
              su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl stop"
              su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_stop"
           # Stop the TNS Listener
           su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
           # Stop the Oracle databases:
           # The following command assumes that the oracle login
           # will not prompt the user for any values
           su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
           rm -f /var/lock/subsys/dbora
      # End of script dbora
    NOTE 1:
    The lines:
      # chkconfig: 35 99 10    
      # description: Starts and stops Oracle database
    are mandatory since they describe the characteristics of the service where:
      35 means that the service will be started in init levels 3 and 5 and will be  
         stopped in other levels.
      99 means that the service will be started at the near end of the init level  
      10 means that the service will be stopped at the near end of the init level  
    NOTE 2:  
    The Management Server is not shut down during service stop since it requires  
    interaction and there is no harm in system killing the processes since the  
    database is shut down already.
    3. Set script permissions:
        chmod 755 /etc/init.d/dbora
    3. Register the Service
        /sbin/chkconfig --add dbora
    This action registers the service to the Linux service mechanism. On SuSE SLES7
    and Red Hat Advanced Server 2.1 it will arrange symbolic links under  
    rc<runlevel>.d directories to /etc/init.d/dbora script.
    On SuSE SLES7 the following symbolic links are created:
    On Red Hat Advanced Server 2.1 the following symbolic links are created:
    The symbolic links are not created in United Linux 1.0 (SuSE SLES8 Edition)  
    with the 'chkconfig -add' command.  
    To have the symbolic links created run the following in addition:
       /sbin/chkconfig --set dbora 35
    After this action, the following symbolic links will be created pointing  
    to /etc/init.d/dbora script:
    In all cases, the 'dbora' service will be running in runlevels 3,5 and it will  
    be stopped in other runlevels (i.e. 0,1,2,4,6).
    - Linux man page: chkconfig (8)
    - Linux man page: chmod (1)  
    - Linux man page: init.d (7)  
    - Linux man page: ln (1)  
    [NOTE:207508.1] Dbstart does not work if using an spfile only
    [NOTE:126146.1] dbora fails to start the database


    This document discusses methods for automatically starting up and shutting    
    down Oracle instances during UNIX system startup or shutdown.  Specific    
    schemes for performing these actions on Sun Solaris are presented, along  
    with a listing of the important scripts and directories that come into play in  
    the process.    
    For more detailed explanations and alternatives, please refer to the System    
    Administrator's Guide for Sun Solaris.    
    Search Words: dbstart, dbshut
    Files of Interest In Your Oracle Installation                                  
    The following list summarizes the functions performed by the different Oracle    
    startup and shutdown scripts (which are invoked during system startup and    
    shutdown, respectively).    
    Script                    Description  
    $ORACLE_HOME/bin/dbstart |Ensures a clean startup of database instance(s),  
                             |even after system failure    
    $ORACLE_HOME/bin/dbshut  |Ensures a clean shutdown for data base instances      
    /etc/oratab    or        |Contains a field that specifies whether a    
    /var/opt/oracle/oratab   |particular database instance should be brought  
                             |up/down at system startup/shutdown time. By    
                             |specifying "Y" in this field, the "dbstart" and    
                             |"dbshut" scripts bring this database instance up or    
    System V Versus BSD UNIX Startup and Shutdown Procedures  
    Since the system re-boot procedure is unique for each Unix Operating System,  
    but can be generalized based on whether the Operating System is System V-based  
    or BSD-based, this section describes the generic approach taken by System V  
    and BSD-based UNIX operating systems at system startup and shutdown time.  For  
    more specific information, refer to the appropriate operating system-specific  
    section below.  
    System V Procedures      
    - - - - - - - - - -  
    System V initialization scripts are contained in /etc/rc<n>.d directories    
    where "n" is the run-level value of the script.  A run-level of 0 usually    
    signifies power shutdown mode, while a run-level of 2 signifies multi-user    
    The directories contain initialization scripts such as "S75cron" and "K30tcp".  
    These scripts are named using the following method:    
         [K or S][two-digit number][descriptive filename]    
    Names starting with "S" indicate scripts that are called at startup; names  
    starting with "K" indicate scripts that are called at shutdown time.      
    Scripts containing larger numbers in their names are executed after those    
    with lower numbers.  Oracle startup scripts typically contain larger    
    numbers in their names, such as "S99oracle", indicating that the script    
    should be run after the system has been started up.  Oracle shutdown script  
    names, on the other hand, usually contain smaller numbers, such as    
    "K01oracle" indicating that the script should be run before system shutdown.  
    BSD Procedures      
    - - - - - - -  
    BSD-based systems, use /etc/rc*, files, such as /etc/rc, /etc/rc.local and  
    so on, at system startup time.                    
    During system shutdown, the /etc/shutdown command is invoked before any    
    system or system-defined scripts.  Some implementations invoke  
    /etc/rc.shutdown at shutdown time.    
    Sun Solaris                                                                    
    - - - - - -  
         Relevant Files                                                              
            /etc/inittab           -- Controls the initialization process    
            /etc/rc2               -- Script to start/stop processes at run    
                                      level 2    
            /etc/rc0               -- Script to start/stop processes at run    
                                      level 0    
            /etc/rc2.d/S99dbstart  -- Link to the script /etc/init.d/dbstart  
            /etc/rc0.d/K01dbshut   -- Link to the script /etc/init.d/dbshut    
            /var/opt/oracle/oratab -- Oracle oratab file                            
    The process of startup and shutdown for Solaris 2.3 is similar to that of    
    OSF/1, the only difference being that all the appropriate scripts and    
    directories can be accessed from /etc instead of /sbin (directories such as    
    rc0.d, rc2.d and others are actually located in /etc).  Scripts such as        
    rc0, rc2, are symbolic links to corresponding scripts in /sbin.    
    /etc/init.d/dbstart and /etc/init.d/dbshut are simple one-line scripts    
    containing the following commands, respectively:            
        su - <oracle_owner> -c <$ORACLE_HOME>/bin/dbstart            
        su - <oracle_owner> -c <$ORACLE_HOME>/bin/dbshut                
    where "<$ORACLE_HOME>" stands for the path to which $ORACLE_HOME points, and    
    <oracle_owner> stands for the userid who owns the Oracle installation.    
    Unlike with OSF/1, the "start" and "stop" parameters, passed to the scripts by  
    the system, are ignored by /etc/init.d/dbstart and /etc/init.d/dbshut.    
    Note: please make sure that both dbstart and dbshut in /etc/init.d are          
          executable by the oracle userid.                                          
    For more details of the initialization process, please refer to    


    Accepted Solution

    Closed, 500 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    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

    How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
    From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
    Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
    This video shows how to recover a database from a user managed backup

    754 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

    23 Experts available now in Live!

    Get 1:1 Help Now