Archive for the ‘Administration’

Instance Background Processes Information

This script displays instance background process information. The script works when the database is MOUNTed or OPENed. -- Oracle 8I select A.SID, A.SERIAL#, A.PROGRAM, P.PID, [...][...]


Initialization Parameter files: PFILEs vs. SPFILEs

When an Oracle Instance is started, the characteristics of the Instance are established by parameters specified within the initialization parameter file. These initialization parameters are either stored in a PFILE or S[...]


Killing Oracle Sessions

Sessions can be killed from within oracle using the ALTER SYSTEM KILL SESSION syntax. First identify the offending session as follows: SELECT s.sid, s.serial#, s.osuser, s.program FROM v$session s[...]


Using Oracle’s recycle bin

One of the many new features that Oracle 10g introduced is the recyclebin. When enabled, this feature works a little bit like the familiar Windows recycle bin or Mac Trash. Dropped tables go “into” the recycl[...]


Show the ten largest objects in the database

col owner format a15 col segment_name format a30 col segment_type format a15 col mb format 999,999,999 select owner , segment_name , segment_type , mb from ( select owner , segment_name , segment_type , bytes / 1024[...]


How large is the database

col "Database Size" format a20 col "Free space" format a20 col "Used space" format a20 select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || ' GB' "Database Size" , round(sum(used.bytes) / 1024 / 1024 / 1024 ) - round([...]


Show user info including os pid

col "SID/SERIAL" format a10 col username format a15 col osuser format a15 col program format a40 select s.sid || ',' || s.serial# "SID/SERIAL" , s.username , s.osuser , p.spid "OS PID" , s.program from v$session s , v$pr[...]


Sessions sorted by logon time

set lines 100 pages 999 col ID format a15 col osuser format a15 col login_time format a14 select username , osuser , sid || ',' || serial# "ID" , status , to_char(logon_time, 'hh24:mi dd/mm/yy') login_time , last_call_[...]


Show all connected users

set lines 100 pages 999 col ID format a15 select username , sid || ',' || serial# "ID" , status , last_call_et "Last Activity" from v$session where username is not null order by status desc , las[...]


Startup time

select to_char(startup_time, 'HH24:MI DD-MON-YY') "Startup time" from v$instance / [...]




sponsored link