cat status_oem.sh

-- =================================
-- CHECKS STATUS -- =================================
export ORACLE_SID=oemcc
export ORACLE_UNQNAME=oemcc
export ORACLE_GLOBAL_NAME=OEMCC.LAB
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export ORACLE_HOSTNAME=EMCC
export AGENT_HOME=/u01/app/oracle/agent/agent_13.5.0.0.0
export OMS_HOME=/u01/app/oracle/middleware
sleep 2;
echo '==STATUS:LISTENER============================================'
$ORACLE_HOME/bin/lsnrctl status

sleep 2;
echo '==STATUS:DATABASE============================================'
$ORACLE_HOME/bin/sqlplus /nolog < connect / as sysdba
SELECT name,open_mode,log_mode FROM v\$database ;
exit;
EOF

sleep 2;
echo '==STATUS:MANAGEMENT-SERVICE=================================='
$OMS_HOME/bin/emctl status oms

sleep 2;
echo '==STATUS:AGENTE=============================================='
$AGENT_HOME/bin/emctl status agent

sleep 2;
echo '====FIM--STATUS=============================================='

######===EXECUTION::OUTPUT===################################################ status_oem.sh ==STATUS:LISTENER============================================ LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 31-JUL-2024 14:27:49 Copyright (c) 1991, 2023, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=EMCC)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 12-MAR-2024 13:58:22 Uptime 141 days 0 hr. 29 min. 26 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/EMCC/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=EMCC)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "oemcc.lab" has 1 instance(s). Instance "oemcc", status READY, has 1 handler(s) for this service... Service "oemccXDB.lab" has 1 instance(s). Instance "oemcc", status READY, has 1 handler(s) for this service... The command completed successfully ==STATUS:DATABASE============================================ SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jul 31 14:27:51 2024 Version 19.19.0.0.0 Copyright (c) 1982, 2022, Oracle. All rights reserved. SQL> Connected. NAME OPEN_MODE LOG_MODE -------- -------------------- ------------ OEMCC READ WRITE NOARCHIVELOG SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.19.0.0.0 ==STATUS:MANAGEMENT-SERVICE================================== Oracle Enterprise Manager Cloud Control 13c Release 5 Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved. WebTier is Up Oracle Management Server is Up JVMD Engine is Up ==STATUS:AGENTE============================================== Oracle Enterprise Manager Cloud Control 13c Release 5 Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved. --------------------------------------------------------------- Agent Version : 13.5.0.0.0 OMS Version : 13.5.0.0.0 Protocol Version : 12.1.0.1.0 Agent Home : /u01/app/oracle/agent/agent_inst Agent Log Directory : /u01/app/oracle/agent/agent_inst/sysman/log Agent Binaries : /u01/app/oracle/agent/agent_13.5.0.0.0 Core JAR Location : /u01/app/oracle/agent/agent_13.5.0.0.0/jlib Agent Process ID : 2185201 Parent Process ID : 2185136 Agent URL : https://EMCC:3872/emd/main/ Local Agent URL in NAT : https://EMCC:3872/emd/main/ Repository URL : https://EMCC:4903/empbs/upload Started at : 2024-03-12 14:02:11 Started by user : oracle Operating System : Linux version 5.4.17-2136.315.5.el8uek.x86_64 (amd64) Number of Targets : 36 Last Reload : (none) Last successful upload : 2024-07-31 14:25:06 Last attempted upload : 2024-07-31 14:25:06 Total Megabytes of XML files uploaded so far : 276.6 Number of XML files pending upload : 0 Size of XML files pending upload(MB) : 0 Available disk space on upload filesystem : 65.34% Collection Status : Collections enabled Heartbeat Status : Ok Last attempted heartbeat to OMS : 2024-07-31 14:27:15 Last successful heartbeat to OMS : 2024-07-31 14:27:15 Next scheduled heartbeat to OMS : 2024-07-31 14:28:15 --------------------------------------------------------------- Agent is Running and Ready ====FIM--STATUS==============================================
cat stop_oem.sh
-- =================================
-- STOP SERVICES  
-- =================================
export ORACLE_SID=oemcc
export ORACLE_UNQNAME=oemcc
export ORACLE_GLOBAL_NAME=oemcc.LAB
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export ORACLE_HOSTNAME=EMCC
export AGENT_HOME=/u01/app/oracle/agent/agent_13.5.0.0.0
export OMS_HOME=/u01/app/oracle/middleware

sleep 2;
echo '==STOP:LISTENER============================================'
$ORACLE_HOME/bin/lsnrctl stop

sleep 2;
echo '==STOP:BANCO==============================================='
$ORACLE_HOME/bin/sqlplus /nolog < Connected.
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.19.0.0.0

==STOP:MANAGEMENT SERVICE==================================
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation.  All rights reserved.
Stopping Oracle Management Server...
WebTier Successfully Stopped
Oracle Management Server Successfully Stopped
AdminServer Successfully Stopped
Oracle Management Server is Down
JVMD Engine is Down

==STOP:AGENTE==============================================
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation.  All rights reserved.
Stopping agent ... stopped.

====FIM--STOP===============================================
cat start_oem.sh
-- =================================
-- START SERVICES 
-- =================================
export ORACLE_SID=oemcc
export ORACLE_UNQNAME=oemcc
export ORACLE_GLOBAL_NAME=oemcc.LAB
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export ORACLE_HOSTNAME=EMCC
export AGENT_HOME=/u01/app/oracle/agent/agent_13.5.0.0.0
export OMS_HOME=/u01/app/oracle/middleware

sleep 2;
echo '==START:LISTENER============================================'
$ORACLE_HOME/bin/lsnrctl start

sleep 2;
echo '==START:DATABASE============================================='
$ORACLE_HOME/bin/sqlplus /nolog < Connected to an idle instance.
SQL> ORACLE instance started.

Total System Global Area 8589930576 bytes
Fixed Size                 13664336 bytes
Variable Size            2969567232 bytes
Database Buffers         5586812928 bytes
Redo Buffers               19886080 bytes
Database mounted.
Database opened.
SQL>
NAME    OPEN_MODE            LOG_MODE
------- -------------------- ------------
oemcc   READ WRITE           NOARCHIVELOG

SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0

==START:MANAGEMENT SERVICE==================================
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation.  All rights reserved.
Starting Oracle Management Server...
WebTier Successfully Started
Oracle Management Server Successfully Started
Oracle Management Server is Up
JVMD Engine is Up

==START:AGENT===============================================
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation.  All rights reserved.
Starting agent ............. started.
====FIM--START==============================================

hostgator