Monday, February 17, 2014

Shared Pool

Shared Pool
The Shared Pool environment contains both fixed and variable structures. The fixed
structures remain relatively the same size, whereas the variable structures grow and shrink
based on user and program requirements. The actual sizing for the fixed and variable
structures is based on an initialization parameter and the work of an Oracle internal
algorithm.

Benefits of Using the Shared Pool
Proper use and sizing of the shared pool can reduce resource consumption in at least four ways:
1-If the SQL statement is in the shared pool, parse overhead is avoided, resulting in reduced CPU resources on the system and elapsed time for the end user.
2-Latching resource usage is significantly reduced, resulting in greater scalability.
3-Shared pool memory requirements are reduced, because all applications use the same pool of SQL statements and dictionary resources.
4-I/O is reduced, because dictionary elements that are in the shared pool do not require disk access

There are two parts of Shared Pool
1-Library Cache
2-Data Dictionary Cache
1- Library cache
                The library cache stores the executable (parsed or compiled) form of recently referenced SQL and PL/SQL code.The Library Cache is managed by an LRU algorithm.It contains -
               
Shared SQL: The Shared SQL stores and shares the execution plan and parse tree for
SQL statements run against the database. The second time that an identical SQL
statement is run, it is able to take advantage of the parse information available in the
shared SQL to expedite its execution. To ensure that SQL statements use a shared SQL
area whenever possible, the text, schema, and bind variables must be exactly the same.

Shared PL/SQL: The Shared PL/SQL area stores and shares the most recently
executed PL/SQL statements. Parsed and compiled program units and procedures
(functions, packages, and triggers) are stored in this area.

2- Data Dictionary Cache
The Data Dictionary Cache is also referred to as the dictionary cache or row cache.
Information about the database (user account data, data file names, segment names, extent
locations, table descriptions, and user privileges) is stored in the data dictionary tables.
When this information is needed by the server, the data dictionary tables are read, and the

data that is returned is stored in the Data Dictionary Cache.

Saturday, February 15, 2014

Cold backup and hot backup in Oracle

Cold Backup,
A cold backup is taking a backup of the database while it is shut down and does not require being in archive log mode. The benefit of taking a cold backup is that it is typically easier to administer the backup and recovery process.It is  Copying the three sets of files (database files, redo logs, and control file) when the instance is shut down.You must shut down the  instance to guarantee a consistent copy.
If a cold backup is performed, the only option available in the event of data file loss is restoring all the files from the latest backup. All work performed on the database since the last backup is lost.


 Hot Backup:
A hot backup is basically taking a backup of the database while it is still up and running and it must be in archive log mode.We use to setup host back where cannot shut down the database while making a backup copy of the files.Or the cold backup is not an available option.
If a data loss failure does occur, the lost database files can be restored using the hot backup and the online and offline redo logs created since the backup was done. The database is restored to the most consistent state without any loss of  committed transactions.The benefit of taking a hot backup is that the database is still available for use while the backup is occurring and
 you can recover the database to any point in time.


Some Oracle Sql Scripts ,

                    Helpful script to check running sql if we know SID detail.

Alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';
Select   .spid,s.sid,s.serial#, s.p1,s.p1text,s.username,s.status, s.last_call_et,p.program,
p.terminal,s.logon_time,s.module,s.osuser,l.SQL_TEXT from V$process p,V$session s,v$sql l where s.paddr = p.addr and l.SQL_ID=s.SQL_ID and l.HASH_VALUE=s.SQL_HASH_VALUE and  .ADDRESS=s.SQL_ADDRESS and s.MODULE='&SID';


                 Helpful script to check running session detail from Toad, 

Alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';
select  p.spid,s.sid,s.serial#,s.p1,s.p1text,s.username,s.status,
s.last_call_et,p.program,p.terminal,s.logon_time,s.module,s.osuser,l.SQL_TEXT
,s.TERMINAL from V$process p,V$session s,v$sql l
where s.paddr = p.addr and l.SQL_ID=s.SQL_ID and l.HASH_VALUE=s.SQL_HASH_VALUE  and l.ADDRESS=s.SQL_ADDRESS
and s.MODULE='T.O.A.D.';

               Helpful script to check total number of sql from user .

Select count(SID) "Total number of session",USERNAME,status from v$session where type='USER' group by USERNAME,status ;

                 Helpful script to check session detail if we have PID /OS Process id.

SELECT
           'USERNAME   : ' || s.username     || CHR(10) ||
           'SCHEMA     : ' || s.schemaname   || CHR(10) ||
           'OSUSER     : ' || s.osuser       || CHR(10) ||
           'PROGRAM    : ' || s.program      || CHR(10) ||
           'SPID       : ' || p.spid         || CHR(10) ||
           'SID        : ' || s.sid          || CHR(10) ||
           'SERIAL#    : ' || s.serial#      || CHR(10) ||
           'KILL STRING: ' || '''' || s.sid || ',' || s.serial# || ''''  || CHR(10) ||
           'MACHINE    : ' || s.machine      || CHR(10) ||
           'TYPE       : ' || s.type         || CHR(10) ||
           'TERMINAL   : ' || s.terminal     || CHR(10) ||
           'SQL ID     : ' || q.sql_id       || CHR(10) ||
           'SQL TEXT   : ' || q.sql_text
           FROM v$session s  ,v$process p ,  v$sql     q
WHERE s.paddr  = p.addr
AND   p.spid   = '&PID_FROM_OS'
AND   s.sql_id = q.sql_id(+);

                We can find out Plan for any session if we know sqlid.
SELECT * FROM table(DBMS_XPLAN.DISPLAY_CURSOR(('&&sql_id')));





TableSpace Script

Below script is helpful to check tablepsace  detail.
col "Tablespace" for a22
col "Used MB" for 99,999,999
col "Free MB" for 99,999,999
col "Total MB" for 99,999,999

Select
   fs.tablespace_name                          "Tablespace",
  df.totalspace                               "TOT_SIZE",
  fs.freespace                                "TOT_FREE",
  (round(100 * (fs.freespace / df.totalspace))) pct_Free
from
   (select      tablespace_name,
      round(sum(bytes) / 1048576) TotalSpace
   from
      dba_data_files
   group by
      tablespace_name
   ) df,
   (select
      tablespace_name,
      round(sum(bytes) / 1048576) FreeSpace
   from
      dba_free_space
   group by
      tablespace_name  ) fs
where   (df.tablespace_name = fs.tablespace_name ) and fs.tablespace_name like '%&TBS%' ORDER BY pct_free DESC ;

Friday, February 14, 2014

Linux Command

This article provides practical examples for 50 most frequently used commands in Linux / UNIX.

This is not a comprehensive list by any means, but this should give you a jumpstart on some of the common Linux commands. Bookmark this article for your future reference.

Did I miss any frequently used Linux commands? Leave a comment and let me know.

1-mkdir - make directories
cd - change directories

Use cd to change directories. Type cd followed by the name of a directory to access that directory.Keep in mind that you are always in a directory and can navigate to directories hierarchically above or below.

2mv- change the name of a directory

Type mv followed by the current name of a directory and the new name of the directory.

 Ex: mv testdir newnamedir

3pwd - print working directory

will show you the full path to the directory you are currently in. This is very handy to use, especially when performing some of the other commands on this page

 4rmdir - Remove an existing directory

 rm -r

Removes directories and files within the directories recursively.

5chown - change file owner and group

6-ls - Short listing of directory contents

-a        list hidden files

-d        list the name of the current directory

-F        show directories with a trailing '/'

            executable files with a trailing '*'

-g        show group ownership of file in long listing

-i        print the inode number of each file

-l        long listing giving details about files  and directories

-R        list all subdirectories encountered

-t        sort by time modified instead of name

7-cp - Copy files

8-top - Prints a display of system processes that's continually updated until the user presses the q key.

9-uptime - Prints the system uptime.

10-w - Prints the current system users.

11-reboot - Reboots the system (requires root privileges).

12-head files - Prints the first several lines of each specified file.
13-cal month year - Prints a calendar for the specified month of the specified year.

14-cat files - Prints the contents of the specified files.

15-clear - Clears the terminal screen.
16-mv- moves the file data1 to the folder newdata and deletes the old one.
17-df-Shows the disk usage. This will tell you how much disk space you have left on your hard drive as well as the floppy.
18-pwd-Shows what directory (folder) you are in.
In Linux, your home directory is /home/particle

19-man -This command brings up the online Unix
manual.

20-kill-Use kill command to terminate a process

Thursday, February 13, 2014

SAR - System Activity Reporter

System Activity Reporter is an important tool that helps system administrators to get an overview of the server machine with status of different important metrics at different points of time.
If suppose you are having an issue with the system currently, Like some of your customers are unable to list some data from the
Database. The first thing that most of the Linux system administrators do is to recall the same issue when it previously occurred,
 and If you remember the day of its previous occurrence then you can easily compare the internal system statistics with the current  statistics.
SAR is very much helpful in doing exactly that.

The first thing that we need to do is check and confirm whether you have SAR utility installed on the machine.
 Which can be checked by listing all rpm's and finding for this utility.
1 CPU Usage of ALL CPUs (sar -u)

 This gives the cumulative real-time CPU usage of all CPUs. “1 3″ reports for every 1 seconds a total of 3 times.
 Most likely you’ll focus on the last field “%idle” to see the cpu load.
 01:10:01 AM       all     12.92      0.00      0.21      1.37      0.00     85.50
01:20:01 AM       all     12.56      0.00      0.23      0.88      0.00     86.33
01:30:01 AM       all     13.80      0.00      0.21      0.78      0.00     85.21
01:40:01 AM       all      8.15      0.00      0.13      0.39      0.00     91.34
01:50:01 AM       all      4.89      0.00      0.11      0.24      0.00     94.76
02:00:01 AM       all      7.01      0.00      0.14      0.36      0.00     92.49
02:10:01 AM       all     13.55      0.00      0.27      1.85      0.00     84.33
02:20:01 AM       all      9.95      0.00      0.21      0.64      0.00     89.20
02:30:01 AM       all      7.02      0.00      0.16      0.87      0.00     91.95

2-. CPU Usage of Individual CPU or Core (sar -P)
If you have 4 Cores on the machine and would like to see what the individual cores are doing, do the following.

“-P ALL” indicates that it should displays statistics for ALL the individual Cores.

In the following example under “CPU” column 0, 1, 2, and 3 indicates the corresponding CPU core numbers.
01:30:01 AM       all     13.80      0.00      0.21      0.78      0.00     85.21
01:40:01 AM       all      8.15      0.00      0.13      0.39      0.00     91.34
01:50:01 AM       all      4.89      0.00      0.11      0.24      0.00     94.76
02:00:01 AM       all      7.01      0.00      0.14      0.36      0.00     92.49
02:10:01 AM       all     13.55      0.00      0.27      1.85      0.00     84.33
02:20:01 AM       all      9.95      0.00      0.21      0.64      0.00     89.20
02:30:01 AM       all      7.02      0.00      0.16      0.87      0.00     91.95

3- Memory Free and Used (sar -r)
This reports the memory statistics. “1 3″ reports for every 1 seconds a total of 3 times.
Most likely you’ll focus on “kbmemfree” and “kbmemused” for free and used memory.
12:00:01 AM kbmemfree kbmemused  %memused kbbuffers  kbcached kbswpfree kbswpused  %swpused  kbswpcad
12:10:01 AM    113948  12112648     99.07     35492   9002588  16200712    571064      3.40    204928
12:20:03 AM     81892  12144704     99.33     34468   9061424  16201388    570388      3.40    204120
12:30:01 AM    137436  12089160     98.88     37432   9099808  16201640    570136      3.40    204216
12:40:02 AM    138400  12088196     98.87     38592   9128920  16201872    569904      3.40    204076
12:50:01 AM    122772  12103824     99.00     40156   9139808  16201944    569832      3.40    204632
01:00:01 AM    169380  12057216     98.61     41868   9061508  16202004    569772      3.40    205168

4-Swap Space Used (sar -S)
This reports the swap statistics. “1 3″ reports for every 1 seconds a total of 3 times.
 If the “kbswpused” and “%swpused” are at 0, then your system is not swapping.
 Linux 2.6.18-194.el5 (milli.tenongroove.com)     02/13/2014

 5-Overall I/O Activities (sar -b)

                This reports I/O statistics. “1 3″ reports for every 1 seconds a total of 3 times.

Following fields are displays in the example below.

tps – Transactions per second (this includes both read and write)
rtps – Read transactions per second
wtps – Write transactions per second
bread/s – Bytes read per second
bwrtn/s – Bytes written per second

12:00:01 AM       tps      rtps      wtps   bread/s   bwrtn/s
12:10:01 AM    159.91    108.09     51.82   3141.91   1284.71
12:20:03 AM    359.40    300.74     58.66  41838.06  22521.18
12:30:01 AM    314.82    238.17     76.65  23390.49  13952.02
12:40:02 AM    277.36    255.01     22.34  33625.52   1036.20
12:50:01 AM     99.54     73.69     25.85   2332.04   1779.16
01:00:01 AM    110.22     86.61     23.61   3601.47    946.98

6-6. Individual Block Device I/O Activities (sar -d)

01:00:01 AM    dev8-0     94.28    639.08   1167.44     19.16      0.65      6.85      4.66     43.91
01:00:01 AM   dev8-16    243.98     67.84   2272.06      9.59      1.85      7.57      3.62     88.41
01:10:01 AM    dev8-0     96.15    609.59    675.88     13.37      0.64      6.67      4.62     44.40
01:10:01 AM   dev8-16    114.92   1887.28    751.40     22.96      0.77      6.69      3.54     40.67
01:20:01 AM    dev8-0     93.70    539.33    895.29     15.31      0.58      6.21      4.41     41.28
01:20:01 AM   dev8-16     96.87    144.94   1030.79     12.14      0.72      7.39      3.62     35.05

01:20:01 AM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
01:30:01 AM    dev8-0     88.23    501.38   1042.23     17.50      0.63      7.18      5.02     44.33
01:30:01 AM   dev8-16     80.55    126.41   1034.64     14.41      0.57      7.07      3.50     28.15
01:40:01 AM    dev8-0     72.41    613.69   1002.74     22.32      0.52      7.23      4.88     35.36
01:40:01 AM   dev8-16    260.85  34977.00  27110.38    238.02     70.49    267.99      2.52     65.80
01:50:01 AM    dev8-0     87.83   1140.87    924.01     23.51      0.59      6.69      4.30     37.76

To identify the activities by the individual block devices (i.e a specific mount point, or LUN, or partition), use “sar -d”

7-7. Display context switch per second (sar -w)

This reports the total number of processes created per second, and total number of context switches per second.
 “1 3″ reports for every 1 seconds a total of 3 times.
 12:00:01 AM   cswch/s
12:10:01 AM    839.84
12:20:03 AM   1150.19
12:30:01 AM   1160.66
12:40:02 AM   1340.34
12:50:01 AM    852.09
01:00:01 AM    826.40
01:10:01 AM    804.37
01:20:01 AM    793.43

8. Reports run queue and load average (sar -q)

This reports the run queue size and load average of last 1 minute, 5 minutes, and 15 minutes.
“1 3″ reports for every 1 seconds a total of 3 times.

12:00:01 AM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
12:10:01 AM         3       476      3.98      3.92      3.07
12:20:03 AM         1       475      6.53      5.21      3.90
12:30:01 AM         3       474      3.05      3.47      3.72
12:40:02 AM         2       467      3.04      3.20      3.36
12:50:01 AM         2       472      1.76      2.27      2.79
01:00:01 AM         4       476      2.52      2.52      2.61
01:10:01 AM         3       473      2.05      2.35      2.49
01:20:01 AM         4       472      2.32      2.30      2.36

09. Report Sar Data Using Start Time (sar -s)

When you view historic sar data from the /var/log/sa/saXX file using “sar -f” option, it displays all the sar data for
 that specific day starting from 12:00 a.m for that day.

Using “-s hh:mi:ss” option, you can specify the start time. For example, if you specify “sar -s 08:00:00″,
 it will display the sar data starting from 10 a.m (instead of starting from midnight) as shown below.

You can combine -s option with other sar option.


For example, to report the load average on 26th of this month starting from 10 a.m in the morning, combine the -q and -s option as shown below.
08:00:01 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
08:10:02 AM     all     19.72      0.00      2.46     10.92      0.00     66.90
08:20:01 AM     all     22.18      0.00      3.13     10.57      0.00     64.12

Average:        all     20.95      0.00      2.80     10.75      0.00     65.51

Wednesday, February 12, 2014

Top Command in Linux

something about top command -

The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a
 list of processes or threads currently being managed by the kernel. The types of system summary information shown and the types,
 order and size of information displayed for tasks are all user-configurable.

Sorting with -O (Uppercase Letter ‘O’).

 Press (Shift+O) to Sort field via field letter, for example press ‘a‘ letter to sort process with PID (Process ID).
 Type any key to return to main top window with sorted PID order as shown in below screen. Press ‘q‘ to quit exit the window.
 Current Sort Field:  K  for window 1:Def
Select sort field via field letter, type any other key to return

  a: PID        = Process Id                                                               not those in column display.  Thus,
  b: PPID       = Parent Process Pid                                                       the TTY & WCHAN fields will violate
  c: RUSER      = Real user name                                                           strict ASCII collating sequence.
  d: UID        = User Id                                                                  (shame on you if WCHAN is chosen)
  e: USER       = User Name
  f: GROUP      = Group Name
  g: TTY        = Controlling Tty
  h: PR         = Priority

2-. Display Specific User Process

 Use top command with ‘u‘ option will display specific User process details.
 [oracle@swati_test ~]$ top
top - 11:13:29 up 124 days, 23:27,  2 users,  load average: 0.00, 0.00, 0.00
Tasks: 391 total,   1 running, 390 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   8098892k total,  8050776k used,    48116k free,   113992k buffers
Swap: 16217580k total,   241316k used, 15976264k free,  6870532k cached
Which user (blank for all): U
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                            
 2366 oracle    15   0 12996 1340  812 R  0.3  0.0   0:00.04 top                                                                                                                  
    1 root      15   0 10348  628  568 S  0.0  0.0   0:03.12 init                                                                                                                
    2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.56 migration/0                                                                                                          
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0                                                                                                          
    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0

3- Highlight Running Process in Top

   Press ‘z‘ option in running top command will display running process in color which may help you to identified running process
   easily.
   [oracle@swati_test ~]$ top
top - 11:15:38 up 124 days, 23:29,  2 users,  load average: 0.00, 0.00, 0.00
Tasks: 391 total,   2 running, 389 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   8098892k total,  8052064k used,    46828k free,   114832k buffers
Swap: 16217580k total,   241316k used, 15976264k free,  6870516k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                            
 2369 oracle    15   0 12996 1344  816 R  0.3  0.0   0:00.14 top                                                                                                                  
    1 root      15   0 10348  628  568 S  0.0  0.0   0:03.12 init                                                                                                                
    2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.56 migration/0                                                                                                          
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0                                                                                                          
    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                                                                                                          
    5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.70 migration/1

4-  Shows Absolute Path of Processes

Press ‘c‘ option in running top command, it will display absolute path of running process.
top - 11:17:22 up 43 days,  8:45,  2 users,  load average: 8.21, 8.77, 8.92
Tasks: 904 total,   9 running, 895 sleeping,   0 stopped,   0 zombie
Cpu(s): 15.1%us,  2.1%sy,  0.0%ni, 81.9%id,  0.7%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:  16226808k total, 14786320k used,  1440488k free,    18980k buffers
Swap: 37758728k total,   920880k used, 36837848k free, 11425508k cached

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                            
157616 oracle    20   0 4246m 2.6g 2.5g R 49.8 16.5 108:58.69 oracletest (LOCAL=NO)                                                                                            
172755 oracle    20   0 4528m 1.9g 1.6g S 32.7 12.3  78:40.91 oracletest (LOCAL=NO)                                                                                            
172753 oracle    20   0 4304m 1.7g 1.7g D 30.4 11.3  66:19.20 oracletest (LOCAL=NO)                                                                                            
155644 oracle    20   0 4246m 2.0g 2.0g R 20.8 13.0   9:12.19 oracletest (LOCAL=NO)                                                                                            
156643 oracle    20   0 4262m 2.1g 2.1g R 19.8 13.5 128:06.64 oracletest (LOCAL=NO)

5-
 Change Delay or Set ‘Screen Refresh Interval’ in Top

By default screen refresh interval is 3.0 seconds, same can be change pressing ‘d‘ option in running top command and change
 it as desired as shown below.
 top - 11:20:50 up 43 days,  8:49,  2 users,  load average: 8.96, 8.72, 8.85
Tasks: 906 total,   5 running, 901 sleeping,   0 stopped,   0 zombie
Cpu(s): 21.9%us,  2.6%sy,  0.0%ni, 74.8%id,  0.6%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:  16226808k total, 14889092k used,  1337716k free,    20340k buffers
Swap: 37758728k total,   920880k used, 36837848k free, 11522528k cached
Change delay from 10.0 to:
   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                            
157616 oracle    20   0 4246m 2.6g 2.5g R 84.7 16.5 111:27.25 oracle                                                                                                              
172755 oracle    20   0 4528m 1.9g 1.6g D 68.0 12.3  80:23.74 oracle                                                                                                              
172753 oracle    20   0 4304m 1.8g 1.7g S 57.4 11.3  67:47.44 oracle

 6-Kill running process with argument ‘k’

 You can kill a process after finding PID of process by pressing ‘k‘ option in running top command without
 exiting from top window as shown below.

 7-Sort by CPU Utilisation

 Press (Shift+P) to sort processes as per CPU utilization. See screenshot below.
 Tasks: 913 total,   6 running, 907 sleeping,   0 stopped,   0 zombie
Cpu(s): 14.3%us,  1.5%sy,  0.0%ni, 82.6%id,  1.3%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:  16226808k total, 15050824k used,  1175984k free,    21284k buffers
Swap: 37758728k total,   920880k used, 36837848k free, 11679112k cached

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                            
157616 oracle    20   0 4246m 2.6g 2.5g R 71.5 16.5 112:56.40 oracle                                                                                                              
156862 oracle    20   0 4245m 2.6g 2.6g R 69.6 16.5 108:25.97 oracle                                                                                                              
172753 oracle    20   0 4304m 1.8g 1.7g R 18.0 11.3  68:37.61 oracle                                                                                                              
172755 oracle    20   0 4528m 1.9g 1.6g R 17.4 12.3  81:22.37 oracle

 8- Renice a Process
 You can use ‘r‘ option to change the priority of the process also called Renice.

 9-Save Top Command Results
 Press (Shift+W) to save the running top command results under /root/.toprc.

 10- Getting Top Command Help

 Press ‘h‘ option to obtain the top command help.
 Help for Interactive Commands - procps version 3.2.8
Window 1:Def: Cumulative mode Off.  System: Delay 3.0 secs; Secure mode Off.

  Z,B       Global: 'Z' change color mappings; 'B' disable/enable bold
  l,t,m     Toggle Summaries: 'l' load avg; 't' task/cpu stats; 'm' mem info
  1,I       Toggle SMP view: '1' single/separate states; 'I' Irix/Solaris mode

  f,o     . Fields/Columns: 'f' add or remove; 'o' change display order
  F or O  . Select sort field
  <,>     . Move sort field: '<' next col left; '>' next col right
  R,H     . Toggle: 'R' normal/reverse sort; 'H' show threads
  c,i,S   . Toggle: 'c' cmd name/line; 'i' idle tasks; 'S' cumulative time
  x,y     . Toggle highlights: 'x' sort field; 'y' running tasks
  z,b     . Toggle: 'z' color/mono; 'b' bold/reverse (only if 'x' or 'y')
  u       . Show specific user only
  n or #  . Set maximum tasks displayed

  k,r       Manipulate tasks: 'k' kill; 'r' renice
  d or s    Set update interval
  W         Write configuration file
  q         Quit
          ( commands shown with '.' require a visible task display window )
Press 'h' or '?' for help with Windows,
any other key to continue

 11-. Exit Top Command After Specific repetition
 Top output keep refreshing until you press ‘q‘. With below command top command will automatically exit after 10 number of repetition



How to create user in MY SQL

Create  a new MySQL user Account mysql > CREATE USER ' newuser '@'localhost' IDENTIFIED BY ' password '...