DB shutdown/startup scripts
TEST DATABSES (ts-odb1, ts-odb2, ts-odb3)
 ==BEGIN TS-ODB1 Server Databases==================================================
A. SHUTDOWN
1. Stop All Oracle Databases on ts-odb1
                 On the database server (ts-odb1.nwfsc.edu / 192.168.7.139)
                Logon as "oracle"   
ORACLE_SID = [oracle] ? ODST
                 set bash shell   
ODST-oracle-/u01/home/oracle> bash
cd /u01/home/oracle/scripts
./stop_db ODST (wait for prompts…)
SQL> SQL> Database closed.
 Database dismounted.
 ORACLE instance shut down.
 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
 Version 19.3.0.0.0
./stop_db DWTEST2        (wait for prompts…)
./stop_db COGT  -only if necessary: this DB typically has not been running in 2024 (wait for prompts…)
2. Stop Oracle Listener on ts-odb1
lsnrctl status
 LSNRCTL for Solaris: Version 19.0.0.0.0
 …
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ts-odb3.nwfsc.edu)(PORT=1521)))
 STATUS of the LISTENER
 ------------------------
 Alias                     LISTENER
 Version                TNSLSNR for Solaris: Version 19.0.0.0.0 – Production
 Start Date           15-JUL-2024 20:05:21
 Uptime                  7 days 18 hr. 45 min. 13 sec 
 …
 Service "ODST.nwfsc.edu" has 1 instance(s).
   Instance "ODST", status UNKNOWN, has 1 handler(s) for this service...
 The command completed successfully
lsnrctl stop
 LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 23-JUL-2024 14:56:14
 Copyright (c) 1991, 2019, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ts-odb3.nwfsc.edu)(PORT=1521)))
 The command completed successfully
lsnrctl status
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ts-odb3.nwfsc.edu)(PORT=1521)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 146: Connection refused
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 2: No such file or directory
ps -ef | grep smon -will show what databases are running
oracle 16144 13415 0 15:00:39 pts/3 0:00 grep smon (if none)
B. STARTUP
1. Start Oracle Listener on ts-odb1
                On the database server (ts-odb1.nwfsc.edu / 192.168.7.139)
                Logon as "oracle"   
ORACLE_SID = [oracle] ? ODST
                 set bash shell   
ODST-oracle-/u01/home/oracle> bash
cd /u01/home/oracle/scripts
lsnrctl start
 LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 23-JUL-2024 14:56:14
 Starting /u01/app/oracle/product/19.3.0.0.0/dbhome_1/bin/tnslsnr: please wait...
…
 Service "ODST.nwfsc.edu" has 1 instance(s).
   Instance "ODST", status UNKNOWN, has 1 handler(s) for this service...
 The command completed successfully
2. Start All Oracle Databases on ts-odb1
cd /u01/home/oracle/scripts
./start_db ODST (wait for prompts…)
…
 SQL> SQL> ORACLE instance started.
 …
 Database mounted.
 Database opened.
 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
 Version 19.3.0.0.0
./start_db DWTEST2 (wait for prompts…)
./start_db COGT -only if necessary: this DB typically has not been running in 2024 (wait for prompts…)
ps -ef | grep smon -will show what databases are running
  oracle 25072 25054   0 15:20:50 pts/1       0:00 grep smon
   oracle   1825  1796   0    Jul 22 ?           0:05 ora_smon_ODST
   oracle   2084  2055   0    Jul 22 ?           0:02 ora_smon_DWTEST2
   oracle 25132 25103   0 15:22:26 ?           0:00 ora_smon_COGT
==END TS-ODB1 Server Databases==================================================
==BEGIN TS-ODB2 Server Databases==================================================
A. SHUTDOWN
1. Stop All Oracle Databases on ts-odb2
                 On the database server (ts-odb2.nwfsc.edu / 192.168.7.140)
                Logon as "oracle"   
ORACLE_SID = [oracle] ? TEST
                 set bash shell   
ODST-oracle-/u01/home/oracle> bash
cd /u01/home/oracle/scripts
./stop_db TEST (wait for prompts…)
SQL> SQL> Database closed.
 Database dismounted.
 ORACLE instance shut down.
 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
 Version 19.3.0.0.0
./stop_db LUM5T             (wait for prompts…)
./stop_db UC4T                (wait for prompts…)
2. Stop Oracle Listener on ts-odb1
lsnrctl status
 LSNRCTL for Solaris: Version 19.0.0.0.0
 …
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ts-odb2.nwfsc.edu)(PORT=1521)))
 STATUS of the LISTENER
 ------------------------
 Alias                     LISTENER
 Version                TNSLSNR for Solaris: Version 19.0.0.0.0 – Production
 Start Date           15-JUL-2024 20:05:21
 Uptime                  7 days 18 hr. 45 min. 13 sec 
 …
 Service "TEST.nwfsc.edu" has 1 instance(s).
   Instance "TEST", status UNKNOWN, has 1 handler(s) for this service...
 The command completed successfully
lsnrctl stop
 LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 23-JUL-2024 14:56:14
 Copyright (c) 1991, 2019, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ts-odb2.nwfsc.edu)(PORT=1521)))
 The command completed successfully
lsnrctl status
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ts-odb2.nwfsc.edu)(PORT=1521)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 146: Connection refused
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 2: No such file or directory
ps -ef | grep smon -will show what databases are running
oracle 16144 13415 0 15:00:39 pts/3 0:00 grep smon (if none)
B. STARTUP
1. Start Oracle Listener on ts-odb1
                On the database server (ts-odb1.nwfsc.edu / 192.168.7.139)
                Logon as "oracle"   
ORACLE_SID = [oracle] ? ODST
                 set bash shell   
ODST-oracle-/u01/home/oracle> bash
cd /u01/home/oracle/scripts
lsnrctl start
 LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 23-JUL-2024 14:56:14
 Starting /u01/app/oracle/product/19.3.0.0.0/dbhome_1/bin/tnslsnr: please wait...
…
 Service "TEST.nwfsc.edu" has 1 instance(s).
   Instance "TEST", status UNKNOWN, has 1 handler(s) for this service...
 The command completed successfully
2. Start All Oracle Databases on ts-odb1
cd /u01/home/oracle/scripts
./start_db TEST (wait for prompts…)
…
 SQL> SQL> ORACLE instance started.
 …
 Database mounted.
 Database opened.
 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
 Version 19.3.0.0.0
./start_db LUM5T (wait for prompts…)
./start_db UC4T (wait for prompts…)
ps -ef | grep smon -will show what databases are running
  oracle 25072 25054   0 15:20:50 pts/1   0:00 grep smon
   oracle   1825  1796   0    Jul 22 ?                 0:05 ora_smon_TEST
   oracle   2084  2055   0    Jul 22 ?                 0:02 ora_smon_LUM5T
   oracle 25132 25103   0 15:22:26 ?           0:00 ora_smon_UC4T
==END TS-ODB2 Server Databases==================================================
 
PROD DATABSES (ps-odb1, ps-odb2)
 ==BEGIN PS-ODB1 Server Databases==================================================
A. SHUTDOWN
1. Stop All Oracle Databases on ps-odb1
                 On the database server (ps-odb1.nwfsc.edu)
                Logon as "oracle"   
ORACLE_SID = [oracle] ? ODSP
                 set bash shell   
ODST-oracle-/u01/home/oracle> bash
cd /u01/home/oracle/scripts
./stop_db ODSP (wait for prompts…)
SQL> SQL> Database closed.
 Database dismounted.
 ORACLE instance shut down.
 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
 Version 19.3.0.0.0
./stop_db DWPROD2     (wait for prompts…)
./stop_db COGP               (wait for prompts…)
2. Stop Oracle Listener on ps-odb1
lsnrctl status
 LSNRCTL for Solaris: Version 19.0.0.0.0
 …
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ps-odb1.nwfsc.edu)(PORT=1521)))
 STATUS of the LISTENER
 ------------------------
 Alias                     LISTENER
 Version                TNSLSNR for Solaris: Version 19.0.0.0.0 – Production
 Start Date           15-JUL-2024 20:05:21
 Uptime                7 days 18 hr. 45 min. 13 sec 
 …
 Service "ODSP.nwfsc.edu" has 1 instance(s).
   Instance "ODSP", status UNKNOWN, has 1 handler(s) for this service...
 The command completed successfully
lsnrctl stop
 LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 23-JUL-2024 14:56:14
 Copyright (c) 1991, 2019, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ps-odb1.nwfsc.edu)(PORT=1521)))
 The command completed successfully
lsnrctl status
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ps-odb1.nwfsc.edu)(PORT=1521)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 146: Connection refused
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 2: No such file or directory
ps -ef | grep smon -will show what databases are running
oracle 16144 13415 0 15:00:39 pts/3 0:00 grep smon (if none)
B. STARTUP
1. Start Oracle Listener on ps-odb1
                On the database server (ps-odb1.nwfsc.edu)
                Logon as "oracle"   
ORACLE_SID = [oracle] ? ODSP
                 set bash shell   
ODST-oracle-/u01/home/oracle> bash
cd /u01/home/oracle/scripts
lsnrctl start
 LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 23-JUL-2024 14:56:14
 Starting /u01/app/oracle/product/19.3.0.0.0/dbhome_1/bin/tnslsnr: please wait...
…
 Service "ODSP.nwfsc.edu" has 1 instance(s).
   Instance "ODSP", status UNKNOWN, has 1 handler(s) for this service...
 The command completed successfully
2. Start All Oracle Databases on ps-odb1
cd /u01/home/oracle/scripts
./start_db ODSP (wait for prompts…)
…
 SQL> SQL> ORACLE instance started.
 …
 Database mounted.
 Database opened.
 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
 Version 19.3.0.0.0
./start_db DWPROD2 (wait for prompts…)
./start_db COGP -THIS IS NECESSARY IN PRODUCTION (wait for prompts…)
ps -ef | grep smon -will show what databases are running
  oracle 25072 25054   0 15:20:50 pts/1   0:00 grep smon
   oracle   1825  1796   0    Jul 22 ?                 0:05 ora_smon_ODSP
   oracle   2084  2055   0    Jul 22 ?                 0:02 ora_smon_DWPROD2
   oracle 25132 25103   0 15:22:26 ?           0:00 ora_smon_COGP
==END PS-ODB1 Server Databases==================================================
==BEGIN PS-ODB2 Server Databases==================================================
A. SHUTDOWN
1. Stop All Oracle Databases on ps-odb2
                 On the database server (ps-odb2.nwfsc.edu)
                Logon as "oracle"   
ORACLE_SID = [oracle] ? PROD
                 set bash shell   
ODST-oracle-/u01/home/oracle> bash
cd /u01/home/oracle/scripts
./stop_db PROD (wait for prompts…)
SQL> SQL> Database closed.
 Database dismounted.
 ORACLE instance shut down.
 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
 Version 19.3.0.0.0
./stop_db LUM5P            (wait for prompts…)
./stop_db UC4P                (wait for prompts…)
2. Stop Oracle Listener on ps-odb2
lsnrctl status
 LSNRCTL for Solaris: Version 19.0.0.0.0
 …
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ps-odb2.nwfsc.edu)(PORT=1521)))
 STATUS of the LISTENER
 ------------------------
 Alias                     LISTENER
 Version                TNSLSNR for Solaris: Version 19.0.0.0.0 – Production
 Start Date            15-JUL-2024 20:05:21
 Uptime                 7 days 18 hr. 45 min. 13 sec 
 …
 Service "PROD.nwfsc.edu" has 1 instance(s).
   Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...
 The command completed successfully
lsnrctl stop
 LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 23-JUL-2024 14:56:14
 Copyright (c) 1991, 2019, Oracle.  All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ps-odb2.nwfsc.edu)(PORT=1521)))
 The command completed successfully
lsnrctl status
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ps-odb2.nwfsc.edu)(PORT=1521)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 146: Connection refused
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 2: No such file or directory
ps -ef | grep smon -will show what databases are running
oracle 16144 13415 0 15:00:39 pts/3 0:00 grep smon (if none)
B. STARTUP
1. Start Oracle Listener on ps-odb2
                On the database server (ps-odb2.nwfsc.edu)
                Logon as "oracle"   
ORACLE_SID = [oracle] ? PROD
                 set bash shell   
ODST-oracle-/u01/home/oracle> bash
cd /u01/home/oracle/scripts
lsnrctl start
 LSNRCTL for Solaris: Version 19.0.0.0.0 - Production on 23-JUL-2024 14:56:14
 Starting /u01/app/oracle/product/19.3.0.0.0/dbhome_1/bin/tnslsnr: please wait...
…
 Service "PROD.nwfsc.edu" has 1 instance(s).
   Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...
 The command completed successfully
2. Start All Oracle Databases on ps-odb2
cd /u01/home/oracle/scripts
./start_db PROD (wait for prompts…)
…
 SQL> SQL> ORACLE instance started.
 …
 Database mounted.
 Database opened.
 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
 Version 19.3.0.0.0
./start_db LUM5P (wait for prompts…)
./start_db UC4TP (wait for prompts…)
ps -ef | grep smon -will show what databases are running
  oracle 25072 25054   0 15:20:50 pts/1   0:00 grep smon
   oracle   1825  1796   0    Jul 22 ?                 0:05 ora_smon_PROD
   oracle   2084  2055   0    Jul 22 ?                 0:02 ora_smon_LUM5P
   oracle 25132 25103   0 15:22:26 ?           0:00 ora_smon_UC4P
==END PS-ODB2 Server Databases==================================================
