Monday, April 20, 2009

check tcp traffic between servers

Here's the troubleshooting command for tcpdump:

tcpdump -A -s 0 -l 'dst host hostname'

Another example:
tcpdump -nnvvXSs 1024 src 10.94.242.73 and dst port 80 and greater 512


It'll capture 1024 bytes for the request with the size bigger than 512 bytes, and from a specific source server to the http port (80)

drop all tables in an Oracle schema

Here's the script to drop all tables in a schema:

SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 80
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SET MARKUP HTML OFF
SET ESCAPE \
SPOOL DELETEME.SQL
select 'drop table ', table_name, 'cascade constraints \;' from user_tables;
SPOOL OFF
@DELETEME