Posts

How to Gather stats for schema, table and partitions

  Check Stats for Schema, table and Partitions 1. Check for Schema select owner, min(last_Analyzed), max(last_analyzed) from dba_tables where owner = '&i' group by owner order by 1; 2. Check for table stats select table_name, last_analyzed from dba_tables where owner='&i' AND TABLE_NAME IN ('&y'); 3. Check for partition stats col table_name for a10 col partition_name for a10 SELECT table_name, partition_name,to_char(last_analyzed,'DD-MON-YYYY HH24:MI:SS') "LASTANALYZED" FROM DBA_TAB_PARTITIONS WHERE table_name='&i' AND partition_name like 'TEST2020%' order by partition_name; Gather Stats for Schema 1st Method:- Begin dbms_stats.gather_schema_stats( ownname => '&i', --- schema name options => 'GATHER AUTO', estimate_percent => dbms_stats.auto_sample_size, method_opt => 'for all columns size repeat', degree => 24 ); / 2md Method:- EXEC DBMS_STATS.gather_schema_stats (...

How to kill Zombie Processes on Linux

 A  Linux  process notifies its parent process once it has completed its execution and has exited. Then the parent process would remove the process from process table. At this step, if the parent process is unable to read the process status from its child (the completed process), it won’t be able to remove the process from memory and thus the process being dead still continues to exist in the process table – hence, called a   Zombie! In order to kill a Zombie process, we need to identify it first. The following command can be used to find zombie processes: $ ps aux | egrep "Z|defunct" Z 108 103 ps ux | awk '{if($8=="Z") print}' kill -s SIGCHLD 103 Z  in the STAT column and/or  [defunct]  in the last (COMMAND) column of the output would identify a Zombie process. Practically we can’t kill a Zombie because it is already dead! What can be done is to notify its parent process explicitly so that it can retry to read the child (dead) process’s status...

How to use Linux Screen

Screen is a terminal multiplexer.  It means that we can start a screen session and then open any number of windows inside that session. Processes running in Screen will continue to run when their window is not visible even if  it will be disconnected. Install Linux GNU Screen The screen package is pre-installed on most Linux distros nowadays. You can check if it is installed on your system by typing: screen --version Copy Copy In case don’t have screen installed on system, we can easily install it by using the package manager. Install Linux Screen depends on flavor of screen sudo apt update sudo apt install screen Copy Copy sudo yum install screen Copy Starting Linux Screen To start a screen session, simply type  screen  in your console: screen Copy This will open a screen session and will create a new window. Now can have opened a screen session, get a list of commands by typing: Ctrl+a   ? screen -help Starting Named Session Named sessions are useful when you ...