Audit de configuration oracle 11g

 

/* ce script sql permet d’avoir la configuration complet d’un base oracle 11g
Il produit un fichier au format html
*/

–Script pour une Database 11G et supérieure

dbinfo_11g.sql
SET heading ON
SET verify ON
SET term ON
SET serveroutput ON SIZE 900000
SET wrap ON
SET linesize 200
SET pagesize 900

SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON HEAD « <STYLE type=’text/css’> –
BODY { COLOR : #000000; FONT-FAMILY : Courier New; COLOR: #336699; FONT-SIZE: 12pt; BACKGROUND : #FFFFFF;} –
TD {COLOR: #000000; border-style: none; BACKGROUND: #FFFFCC; TEXT-ALIGN: left; padding-left: 8px; –
padding-right: 8px; FONT-WEIGHT: normal; FONT-SIZE: 8pt; FONT-FAMILY: Courier New} –
TH {COLOR: #000000; BACKGROUND: cyan; TEXT-ALIGN: center; padding-left: 20px; padding-right: 20px; –
FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Courier New} –
TABLE {border-style: solid; border-color: grey; border-width: thin; –
FONT-WEIGHT: bold; width:auto; FONT-SIZE: 10pt; FONT-FAMILY: Courier New; align: left} –
P {COLOR: #000000; TEXT-ALIGN: left; FONT-WEIGHT: bold; FONT-SIZE: 11pt; FONT-FAMILY: Courier New} </STYLE> »

/*_____ DEBUT RAPPORT _________*/

SPOOL Database_Informations.html
SET feedback off
SET heading off
SET TIMING off;
prompt _______________________________________________________________________________________________________
prompt Information sur le Serveur et la DATABASE
prompt
SELECT ‘Date / Heure du rapport : ‘||to_char(SYSDATE,’DD MON, yyyy hh24:mi:ss’)
FROM dual;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt VERSION DE LA DATABASE
SELECT DBID,
NAME « Database Name »,
CREATED « Date Creation »,
OPEN_MODE « Open Mode »,
PLATFORM_NAME  » Version OS »,
LOG_MODE « Status »
FROM sys.v_$database;

SELECT banner « Current Versions »
FROM sys.v_$version;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt VERSION DES OPTIONS ET COMPOSANTS DE LA DATABASE
SELECT COMP_ID « Code », COMP_NAME « Nom », STATUS « Status », VERSION « Version »
FROM DBA_REGISTRY
ORDER BY COMP_ID;
SELECT name « Parametre », VALUE « DIAGNOSTIC ET TUNING PACKS »
FROM v$parameter
WHERE name = ‘control_management_pack_access’;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt DEMARRAGE INSTANCE
SELECT NAME « Instance », TO_CHAR(STARTUP_TIME,’DD-MON-YYYY « at » HH24:MI:SS’) « Dernier Demarrage le  »
FROM V$INSTANCE, V$DATABASE;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt TAILLE DE LA MEMORY
show parameter memory;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt TAILLE DE LA SGA
show parameter sga;
COLUMN SIZE format 99,999,999,999
SELECT DECODE(name, ‘Database Buffers’,
‘Database Buffers (DB_BLOCK_SIZE*DB_BLOCK_BUFFERS)’,
‘Redo Buffers’,
‘Redo Buffers (LOG_BUFFER)’, name) « Memory »,
ROUND(VALUE/1024/1024,2) « Size en Mo »
FROM sys.v_$sga
UNION ALL
SELECT ‘——————————————————‘ « Memory »,
TO_NUMBER(NULL) « Size »
FROM dual
UNION ALL
SELECT ‘Total Memory’ « Memory »,
SUM(VALUE)/1024/1024 « Size en Mo »
FROM sys.v_$sga;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt TAILLE DE LA PGA
show parameter pga;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt ARCHIVELOG, DATABASE FLASH BACK, DATAGUARD
COL NAME FORMAT A30
SELECT LOG_MODE, FLASHBACK_ON, DATABASE_ROLE, DATAGUARD_BROKER, PROTECTION_MODE, REMOTE_ARCHIVE
FROM V$DATABASE;
col name FOR a30 head « Parametre »
col VALUE FOR a90 head « Destination »
SELECT name, VALUE
FROM v$parameter
WHERE name LIKE ‘log_archive_dest_%’
AND name NOT LIKE ‘log_archive_dest_state%’;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt LES TRACES
COL NAME FORMAT A40
COL VALUE FORMAT A100
SELECT name, VALUE FROM v$parameter WHERE name LIKE ‘%dump%’ ORDER BY 1;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt LES CONTROL FILES
COL FILE_TYPE FORMAT A45
COL STATUS FORMAT A18
COL GRP FORMAT 9999
COL NAME FORMAT A72
SELECT ‘Control’ FILE_TYPE
, TO_NUMBER (NULL) GRP
, NAME
, STATUS
, TO_NUMBER (NULL) MBYTES
FROM V$CONTROLFILE;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt LES REDO LOGS
COL FILE_TYPE FORMAT A45
COL STATUS FORMAT A18
COL GRP FORMAT 9999
COL NAME FORMAT A72
SELECT ‘Redo’ FILE_TYPE
, LF.GROUP# GRP
, LF.MEMBER name
, L.STATUS
, ROUND(L.BYTES / (1024 * 1024),0) MBYTES
FROM V$LOG L, V$LOGFILE LF
WHERE L.GROUP# = LF.GROUP#
UNION
SELECT ‘Redo Standby’ FILE_TYPE
, LF.GROUP# GRP
, LF.MEMBER name
, L.STATUS
, ROUND(L.BYTES / (1024 * 1024),0) MBYTES
FROM V$STANDBY_LOG L, V$LOGFILE LF
WHERE L.GROUP# = LF.GROUP#;
SELECT * FROM v$log ORDER BY 1;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt ETAT DE LA RECYCLEBIN
COL NAME FORMAT A40 head « Parametre »
COL VALUE FORMAT A100 head « Status »
SELECT name, VALUE FROM v$parameter WHERE name LIKE ‘%recyclebin%’;
COL taille head « Taille en Mo » FOR 999,999,999,999.999999
SELECT SUM(SPACE)*8192/1024/1024 taille FROM dba_recyclebin ORDER BY owner;

COL OWNER FOR a30
COL TYPE FOR a30
COL taille_mo FORMAT 999,999,999,999.999999
SELECT owner
, TYPE
, can_purge
, ( SUM (SPACE)
* (SELECT VALUE
FROM v$parameter
WHERE name = ‘db_block_size’)
/ 1024
/ 1024)
taille_mo
FROM dba_recyclebin
GROUP BY owner
, TYPE
, can_purge
ORDER BY owner;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt ETAT DE LA FLASH RECOVERY
COL NAME FORMAT A40 head « Parametre »
COL VALUE FORMAT A100 head « Valeur »
SELECT name, VALUE FROM v$parameter WHERE name LIKE ‘%recovery%’;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt REPARTITION DE LA FLASH RECOVERY
col file_type FOR a30 head « Type de ficheir »
col percent_space_used head « Poucentage utilisation »
col number_of_files head « Nombre de fichiers »
SELECT file_type, percent_space_used, number_of_files FROM V$FLASH_RECOVERY_AREA_USAGE;
col name FOR a30 head « Parametre »
col SIZE FOR 999,999,999,999 head « Taille Totale en MB »
col used FOR 999,999,999,999 head « Taille Utilise en MB »
SELECT name
, FLOOR(space_limit / 1024 / 1024) « size »
, CEIL(space_used / 1024 / 1024) « used »
FROM v$recovery_file_dest
ORDER BY name;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt LES DBLINKS
COLUMN host format a32
COLUMN db_link format a32
SELECT A.OWNER, A.HOST, A.DB_LINK, A.USERNAME, A.CREATED,DECODE (B.FLAG, 0, ‘NO’, 1, ‘YES’) « DEC », B.AUTHUSR, C.STATUS
FROM DBA_DB_LINKS A, SYS.USER$ U, SYS.LINK$ B, DBA_OBJECTS C
WHERE A.DB_LINK = B.NAME
AND A.OWNER = U.NAME
AND B.OWNER# = U.USER#
AND A.DB_LINK = C.OBJECT_NAME
AND A.OWNER = C.OWNER
AND C.OBJECT_TYPE = ‘DATABASE LINK’
ORDER BY 1, 2, 3;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt LES DIRECTORY
COL OWNER FORMAT A20
COL DIRECTORY_NAME FORMAT A30
COL DIRECTORY_PATH FORMAT A100
SELECT OWNER,DIRECTORY_NAME,DIRECTORY_PATH
FROM DBA_DIRECTORIES
ORDER BY OWNER,DIRECTORY_NAME;
SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt LES USERS
col USER_ID FOR 999999
col USERNAME FOR a20
col DEFAULT_TABLESPACE FOR a20
col DEFAULT_TABLESPACE FOR a20
col PROFILE FOR a20
col ACCOUNT_STATUS FOR a16
SELECT USERNAME,
USER_ID,
DEFAULT_TABLESPACE,
TEMPORARY_TABLESPACE,
ACCOUNT_STATUS,
PROFILE,
CREATED
FROM DBA_USERS
ORDER BY USERNAME;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt LE STOCKAGE ASM
col gprnb FOR 9999
col dsknb FOR 9999
COL NAME FOR A15
COL FAILGROUP FOR A15
COL PATH FOR A26
COL DATABASE_COMPATIBILITY HEAD « DATABASE|COMPATIBILITY » FOR a15
COL TOTAL_MB FOR 99,999,999
COL FREE_MB FOR 99,999,999
COL required_mirror_free_mb HEAD « REQUIRED_MIRROR|FREE_MB » FOR 99,999,999
COL CAPACITY_ASM HEAD « CAPACITY|ASM » FOR a8
COL header_status HEAD « HEADER|STATUS » FOR a11
COL re FOR 99
COL we FOR 99
COL repair FOR 99999
BREAK ON gprnb SKIP 1
COMPUTE SUM LABEL ‘Totals MB :’ OF TOTAL_MB ON gprnb
COMPUTE SUM LABEL ‘Totals MB :’ OF FREE_MB ON gprnb

SELECT g.GROUP_NUMBER gprnb , g.NAME,d.FAILGROUP, d.FAILGROUP_TYPE, d.DISK_NUMBER dsknb, d.NAME, d.header_status,
g.TYPE, DECODE(g.TYPE,’EXTERN’,’Pas de Raid’,’NORMAL’,’Raid sur 2 Disk’,’HIGH’,’Raid sur 3 Disk’) Typeraid,
g.STATE, d.PREFERRED_READ,
g.DATABASE_COMPATIBILITY, d.PATH, read_errs RE, write_errs wE, d.repair_timer repair, d.TOTAL_MB, d.FREE_MB,
ROUND(100*(g.total_mb-g.free_mb)/g.total_mb) pctocc, required_mirror_free_mb,
CASE WHEN g.USABLE_FILE_MB >0 THEN ‘OK’ ELSE ‘Ajout disque requis’ END AS CAPACITY_ASM
FROM V$ASM_DISK d,V$ASM_DISKGROUP g
WHERE d.GROUP_NUMBER=g.GROUP_NUMBER
ORDER BY 1,3;

COL USABLE_FILE_MB FOR 999,999,999
SELECT name, TYPE, total_mb, free_mb, required_mirror_free_mb, usable_file_mb
FROM V$ASM_DISKGROUP;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt LISTE DES DATAFILES PAR TABLESPACES
clear breaks
clear computes
clear columns
SET VERIFY ON
SET FEEDBACK OFF
SET TERMOUT ON
SET HEADSEP ON
SET HEADING ON
SET TRIMSPOOL OFF
SET PAGESIZE 1000
SET LINES 500
SET TRIMSPOOL OFF
COL TABLESPACE_NAME FORMAT A30 HEAD ‘Nom|Tablespace’
COL FILE_ID FORMAT 9999 HEAD ‘File|Id’
COL FILE_NAME FORMAT A64 HEAD ‘Nom|Datafile’
COL MAX_MBYTES FORMAT 9,999,999.99 HEAD ‘Taille Max|Mo’
COL TAILLE FORMAT 9,999,999.99 HEAD ‘Alloue|Mo’
COL LIBRE FORMAT 9,999,999.99 HEAD ‘Libre|Mo’
COL OCCUPE FORMAT 9,999,999.99 HEAD ‘Occupe|Mo’
COL PCTLIBRE FORMAT 999.99 HEAD ‘Libre|pct’
COL INCREMENT_BY FORMAT 999.99 HEAD ‘Extend|Mo’
COL CONTENTS FORMAT A4 TRUNC HEAD ‘Type’
COLUMN STATUS FORMAT A6 HEAD ‘Statut’ TRUNC
BREAK ON CONTENTS ON TABLESPACE_NAME SKIP PAGE
COMPUTE AVG LABEL ‘% Libre Total’ OF PCTLIBRE ON TABLESPACE_NAME
COMPUTE SUM LABEL ‘Taille totale Mo’ OF MAX_MBYTES ON TABLESPACE_NAME
COMPUTE SUM LABEL ‘Taille totale Mo’ OF TAILLE ON TABLESPACE_NAME
COMPUTE SUM LABEL ‘Taille totale Mo’ OF LIBRE ON TABLESPACE_NAME
COMPUTE SUM LABEL ‘Taille totale Mo’ OF OCCUPE ON TABLESPACE_NAME
SELECT
TS.CONTENTS,
RPAD(DF.TABLESPACE_NAME,20) || ‘:’ ||
DECODE(EXTENT_MANAGEMENT,’LOCAL’,’LM-‘,’DM-‘) ||
SUBSTR(ALLOCATION_TYPE,1,1)||’+’||
SUBSTR(SEGMENT_SPACE_MANAGEMENT,1,1)||’@’||
SUBSTR(TS.STATUS,1,2) TABLESPACE_NAME,
DF.FILE_ID,
DF.FILE_NAME,
DF.AUTOEXTENSIBLE,
DF.STATUS STATUS,
ROUND(DF.MAXBYTES / (1024 * 1024),0) MAX_MBYTES,
TRUNC(DF.BYTES/1024/1024) TAILLE,
(TRUNC(DF.BYTES/1024/1024)) – NVL((FS.BYTES/1024/1024),0) OCCUPE,
NVL(FS.BYTES/1024/1024,0) LIBRE,
(NVL(FS.BYTES,0)*100/DF.BYTES) PCTLIBRE,
ROUND(NVL(DF.INCREMENT_BY,0)*TS.BLOCK_SIZE / (1024 * 1024),0) INCREMENT_BY
FROM DBA_DATA_FILES DF,
DBA_TABLESPACES TS,
(SELECT TABLESPACE_NAME, FILE_ID, SUM(BYTES) BYTES FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME, FILE_ID) FS
WHERE TS.TABLESPACE_NAME=DF.TABLESPACE_NAME
AND FS.TABLESPACE_NAME(+)=DF.TABLESPACE_NAME
AND FS.FILE_ID(+)=DF.FILE_ID
AND TS.TABLESPACE_NAME LIKE UPPER(‘%’)
ORDER BY TS.CONTENTS, DF.TABLESPACE_NAME, DF.FILE_NAME;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt UTILISATION DES TABLESPACES
clear breaks
clear computes
clear columns
SET VERIFY ON
SET FEEDBACK OFF
SET TERMOUT ON
SET HEADSEP ON
SET HEADING ON
SET TRIMSPOOL OFF
SET pagesize 50
SET linesize 120
COLUMN tablespace_name heading ‘Tablespace’ justify left format a30 truncated
COLUMN tbsize heading ‘Size|(Mb) ‘ justify left format 9,999,999.99
COLUMN tbused heading ‘Used|(Mb) ‘ justify right format 9,999,999.99
COLUMN tbfree heading ‘Free|(Mb) ‘ justify right format 9,999,999.99
COLUMN tbusedpct heading ‘Used % ‘ justify left format a8
COLUMN tbfreepct heading ‘Free % ‘ justify left format a8
break ON report
compute SUM label ‘Totals:’ OF tbsize tbused tbfree ON report
SELECT t.tablespace_name, ROUND(a.bytes,2) tbsize,
NVL(ROUND(b.bytes,2),’0′) tbused,
NVL(ROUND(c.bytes,2),’0′) tbfree,
TO_CHAR(ROUND(100 * (NVL(b.bytes,0)/NVL(a.bytes,1)),2)) || ‘%’ tbusedpct,
TO_CHAR(ROUND(100 * (NVL(c.bytes,0)/NVL(a.bytes,1)),2)) || ‘%’ tbfreepct
FROM dba_tablespaces t,
(SELECT tablespace_name, ROUND(SUM(bytes)/1024/1024,2) bytes
FROM dba_data_files
GROUP BY tablespace_name
UNION
SELECT tablespace_name, ROUND(SUM(bytes)/1024/1024,2) bytes
FROM dba_temp_files
GROUP BY tablespace_name ) a,
(SELECT e.tablespace_name, ROUND(SUM(e.bytes)/1024/1024,2) bytes
FROM dba_segments e
GROUP BY e.tablespace_name
UNION
SELECT tablespace_name, SUM(max_size) bytes
FROM v$sort_segment
GROUP BY tablespace_name) b,
(SELECT f.tablespace_name, ROUND(SUM(f.bytes)/1024/1024,2) bytes
FROM dba_free_space f
GROUP BY f.tablespace_name
UNION
SELECT tmp.tablespace_name, (SUM(bytes/1024/1024) – SUM(max_size)) bytes
FROM dba_temp_files tmp, v$sort_segment sort
WHERE tmp.tablespace_name = sort.tablespace_name
GROUP BY tmp.tablespace_name) c
WHERE
t.tablespace_name = a.tablespace_name (+)
AND t.tablespace_name = b.tablespace_name (+)
AND t.tablespace_name = c.tablespace_name (+)
ORDER BY t.tablespace_name;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt Liste des Tables sans INDEX
SELECT s.owner, s.segment_name TABLE_NAME, s.segment_type TABLE_TYPE, s.tablespace_name, ROUND(SUM(s.bytes)/1024/1024,2) sizemo, SUM(t.num_rows) num_rows, MAX(t.LAST_ANALYZED) LAST_ANALYZED
,(SELECT COUNT(*) FROM dba_indexes i WHERE i.table_owner = s.owner AND i.table_name = s.segment_name) nb_index
FROM dba_segments s, dba_tables t
WHERE s.owner LIKE UPPER(‘%’)
AND s.owner = t.owner
AND s.segment_name = t.table_name
AND (SELECT COUNT(*) FROM dba_indexes i WHERE i.table_owner = s.owner AND i.table_name = s.segment_name) = 0
GROUP BY s.owner,s.segment_name,s.segment_type,s.tablespace_name
ORDER BY 1,2;

SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt Jobs Broken
SELECT
j.log_user,
j.job,
j.broken,
j.failures,
j.last_date||’:’||j.last_sec last_date,
j.this_date||’:’||j.this_sec this_date,
j.next_date||’:’||j.next_sec next_date,
j.next_date – j.last_date rinterval,
j.INTERVAL
FROM dba_jobs j
WHERE broken = ‘Y’
ORDER BY job;
SET heading ON
prompt
prompt _______________________________________________________________________________________________________
prompt Liste des Objet invalides
SELECT OWNER
, OBJECT_TYPE
, OBJECT_NAME
, TO_CHAR ( CREATED, ‘dd/mm/yyyy hh24:mi:ss’) CREATED
, TO_CHAR ( LAST_DDL_TIME, ‘dd/mm/yyyy hh24:mi:ss’) LAST_DDL_TIME
FROM DBA_OBJECTS
WHERE STATUS != ‘VALID’
ORDER BY OWNER
, OBJECT_TYPE
, OBJECT_NAME;

SET heading ON

prompt
prompt _______________________________________________________________________________________________________
prompt switch des redo

column day format a10
column Switches_per_day format 9999
column 00 format 999
column 01 format 999
column 02 format 999
column 03 format 999
column 04 format 999
column 05 format 999
column 06 format 999
column 07 format 999
column 08 format 999
column 09 format 999
column 10 format 999
column 11 format 999
column 12 format 999
column 13 format 999
column 14 format 999
column 15 format 999
column 16 format 999
column 17 format 999
column 18 format 999
column 19 format 999
column 20 format 999
column 21 format 999
column 22 format 999
column 23 format 999
select to_char(first_time,’DD-MON’) day,
sum(decode(to_char(first_time,’hh24′),’00’,1,0)) « 00 »,
sum(decode(to_char(first_time,’hh24′),’01’,1,0)) « 01 »,
sum(decode(to_char(first_time,’hh24′),’02’,1,0)) « 02 »,
sum(decode(to_char(first_time,’hh24′),’03’,1,0)) « 03 »,
sum(decode(to_char(first_time,’hh24′),’04’,1,0)) « 04 »,
sum(decode(to_char(first_time,’hh24′),’05’,1,0)) « 05 »,
sum(decode(to_char(first_time,’hh24′),’06’,1,0)) « 06 »,
sum(decode(to_char(first_time,’hh24′),’07’,1,0)) « 07 »,
sum(decode(to_char(first_time,’hh24′),’08’,1,0)) « 08 »,
sum(decode(to_char(first_time,’hh24′),’09’,1,0)) « 09 »,
sum(decode(to_char(first_time,’hh24′),’10’,1,0)) « 10 »,
sum(decode(to_char(first_time,’hh24′),’11’,1,0)) « 11 »,
sum(decode(to_char(first_time,’hh24′),’12’,1,0)) « 12 »,
sum(decode(to_char(first_time,’hh24′),’13’,1,0)) « 13 »,
sum(decode(to_char(first_time,’hh24′),’14’,1,0)) « 14 »,
sum(decode(to_char(first_time,’hh24′),’15’,1,0)) « 15 »,
sum(decode(to_char(first_time,’hh24′),’16’,1,0)) « 16 »,
sum(decode(to_char(first_time,’hh24′),’17’,1,0)) « 17 »,
sum(decode(to_char(first_time,’hh24′),’18’,1,0)) « 18 »,
sum(decode(to_char(first_time,’hh24′),’19’,1,0)) « 19 »,
sum(decode(to_char(first_time,’hh24′),’20’,1,0)) « 20 »,
sum(decode(to_char(first_time,’hh24′),’21’,1,0)) « 21 »,
sum(decode(to_char(first_time,’hh24′),’22’,1,0)) « 22 »,
sum(decode(to_char(first_time,’hh24′),’23’,1,0)) « 23 »,
count(to_char(first_time,’MM-DD’)) Switches_per_day
from v$log_history
where trunc(first_time) between trunc(sysdate) – 6 and trunc(sysdate)
group by to_char(first_time,’DD-MON’)
order by to_char(first_time,’DD-MON’) ;
SET heading ON

prompt
prompt _______________________________________________________________________________________________________
prompt TAILLE DE LA BASE

select sum(bytes/1024/1024/1024) from dba_data_files;

prompt TAILLE TEMPFILE

select sum(bytes/1024/1024/1024) from dba_temp_files;

SET heading ON

prompt
prompt _______________________________________________________________________________________________________
prompt IP + PORT

select sys_context(‘userenv’, ‘ip_address’) ip_address, port
from gv$session
where gv$session.inst_id = sys_context(‘userenv’, ‘instance’)
and gv$session.sid = sys_context(‘userenv’, ‘sid’);

SET heading ON

prompt
prompt _______________________________________________________________________________________________________
prompt ORACLE_HOME

var OH varchar2(200);
EXEC dbms_system.get_env(‘ORACLE_HOME’, :OH) ;

PRINT OH
prompt _______________________________________________________________________________________________________
prompt FIN DU RAPPORT
SET MARKUP HTML OFF
spool off
–exit;

Post Comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *