ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling
complimentary technical Workshops on Database Security for the first 30
Oracle Database customers located anywhere in North America, EMEA, LATAM, or
APAC that send an email to
asra_us@oracle.com. Request a Workshop for
your organization today.
Purpose
The entries on this page demonstrate ways, from within the Oracle database, to access information about the host hardware and operating system.
There are ways to do it in the operating system shell environment but what is important, most often, is to see what the database has access to and what Oracle will be watching for licensing purposes.
Demos
Number of CPUs
col value format 99999
SELECT inst_id, value
FROM gv$osstat
WHERE stat_name = 'NUM_CPUS';
INST_ID VALUE
-------- ------
1 4
Amount of Physical Memory
col value format 999999999999
SELECT inst_id, value
FROM gv$osstat
WHERE stat_name = 'PHYSICAL_MEMORY_BYTES';
INST_ID VALUE
-------- ------------
1 17028419584
Operating System Endian Value
SELECT dbms_utility.get_endianness
FROM dual;
GET_ENDIANNESS
--------------
2
Operating System Environment Variables
set serveroutput on
DECLARE
RetVal VARCHAR2(30);
BEGIN
dbms_system.get_env('ORACLE_SID', RetVal);
dbms_output.put_line(RetVal);
END;
/ orabase19
DECLARE
RetVal VARCHAR2(100);
BEGIN
dbms_system.get_env('ORACLE_HOME', RetVal);
dbms_output.put_line(RetVal);
END;
/ /u01/app19
DECLARE
RetVal VARCHAR2(100);
BEGIN
dbms_system.get_env('TEMP', RetVal);
dbms_output.put_line(RetVal);
END;
/ C:\Users\ORA19U~1\AppData\Local\Temp