-
Notifications
You must be signed in to change notification settings - Fork 2
/
rac_info.sql
executable file
·55 lines (50 loc) · 1.84 KB
/
rac_info.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
SET TERMOUT OFF;
COLUMN current_instance NEW_VALUE current_instance NOPRINT;
SELECT rpad(sys_context('USERENV', 'INSTANCE_NAME'), 17) current_instance
FROM dual;
SET TERMOUT ON;
PROMPT
PROMPT +------------------------------------------------------------------------+
PROMPT | Report : Oracle RAC Instances |
PROMPT | Instance : ¤t_instance |
PROMPT +------------------------------------------------------------------------+
SET ECHO OFF
SET FEEDBACK 6
SET HEADING ON
SET LINESIZE 180
SET PAGESIZE 50000
SET TERMOUT ON
SET TIMING OFF
SET TRIMOUT ON
SET TRIMSPOOL ON
SET VERIFY OFF
CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTES
COLUMN instance_name FORMAT a13 HEAD 'Instance|Name / Number'
COLUMN thread# FORMAT 99999999 HEAD 'Thread #'
COLUMN host_name FORMAT a28 HEAD 'Host|Name'
COLUMN status FORMAT a6 HEAD 'Status'
COLUMN startup_time FORMAT a20 HEAD 'Startup|Time'
COLUMN database_status FORMAT a8 HEAD 'Database|Status'
COLUMN archiver FORMAT a8 HEAD 'Archiver'
COLUMN logins FORMAT a10 HEAD 'Logins?'
COLUMN shutdown_pending FORMAT a8 HEAD 'Shutdown|Pending?'
COLUMN active_state FORMAT a6 HEAD 'Active|State'
COLUMN version HEAD 'Version'
SELECT
instance_name || ' (' || instance_number || ')' instance_name
, thread#
, host_name
, status
, TO_CHAR(startup_time, 'DD-MON-YYYY HH:MI:SS') startup_time
, database_status
, archiver
, logins
, shutdown_pending
, active_state
, version
FROM
gv$instance
ORDER BY
instance_number;