Automate startup and shutdown on UNIX
You can modify startup and shutdown scripts on UNIX™ to automatically start and shut down the database server.
UNIX startup script
Modify the UNIX startup script to start the database server automatically when your computer enters multiuser mode.
- Add UNIX and database server
utility commands to the UNIX startup
script so that the script performs the following actions:
- Sets the ONEDB_HOME environment variable to the full path name of the directory in which the database server is installed.
- Sets the PATH environment variable to include the $ONEDB_HOME/bin directory.
- Sets the ONEDB_SERVER environment variable so that the sysmaster database can be updated (or created, if necessary).
- Runs the oninit command, which starts the database server and leaves it in online mode.
- If you plan to start multiple versions of the database server (multiple residency), you must add commands in the script to set the ONCONFIG and ONEDB_SERVER environment variables and run the oninit command for each instance of the database server.
- If different versions of the database server are installed in different directories, you must add commands to the script to set the ONEDB_HOME environment variable and repeat the preceding steps for each version.
UNIX shutdown script
Modify your UNIX shutdown script to shut down the database server in a controlled manner whenever UNIX shuts down. The database server shutdown commands run after all client applications complete transactions and exit.
- Add UNIX and database server
utility commands to the UNIX shutdown
script so that the script performs the following tasks:
- Sets the ONEDB_HOME environment variable to the full path name of the directory in which the database server is installed.
- Sets the PATH environment variable to include the $ONEDB_HOME/bin directory.
- Sets the ONCONFIG environment variable to the appropriate configuration file.
- Runs the onmode -ky command, which initiates an immediate shutdown and takes the database server offline.
- If you are running multiple versions of the database server (multiple residency), you must add commands in the script to set the ONCONFIG environment variable and run the onmode -ky command for each instance.
- If different versions of the database server are installed in different directories, you must add commands to the script to set the ONEDB_HOME environment variable and repeat the preceding steps for each version.