├── README ├── oracle_startup_time.txt ├── oracle_version.txt ├── python-get_hostname.py ├── python-get_python_version.py └── spfile_or_pfile.txt /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Snippets/99bec84d62a26a3b298a63ac1bd2797a7d41bd2e/README -------------------------------------------------------------------------------- /oracle_startup_time.txt: -------------------------------------------------------------------------------- 1 | This will show you when the database was started. 2 | 3 | SQL> select to_char(startup_time, 'DD-MON-YYYY HH24:MI:SS') from v$instance; 4 | 5 | TO_CHAR(STARTUP_TIME 6 | -------------------- 7 | 24-FEB-2012 23:59:11 8 | 9 | This will show you when the database was started and how long the database has been running 10 | 11 | SELECT to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') "DB Startup Time", 12 | to_char(round((sysdate-startup_time)*24*60)) UP_TIME_MINUTES 13 | FROM sys.v_$instance; 14 | 15 | DB Startup Time UP_TIME_MINUTES 16 | -------------------- ---------------------------------------- 17 | 29-FEB-2012 11:58:50 10426 18 | -------------------------------------------------------------------------------- /oracle_version.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekcomputers/Snippets/99bec84d62a26a3b298a63ac1bd2797a7d41bd2e/oracle_version.txt -------------------------------------------------------------------------------- /python-get_hostname.py: -------------------------------------------------------------------------------- 1 | #Get hostname from a simple one liner 2 | from socket import gethostname; print gethostname() 3 | 4 | #Get Hostname 5 | import socket 6 | print socket.gethostname() 7 | -------------------------------------------------------------------------------- /python-get_python_version.py: -------------------------------------------------------------------------------- 1 | #Get the python version 2 | import sys 3 | print (sys.version) -------------------------------------------------------------------------------- /spfile_or_pfile.txt: -------------------------------------------------------------------------------- 1 | This is how to determine if the database was started with an SPFILE or a PFILE. 2 | 3 | SELECT instance_name, DECODE(value, NULL, 'PFILE','SPFILE') "Init File Type" 4 | FROM sys.v_$parameter, v$instance 5 | WHERE name = 'spfile'; 6 | 7 | Or you can use the commands below as you can see the first one does not use a spfile whereas the second one does. 8 | 9 | SQL> show parameter spfile; 10 | 11 | NAME TYPE VALUE 12 | ------------------------------------ ----------- ------------------------------ 13 | spfile string 14 | 15 | SQL> show parameter spfile 16 | 17 | NAME TYPE VALUE 18 | ------------------------------------ ----------- ------------------------------ 19 | spfile string /opt/oracle/home/10gHome/dbs/spfileRIMSTEST.ora 20 | 21 | SQL> 22 | --------------------------------------------------------------------------------