To enable the Database Agent to start automatically whenever the machine starts up:

  1. Create an initialization script that starts the agent, as in the sample initialization script that is an attachment to this page.

    In your script, set the JAVA and AGENT_HOME values to the paths for your system. Also, configure agent options and heap size, as needed.

  2. Enable execution permissions for the script. For example, given an initialization script named db-agent, enter:

    sudo chmod 775 db-agent
  3. Place the script in the initialization directory on your system, typically /etc/init.d. Alternatively, create a symbolic link to the script from the init.d directory to the script if you want to keep it in another location. 

  4. Add the script as a service as follows:

    • For Red Hat and most Linux Operating Systems, run these commands, replacing db-agent with the name of your file or symbolic link:

      chkconfig --add db-agent 
      chkconfig --level 2345 db-agent on


    • For Ubuntu and Debian Operating Systems, run this command, replacing db-agent with the name of your file or symbolic link:

      update-rc.d -f db-agent start 99 2 3 4 5 . 

      In the command: 

      • start is the argument given to the script (start, stop).
      • 99 is the start order of the script (1 = first one, 99 = last one)
      • 2 3 4 5 are the runlevels to start
      • Be sure to include the dot (.) at the end of the command.

The Database Agent now starts automatically upon machine startup. When setting the agent to automatically start up using Task Scheduler when the machine starts or restarts, ensure the agent runs with the highest privileges available.