Tag Archives: cpu

Patch Terminology

Patch Terminology

Critical Patch Update (CPU):

CPU patch are released quarterly and only includes security-related fixes.
CPUs are usually cumulative, so a later CPU will contain all of the fixes from an earlier CPU for the same patchset.
CPUs are “molecular” which means groups of related fixes (“molecules”) can be excluded if they conflict with existing patches.

Patch Set Updates (PSU):

PSU contains critical bug fixes for its intended patchset and also security fixes.
PSU are cumulative, so they contain all fixes from previous PSUs for the same patchset – they also include the CPU released on the same date. So for example PSUApr2010 includes CPUApr2010.
PSU will increment the last digit of the release number. e.g., 11.2.0.3.0 to 11.2.0.3.9

Security Patch Update (SPU):

Security Patch Update (SPU) terminology is introduced in the October 2012 Critical Patch Update as the term for the quarterly security patch.
SPU patches are the same as previous CPU patches, just a new name.

Bundle Patches:

Bundle Patches are the quarterly patches for Windows and Exadata which include both the quarterly security patches as well as recommended fixes.

Label:

The name for a set of changes (e.g. the fixing of a bug) in the source code; the output of a label is a set of C files (*.c, *.h etc)

Conflict:

Two or more bugfixes which modify the same source code files; if this is the case then only one can be applied, otherwise the code for the fixes will need to be “merged” to produce a new label

Interim Patch:

This is the official name for a one-off patch. Single bug fix.

Merge Patch:

This is combination of labels; if for example you have two bugfixes which touch the same files then you would need to have those fixes merged together, producing one new patch with a new label

Overlay Patch:

When a one-off interim patch conflicts with a PSU, an overlay patch is required. This is basically a merge of the patch you want and the PSU.

Overlay PSU:

During the lifecycle of a patchset, PSUs will normally be released every quarter.
As the patchset reaches maturity it would be expected that there are less critical bugs which can be considered as candidates for inclusion in PSUs.
At some point the number of bug fixes included in each PSU will reach a low enough number that it is no longer considered worthwhile to make the PSU cumulative.
At this point the previous PSU becomes a baseline and all future PSUs are released as “overlay PSUs”.

An example of this is 10.2.0.4.4 which is the last base PSU for the 10.2.0.4 patchset.
From 10.2.0.4.5 all PSUs are overlay PSUs, which means that in order to install, for example, 10.2.0.4.10, the user must first install 10.2.0.4.4 and then install 10.2.0.4.10 on top.
The overlay PSU is cumulative down to the base PSU, which means that by installing 10.2.0.4.4 the user automatically gets all of the fixes in 10.2.0.4.3 and below,
then by installing 10.2.0.4.10 all of the fixes in 10.2.0.4.9 down to 10.2.0.4.5 are also included.
If a conflict were to occur between an interim patch and the overlay PSU then a merge of the overlay PSU would be required.
For example, if patch 999999 conflicted with 10.2.0.4.10 then the user would install 10.2.0.4.4 as usual and then require a merge overlay patch of 10.2.0.4.10 merged with 999999.

References:
New Patch Nomenclature for Oracle Products [ID 1430923.1]
http://flashdba.com/database/all-about-patching/

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. 

OS

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. We do not guarantee it will work for you. Ensure that you run it in your test environment before using.

OS commands for DBA

1. RAM SIZE 
2. Find
3. SAR
4. vmstat
5. iostat
6. swap
7. uptime
8. Top CPU users
9. Top memory users
10. Check disk space
11. TOP Command Examples
12. Find number of CPU
13. Trace SID
14. System logfile
15. Send mail
16. Tar Command Examples
17. ZIP Command Examples
18. GZIP Command Examples


1. RAM SIZE

/usr/sbin/prtconf | grep Mem  	-- For Solaris
dmesg 					-- For HP-UX
lsdev -C | grep mem  			-- For AIX
lsattr -El mem0 ( output from previous command) -- For AIX
free 					-- For Linux
uerf -r 300 | grep -I mem		-- DEC-UNIX


2. Find

find / -print | grep -i z.sql  -- In root mount point searching for file "z.sql"
find /usr/lib -name "*raj*" /*finding can’t remember the exact name of*/
find . -size +20000 /*find files bigger than 20000 blocks, about 10MB )*/
find . -size +20000 -mtime -1 -ls
find . -mtime -1 /*Find files or directories modified in last day*/
find /tmp -atime +45 /*find files not accessed (read) in 45 days*/
find . -name "*.c" |xargs grep -l libsocket /*look for a particular word in all your .c files*/


3. SAR (System Activity Report)

sar -u 1 10   /*if I run sar 1 10 it will report to the screen, 10 instances every one second*/


4. vmstat

vmstat 1 5 /*vmstat [interval] [count]*/


5. iostat

iostat -x 1 5  /*iostat [interval] [count]*/


6. swap space

/usr/sbin/swap -s /*solaris*/


7. uptime

uptime /*check system load average: an uptime more than double the number of CPUs is getting a bit busy*/


8. Top CPU users

/usr/ucb/ps uax |head /*solaris*/


9. Top memory users

/usr/ucb/ps vax |head /*solaris*/


10. Check disk space

df -h or df -k or df -g /*shows all mounted filesystems*/
df -h /u01 /*show space for specified mountpoing /u01 */
du -sh /home/oracle /*To find size of a directory */
du -sk
[root@rac1 ~]# du -k /u01 | sort -r -n -k 1 | head -20 | awk ' { print $2 "....."$1/1024 "MB" } '
/u01.....48585.8MB
/u01/app.....40167.6MB
/u01/app/oracle.....21521.9MB
/u01/app/oracle/product.....20262.3MB
/u01/app/grid/product/12.2.....17900.2MB
/u01/app/grid/product.....17900.2MB
/u01/app/grid.....17900.2MB
/u01/app/oracle/product/12.2.0/dbhome_1.....13300.9MB
/u01/app/oracle/product/12.2.0.....13300.9MB
/u01/app/oracle/product/12.2/db_1.....6961.39MB
/u01/app/oracle/product/12.2.....6961.39MB
/u01/stage/30920127.....5662.84MB
/u01/stage.....5662.84MB
/u01/app/oracle/product/12.2.0/dbhome_1/dbs.....3836.5MB
/u01/app/oracle/product/12.2/db_1/database.....3667.68MB
/u01/app/oracle/product/12.2/db_1/database/stage.....3665.52MB
/u01/app/grid/product/12.2/.patch_storage.....3249.18MB
/u01/stage/30920127/30869447.....3093.78MB
/u01/stage/30920127/30869447/files.....3093.64MB
/u01/app/oracle/product/12.2/db_1/database/stage/Components.....3053.15MB
[root@rac1 ~]#


11. TOP Command Examples

# top /*it will show information like tasks, memory, cpu and swap. Press ‘q‘ to quit window*/
# top -u oracle /*will display specific User process details*/
# top ---> then press z /*will display running process in color which may help you to identified running process easily*/
# top ---> then press c /*will display absolute path of running process*/
# top ---> then press d /*Default screen refresh interval is 3.0 seconds, can change pressing ‘d‘ option*/
# top ---> then press k /*You can kill PID in running top command without exiting from top window*/
# top ---> then press Shift+P /*to sort processes as per CPU utilization*/
# top ---> then press r /*To change the priority of the process (Renice a Process)*/
# top ---> then press Shift+W /*To save top command results*/
# top ---> then press h /*Getting Top Command Help*/
# top ---> then press Shift+O then press "a" /*press ‘a‘ letter to sort process with PID (Process ID)/*


12. Find number of CPU

psrinfo | wc -l /*Solaris --suppose virtual CPU*/
cat /proc/cpuinfo|grep processor|wc –l /*Linux*/
psrinfo -v|grep "Status of processor"|wc –l /*Solaris*/
lsdev -C|grep Process|wc –l /*AIX*/
ioscan -C processor | grep processor | wc -l /*HP-UX*/


13. Trace SID

truss -p  /*Solaris and AIX*/
strace -p  /*Linux*/
trace -p  /*Tru 64*/


14. System logfile

Linux: /var/log/messages
Solaris, HP Tru64: /var/adm/messages
HP-UX: /var/adm/syslog/syslog.log
AIX: /bin/errpt


15. Send mail with attachments

uuencode 1.txt 2.txt | mailx -s "subject of mail" br8dba@gmail.com
OR
echo Body of the mail |mailx -s Attachment -a file.txt br8dba@gmail.com


16. Tar Command Examples

TAR

tar -cvf /u01/zzz.tar /home/zzz/ /*will create tar file for /home/zzz directory, it will keep original files as it is*/
c – Creates a new .tar archive file.
v – Verbosely show the .tar file progress.
f – File name type of the archive file.

UNTAR

tar -xvf /u01/zzz.tar -C /home/oracle /*Untar files in specified Directory*/

TAR Compress
Create tar.gz Archive File use option z
tar cvzf /u01/zzz.tar.gz /home/zzz /*will create tar file for /home/zzz directory*/

TAR UnCompress 
tar -xvf /u01/zzz.tar.gz -C /home/oracle /*Untar files in specified Directory*/


TAR Compress tar.bz2

Create tar.bz2 Archive File
The bz2 feature compress and create archive file less than the size of the gzip.
The bz2 compression takes more time to compress and decompress files as compared to gzip which takes less time. 
To create highly compressed tar file we use option as j.

tar cvfj /u01/zzz.tar.bz2 /home/zzz/ -- /*will create tar file for /home/zzz directory*/

TAR UnCompress tar.bz2
tar -xvf /u01/zzz.tar.bz2 -C /home/oracle /*Untar files in specified Directory*/

List Content of tar Archive File

tar -tvf /u01/zzz.tar
tar -tvf /u01/zzz.tar.gz
tar -tvf /u01/zzz.tar.bz2

Untar Single file from tar File

tar -xvf /u01/zzz.tar init.ora
tar -zxvf /u01/zzz.tar.gz init.ora
tar -jxvf /u01/zzz.tar.gz.bz2 init.ora
or
tar --extract --file=/u01/zzz.tar init.ora
tar --extract --file=/u01/zzz.tar.gz init.ora
tar --extract --file=/u01/zzz.tar.gz.bz2 init.ora

Untar Multiple files from tar, tar.gz and tar.bz2 File

tar -xvf /u01/zzz.tar "file 1" "file 2" 
tar -zxvf /u01/zzz.tar.gz "file 1" "file 2" 
tar -jxvf /u01/zzz.tar.bz2 "file 1" "file 2"


Extract Group of Files using Wildcard

tar -xvf /u01/zzz.tar --wildcards '*.php'
tar -zxvf /u01/zzz.tar.gz --wildcards '*.php'
tar -jxvf /u01/zzz.tar.bz2 --wildcards '*.php'


17. ZIP Command Examples

Zipping individual files
zip abc.zip file1 file2 file3

Zip a file or folder
zip archivename.zip file1 file2 folder1

Zip a folder (including all subdirectories)
zip -r folder1*

Zip a folder to a different location
zip -r /tmp/abc.zip /home/oracle/folder1

List all the files stored in a zip file
unzip -l abc.zip

Unzip
unzip abc.zip

To unzip to a specific directory use -d option
unzip abc.zip -d /tmp

Unzip specific file from an archive
unzip abc.zip test.sh


18. GZIP Command Examples

zipping a file with gzip command
gzip file1 file2 file3
oracle@rac1:~/test/test$ ls
dump.doc.gz  file1.gz  test.sh.gz <-- it will zip individually
oracle@rac1:~/test/test$
Note: Above gzip command will create files dump.doc.gz, file1.gz and test.sh.gz respectively by replacing original files.
To avoid deleting of original files, use -k(keep) option with zgip command

gzip  -k dump.doc file1 test.sh 
oracle@rac1:~/test/test$ ls
dump.doc  dump.doc.gz  file1  file1.gz  test.sh  test.sh.gz
oracle@rac1:~/test/test$

How to zip group of files to a gzip single compressed file
gzip don't know how to add files to a single comprss file and it just compress each file individually by default.

oracle@rac1:~/test/test$ cat dump.doc file1 test.sh | gzip > all.gz
oracle@rac1:~/test/test$ ls
all.gz  dump.doc  file1  test.sh
oracle@rac1:~/test/test$

Unzip the gzip file
gunzip all.gz

oracle@rac1:~/test/test$ ls
all.gz  dump.doc  file1  test.sh
oracle@rac1:~/test/test$ gunzip all.gz 
oracle@rac1:~/test/test$ ls
all  dump.doc  file1  test.sh <-- gzip file automatically deleted once unzipped