For restart operation, we must stop and start the Oracle database.
In this article we will show the below scenarios;
- stop an instance of rack database
- stop all instance of rack database
- start an instance of rack database
- start all instance of rack database
To stop the Instance, we load the profile as follows, or with “. Oraenv”.
You can read the following articles to load profiles.
“How To Connect To Oracle With sqlplus“,
“How To Create .profile File To Connect The Oracle”
Stop an instance of rack database:
if you want to stop an instance of the database you should use the below commands.
After the -d parameter we write the database name, after the -i parameter we write the instance name.
1 2 |
[oracle@xx ~]$ . .profile.x [oracle@xx ~]$ srvctl stop instance -d x -i x1 |
You can also use the following commands after you connect the instance with sqlplus to close the instance.
1 2 |
shutdown transaction; <span lang="tr">//</span><span lang="en-US">Waits for existing transactions to finish.</span> |
1 2 |
shutdown immediate; //Closes transactions by rolling back. |
1 2 |
shutdown abort; //Closes the instance as if it pulled out the electricity. Requires instance recovery at bootup. |
Stop all instance of rack database:
If you want to stop the database you should use the below commands.
You can stop the database as follows. After the -d parameter we write the database name.
1 |
[oracle@xx ~]$ srvctl stop database -d x |
Start an instance of rack database:
If you want to open the database to work on only one instance, you can use the following commands after connecting to instance with sqplus.
1 2 |
Startup nomount; //Reads the spfile and starts the current instance. |
1 2 |
Startup mount; //the database can only be accessible for some management operations. |
1 2 |
Alter database open; //the database starts over the corresponding instance. |
If only the startup command is executed, the above operations are executed automatically in order.
Start all instance of rack database:
You can start the database as follows. After the -d parameter we write the database name.
1 |
[oracle@xx ~]$ srvctl start database -d x |