SELECT 
	SID,WAIT_TIME,
	SECONDS_in_WAIT,
	STATE,event 
FROM 
	v$session_wait 
WHERE 
	sid= 855
	
SELECT 
	SID,EVENT,
	SUM(TOTAL_WAITS),
	SUM(TOTAL_TIMEOUTS),
	SUM(TIME_WAITED),
	SUM(AVERAGE_WAIT),
	MAX_WAIT 
FROM 
	V$SESSION_EVENT 
WHERE 
	sid= 855  
GROUP BY 
	SID,EVENT,MAX_WAIT; 
	
SET SERVEROUTPUT ON SIZE 1000000
declare
	nls_1 varchar (20);
	nls_2 varchar (20);
	nls_3 varchar (20);
	so varchar (100);
begin
	SELECT 	banner into so  FROM v$version WHERE banner like '%TNS%';
	SELECT value inTO nls_1 FROM nls_databASe_parameters WHERE parameter IN ('NLS_CHARACTERSET');
	SELECT value inTO nls_3 FROM nls_databASe_parameters WHERE parameter IN ('NLS_TERRITORY');
	SELECT value inTO nls_2 FROM nls_databASe_parameters WHERE parameter IN ('NLS_LANGUAGE');


	if so  like '%Win%' then
		dbms_output.put_line('SET NLS_LANG='||nls_2||'_'||nls_3||'.'||nls_1);
	else
		dbms_output.put_line('export NLS_LANG='||nls_2||'_'||nls_3||'.'||nls_1);
	end if;
end;
/

hostgator