Tuesday, 24 December 2024

Find all files containing a specific text string on Linux recursive

 grep -rnw /u01/data/domains/bi/servers/AdminServer/logs -e 'IO Error: Connection reset' | grep 'Dec 10'

grep -Ril "IO Error: Connection reset" /u01/data/domains/bi/servers/AdminServer/logs/


Monday, 16 December 2024

Run Oracle Apex or other application on privileged ports like 443 or 80 without root

Below will redirect the traffic from port 443 to port 8443

 firewall-cmd --list-all

firewall-cmd --zone=public --permanent --add-forward-port=port=443:proto=tcp:toport=8443

firewall-cmd --reload

firewall-cmd --list-all


Saturday, 14 December 2024

Rebuild Oracle Standby Database oracle 12c and later with archive GAP with single command

-- On standby

rman target /

shutdown immediate;

startup nomount;

restore standby controlfile from service PRIM;

alter database mount;

--restore datafile 4 from service PRIM; -- If new data files added to primary recently    

recover database from service PRIM noredo using compressed backupset

RECOVER MANAGED STANDBY DATABASE disconnect from session;


Tuesday, 24 September 2024

Weblogic managed server Caused By: java.lang.OutOfMemoryError: GC overhead limit exceeded

 

  1. After logging into the console, click Servers.
  2. Click the server that is being deployed.
  3. On the Server Start tab, paste the following line into the Arguments box:

    -Xms4096m -Xmx4096m -XX:PermSize=256m -XX:MaxPermSize=512m

Wednesday, 11 September 2024

Importing private key from existing PFX server certificate to Java key Store (JKS) file

 export CLASSPATH=/u01/app/jdk/lib/tools.jar:/u01/app/Oracle/Middleware/Oracle_Home/wlserver/server/lib/weblogic.jar


openssl pkcs12 -in mycertficate.pfx -out KEYSTORE.pem -nodes


get the private key and the certficate into pem a files 


where: 

Certificate.pem contents between below:

-----BEGIN RSA PRIVATE KEY-----

-----END RSA PRIVATE KEY-----


Privatekey.pem contents between below

-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----

Make sure you have both pfx and private key files with password



/u01/app/jdk/bin/keytool -import -trustcacerts -file Certificate.pem -alias mycertficate -keystore truststore.jks -storepass changeit -keypass changeit


java utils.ImportPrivateKey -keystore keystore.jks -storepass changeit -storetype JKS -keypass changeit -alias mycertficate -certfile Certificate.pem -keyfile Privatekey.pem -keyfilepass C0mm0NC3rt##2024


Now you should have both truststore.jks and keystore.jks


Thursday, 29 August 2024

Linux find out CPU utilization

 1.. TOP :- 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 tasks currently being managed by the Linux kernel.  The types of system summary information shown and the types, order and size of information displayed for tasks are all user configurable and that configuration can be made persistent across restarts.The program provides a limited interactive interface for process manipulation as well as a much more extensive interface for personal configuration encompassing every aspect of its operation.  And while top is referred to throughout this document, you are free to name the program anything you wish.  That new name, possibly an alias, will then be reflected on top’s display and used when reading and writing a configuration file.

500

2.. MPSTAT :- The mpstat command writes to standard output activities for each available processor, processor 0 being the first one. Global average activities among all processors are also reported. The mpstat command can be used both on SMP and UP machines, but in the latter, only global average activities will be printed. If no activity has been selected, then the default report is the CPU utilization report. The interval parameter specifies the amount of time in seconds between each report. A value of 0 (or no parameters at all) indicates that processors statistics are to be reported for the time since system startup (boot). The count parameter can be specified in conjunction with the interval parameter if this one is not set to zero. The value of count determines the number of reports generated at interval seconds apart. If the interval parameter is specified without the count parameter, the mpstat command generates reports continuously.

501

3.. SAR:- The sar command writes to standard output the contents of selected cumulative activity counters in the operating system. The accounting system, based on the values in the count and interval parameters, writes information the specified number of times spaced at the specified intervals in seconds.  If the interval parameter  is set  to  zero,  the sar command displays the average statistics for the time since the system was started. If the interval parameter is specified without the count parameter, then reports are generated continuously. The collected data can also be saved in the file specified by the -o filename flag, in addition to being  displayed  onto the screen. If filename is omitted, sar uses the standard system activity daily data file, the /var/log/sa/sadd file, where the dd parameter indicates the current day.  By default all the data available from the kernel are saved in the data file. The sar command extracts and writes to standard output records previously saved in a file. This file can be either the one specified by the -f flag or, by default,the standard system activity daily data file.

502.png

4.. IOSTAT:- The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks.The first report generated by the iostat command provides statistics concerning the time since the system was booted, unless the -y option is used, when this first report is omitted. Each subsequent report covers the time since the previous report. All statistics are reported each time the iostat command is run.  The report consists of  a CPU header row followed by a row of CPU statistics. On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of statistics for each device that is configured.  When option -n is used, an NFS header row is displayed followed by a line of statistics for each network filesystem that is mounted.

505


Monday, 5 August 2024

unzip multiple files recursively in Linux

 for z in *.zip; do unzip "$z"; done

or

unzip '*.zip'


Number of Visitors