--CERCA NOME COLONNE SU TABELLE DEL PROPRIO UTENTE DB, CON "DBI" INVECE DI "USER" SI CERCA SU TUTTO IL DB select table_name,column_name from user_tab_columns where column_name like '%OPE%' and table_name not like 'BIN%' --ESTRARRE PROCEDURE O FUNZIONI IN SQLPLUS select text from all_source where owner='NOME_UTENTE_DB' and name='NOME_PROCEDURA_O_FUNZIONE' order by line; --VEDERE CONSTRAINTS IN SQLPLUS SELECT * FROM user_constraints WHERE table_name='NBS09_FRONT_SCS'; --UTENTI COLLEGATI select sid,serial#,logon_time from v$session where username=upper('sitescr'); --KILL SESSION alter system kill session ‘SID,SER’ SELECT * FROM DBA_OBJECTS INNER JOIN USER_TAB_COLUMNS ON TABLE_NAME = OBJECT_NAME where OBJECT_NAME like '%CPTMP_%' AND OWNER = 'SITETR' AND OBJECT_TYPE = 'TABLE' AND COLUMN_NAME = 'CODDOC' ORDER BY CREATED DESC -- ultima query su db select * from v$sql where upper(sql_fulltext) like '%NBS09_INV_SOL_CR%' and trunc(last_active_time)=trunc(sysdate) order by last_active_time desc select * from v$sql where upper(sql_fulltext) like '%00000000000000120609%' and last_active_time>=sysdate-(5/1440) and parsing_schema_name='SITEADI' order by last_active_time desc -------------------------- -- MENU' DINAMICO select --* codasl,ordinamento, livello,id , parentid, --itemtext, case when livello=0 then trim(itemtext) when livello=1 then '|-'||trim(itemtext) when livello=2 then ' |--'||trim(itemtext) when livello=3 then ' |--'||trim(itemtext) end itemtext, itemlink from menudinamico m ,gestmenudinamico g where 1=1 and m.id=g.idmenu and g.codegruppo=10 order by ordinamento; ------------------------------------- ipconfig /flushdns ---------------------------- --Comandi con keep per ripescare l'ultimo dato di una serie di valori (SELECT MAX(TRIM(PATOPREV)||' - '|| TRIM(DESCRIZIONE)) KEEP (DENSE_RANK LAST ORDER BY CPROWNUM) FROM nbs02a_valutazionesiad VS, NBS05ICD9CM N WHERE VS.IDRICHIESTA=R.IDRICHIESTA AND PATOPREV=COD_ICD9CM) "ULTIMA PAT. PREV.SIAD INSERITA", execute 'nome procedure' select OWNER, OBJECT_NAME, to_char(CREATED,'MM/DD/YYYY HH24:MI:SS') created, status from dba_objects where OWNER not in ('SYS','SYSTEM') and OBJECT_TYPE='TABLE' order by OWNER,OBJECT_NAME ----------------------------------------------------------------------- ----- COMANDO FLASH PER RECUPERARE DATI create table a35_menudinamico_2 as --- NOME TABELLA DI APPOGGIO SU CUI RECUPERARE I DATI SELECT * FROM a35_menudinamico where 1=2; DECLARE CURSOR c_emp IS SELECT * FROM a35_menudinamico; --- NOME TABELLA ORIGNALE DA CUI RECUPERARE I DATI v_row c_emp%ROWTYPE; BEGIN Dbms_Flashback.Enable_At_Time(SYSDATE-30/1440); --30 minuti OPEN c_emp; Dbms_Flashback.Disable; LOOP FETCH c_emp INTO v_row; EXIT WHEN c_emp%NOTFOUND; INSERT INTO a35_menudinamico_2 ( ID, PARENTID, ITEMTEXT, ITEMLINK, BGIMAGE, NUMSUBELEM, HEIGTH, WIDTH, BGCOLOR, BGHIGHCOLOR, FONTCOLOR, FONTHIGHCOLOR, BORDERCOLOR, FONTFAMILY, FONTSIZE, FONTBOLD, FONTITALIC, TEXTALIGN, STATUSTEXT, ORDINAMENTO, LIVELLO, ID_UNI, CODZONA, ACCESSKEY, CPCCCHK ) values ( v_row.ID, v_row.PARENTID, v_row.ITEMTEXT, v_row.ITEMLINK, v_row.BGIMAGE, v_row.NUMSUBELEM, v_row.HEIGTH, v_row.WIDTH, v_row.BGCOLOR, v_row.BGHIGHCOLOR, v_row.FONTCOLOR, v_row.FONTHIGHCOLOR, v_row.BORDERCOLOR, v_row.FONTFAMILY, v_row.FONTSIZE, v_row.FONTBOLD, v_row.FONTITALIC, v_row.TEXTALIGN, v_row.STATUSTEXT, v_row.ORDINAMENTO, v_row.LIVELLO, v_row.ID_UNI, v_row.CODZONA, v_row.ACCESSKEY, v_row.CPCCCHK ) ; END LOOP; CLOSE c_emp; COMMIT; END; / ----------------------------------------------------------------------- LINUX SPAZIO SU TOMCAT : "df -lh" --------------------------------------------------- DELETE NBS09_TMP_INVITI_MAMM BEGIN dbms_output.PUT_line(Nbs09_Pkg.Nbs09_Getclasseref_Pt ('00000000000000134262',NULL, -1, 'C', NULL, 2, 1)); END; BEGIN Initinviti_Cr(1948); END; ---------------------------------------------------- SELECT INITCAP(TO_CHAR (SYSDATE, 'DAY','NLS_DATE_LANGUAGE = ITALIAN')) FROM DUAL ------------------------------------------ -- Eseguire file.sql da sqlplus: collegarsi come oracle andare sulla home eseguendo "cd" lanciare ". .bash_profile" posizionarsi dove è il file .sql sqlplus utente/password >@file.sql