Posts

Showing posts with the label dba

Indexes and Functions - 01

The user said me that the table has a index in the date column that he used in his query SQL but is too slow. That is true, this table ( TB_EVENTS ) has an index in date type column ( EVNT_PK ).  SQL> SELECT TABLE_NAME , COLUMN_NAME , DATA_TYPE FROM DBA_TAB_COLUMNS WHERE TABLE_NAME = 'TB_EVENTS' AND COLUMN_NAME = 'EVENT_DATE' ; TABLE_NAME                     COLUMN_NAME                      DATA_TYPE ------------------------------ -------------------------------- ------------ TB_EVENTS                      EVENT_DATE                       DATE SQL> SELECT COL . INDEX_NAME ,    COL . COLUMN_NAME   FROM SYS . DBA_IND_COLUMNS COL   WHERE OWNER = 'PSP' AND INDEX_NAME = 'EVNT_PK' ; INDEX_NAME                     COLUMN_NAME ------------------------------ -------------------------------- EVNT_PK                        EVENT_DATE Ok, He use EVENT_DATE column in the WHERE but also use TO_CHAR function in

Useful Unix Command for Oracle DBA.

CPU How many CPU  has your server : mpstat | tail +2 |  wc -l uname -X | grep CPU Details about CPU : psrinfo -v kstat  cpu_info  Number of cores : kstat cpu_info | egrep core_id | awk '{ print $2}' | uniq | wc -l Use of CPU : prstat -a prstat  -U OracleUser Old fashion version of top ten of CPU consumer : /usr/ucb/ ps auxwww | head -11 How many bit: 32 or 64? /bin/ isainfo -kv Memory Memory Size Server /usr/sbin/ prtconf | grep "Memory size" Free Memory  /usr/bin/ vmstat   1 2| tail -1 | awk '{ print "Free Memory: " $5/1024 , "MB" }' Disk I/O  Displays the amount of used and  available space df -h  Displays the amount  of used and  available inodos df -o i .  Blocksize filesystem df -g .