You can start and stop the database manually or set it to automatically stop or start when the system shuts down or starts up. 1) Manual Shutdown and Startup 2) Automatic Shutdown and Start-Up 3) Starting and stopping services using configuration script 1)Manual Shutdown and Startup: Stopping Database and Listener Services #Login as oracle user and source the environment variables. [oracle@orahost ~]$ id uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba) [oracle@orahost ~]$ . oraenv ORACLE_SID = [oracle] ? FREE The Oracle base has been set to /opt/oracle [oracle@orahost ~]$ env | grep ORA ORACLE_SID=FREE ORACLE_BASE=/opt/oracle ORACLE_HOME=/opt/oracle/product/23ai/dbhomeFree #Ensure Database service is running on server. [oracle@orahost ~]$ ps -ef | grep pmon oracle 1925 1 0 09:17 ? 00:00:00 db_pmon_FREE oracle 3758 3711 0 09:39 pts/0 00:00:00 grep --color=auto pmon #Ensure LISTENER service is running on server. [oracle@orahost ~]$ ps -ef | grep tns root 5 2 0 09:16 ? 00:00:00 [netns] oracle 1730 1 0 09:16 ? 00:00:00 /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr LISTENER -inherit oracle 3762 3711 0 09:40 pts/0 00:00:00 grep --color=auto tns #Login as "sqlplus / as sysdba" and shutdown the database. [oracle@orahost ~]$ sqlplus / as sysdba SQL*Plus: Release 23.0.0.0.0 - Production on Thu May 16 09:40:06 2024 Version 23.4.0.24.05 Copyright (c) 1982, 2024, Oracle. All rights reserved. Connected to: Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free Version 23.4.0.24.05 SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- FREE READ WRITE SQL> col name for a20 SQL> select CON_ID,NAME,OPEN_MODE from v$pdbs; CON_ID NAME OPEN_MODE ---------- -------------------- ---------- 2 PDB$SEED READ ONLY 3 FREEPDB1 READ WRITE SQL> SHUTDOWN IMMEDIATE; Database closed. Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free Version 23.4.0.24.05 #At OS level, stop the LISTENER services by executing "lsnrctl stop" command. [oracle@orahost ~]$ lsnrctl stop LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 16-MAY-2024 09:43:15 Copyright (c) 1991, 2024, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orahost.localhost.localdomain)(PORT=1521))) The command completed successfully #Verify both Database and LISTENER services are not running on server. [oracle@orahost ~]$ ps -ef | grep pmon oracle 3826 3711 0 09:43 pts/0 00:00:00 grep --color=auto pmon [oracle@orahost ~]$ ps -ef | grep tns root 5 2 0 09:16 ? 00:00:00 [netns] oracle 3835 3711 0 09:43 pts/0 00:00:00 grep --color=auto tns Starting Database and Listener Services #Login as oracle user, source the environment variables and start the database using "startup" command. [oracle@orahost ~]$ sqlplus / as sysdba SQL*Plus: Release 23.0.0.0.0 - Production on Thu May 16 09:48:55 2024 Version 23.4.0.24.05 Copyright (c) 1982, 2024, Oracle. All rights reserved. Connected to an idle instance. SQL> startup; ORACLE instance started. Total System Global Area 844226552 bytes Fixed Size 5365752 bytes Variable Size 343932928 bytes Database Buffers 490733568 bytes Redo Buffers 4194304 bytes Database mounted. Database opened. SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- FREE READ WRITE SQL> col name for a20 SQL> select CON_ID,NAME,OPEN_MODE from v$pdbs; CON_ID NAME OPEN_MODE ---------- -------------------- ---------- 2 PDB$SEED READ ONLY 3 FREEPDB1 READ WRITE #Execute below command to open all pluggable databases. Here, PDB is already open. SQL> ALTER PLUGGABLE DATABASE ALL OPEN; Pluggable database altered. SQL> select CON_ID,NAME,OPEN_MODE from v$pdbs; CON_ID NAME OPEN_MODE ---------- -------------------- ---------- 2 PDB$SEED READ ONLY 3 FREEPDB1 READ WRITE #Start the LISTENER services by executing "lsnrctl start" command. [oracle@orahost ~]$ lsnrctl start LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 16-MAY-2024 09:51:16 Copyright (c) 1991, 2024, Oracle. All rights reserved. Starting /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 23.0.0.0.0 - Production System parameter file is /opt/oracle/product/23ai/dbhomeFree/network/admin/listener.ora Log messages written to /opt/oracle/diag/tnslsnr/orahost/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orahost.localdomain)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orahost.localhost.localdomain)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 23.0.0.0.0 - Production Start Date 16-MAY-2024 09:51:16 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Default Service FREE Listener Parameter File /opt/oracle/product/23ai/dbhomeFree/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/orahost/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orahost.localdomain)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) The listener supports no services The command completed successfully Wait for 2 minutes...See the status now. [oracle@orahost ~]$ lsnrctl status LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 16-MAY-2024 09:52:31 Copyright (c) 1991, 2024, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orahost.localhost.localdomain)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 23.0.0.0.0 - Production Start Date 16-MAY-2024 09:51:16 Uptime 0 days 0 hr. 1 min. 14 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Default Service FREE Listener Parameter File /opt/oracle/product/23ai/dbhomeFree/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/orahost/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orahost.localdomain)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "189011a1798d7228e0650a0027822869" has 1 instance(s). Instance "FREE", status READY, has 1 handler(s) for this service... Service "FREE" has 1 instance(s). Instance "FREE", status READY, has 1 handler(s) for this service... Service "FREEXDB" has 1 instance(s). Instance "FREE", status READY, has 1 handler(s) for this service... Service "freepdb1" has 1 instance(s). Instance "FREE", status READY, has 1 handler(s) for this service... The command completed successfully 2) Automatic Shutdown and Start-Up It is recommended to configure the system to automatically start/stop Oracle Database Free and LISTENER when the system starts/stops. To automate the start up and shutdown of the listener and database, run the following commands by root user: [root@orahost ~]# systemctl daemon-reload [root@orahost ~]# systemctl enable oracle-free-23ai #Ensure Oracle Database 23ai service is running on server. [oracle@orahost ~]$ ps -ef | grep pmon oracle 3895 2849 0 09:49 ? 00:00:00 db_pmon_FREE oracle 4564 3711 0 10:05 pts/0 00:00:00 grep --color=auto pmon #Ensure LISTENER service is running on server. [oracle@orahost ~]$ ps -ef | grep tns root 5 2 0 09:16 ? 00:00:00 [netns] oracle 4294 2849 0 09:51 ? 00:00:00 /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr LISTENER -inherit oracle 4567 3711 0 10:05 pts/0 00:00:00 grep --color=auto tns #Verify service status using systemctl command. [root@orahost ~]# systemctl status oracle-free-23ai ● oracle-free-23ai.service - SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services. Loaded: loaded (/etc/rc.d/init.d/oracle-free-23ai; generated) Active: active (exited) since Thu 2024-05-16 09:18:00 EDT; 47min ago Docs: man:systemd-sysv-generator(8) Process: 774 ExecStart=/etc/rc.d/init.d/oracle-free-23ai start (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 16807) Memory: 0B CGroup: /system.slice/oracle-free-23ai.service May 16 09:16:45 orahost.localdomain systemd[1]: Starting SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its> May 16 09:16:47 orahost.localdomain oracle-free-23ai[774]: Starting Oracle Net Listener. May 16 09:16:47 orahost.localdomain su[829]: (to oracle) root on none May 16 09:16:59 orahost.localdomain oracle-free-23ai[774]: Oracle Net Listener started. May 16 09:16:59 orahost.localdomain oracle-free-23ai[774]: Starting Oracle Database instance FREE. May 16 09:16:59 orahost.localdomain su[1733]: (to oracle) root on none May 16 09:16:59 orahost.localdomain su[1733]: pam_unix(su:session): session opened for user oracle by (uid=0) May 16 09:18:00 orahost.localdomain oracle-free-23ai[774]: Oracle Database instance FREE started. May 16 09:18:00 orahost.localdomain systemd[1]: Started SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its > #You can also verify services by executing below command as well. [root@orahost ~]# /etc/init.d/oracle-free-23ai status Status of the Oracle FREE 23ai service: LISTENER status: RUNNING FREE Database status: RUNNING #Execute below command to reload the service daemon. This will not show anything on command prompt. [root@orahost ~]# systemctl daemon-reload [root@orahost ~]# #Execute below command to enable the Oracle Database 23ai service. [root@orahost ~]# systemctl enable oracle-free-23ai oracle-free-23ai.service is not a native service, redirecting to systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install enable oracle-free-23ai To test the above case, you can execute "init 6" command on your server to take server reboot and see if both Oracle Database 23ai and LISTENER services come up with server start-up. [root@orahost ~]# id uid=0(root) gid=0(root) groups=0(root) [root@orahost ~]# uptime 10:11:04 up 2 min, 1 user, load average: 4.15, 1.64, 0.61 [root@orahost ~]# date Thu May 16 10:11:07 EDT 2024 [root@orahost ~]# ps -ef | grep pmon oracle 1750 1 0 10:09 ? 00:00:00 db_pmon_FREE root 3304 3196 0 10:11 pts/0 00:00:00 grep --color=auto pmon [root@orahost ~]# ps -ef | grep tns root 5 2 0 10:08 ? 00:00:00 [netns] oracle 1740 1 0 10:09 ? 00:00:00 /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr LISTENER -inherit root 3319 3196 0 10:11 pts/0 00:00:00 grep --color=auto tns #Verify service status using systemctl command. [root@orahost ~]# systemctl status oracle-free-23ai ● oracle-free-23ai.service - SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services. Loaded: loaded (/etc/rc.d/init.d/oracle-free-23ai; generated) Active: active (exited) since Thu 2024-05-16 10:10:39 EDT; 1min 28s ago Docs: man:systemd-sysv-generator(8) Process: 792 ExecStart=/etc/rc.d/init.d/oracle-free-23ai start (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 16807) Memory: 0B CGroup: /system.slice/oracle-free-23ai.service May 16 10:09:31 orahost.localdomain systemd[1]: Starting SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its> May 16 10:09:32 orahost.localdomain oracle-free-23ai[792]: Starting Oracle Net Listener. May 16 10:09:33 orahost.localdomain su[821]: (to oracle) root on none May 16 10:09:45 orahost.localdomain oracle-free-23ai[792]: Oracle Net Listener started. May 16 10:09:45 orahost.localdomain oracle-free-23ai[792]: Starting Oracle Database instance FREE. May 16 10:09:45 orahost.localdomain su[1743]: (to oracle) root on none May 16 10:09:45 orahost.localdomain su[1743]: pam_unix(su:session): session opened for user oracle by (uid=0) May 16 10:10:39 orahost.localdomain oracle-free-23ai[792]: Oracle Database instance FREE started. May 16 10:10:39 orahost.localdomain systemd[1]: Started SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its > [root@orahost ~]# /etc/init.d/oracle-free-23ai status Status of the Oracle FREE 23ai service: LISTENER status: RUNNING FREE Database status: RUNNING #Login as oracle user and verify the database startup time. [root@orahost ~]# su - oracle [oracle@orahost ~]$ . oraenv ORACLE_SID = [oracle] ? FREE The Oracle base has been set to /opt/oracle #Verify the database open mode and startup time. [oracle@orahost ~]$ sqlplus / as sysdba SQL*Plus: Release 23.0.0.0.0 - Production on Thu May 16 10:12:34 2024 Version 23.4.0.24.05 Copyright (c) 1982, 2024, Oracle. All rights reserved. Connected to: Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free Version 23.4.0.24.05 SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- FREE READ WRITE SQL> alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS'; Session altered. SQL> select sysdate from dual; SYSDATE -------------------- 16-MAY-2024 10:13:29 SQL> select instance_name,startup_time from v$instance; INSTANCE_NAME STARTUP_TIME ---------------- -------------------- FREE 16-MAY-2024 10:09:49 SQL> col open_time for a35 SQL> col name for a16 SQL> select con_id,name,open_mode,OPEN_TIME from v$pdbs; CON_ID NAME OPEN_MODE OPEN_TIME ---------- ---------------- ---------- ----------------------------------- 2 PDB$SEED READ ONLY 16-MAY-24 10.10.10.157 AM -04:00 3 FREEPDB1 READ WRITE 16-MAY-24 10.10.23.121 AM -04:00 #Verify the LISTENER status. oracle@orahost ~]$ lsnrctl status LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 16-MAY-2024 10:29:07 Copyright (c) 1991, 2024, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orahost.localhost.localdomain)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 23.0.0.0.0 - Production Start Date 16-MAY-2024 10:09:44 Uptime 0 days 0 hr. 19 min. 23 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Default Service FREE Listener Parameter File /opt/oracle/product/23ai/dbhomeFree/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/orahost/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orahost.localdomain)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "189011a1798d7228e0650a0027822869" has 1 instance(s). Instance "FREE", status READY, has 1 handler(s) for this service... Service "FREE" has 1 instance(s). Instance "FREE", status READY, has 1 handler(s) for this service... Service "FREEXDB" has 1 instance(s). Instance "FREE", status READY, has 1 handler(s) for this service... Service "freepdb1" has 1 instance(s). Instance "FREE", status READY, has 1 handler(s) for this service... The command completed successfully You can see that the database and listener services are stopped and started automatically after server reboot. 3) Starting and stopping services using configuration script Stopping Database and Listener Services Login as root user and execute below commands. [root@orahost ~]# id uid=0(root) gid=0(root) groups=0(root) #Verify Oracle Database 23ai service is running on server. [root@orahost ~]# ps -ef | grep pmon oracle 1750 1 0 10:09 ? 00:00:00 db_pmon_FREE root 4166 3196 0 10:36 pts/0 00:00:00 grep --color=auto pmon #Verify LISTENER service is running on server. [root@orahost ~]# ps -ef | grep tns root 5 2 0 10:08 ? 00:00:00 [netns] oracle 1740 1 0 10:09 ? 00:00:00 /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr LISTENER -inherit root 4186 3196 0 10:36 pts/0 00:00:00 grep --color=auto tns [root@orahost ~]# /etc/init.d/oracle-free-23ai status Status of the Oracle FREE 23ai service: LISTENER status: RUNNING FREE Database status: RUNNING [root@orahost ~]# systemctl status oracle-free-23ai ● oracle-free-23ai.service - SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services. Loaded: loaded (/etc/rc.d/init.d/oracle-free-23ai; generated) Active: active (exited) since Thu 2024-05-16 10:10:39 EDT; 26min ago Docs: man:systemd-sysv-generator(8) Process: 792 ExecStart=/etc/rc.d/init.d/oracle-free-23ai start (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 16807) Memory: 0B CGroup: /system.slice/oracle-free-23ai.service May 16 10:09:31 orahost.localdomain systemd[1]: Starting SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its> May 16 10:09:32 orahost.localdomain oracle-free-23ai[792]: Starting Oracle Net Listener. May 16 10:09:33 orahost.localdomain su[821]: (to oracle) root on none May 16 10:09:45 orahost.localdomain oracle-free-23ai[792]: Oracle Net Listener started. May 16 10:09:45 orahost.localdomain oracle-free-23ai[792]: Starting Oracle Database instance FREE. May 16 10:09:45 orahost.localdomain su[1743]: (to oracle) root on none May 16 10:09:45 orahost.localdomain su[1743]: pam_unix(su:session): session opened for user oracle by (uid=0) May 16 10:10:39 orahost.localdomain oracle-free-23ai[792]: Oracle Database instance FREE started. May 16 10:10:39 orahost.localdomain systemd[1]: Started SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its > #Stop Oracle Database 23ai and LISTENER services: [root@orahost ~]# systemctl stop oracle-free-23ai [root@orahost ~]# #Ensure Oracle Database 23ai service is not running on server. [root@orahost ~]# ps -ef | grep pmon root 4271 3196 0 10:37 pts/0 00:00:00 grep --color=auto pmon = #Verify LISTENER service is not running on server. [root@orahost ~]# ps -ef | grep tns root 5 2 0 10:08 ? 00:00:00 [netns] root 4285 3196 0 10:37 pts/0 00:00:00 grep --color=auto tns Starting Database and Listener Services [root@orahost ~]# systemctl start oracle-free-23ai [root@orahost ~]# #Ensure Oracle Database 23ai service is running on server. [root@orahost ~]# ps -ef | grep pmon oracle 4609 1 0 10:43 ? 00:00:00 db_pmon_FREE root 5110 3196 0 10:50 pts/0 00:00:00 grep --color=auto pmon #Verify LISTENER service is running on server. [root@orahost ~]# ps -ef | grep tns root 5 2 0 10:08 ? 00:00:00 [netns] oracle 4566 1 0 10:43 ? 00:00:00 /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr LISTENER -inherit root 5118 3196 0 10:50 pts/0 00:00:00 grep --color=auto tns #You can also verify database and LISTENER services status by executing below command as well. root@orahost ~]# /etc/init.d/oracle-free-23ai status Status of the Oracle FREE 23ai service: LISTENER status: RUNNING FREE Database status: RUNNING #You can also verify Oracle Database 23ai services status by executing below command. [root@orahost ~]# systemctl status oracle-free-23ai ● oracle-free-23ai.service - SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services. Loaded: loaded (/etc/rc.d/init.d/oracle-free-23ai; generated) Active: active (exited) since Thu 2024-05-16 10:44:12 EDT; 7min ago Docs: man:systemd-sysv-generator(8) Process: 4237 ExecStop=/etc/rc.d/init.d/oracle-free-23ai stop (code=exited, status=0/SUCCESS) Process: 4543 ExecStart=/etc/rc.d/init.d/oracle-free-23ai start (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 16807) Memory: 0B CGroup: /system.slice/oracle-free-23ai.service May 16 10:43:13 orahost.localdomain oracle-free-23ai[4543]: Starting Oracle Net Listener. May 16 10:43:13 orahost.localdomain su[4550]: (to oracle) root on none May 16 10:43:13 orahost.localdomain su[4550]: pam_unix(su:session): session opened for user oracle by (uid=0) May 16 10:43:13 orahost.localdomain su[4550]: pam_unix(su:session): session closed for user oracle May 16 10:43:13 orahost.localdomain oracle-free-23ai[4543]: Oracle Net Listener started. May 16 10:43:13 orahost.localdomain oracle-free-23ai[4543]: Starting Oracle Database instance FREE. May 16 10:43:13 orahost.localdomain su[4572]: (to oracle) root on none May 16 10:43:13 orahost.localdomain su[4572]: pam_unix(su:session): session opened for user oracle by (uid=0) May 16 10:44:14 orahost.localdomain oracle-free-23ai[4543]: Oracle Database instance FREE started. May 16 10:44:12 orahost.localdomain systemd[1]: Started SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its > #Login as oracle user and check the instance startup time. [root@orahost ~]# su - oracle [oracle@orahost ~]$ . oraenv ORACLE_SID = [oracle] ? FREE The Oracle base has been set to /opt/oracle [oracle@orahost ~]$ sqlplus / as sysdba SQL*Plus: Release 23.0.0.0.0 - Production on Thu May 16 10:51:32 2024 Version 23.4.0.24.05 Copyright (c) 1982, 2024, Oracle. All rights reserved. Connected to: Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free Version 23.4.0.24.05 SQL> select instance_name,to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') from v$instance; INSTANCE_NAME TO_CHAR(STARTUP_TIME,'DD-MON- ---------------- ----------------------------- FREE 16-MAY-2024 10:43:14 Restarting Database and Listener Services You can also stop and start Oracle Database 23ai and LISTENER services in one command by executing command "systemctl restart oracle-free-23ai". [root@orahost ~]# date Thu May 16 11:01:03 EDT 2024 [root@orahost ~]# id uid=0(root) gid=0(root) groups=0(root) #Ensure Oracle Database 23ai service is running on server before restarting. [root@orahost ~]# ps -ef | grep pmon oracle 5823 1 0 10:59 ? 00:00:00 db_pmon_FREE root 6864 3196 0 11:01 pts/0 00:00:00 grep --color=auto pmon #Ensure LISTENER service is running on server before restarting. [root@orahost ~]# ps -ef | grep tns root 5 2 0 10:08 ? 00:00:00 [netns] oracle 5814 1 0 10:59 ? 00:00:00 /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr LISTENER -inherit root 6878 3196 0 11:01 pts/0 00:00:00 grep --color=auto tns #You can also verify Oracle Database 23ai services status by executing below command. [root@orahost ~]# systemctl status oracle-free-23ai ● oracle-free-23ai.service - SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services. Loaded: loaded (/etc/rc.d/init.d/oracle-free-23ai; generated) Active: active (exited) since Thu 2024-05-16 11:00:15 EDT; 1min 6s ago Docs: man:systemd-sysv-generator(8) Process: 5783 ExecStop=/etc/rc.d/init.d/oracle-free-23ai stop (code=exited, status=0/SUCCESS) Process: 5800 ExecStart=/etc/rc.d/init.d/oracle-free-23ai start (code=exited, status=0/SUCCESS) May 16 10:59:43 orahost.localdomain systemd[1]: oracle-free-23ai.service: Succeeded. May 16 10:59:43 orahost.localdomain systemd[1]: Stopped SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its > May 16 10:59:43 orahost.localdomain systemd[1]: Starting SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its> May 16 10:59:43 orahost.localdomain oracle-free-23ai[5800]: Starting Oracle Net Listener. May 16 10:59:44 orahost.localdomain oracle-free-23ai[5800]: Oracle Net Listener started. May 16 10:59:44 orahost.localdomain oracle-free-23ai[5800]: Starting Oracle Database instance FREE. May 16 10:59:44 orahost.localdomain su[5817]: (to oracle) root on none May 16 10:59:44 orahost.localdomain su[5817]: pam_unix(su:session): session opened for user oracle by (uid=0) May 16 11:00:15 orahost.localdomain oracle-free-23ai[5800]: Oracle Database instance FREE started. May 16 11:00:15 orahost.localdomain systemd[1]: Started SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its > #You can verify Oracle Database 23ai services status by executing below command as well. [root@orahost ~]# /etc/init.d/oracle-free-23ai status Status of the Oracle FREE 23ai service: LISTENER status: RUNNING FREE Database status: RUNNING [root@orahost ~]# date Thu May 16 11:01:32 EDT 2024 #To stop and start Oracle Database 23ai and LISTENER services, execute single "restart" command. [root@orahost ~]# systemctl restart oracle-free-23ai [root@orahost ~]# #Verify the database and listener services status after restarting. [root@orahost ~]# date Thu May 16 11:02:40 EDT 2024 #Ensure Oracle Database 23ai service is running on server after restarting. [root@orahost ~]# ps -ef | grep pmon oracle 7015 1 0 11:01 ? 00:00:00 db_pmon_FREE root 7427 3196 0 11:02 pts/0 00:00:00 grep --color=auto pmon #Ensure LISTENER service is running on server after restarting. [root@orahost ~]# ps -ef | grep tns root 5 2 0 10:08 ? 00:00:00 [netns] oracle 7006 1 0 11:01 ? 00:00:00 /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr LISTENER -inherit #You can also verify Oracle Database 23ai services status after restarting. [root@orahost ~]# systemctl status oracle-free-23ai ● oracle-free-23ai.service - SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its associated services. Loaded: loaded (/etc/rc.d/init.d/oracle-free-23ai; generated) Active: active (exited) since Thu 2024-05-16 11:02:07 EDT; 50s ago Docs: man:systemd-sysv-generator(8) Process: 6976 ExecStop=/etc/rc.d/init.d/oracle-free-23ai stop (code=exited, status=0/SUCCESS) Process: 6993 ExecStart=/etc/rc.d/init.d/oracle-free-23ai start (code=exited, status=0/SUCCESS) May 16 11:01:44 orahost.localdomain oracle-free-23ai[6993]: Starting Oracle Net Listener. May 16 11:01:44 orahost.localdomain su[7002]: (to oracle) root on none May 16 11:01:44 orahost.localdomain su[7002]: pam_unix(su:session): session opened for user oracle by (uid=0) May 16 11:01:44 orahost.localdomain su[7002]: pam_unix(su:session): session closed for user oracle May 16 11:01:44 orahost.localdomain oracle-free-23ai[6993]: Oracle Net Listener started. May 16 11:01:44 orahost.localdomain oracle-free-23ai[6993]: Starting Oracle Database instance FREE. May 16 11:01:44 orahost.localdomain su[7009]: (to oracle) root on none May 16 11:01:44 orahost.localdomain su[7009]: pam_unix(su:session): session opened for user oracle by (uid=0) May 16 11:02:07 orahost.localdomain oracle-free-23ai[6993]: Oracle Database instance FREE started. May 16 11:02:07 orahost.localdomain systemd[1]: Started SYSV: This script is responsible for taking care of configuring the RPM Oracle FREE Database and its > #You can verify Oracle Database 23ai services status by executing below command as well after restarting. [root@orahost ~]# /etc/init.d/oracle-free-23ai status Status of the Oracle FREE 23ai service: LISTENER status: RUNNING FREE Database status: RUNNING #Login as oracle user and check the instance startup time. [root@orahost ~]# su - oracle [oracle@orahost ~]$ . oraenv ORACLE_SID = [oracle] ? FREE The Oracle base has been set to /opt/oracle [oracle@orahost ~]$ sqlplus / as sysdba SQL*Plus: Release 23.0.0.0.0 - Production on Thu May 16 11:03:15 2024 Version 23.4.0.24.05 Copyright (c) 1982, 2024, Oracle. All rights reserved. Connected to: Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free Version 23.4.0.24.05 SQL> select instance_name,to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') from v$instance; INSTANCE_NAME TO_CHAR(STARTUP_TIME,'DD-MON- ---------------- ----------------------------- FREE 16-MAY-2024 11:01:44 SQL> exit |
Thanks for reading this post ! Please comment if you like this post ! Click on FOLLOW to get next blog updates !
Nicely written technical stuff
ReplyDelete