Systems Engineering and RDBMS

Archive for September 26th, 2007

Documenting the OS of the DB Server in Oracle

Posted by decipherinfosys on September 26, 2007

Since Oracle runs on multiple operating systems, if you want to develop an auditing script in which you document the OS of the DB Server using PL/SQL scripts (since the rest of the auditing scripts will also be a combination of PL/SQL scripts, shell scripts and WMI scripts (windows)), one can make use of the inbuilt packages.  There are various ways of finding operating system of the database server. One of the easier ways is to use DBMS_UTILITY package. This package contains a port string procedure which returns the OS of the database server. Please keep in mind that this is different from the client’s OS (e.g. SQL*Plus session from which we are connecting to the database server). Following is the small code snippet, which displays the OS of the database server.

v_os VARCHAR(100);
V_OS := dbms_utility.port_String;

Here is the output.


PL/SQL procedure successfully completed.

We are running our database on windows server and hence it showed as WIN_NT.

Posted in Oracle | Leave a Comment »