How can we implement Oracle Database restart? This is a problem that many people have mentioned. The following describes how to restart the Oracle database for your reference.
1. Stop various applications at the application layer.
2. Stop the listening process of oralce:
$ Lsnrctl stop
3. Back up the control file under an exclusive system user:
SQL> alter database backup controlfile to trace;
4. Under an exclusive system user, manually switch and recreate the log file to ensure that the modified data is saved to the file:
SQL> alter system switch logfile;
5. Run the following SQL statement under an exclusive system user to generate the kill_all_session. SQL file for killing database user connections:
Set head off;
Set feedback off;
Set newpage none;
Spool/oracle_backup/bin/kill_all_session. SQL
Select 'alter system kill session ''' | sid | ',
'| Serial # | ''';' from v $ session where username is not null;
Spool off;
6. Run the kill_all_session. SQL file to kill database user connections under an exclusive system user:
SQL> @/oracle_backup/bin/kill_all_session. SQL
7. Shut down the database in the immediate Mode under an exclusive system user:
SQL> shutdown immediate;
Or
SVRMGRL> shutdown immediate;
8. Start the oralce listening process:
$ Lsnrctl start
9. Start the oralce database under an exclusive system user:
$ Sqlplus/nolog
SQL> connect/as sysdba
SQL> startup;
Or:
$ Svrmgrl
SVRMGRL> connect internal;
SVRMGRL> startup;
10. Start various applications at the application layer.
The preceding describes how to restart the Oracle database.
Use dynamic SQL for Oracle stored procedures
Oracle string connection method
JAVA Implementation of Oracle Storage Process Creation
Oracle background process Introduction
Setting of Oracle automatic archiving Mode