Tuesday, June 26, 2018


Oracle Linux & Red Hat Linux


Get the opened ports with service and port number

# netstat -tulpn
# iptables -L











Enable ports from the fire wall

[root@evis ~]# iptables -I INPUT -p tcp -m tcp --dport 5901 -j ACCEPT

[root@evis ~]# service iptables save






Monday, June 4, 2018


Basics of the crontab 

Crontab file controls how and what to run by cron. The crontab line has a format as follows:
.---------------- minute (0-59)
|  .------------- hour (0-23)
|  |  .---------- day of month (1-31)
|  |  |  .------- month (1-12) OR jan,feb,mar,apr ...
|  |  |  |  .---- day of week (0-6) (Sunday=0 or 7) OR sun,mon,tue ...
|  |  |  |  |
*  *  *  *  *  command to be executed
To add a cron job for your current user, run
$ crontab -e

use crontab extensions 

crontab provides some extensions to support this: ranges can include “steps” like /21-9/2 is the same as 1,3,5,7,9. This can be the easiest method if the job is intended to be run every two N in a range such as N is “day” and the range is “days in a month”. Check the crontab man page for more details about ranges and steps of crontab.
An example.
To run the command every two months at 1:00 on the first day of the month, the crontab is
0 1 1 */2 * command to be executed

Friday, June 1, 2018


Generating the AWR Report


This chapter focuses on the skills required for reading and interpreting an Automated Workload Repository (AWR) report (awrrpt.sql), which is very similar to the STATSPACK elapsed-time report.  The AWR elapsed-time report (awrrpt.sql)contains valuable information regarding the health of the Oracle instance, but considerable skill is required to fully understand and interpret each section.

The easy way to generate an AWR report from from the SQL*Plus command line:


SQL>@$ORACLE_HOME/rdbms/admin/awrrpt.sql

Generating the AWR Report
The procedure for creating a standard report provided by the STATSPACK utility in previous Oracle releases has already been introduced.  The only way to get a final STATSPACK report is to manually run the spreport.sql script in an ad-hoc SQL environment like SQL*Plus. The procedure of report generation in Oracle10g is quite different with AWR. The final AWR report can be built by using the PL/SQL API provided in the dbms_workload_repository package.
Two procedures that generate AWR reports from awrrpt.sql are awr_report_textand awr_report_html .  These procedures generate the AWR report for the specified snapshot range in TEXT or HTML formats, respectively.  The following script shows one way of retrieving the AWR text report for the particular snapshot range:

SELECT
   output 
FROM   
   TABLE
   (dbms_workload_repository.awr_report_text
      (37933856,1,2900,2911 )
   );


You can create snap using the below
EXEC DBMS_WORKLOAD_REPOSITORY.create_snapshot;

Below query help to find snaps information
select snap_id,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME from dba_hist_snapshot where BEGIN_INTERVAL_TIME > systimestamp -1 order by BEGIN_INTERVAL_TIME desc;

  RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time https://shivanandarao-oracle.com/2012/12/05/rman-20207-until-time-or-re...