Database(23)
-
Session 확인
select machine "hostname", username "username", osuser "OS User", program "Program", sid||','||serial# "ID", last_call_et "Last Activity", status from v$session where username is not null order by status desc, last_call_et desc;
2015.04.23 -
행걸린 사용자 찾기
select b.machine "hostname", b.username "username", b.osuser "OS User", b.program "Program", a.tablespace_name "TableSpace", row_wait_file# "File Number", row_wait_block# "Block Number", c.owner, c.segment_name, c.segment_type from dba_data_files a, v$session b, dba_extents c where b.row_wait_file# = a.file_id and c.file_id = row_wait_file# and row_wait_block# between c.block_id and c.block_id +..
2015.04.23 -
DB별 insert후 자동 sequence Key 값을 가져오는 설정 방법
MySql INSERT INTO CONTENT ( CREATED_DATE, TITLE, CONTENT, CONTENT_TYPE ) VALUES ( now(), #title#, #content#, #contentType# ) ]]> SELECT LAST_INSERT_ID() MSSQL INSERT INTO PRJ_INFO ( ... ) VALUES ( ... ) SELECT SCOPE_IDENTITY() Oracle SELECT message_id_seq.nextval FROM DUALINSERT INTO guestbook_message (message_id, guest_name, password, message) VALUES( #message_id#, #gName#, #pw#, #ms#)
2015.04.23 -
DATABASE별 결과 값 RANDOM 으로 나오게 하기
ORACLE SELECT * FROM TABLE_NAME SAMPLE (3)SELECT * FROM (SELECT * FROM TABLE_NAME ORDER BY DBMS_RANDOM.VALUE)WHERE ROWNUM < 3 MSSQLSELECT TOP 3 * FROM TABLE_NAME ORDER BY NEWID() MYSQLSELECT * FROM TABLE_NAME ORDER BY RAND() LIMIT 0,3
2015.04.23 -
MD5 함수
CREATE OR REPLACE FUNCTION UHSOFT.F_MD5_CRIPT( V_PASSWORD VARCHAR2 ) RETURN sys.dbms_obfuscation_toolkit.varchar2_checksum AS BEGIN RETURN LOWER(RAWTOHEX(UTL_RAW.CAST_TO_RAW(sys.dbms_obfuscation_toolkit.md5( input_string => V_PASSWORD )))); END;
2014.05.08 -
ORA-01940: 현재 접속되어 있는 사용자는 삭제할 수 없습니다
ORA-01940: 현재 접속되어 있는 사용자는 삭제할 수 없습니다 사용자 확인 select sid,serial#,username,status from v$session where schemaname = '사용자아이디(대문자)'; 프로세스 죽이기 alter system kill session 'sid,serial#';
2014.04.03