How to turn off and restart Linux ?
Shutting down, rebooting the computer from the shell or command line
Below is a list the commands that will enable a user to shut down, turn off, reboot, etc. their Linux computer from the command line.
- halt
- poweroff
- reboot
- shutdown
Commands with options:
/sbin/halt [-n] [-w] [-d] [-f] [-i] [-p] [-h]
/sbin/reboot [-n] [-w] [-d] [-f] [-i]
/sbin/poweroff [-n] [-w] [-d] [-f] [-i] [-h]
/sbin/reboot [-n] [-w] [-d] [-f] [-i]
/sbin/poweroff [-n] [-w] [-d] [-f] [-i] [-h]
OPTIONS
- -n
- Don't sync before reboot or halt.
- -w
- Don't actually reboot or halt but only write the wtmp record (in the /var/log/wtmp file).
- -d
- Don't write the wtmp record. The -n flag implies -d.
- -f
- Force halt or reboot, don't call shutdown
- -i
- Shut down all network interfaces just before halt or reboot.
- -h
- Put all harddrives on the system in standby mode just before halt or poweroff.
- -p
- When halting the system, do a poweroff. This is the default when halt is called as poweroff.
- Simply, Reboot command restart the Linux servers.

How to stop oracle database ?
Stopping/Shutdown the Oracle Database
There are certain ways to start oracle database like:- Using SQLPLUS
- Using Oracle Enterprise manager (If DB is configured with EM)
- Using Oracle Grid/cloud control (If DB is configured with GC)
1. Logon to the database server as the administrator/OS user 2. To start the database instance, go to Start -> Settings -> Control Panel -> Administrative Tools -> Services.
3. Scroll down to the service for the database, for example: OracleServiceORCL
4. Right click and select Stop. A dialog box appears showing the progress of the shut-donw and after a few seconds it will disappear.
The database instance service is now stopped
Linux Database Shutdown
1. Logon to the database server as the administrator/OS user
2. To start the database instance, go to Terminal and set below environment variable if already not.
On Bash shell,
export ORACLE_HOME=<ORACLE_HOME value like /u01/app/oracle/product/11.2/db_1>
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=<DB Name like orcl>
3. Connect to the database:
sqlplus / as sysdba OR Sqlplus sys/<pwd>@<TNS> as sysdba
4.enter the following command:
shutdown;
OR
Shutdown immediate;
OR
Shutdown abort; (for instant DB shutdown)

Different modes to shutdown Oracle Database
DATABASE SHUTDOWN IN DIFFERENT MODES
When shutting down an instance,
perform these steps, which are reverse from those you just saw when opening a
database:
- Close the database, including the data files and redo logs, so that it is no longer usable for normal tasks.
- Unmount the database from the instance so that only the instance memory structures and background tasks are left running without a database associated with them.
- Shut down the instance to close the control files.
