Sunday, June 28, 2015

UNIX - Remove ^M

Open the file with “vi” editor and type the following:

:%s/^M//g

NOTE: To get the ^M in there, you should type CTRL+V+M

Saturday, June 13, 2015

Oracle - Show all sequence

SELECT us.sequence_name
              FROM USER_SEQUENCES us;

Oracle - Show all table name

SELECT ut.table_name
              FROM USER_TABLES ut;

Oracle - PL/SQL - Delete all table

DECLARE
BEGIN
    --Bye Tables!
  FOR i IN (SELECT ut.table_name
              FROM USER_TABLES ut) LOOP
    EXECUTE IMMEDIATE 'drop table '|| i.table_name ||' CASCADE CONSTRAINTS ';
  END LOOP;

END;

Oracle - PL/SQL - Delete all sequence

DECLARE
BEGIN
--Bye Sequences!
  FOR i IN (SELECT us.sequence_name
              FROM USER_SEQUENCES us) LOOP
    EXECUTE IMMEDIATE 'drop sequence '|| i.sequence_name ||'';
  END LOOP;


END;

Wednesday, February 25, 2015

Sun Solaris : Check Memory like Unix Top command

Here you go :

prstat -Z

Sun solaris : Ping not found

Ping tool usually found under /usr/sbin/ping

You can use directly by do this :

/usr/sbin/ping 10.10.10.11


You can edit your ~/.profile and put in the path.

PATH=$PATH:/usr/sbin
export PATH


Exit and login back the terminal ssh. and try "ping 10.10.10.11".

Oracle : Check last analyzed after gather statistic of schema

select table_name, last_analyzed
from user_tables
order by last_analyzed desc nulls last;
It show all table that has been analyzed with last analyzed date..