Senten500.c

291 views
254 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
291
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Senten500.c

  1. 1. senten500.c#include <stdio.h>#include <string.h>#include <stdlib.h>cargar_sentencia (int version, int sentencia, char *opcion_uno, char*opcion_dos, char *opcion_tres ) { switch (sentencia) { case 0: /********** PARA TODAS LAS VERSIONES **********/ strcpy (dyn_column,"|ORACLE_VERSION|"); strcpy (dyn_title,"Oracle Version ...n"); strcpy (dyn_sts,"select ltrim(lpad(banner,70)) Versionfrom v$version "); strcat (dyn_sts,"where banner like %Oracle% "); strcpy (dyn_size,"80"); break; case 1: /********** PARA TODAS LAS VERSIONES **********/ strcpy (dyn_column,"|NOMBRE|VALOR|DESCRIPCION|"); strcpy (dyn_title,"Active Parameters ...n"); strcpy (dyn_sts,"select name,value,description fromv$parameter order by 1 "); strcpy (dyn_size,"355540"); break; case 2: /********** PARA TODAS LAS VERSIONES **********/ strcpy(dyn_column,"|DIRECCION|SES|NOMBRE|CMD|ESTADO|PID|TERMINAL|INICIADO|"); strcpy (dyn_title,"User conected...n"); strcpy (dyn_sts,"select saddr ADDRESS,sid SES,usernameNOMBRE,command CMD, n"); strcat (dyn_sts,"status ESTADO,process PID,terminalTERMINAL, n"); strcat (dyn_sts,"to_char(logon_time,DD/MM/YYYY -HH24:MI:SS) INICIADO from v$session "); strcpy (dyn_size,"0804150608091122"); break; case 3: /********** PARA TODAS LAS VERSIONES **********/ strcpy (dyn_column,"|CANTIDAD|TIEMPO|CLASE|"); strcpy (dyn_title,"User conected...n"); strcpy (dyn_title,"Wait Statistics...n"); strcpy (dyn_sts,"select count CANTIDAD,time TIEMPO,classCLASE from v$waitstat order by 1 "); strcpy (dyn_size,"101030"); break; case 4: strcpy (dyn_title,"Datafile I-O ...n"); switch (version) { case VERSION_ORACLE_920: strcpy(dyn_column,"|READPHY|READBLK|WRITPHY||WRITBLK|DATAFILE|IO_STAT|"); strcpy (dyn_sts,"select f.phyrds,f.phyblkrd, f.phywrts, "); strcat (dyn_sts,"f.phyblkwrt,f.lstiotim*10 , d.namen"); strcat (dyn_sts,"from v$filestat f,v$datafile d "); strcat (dyn_sts,"where f.file# = d.file#and "); strcat (dyn_sts,"f.lstiotim > 0 order by2 n"); strcpy (dyn_size,"080808086010"); Página 1
  2. 2. senten500.c break; case VERSION_ORACLE_817: case VERSION_ORACLE_816: case VERSION_ORACLE_734: strcpy(dyn_column,"|READPHY|READBLK|WRITPHY|WRITBLK|DATAFILE|"); strcpy (dyn_sts,"select f.phyrds,f.phyblkrd, f.phywrts, "); strcat (dyn_sts,"f.phyblkwrt, d.name "); strcat (dyn_sts,"from v$filestatf,v$datafile d "); strcat (dyn_sts,"where f.file# = d.file#"); strcat (dyn_sts,"order by 2 n"); strcpy (dyn_size,"0606060660"); break; default: break; } break; case 5: /********** PARA TODAS LAS VERSIONES **********/ strcpy(dyn_column,"|DATAFILE|BLKREAD|BLKWRITE|BLKTOT|"); strcpy (dyn_title,"Datafile Blocks R+W ...n"); strcpy (dyn_sts,"select d.name DATAFILE, f.phyblkrdBLK_READ, f.phyblkwrt BLK_WRITE, n"); strcat (dyn_sts,"f.phyblkrd+f.phyblkwrt BLK_TOTAL fromv$filestat f, v$datafile d n"); strcat (dyn_sts,"where f.file# = d.file# order by 3 desc"); strcpy (dyn_size,"60060606"); break; case 6: /********** PARA TODAS LAS VERSIONES **********/ strcpy (dyn_column,"|USUARIO|CANTIDAD|EVENTO|"); strcpy (dyn_title,"Wait Events ...n"); strcpy (dyn_sts,"select se.username USUARIO,count(*)CANTIDAD,sw.event EVENTO n"); strcat (dyn_sts,"from v$session se, v$session_wait swwhere sw.sid=se.sid and n"); strcat (dyn_sts,"se.username > A and sw.event not likeSQL*Net% and n"); strcat (dyn_sts,"sw.event not like PX Deq: Table QNormal% and n"); strcat (dyn_sts,"sw.event not like PX Deq: ExecutionMsg% and n"); strcat (dyn_sts,"sw.event not like pipe get% group byse.username, sw.event "); strcpy (dyn_size,"201030"); break; case 7: strcpy (dyn_title,"Instance status ...n"); switch (version) { case VERSION_ORACLE_816: case VERSION_ORACLE_817: case VERSION_ORACLE_920: strcpy(dyn_column,"|INSTNRO|INSTNAME|HOSTNAME|VERSION|INICIADO|ESTADO|PARALELO|DATAESTA|INSTROLE|ACTSTATUS|"); strcpy (dyn_title,"Instance status...n"); strcpy (dyn_sts,"select instance_number,instance_name, host_name, version, n"); strcat(dyn_sts,"to_char(startup_time,DD/MM/YYYY - HH24:MI:SS),status, parallel, Página 2
  3. 3. senten500.cn"); strcat (dyn_sts,"database_status,instance_role n"); strcat (dyn_sts,"from v$instance n"); strcpy(dyn_size,"03080910220503101010"); break; case VERSION_ORACLE_734: strcpy (dyn_column,"|NOMBRE DECLAVE|ESTADO|"); strcpy (dyn_title,"Instance status...n"); strcpy (dyn_sts,"select RESTRITEDMODE,value "); strcat (dyn_sts,"from v$instance wherekey=RESTRICTED MODE "); strcat (dyn_sts,"union "); strcat (dyn_sts,"select SHUTDOWNPENDING,value "); strcat (dyn_sts,"from v$instance wherekey=SHUTDOWN PENDING "); strcat (dyn_sts,"union "); strcat (dyn_sts,"select STARTUP TIME -JULIAN,value "); strcat (dyn_sts,"from v$instance wherekey=STARTUP TIME - JULIAN "); strcat (dyn_sts,"union "); strcat (dyn_sts,"select STARTUP TIME -SECONDS, value "); strcat (dyn_sts,"from v$instance wherekey=STARTUP TIME - SECONDS n"); strcpy (dyn_size,"4015"); break; default: break; } break; case 8: switch (version) { case VERSION_ORACLE_816: case VERSION_ORACLE_817: case VERSION_ORACLE_920: strcpy(dyn_column,"|SES|SERIAL|USER|EXTENTS|CONTENTS|SIZEKB"); strcpy (dyn_title,"Temporal Space byuser ...n"); strcpy (dyn_sts,"select se.sid,se.serial#, se.username, so.extents, so.contents, n"); strcat (dyn_sts,"sum((so.blocks)*(selectvalue from v$parameter n"); strcat (dyn_sts,"where name in(db_block_size))/1000) size_kb n"); strcat (dyn_sts,"from v$session se,v$sort_usage so where se.saddr=so.session_addr n"); strcat (dyn_sts,"group byse.sid,se.serial#,se.username,so.extents,so.contents n"); strcpy (dyn_size,"101010101030"); break; case VERSION_ORACLE_734: /* PROCESAR CON FUNCION.....SELECT NO SOPORTADO */ strcpy (dyn_proc_fun,"|NO|0601|"); strcpy(dyn_column,"|SES|SERIAL|USER|EXTENTS|CONTENTS|SIZEKB"); strcpy (dyn_title,"Temporal Space byuser ...n"); strcpy (dyn_sts,"select se.sid,se.serial#, se.username, so.extents, so.contents, n"); Página 3
  4. 4. senten500.c strcat (dyn_sts,"sum(so.blocks) size_kbn"); strcat (dyn_sts,"from v$session se,v$sort_usage so where se.saddr=so.session_addr n"); strcat (dyn_sts,"group byse.sid,se.serial#,se.username,so.extents,so.contents n"); strcpy (dyn_size,"101010101030"); default: break; } break; case 9: strcpy (dyn_column,"|PCTFREE|"); strcpy (dyn_title,"Total Freelist Wait Percentage...n"); strcpy (dyn_sts,"select (a.count/sum(b.value))*100PCT_FREELIST from v$waitstat a, n"); strcat (dyn_sts,"v$sysstat b where a.class=free listand n"); strcat (dyn_sts,"b.name in (db block gets,consistentgets) group by a.count "); strcpy (dyn_size,"12"); break; case 10: strcpy (dyn_column,"|CHEKPOINT_VALUE|FECHA|"); strcpy (dyn_title,"Last Checkpoint Time ...n"); strcpy (dyn_sts,"select min(sysdate -CHECKPOINT_TIME)*24*60 MINUTO, n"); strcat (dyn_sts,"to_char(sysdate,DD/MM/YYYY -HH24:MI:SS) FECHA from v$datafile_header"); strcpy (dyn_size,"1522"); break; case 11: strcpy(dyn_column,"|TBLSPACE|CONTENT|AVAILA_KB|MAX_ID|USED_KB|FREE_KB|PCT_USED|"); strcpy (dyn_title,"List Tablespaces ...n"); strcpy (dyn_sts,"select a.tablespace_nameTBL_NAME,d.contents CONTENT,a.sum_bytes/1048576 AVAILA_KB, n"); strcat (dyn_sts,"a.max_id MAX_ID,nvl(a.sum_bytes -c.sum_bytes,0)/1048576 USED_KB, n"); strcat (dyn_sts,"nvl(c.sum_bytes,0)/1048576 FREE_KB,n"); strcat (dyn_sts,"round(nvl((a.sum_bytes -c.sum_bytes),0.00)/a.sum_bytes*100.0,2) PCT_USED, d.status, n"); strcat (dyn_sts,"d.extent_management,d.allocation_typefrom (select tablespace_name,sum(bytes) sum_bytes, n"); strcat (dyn_sts,"count(1) max_id from dba_data_filesgroup by tablespace_name ) a, n"); strcat (dyn_sts,"(select tablespace_name,sum(bytes)sum_bytes from dba_free_space n"); strcat (dyn_sts,"group by tablespace_name) c,dba_tablespaces d n"); strcat (dyn_sts,"where a.tablespace_name =c.tablespace_name(+) and n"); strcat (dyn_sts,"a.tablespace_name = d.tablespace_name(+) order by 1 "); strcpy (dyn_size,"151010061010070810101010"); break; case 12: strcpy(dyn_column,"|ADDRESS|TIMESTART|ESTADO|BLK_USED|KB_USED|SES|SERIAL|NOMBRE|USUARIO|"); strcpy (dyn_title,"Active Transactions ...n"); strcpy (dyn_sts,"selecttr.addr,to_char(tr.start_time,DD/MM/YYYY - 24HH:MM:SS) TIME_START, n"); strcat (dyn_sts,"tr.status ESTADO,tr.used_ublkBLK_USED,tr.used_ublk*(select value n"); strcat (dyn_sts,"from v$parameter where name in Página 4
  5. 5. senten500.cdb_block_size)/1000 KB_USED,tr.used_urec, n"); strcat (dyn_sts,"se.sid SES, se.serial#SERIAL,rn.name,se.username from v$transaction tr, n"); strcat (dyn_sts,"v$session se, v$rollname rn wheretr.xidusn=rn.usn and n"); strcat (dyn_sts,"tr.ses_addr=se.saddr order by 6"); strcpy (dyn_size,"102208080810040605101010"); break; case 13: strcpy(dyn_column,"|GETS|MISS|HITRATIO|IMM_GETS|IMM_MISS|SLEEP|GETSPIN|ADDRESS|LATCH|NOMBRE|"); strcpy (dyn_title,"Latch Details ...n"); strcpy (dyn_sts,"select gets GETS,missesMISS,round((gets-misses)*100/gets,2) HITRATIO, n"); strcat (dyn_sts,"immediate_getsIMM_GETS,immediate_misses IMM_MISS,sleeps SLEEP, n"); strcat (dyn_sts,"spin_gets GETSPIN,addr ADDR,latch#,nameNOMBRE from v$latch n"); strcat (dyn_sts,"where misses > 0 and gets > 0 order byround(((gets-misses)/gets),2) desc"); strcpy (dyn_size,"10040808080507080825"); break; case 14: strcpy(dyn_column,"|NOMBRE|INIT_ALLOC|CURR_UTILIZA|MAX_UTILIZA|LIMITE|"); strcpy (dyn_title,"Resource Limits ...n"); strcpy (dyn_sts,"select resource_nameNOMBRE,initial_allocation INIT_ALLOC, n"); strcat (dyn_sts,"current_utilizationCURR_UTILIZA,max_utilization MAX_UTILIZA, n"); strcat (dyn_sts,"limit_value LIMITE fromv$resource_limit order by 1"); strcpy (dyn_size,"3010101010"); break; case 15: strcpy (dyn_column,"|DATAFILE|MBYTES|ESTADO|"); strcpy (dyn_title,"List Datafiles ...n"); strcpy (dyn_sts,"select name DATAFILE,bytes/1048576MBYTES, status ESTADO from v$datafile n"); strcat (dyn_sts,"union all n"); strcat (dyn_sts,"select name DATAFILE,bytes/1048576MBYTES, status ESTADO from v$tempfile n"); strcpy (dyn_size,"701008"); break; case 16: strcpy(dyn_column,"|ESTADO|DATAFILE|TBLSPACE|SIZE_KB|USED_KB|USED_PCT|"); strcpy (dyn_title,"List Datafiles New 9i ...n"); strcpy (dyn_sts,"select v.status ESTADO, d.file_nameDATAFILE, d.tablespace_name TBLNAME, n"); strcat(dyn_sts,"to_char(nvl((d.bytes/1024),0),99999990.000) SIZE_KB, n"); strcat(dyn_sts,"to_char(nvl(((d.bytes-nvl(s.bytes,0))/1024),0),99999999.999) || /|| to_char(nvl((d.bytes/1024),0),99999999.999) || / || nvl(d.autoextensible,NO) USED_KB, n"); strcat (dyn_sts,"to_char(nvl(((d.bytes -nvl(s.bytes,0))/d.bytes)*100,0),990.00) USED_PCT n"); strcat (dyn_sts,"from sys.dba_data_files d, v$datafilev, (select file_id,sum(bytes) bytes n"); strcat (dyn_sts,"from sys.dba_free_space group byfile_id) s n"); strcat (dyn_sts,"where s.file_id(+)=d.file_id andd.file_name=v.name n"); strcat (dyn_sts,"union all n"); strcat (dyn_sts,"select v.status ESTADO, d.file_nameDATAFILE, d.tablespace_name TBLNAME, n"); Página 5
  6. 6. senten500.c strcat(dyn_sts,"to_char(nvl((d.bytes/1024),0),99999990.000) SIZE_KB, n"); strcat (dyn_sts,"to_char(nvl((t.bytes_cached /1024),0),9999999.999) || / || to_char(nvl((d.bytes/1024),0),99999999.999)|| / || nvl (d.autoextensible,NO) USED_KB, n"); strcat(dyn_sts,"to_char(nvl((t.bytes_cached/d.bytes)*100,0),990.00) USED_PCT n"); strcat (dyn_sts,"from sys.dba_temp_files d,v$temp_extent_pool t, v$tempfile v n"); strcat (dyn_sts,"where t.file_id(+)=d.file_id andd.file_id=v.file# n"); strcpy (dyn_size,"036018121208"); break; case 17: strcpy(dyn_column,"|ESTADO|TBLSPACE|TIPO|EXTENT_MGM|SIZE_KB|USED_KB|USED_PCT|"); strcpy (dyn_title,"List Tablespaces New 9i...n"); strcpy (dyn_sts,"select d.status ESTADO,d.tablespace_name TBLNAME,d.contents TIPO, n"); strcat (dyn_sts,"d.extent_managementEXTENT_MGM,to_char(nvl((a.bytes/1024),0),99999999.999) SIZE_KB, n"); strcat(dyn_sts,"to_char((nvl(a.bytes-nvl(f.bytes,0),0)/1024),99999999.999) || / ||to_char(nvl((a.bytes/1024),0),99999999.999) USED_KB, n"); strcat (dyn_sts,"to_char(nvl(((a.bytes -nvl(f.bytes,0))/a.bytes)*100,0),990.00) USED_PCT n"); strcat (dyn_sts,"from sys.dba_tablespaces d, (selecttablespace_name, sum(bytes) bytes n"); strcat (dyn_sts,"from dba_data_files group bytablespace_name) a, (select tablespace_name,sum(bytes) bytes n"); strcat (dyn_sts,"from dba_free_space group bytablespace_name ) f n"); strcat (dyn_sts,"whered.tablespace_name=a.tablespace_name(+) and n"); strcat (dyn_sts,"d.tablespace_name =f.tablespace_name(+) and n"); strcat (dyn_sts,"not (d.extent_management like LOCALand d.contents LIKE TEMPORARY) n"); strcat (dyn_sts,"union all n"); strcat (dyn_sts,"select d.status ESTADO,d.tablespace_name TBLNAME,d.contents TIPO, n"); strcat (dyn_sts,"d.extent_managementEXTENT_MGM,to_char(nvl((a.bytes/1024),0),99999999.999) SIZE_KB, n"); strcat(dyn_sts,"to_char((nvl(t.bytes,0)/1024),99999999.999) || / ||to_char(nvl((a.bytes/1024),0),99999999.999) USED_KB, n"); strcat(dyn_sts,"to_char(nvl((t.bytes/a.bytes)*100,0),990.00) USED_PCT fromsys.dba_tablespaces d, n"); strcat (dyn_sts,"(select tablespace_name, sum(bytes)bytes from dba_temp_files group by tablespace_name) a, n"); strcat (dyn_sts,"(select tablespace_name,sum(bytes_cached) bytes from v$temp_extent_pool n"); strcat (dyn_sts,"group by tablespace_name) t whered.tablespace_name=a.tablespace_name (+) and n"); strcat (dyn_sts,"d.tablespace_name=t.tablespace_name (+)and d.extent_management like LOCAL and n"); strcat (dyn_sts,"d.contents like TEMPORARY "); strcpy (dyn_size,"06251012121212121212121010101010"); break; case 18: strcpy(dyn_column,"|SES|SERIAL|TIPO|OS_USER|LOGON|ESTADO|PROCESO|MAQUINA|NOMBRE|PID|PROGRAMA|"); strcpy (dyn_title,"Active Sessions ...n"); strcpy (dyn_sts,"select s.sid SES, s.serial# SERI,s.type TIPO, s.osuser OS_USER, n"); strcat (dyn_sts,"to_char(logon_time,DD/MM/YYYY - Página 6
  7. 7. senten500.cHH24:MI:SS) LOGON,s.status ESTADO, n"); strcat (dyn_sts,"s.process PROCESO, s.machine MAQUINA,s.username NOMBRE, n"); strcat (dyn_sts,"p.spid PID, s.program PROGRAMA n"); strcat (dyn_sts,"from v$session s, v$process p n"); strcat (dyn_sts,"where osuser is not null andp.addr=s.paddr n"); strcpy (dyn_size,"0404101022100910100930"); break; case 19: strcpy(dyn_column,"|SES|SEQ|W_T|S_W_T|USUARIO|ESTADO|EVENT|STATE|P1TEXT|P1|P1RAW|P2TEXT|P2|P2RAW|P3TEXT|P3|P3RAW|"); strcpy (dyn_title,"Session Waits n"); strcpy (dyn_sts,"select sw.sid SES, sw.seq# SEQ,nvl(sw.wait_time,0) W_T, n"); strcat (dyn_sts,"nvl(sw.seconds_in_wait,0)S_W_T,nvl(se.username,.) USUA, n"); strcat (dyn_sts,"nvl(se.status,.) ESTA,sw.event EVENT,sw.state, sw.p1text, sw.p1, n"); strcat (dyn_sts,"sw.p1raw, sw.p2text, sw.p2, sw.p2raw,sw.p3text, sw.p3, sw.p3raw n"); strcat (dyn_sts,"from v$session_wait sw, v$session sen"); strcat (dyn_sts,"where sw.sid = se.sid order by 2 n"); strcpy(dyn_size,"0404050506062020101010101010101010101010101010"); break; case 20: strcpy(dyn_column,"|TBLSPACE|INI_EXT|NEX_EXT|MIN_EXT|MAX_EXT|PCT_INC|"); strcpy (dyn_title,"Default Storage Settings - ByTablespace n"); strcpy (dyn_sts,"select tablespace_name TBLNAME,initial_extent INI_EXT, next_extent NEX_EXT, n"); strcat (dyn_sts,"min_extents MIN_EXT, max_extentsMAX_EXT, pct_increase PCT_INC n"); strcat (dyn_sts,"from dba_tablespaces n"); strcat (dyn_sts,"order by tablespace_name n"); strcpy (dyn_size,"201212121207"); break; case 21: strcpy(dyn_column,"|OWNER_TABLE|SEG_NAME|TBLSPACE|BLOCKS|SIZE_KB|MAX_EXT|"); strcpy (dyn_title,"All tables Storage (Except SYS andSYSTEM) n"); strcpy (dyn_sts,"select owner OWNER_TABLE,segment_nameSEG_NAME,tablespace_name TBL_NAME, blocks BLKS, n"); strcat (dyn_sts,"(select value from v$parameter wherename in db_block_size)*blocks/1024 SIZE_KB, n"); strcat (dyn_sts,"extents EXTS, max_extents MAX_EXT n"); strcat (dyn_sts,"from dba_segments n"); strcat (dyn_sts,"where segment_type=TABLE order by 1,2n"); strcpy (dyn_size,"12402005060510"); break; case 22: strcpy(dyn_column,"|OWNER|TABLNAME|TBLSPACE|BLOCK|NROWS|BUFF_POOL|LAST_ANALIZE|SIZE_KB"); strcpy (dyn_title,"Non-Sys Tables n"); strcpy (dyn_sts,"select owner OWNER, table_name TNAME,tablespace_name TBLNAME, n"); strcat (dyn_sts,"nvl(blocks,-1) BLOCK, nvl(num_rows,-1)NROWS, buffer_pool BUFF_POOL, n"); strcat (dyn_sts,"nvl(to_char(last_analyzed,DD/MM/YYYY -HH24:MI),-1) LAST_ANALIZE, n"); strcat (dyn_sts,"sum((blocks) * (select value from Página 7
  8. 8. senten500.cv$parameter where name in (db_block_size)))/1000 n"); strcat (dyn_sts,"from dba_tables n"); strcat (dyn_sts,"group byowner,table_name,tablespace_name,nvl(blocks,-1),nvl(num_rows,-1), n"); strcat(dyn_sts,"buffer_pool,nvl(to_char(last_analyzed,DD/MM/YYYY - HH24:MI),-1)n"); strcat (dyn_sts,"order by 1,2 n"); strcpy (dyn_size,"1225200808101808"); break; case 23: strcpy(dyn_column,"|OWNER|INDEXNAME|TBLSPACE|LEAFBLK|NROROWS|BUFFPOOL|LASTANALIZ|SIZE_KB|"); strcpy (dyn_title,"Non-Sys Indexes n"); strcpy (dyn_sts,"selectowner,index_name,tablespace_name, nvl(leaf_blocks,-1), nvl(num_rows,-1), n"); strcat (dyn_sts,"buffer_pool,nvl(to_char(last_analyzed,DD/MM/YYYY - HH24:MI),-1), n"); strcat (dyn_sts,"sum((leaf_blocks) * (select value fromv$parameter n"); strcat (dyn_sts,"where name in (db_block_size)))/1000n"); strcat (dyn_sts,"from dba_indexes n"); strcat (dyn_sts,"group by owner, index_name,tablespace_name, nvl(leaf_blocks,-1), n"); strcat (dyn_sts,"nvl(num_rows,-1), buffer_pool,nvl(to_char(last_analyzed,DD/MM/YYYY - HH24:MI),-1) n"); strcat (dyn_sts,"order by 1,2 n"); strcpy (dyn_size,"1225200808101808"); break; case 24: strcpy(dyn_column,"|USUA|ACCSTAT|EXPIRYDATE|DFLTBLNAME|TMPTBLNAME|PROFILE|CREATED|"); strcpy (dyn_title,"User Defined n"); strcpy (dyn_sts,"select * from (select distinctusername, account_status, expiry_date, n"); strcat (dyn_sts,"default_tablespace,temporary_tablespace, profile, n"); strcat (dyn_sts,"to_char(created,DD/MM/YYYY - HH24:MI)from dba_users n"); strcat (dyn_sts,"union n"); strcat (dyn_sts,"select PUBLIC,OPEN, to_date(null),, , , to_char(to_date(null), n"); strcat (dyn_sts,"DD/MM/YYYY - HH24:MI) from dual)n"); strcat (dyn_sts,"order by initcap(username) n"); strcpy (dyn_size,"25090820203018101010"); break; case 25: strcpy (dyn_column,"|FILENAME|TBLSPACE|ESTADO|"); strcpy (dyn_title,"List Datafiles, Online Redo Logs,Control Files n"); strcpy (dyn_sts,"select file_name, tablespace_name,status from dba_data_files n"); strcat (dyn_sts,"union all n"); strcat (dyn_sts,"select member, LOG FILE, status fromv$logfile n"); strcat (dyn_sts,"union all n"); strcat (dyn_sts,"select name, CONTROL FILE, statusfrom v$controlfile n"); strcat (dyn_sts,"order by 1,2 n"); strcpy (dyn_size,"702010"); break; case 26: strcpy(dyn_column,"|TBLSPACE|FILENAME|BYTES|HIGHWATER|"); strcpy (dyn_title,"List Datafiles and their Used Blocks Página 8
  9. 9. senten500.cn"); strcpy (dyn_sts,"select a.tablespace_name, a.file_name,a.bytes, n"); strcat (dyn_sts,"(b.maximum + c.blocks -1) *d.db_block_size highwater n"); strcat (dyn_sts,"from dba_data_files a, n"); strcat (dyn_sts,"(select file_id, max(block_id) maximumn"); strcat (dyn_sts,"from dba_extents n"); strcat (dyn_sts,"group by file_id ) b, n"); strcat (dyn_sts,"dba_extents c, n"); strcat (dyn_sts,"(select value db_block_size fromv$parameter where name=db_block_size) d n"); strcat (dyn_sts,"where a.file_id = b.file_id n"); strcat (dyn_sts,"and c.file_id = b.file_id n"); strcat (dyn_sts,"and c.block_id = b.maximum n"); strcat (dyn_sts,"order by a.tablespace_name, a.file_namen"); strcpy (dyn_size,"256012121212"); break; case 27: strcpy (dyn_column,"|VALOR|TYPESORT|OS_USER|DB_USER|"); strcpy (dyn_title,"List sorts by user n"); strcpy (dyn_sts,"select vss.value VALOR,substr(vsn.name,1,20) TYPE_SORT, n"); strcat (dyn_sts,"substr(vs.osuser,1,20) OS_USER,substr(vs.username,1,20) DB_USER n"); strcat (dyn_sts,"from v$session vs, v$sesstat vss,v$statname vsn n"); strcat (dyn_sts,"where (vss.statistic# = vsn.statistic#)and n"); strcat (dyn_sts,"(vs.sid = vss.sid ) and n"); strcat (dyn_sts,"(vsn.name like %sort%) and n"); strcat (dyn_sts,"vss.value <> 0 n"); strcat (dyn_sts,"order by 1,2,3 n"); strcpy (dyn_size,"141820251010"); break; case 28: strcpy(dyn_column,"|ADDRESS|KADDRESS|SES|TIPO|OBJ_ID|ID2|LOCKTY|REQT|"); strcpy (dyn_title,"List lock status n"); strcpy (dyn_sts,"select lo.addr, lo.kaddr, lo.sid SES,lo.type TIP, lo.id1 OBJID, lo.id2, n"); strcat(dyn_sts,"decode(lo.lmode,0,None,1,Null,2,Row-S (ss),3,Row-X(sx),4,Share,5,S/Row-X (ssx),6,Exclu ) LOCTYP, n"); strcat (dyn_sts,"lo.request REQT, n"); strcat (dyn_sts,"(select ltrim(object_type) n"); strcat (dyn_sts,"from all_objects whereobject_id=lo.id1) OBJ_TYP, n"); strcat (dyn_sts,"(selectltrim(owner)||.||ltrim(object_name) n"); strcat (dyn_sts,"from all_objects whereobject_id=lo.id1) OWN_OBJ, n"); strcat (dyn_sts,"(select sid SES n"); strcat (dyn_sts,"from v$session where lockwait=lo.kaddr)LOC_SID n"); strcat (dyn_sts,"from v$lock lo n"); strcat (dyn_sts,"order by lo.id1, lo.lmode desc n"); strcpy (dyn_size,"0909050405041105083509"); break; case 29: strcpy(dyn_column,"|SES|SERIAL|TYPE|OSUSER|LOGON|PROCESS|MACHINE|USER|VALUE|PROGRAM|"); strcpy (dyn_title,"List Users by CPU Usage n"); strcpy (dyn_sts,"select vs.sid, vs.serial#, vs.type,vs.osuser, n"); Página 9
  10. 10. senten500.c strcat (dyn_sts,"sysdate - logon_time, n"); strcat (dyn_sts,"vs.process, vs.machine, vs.username,vss.value, n"); strcat (dyn_sts,"vs.program n"); strcat (dyn_sts,"from v$session vs, v$sesstat vss,v$statname vsn n"); strcat (dyn_sts,"where vss.statistic# = vsn.statistic#and n"); strcat (dyn_sts,"vs.sid = vss.sid and n"); strcat (dyn_sts,"vsn.name = CPU used by this sessionn"); strcat (dyn_sts,"and vss.value <> 0 n"); strcat (dyn_sts,"order by 10 n"); strcpy(dyn_size,"10101010101010101010101010101010101010101010"); break; case 30: strcpy (dyn_column,"|TEXT_SQL|"); strcpy (dyn_title,"Sql statement by this user n"); strcpy (dyn_sts,"select sql_text n"); strcat (dyn_sts,"from v$sqltext n"); strcat (dyn_sts,"where address = ( select sql_addressn"); strcat (dyn_sts,"from v$session n"); strcat (dyn_sts,"where sid="); strcat (dyn_sts,opcion_uno); strcat (dyn_sts,") order by piece n"); strcpy (dyn_size,"70"); break; case 31: strcpy(dyn_column,"|GRUPO|THREAD|SEQUENCE|BYTES|MEMBER|ARCHIVED|ESTADO|FSTCHANGE|FSTTIME|"); strcpy (dyn_title,"Redo Logs - Status "); strcpy (dyn_sts,"select group#, thread#, sequence#,bytes, members, n"); strcat (dyn_sts,"archived, status, first_change#, n"); strcat (dyn_sts,"to_char(first_time,DD/MM/YYYY -HH24:MI) n"); strcat (dyn_sts,"from v$log n"); strcpy (dyn_size,"070710101010101220"); break; case 32: strcpy(dyn_column,"|THREAD|SEQUENCE|NAME|FSTCHANGE|FSTTIME|BLOCKS|BLKSIZE|COMPTIME|"); strcpy (dyn_title,"Archived Logs History - by firstTimeStamp "); strcpy (dyn_sts,"select thread#, sequence#, name,first_change#, n"); strcat (dyn_sts,"to_char (first_time,DD/MM/YYYY -HH24:MI:SS), n"); strcat (dyn_sts,"blocks, block_size, n"); strcat (dyn_sts,"to_char (completion_time,DD/MM/YYYY -HH24:MI:SS) n"); strcat (dyn_sts,"from v$archived_log order by 6 n"); strcpy (dyn_size,"1010101020101020101020"); break; case 33: strcpy (dyn_column,"|GROUP|FSTCHANGE|MEMBER|SEQUENCE|"); strcpy (dyn_title,"Redo Log Recovery Report - CURRENTOnline Redo log info "); strcpy (dyn_sts,"select a.group#, a.first_change#,b.member, a.sequence# n"); strcat (dyn_sts,"from v$log a, v$logfile b n"); strcat (dyn_sts,"where a.group# = b.group# n"); strcat (dyn_sts,"and a.status = CURRENT n"); strcpy (dyn_size,"06125208"); break; Página 10
  11. 11. senten500.c case 34: strcpy(dyn_column,"|THREAD|SEQUENCE|FSTCHANGE|SWICHANGE|FSTTIME|"); strcpy (dyn_title,"Archive Log History "); strcpy (dyn_sts,"select thread#, sequence#,first_change#, n"); strcat (dyn_sts,"switch_change#, n"); strcat (dyn_sts,"to_char(first_time,DD/MM/YYYY -HH24:MI:SS) n"); strcat (dyn_sts,"from v$loghist n"); strcat (dyn_sts,"order by 5 n"); strcpy (dyn_size,"0810171722"); break; case 35: strcpy (dyn_column,"|SES|USER|STATUS|SQLTEXT|"); strcpy (dyn_title,"Session Latch Waits - SQL "); strcpy (dyn_sts,"select sw.sid , nvl(se.username,.) ,n"); strcat (dyn_sts,"nvl(se.status,.) , sq.sql_text n"); strcat (dyn_sts,"from v$session_wait sw, v$session se,v$sqltext sq n"); strcat (dyn_sts,"where sw.sid = se.sid and n"); strcat (dyn_sts,"se.sql_address = sq.address and n"); strcat (dyn_sts,"se.sql_hash_value = sq.hash_value andn"); strcat (dyn_sts,"sw.event = latch_free n"); strcat (dyn_sts,"order by 1 n"); strcpy (dyn_size,"0530303030"); break; case 36: strcpy (dyn_column,"|SES|USER|STATUS|SQLTEXT|"); strcpy (dyn_title,"Whoami in Oracle "); strcpy (dyn_sts,"select substr(v2.sid,1,5),substr(v2.username,1,8), n"); strcat (dyn_sts,"program, sql_text n"); strcat (dyn_sts,"from sys.v_$sqlarea v1, n"); strcat (dyn_sts,"sys.v_$session v2 n"); strcat (dyn_sts,"where v1.address = v2.sql_address andn"); strcat (dyn_sts,"v1.hash_value = v2.sql_hash_value n"); strcpy (dyn_size,"10202030"); break; case 37: strcpy (dyn_column,"|fadsdf|asdfasd|"); strcpy (dyn_title,"Privileges by User "); strcpy (dyn_sts,"select decode (sa1.grantee#1, 1,PUBLIC, u1.name), n"); strcat (dyn_sts,"substr (u2.name,1,20),substr(spm.name,1,27) n"); strcat (dyn_sts,"from sys.sysauth$ sa1, sys.sysauth#sa2, sys.user$ u1, n"); strcat (dyn_sts,"sys.user$ u2, sys.system_privilege_mapspm n"); strcat (dyn_sts,"where sa1.grantee# = u1.user# and n"); strcat (dyn_sts,"sa1.privilege# = u2.user# and n"); strcat (dyn_sts,"u2.user# = sa2.grantee# and n"); strcat (dyn_sts,"sa2.privilege# = spm.privilege n"); strcat (dyn_sts,"union n"); strcat (dyn_sts,"select u.name, NULL,substr(spm.name,1,27) n"); strcat (dyn_sts,"from sys.system_privilege_map spm,sys.sysauth$ sa, n"); strcat (dyn_sts,"sys.user$ u n"); strcat (dyn_sts,"where sa.grantee#=u.user# and n"); strcat (dyn_sts,"sa.privilege# = spm.privilege n"); strcpy (dyn_size,"1010101010101010"); break; case 38: Página 11
  12. 12. senten500.c strcpy(dyn_column,"|USERNAME|SID|TERMINAL|TAB|COMMAND|LMODE|REQUEST|LADDR|LOCKT|"); strcpy (dyn_title,"Detailed locking causes "); strcpy (dyn_sts,"select nvl(S.USERNAME,Internal),L.SID, nvl(S.TERMINAL,None),n"); strcat (dyn_sts,"decode(command,0,None,decode(l.id2,0,U1.NAME||.||substr(T1.NAME,1,20),None)),n"); strcat (dyn_sts,"decode(command,0,BACKGROUND,1,Create Table, 2,INSERT, 3,SELECT, 4,CREATE CLUSTER,"); strcat (dyn_sts,"5,ALTER CLUSTER, 6,UPDATE,7,DELETE, 8,DROP, 9,CREATE INDEX, 10,DROP INDEX,"); strcat (dyn_sts,"11,ALTER INDEX, 12,DROP TABLE,13,CREATE SEQUENCE, 14,ALTER SEQUENCE, 15,ALTER TABLE,"); strcat (dyn_sts,"16,DROP SEQUENCE, 17,GRANT,18,REVOKE, 19,CREATE SYNONYM, 20,DROP SYNONYM, 21,CREATE VIEW,"); strcat (dyn_sts,"22,DROP VIEW, 23,VALIDATE INDEX,24,CREATE PROCEDURE, 25,ALTER PROCEDURE, 26,LOCK TABLE,"); strcat (dyn_sts,"27,NO OPERATION, 28,RENAME,29,COMMENT, 30,AUDIT, 31,NOAUDIT, 32,CREATE EXTERNAL DATABASE,"); strcat (dyn_sts,"33,DROP EXTERNAL DATABASE, 34,CREATEDATABASE, 35,ALTER DATABASE, 36,CREATE ROLLBACK SEGMENT,"); strcat (dyn_sts,"37,ALTER ROLLBACK SEGMENT, 38,DROPROLLBACK SEGMENT, 39,CREATE TABLESPACE, 40,ALTER TABLESPACE,"); strcat (dyn_sts,"41,DROP TABLESPACE, 42,ALTERSESSION, 43,ALTER USER, 44,COMMIT, 45,ROLLBACK,"); strcat (dyn_sts,"46,SAVEPOINT, 47,PL/SQL EXECUTE,48,SET TRANSACTION, 49,ALTER SYSTEM SWITCH LOG,"); strcat (dyn_sts,"50,EXPLAIN, 51,CREATE USER,52,CREATE ROLE, 53,DROP USER, 54,DROP ROLE,"); strcat (dyn_sts,"55,SET ROLE, 56,CREATE SCHEMA,57,CREATE CONTROL FILE, 58,ALTER TRACING, 59,CREATE TRIGGER,"); strcat (dyn_sts,"60,ALTER TRIGGER, 61,DROP TRIGGER,62,ANALYZE TABLE, 63,ANALYZE INDEX, 64,ANALYZE CLUSTER,"); strcat (dyn_sts,"65,CREATE PROFILE, 66,DROP PROFILE,67,ALTER PROFILE, 68,DROP PROCEDURE, 69,DROP PROCEDURE,"); strcat (dyn_sts,"70,ALTER RESOURCE COST, 71,CREATESNAPSHOT LOG, 72,ALTER SNAPSHOT LOG, 73,DROP SNAPSHOT LOG,"); strcat (dyn_sts,"74,CREATE SNAPSHOT, 75,ALTERSNAPSHOT, 76,DROP SNAPSHOT, 79,ALTER ROLE,85,TRUNCATE TABLE,"); strcat (dyn_sts,"86,TRUNCATE CLUSTER, 87,-,88,ALTER VIEW, 89,-, 90,-, 91,CREATE FUNCTION,"); strcat (dyn_sts,"92,ALTER FUNCTION, 93,DROPFUNCTION, 94,CREATE PACKAGE, 95,ALTER PACKAGE, 96,DROP PACKAGE,"); strcat (dyn_sts,"97,CREATE PACKAGE BODY, 98,ALTERPACKAGE BODY, 99,DROP PACKAGE BODY, command|| - ???),n"); strcat (dyn_sts,"decode(L.LMODE,1,No Lock, 2,RowShare, 3,Row Exclusive, 4,Share, 5,Share Row Exclusive,"); strcat (dyn_sts,"6,Exclusive,NONE),decode(L.REQUEST,1,No Lock, 2,Row Share, 3,Row Exclusive,"); strcat (dyn_sts,"4,Share, 5,Share Row Exclusive,6,Exclusive,NONE),n"); strcat (dyn_sts,"l.id1||-||l.id2, l.type|| - ||decode(l.type, BL,Buffer hash table instance lock,"); strcat (dyn_sts,"CF, Control file schema globalenqueue lock, CI,Cross-instance function invocation instance lock,"); strcat (dyn_sts,"CS,Control file schema globalenqueue lock, CU,Cursor bind lock,"); strcat (dyn_sts,"DF,Data file instance lock,DL,Direct loader parallel index create,"); strcat (dyn_sts,"DM,Mount/startup dbprimary/secondary instance lock, DR,Distributed recovery process lock,"); strcat (dyn_sts,"DX,Distributed transaction entrylock, FI,SGA open-file information lock,"); strcat (dyn_sts,"FS,File set lock, HW,Spacemanagement operations on a specific segment lock,"); strcat (dyn_sts,"IN,Instance numberlock,IR,Instance recovery serialization global enqueue lock,"); strcat (dyn_sts,"IS,Instance state Página 12
  13. 13. senten500.clock,IV,Library cache invalidation instance lock,"); strcat (dyn_sts,"JQ,Job queue lock,KK,Thread kicklock,MB,Master buffer hash table instance lock,"); strcat (dyn_sts,"MM,Mount definition gloabal enqueuelock, MR,Media recovery lock,"); strcat (dyn_sts,"PF,Password filelock,PI,Parallel operation lock,PR,Process startup lock,"); strcat (dyn_sts,"PS,Parallel operationlock,RE,USE_ROW_ENQUEUE enforcement lock, RT,Redo thread global enqueuelock,"); strcat (dyn_sts,"RW,Row wait enqueue lock,SC,System commit number instance lock,"); strcat (dyn_sts,"SH,System commit number high watermark enqueue lock, SM,SMON lock,SN,Sequence number instance lock,"); strcat (dyn_sts,"SQ,Sequence number enqueue lock,SS,Sort segment lock,ST,Space transaction enqueue lock,"); strcat (dyn_sts,"SV,Sequence number value lock,TA,Generic enqueue lock, TD,DDL enqueue lock,"); strcat (dyn_sts,"TE,Extend-segment enqueue lock,TM,DML enqueue lock, TT,Temporary table enqueue lock,"); strcat (dyn_sts,"TX,Transaction enqueue lock,UL,User supplied lock, UN,User name lock,"); strcat (dyn_sts,"US,Undo segment DDLlock,WL,Being-written redo log instance lock,"); strcat (dyn_sts,"WS,Write-atomic-log-switch globalenqueue lock, TS,decode(l.id2,0,Temporary segment enqueue lock (ID2=0),"); strcat (dyn_sts,"New block allocation enqueue lock(ID2=1)), LA,Library cache lock instance lock (A=namespace),"); strcat (dyn_sts,"LB,Library cache lock instance lock(B=namespace), LC,Library cache lock instance lock (C=namespace),"); strcat (dyn_sts,"LD,Library cache lock instance lock(D=namespace), LE,Library cache lock instance lock (E=namespace),"); strcat (dyn_sts,"LF,Library cache lock instance lock(F=namespace), LG,Library cache lock instance lock (G=namespace),"); strcat (dyn_sts,"LH,Library cache lock instance lock(H=namespace), LI,Library cache lock instance lock (I=namespace),"); strcat (dyn_sts,"LJ,Library cache lock instance lock(J=namespace), LK,Library cache lock instance lock (K=namespace),"); strcat (dyn_sts,"LL,Library cache lock instance lock(L=namespace), LM,Library cache lock instance lock (M=namespace),"); strcat (dyn_sts,"LN,Library cache lock instance lock(N=namespace), LO,Library cache lock instance lock (O=namespace),"); strcat (dyn_sts,"LP,Library cache lock instance lock(P=namespace), LS,Log start/log switch enqueue lock,"); strcat (dyn_sts,"PA,Library cache pin instance lock(A=namespace), PB,Library cache pin instance lock (B=namespace),"); strcat (dyn_sts,"PC,Library cache pin instance lock(C=namespace), PD,Library cache pin instance lock (D=namespace),"); strcat (dyn_sts,"PE,Library cache pin instance lock(E=namespace), PF,Library cache pin instance lock (F=namespace),"); strcat (dyn_sts,"PG,Library cache pin instance lock(G=namespace), PH,Library cache pin instance lock (H=namespace),"); strcat (dyn_sts,"PI,Library cache pin instance lock(I=namespace), PJ,Library cache pin instance lock (J=namespace),"); strcat (dyn_sts,"PL,Library cache pin instance lock(K=namespace), PK,Library cache pin instance lock (L=namespace),"); strcat (dyn_sts,"PM,Library cache pin instance lock(M=namespace), PN,Library cache pin instance lock (N=namespace),"); strcat (dyn_sts,"PO,Library cache pin instance lock(O=namespace), PP,Library cache pin instance lock (P=namespace),"); strcat (dyn_sts,"PQ,Library cache pin instance lock(Q=namespace), PR,Library cache pin instance lock (R=namespace),"); strcat (dyn_sts,"PS,Library cache pin instance lock(S=namespace), PT,Library cache pin instance lock (T=namespace),"); strcat (dyn_sts,"PU,Library cache pin instance lock(U=namespace), PV,Library cache pin instance lock (V=namespace),"); strcat (dyn_sts,"PW,Library cache pin instance lock(W=namespace), PX,Library cache pin instance lock (X=namespace),"); Página 13
  14. 14. senten500.c strcat (dyn_sts,"PY,Library cache pin instance lock(Y=namespace), PZ,Library cache pin instance lock (Z=namespace),"); strcat (dyn_sts,"QA,Row cache instance lock(A=cache), QB,Row cache instance lock (B=cache),"); strcat (dyn_sts,"QC,Row cache instance lock(C=cache), QD,Row cache instance lock (D=cache),"); strcat (dyn_sts,"QE,Row cache instance lock(E=cache), QF,Row cache instance lock (F=cache),"); strcat (dyn_sts,"QG,Row cache instance lock(G=cache), QH,Row cache instance lock (H=cache),"); strcat (dyn_sts,"QI,Row cache instance lock(I=cache), QJ,Row cache instance lock (J=cache),"); strcat (dyn_sts,"QL,Row cache instance lock(K=cache), QK,Row cache instance lock (L=cache),"); strcat (dyn_sts,"QM,Row cache instance lock(M=cache), QN,Row cache instance lock (N=cache),"); strcat (dyn_sts,"QO,Row cache instance lock(O=cache), QP,Row cache instance lock (P=cache),"); strcat (dyn_sts,"QQ,Row cache instance lock(Q=cache), QR,Row cache instance lock (R=cache),"); strcat (dyn_sts,"QS,Row cache instance lock(S=cache), QT,Row cache instance lock (T=cache),"); strcat (dyn_sts,"QU,Row cache instance lock(U=cache), QV,Row cache instance lock (V=cache),"); strcat (dyn_sts,"QW,Row cache instance lock(W=cache), QX,Row cache instance lock (X=cache),"); strcat (dyn_sts,"QY,Row cache instance lock(Y=cache), QZ,Row cache instance lock (Z=cache),????) n"); strcat (dyn_sts,"from v$lock l, v$session s, sys.user$u1, sys.obj$ t1 n"); strcat (dyn_sts,"where l.sid = s.sid and t1.obj# =decode (l.id2,0,l.id1,1) and n"); strcat (dyn_sts,"u1.user# = t1.owner# and s.type !=BACKGROUND n"); strcat (dyn_sts,"order by 1,2,5"); strcpy (dyn_size,"1010101010101010"); break; case 39: strcpy (dyn_column,"|VALOR|NOMBRE|"); strcpy (dyn_title,"Current Activity Report "); strcpy (dyn_sts,"select name,value from v$sysstat n"); strcat (dyn_sts,"where name like %user%; n"); strcpy (dyn_size,"2512"); break; case 40: strcpy (dyn_column,"|TBLSPACE|TABLENAME|NROWS|LASTANALIZED|INIEXT|NEXEXT|MINEXT|MAXEXT|PCTINC|BUFPOL|BLOCKS|FREELST|PCTFREE|INITRANS|MAXTRANS|FREEGRP"); strcpy (dyn_title,"Table Description del Usuario [ "); strcat (dyn_title,opcion_uno); strcat (dyn_title," ] "); strcpy (dyn_sts,"select tablespace_name, table_name,n"); strcat (dyn_sts,"nvl(to_char (num_rows),(Null)),n"); strcat (dyn_sts,"nvl(to_char(last_analyzed,YYYY/MM/DD-HH24:MI:SS),(Null)), n"); strcat (dyn_sts,"initial_extent,next_extent,n"); strcat(dyn_sts,"min_extents,max_extents,pct_increase,buffer_pool,n"); strcat (dyn_sts,"nvl(to_char (blocks),(Null)),n"); strcat(dyn_sts,"freelists,pct_free,ini_trans,max_trans,n"); strcat (dyn_sts,"freelist_groups n"); strcat (dyn_sts,"from dba_tables n"); strcat (dyn_sts,"where owner = "); strcat (dyn_sts,opcion_uno); strcat (dyn_sts," "); Página 14
  15. 15. senten500.c if ( strlen (opcion_dos) > 0 ) { strcat (dyn_sts,"and table_name = "); strcat (dyn_sts,opcion_dos); strcat (dyn_sts," n"); } else strcat (dyn_sts,"n"); strcpy (dyn_size,"15300719050505050508060606060606"); break; default: strcpy (dyn_column,"|ORACLE_VERSION|"); strcpy (dyn_title,"Oracle Version ...n"); strcpy (dyn_sts,"select ltrim(lpad(banner,70)) Versionfrom v$version "); strcpy (dyn_size,"80"); break; } /********************************************************/ /* printf ("Statement [%s] n",dyn_sts);*/ /********************************************************/ if (strlen (dyn_sts) >= MAX_STMT) printf ("Max Statement large [%d] | Actual Statement large [%d]n",MAX_STMT,strlen(dyn_sts)); return NO_ERROR; } Página 15

×