Thursday, 27 February 2020

oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.12-1.el7.x86_64 -- in CentOS

i downloaded oracleasm-support-2.1.11-2.el7.x86_64.rpm and oracleasmlib-2.0.12-1.el7.x86_64.rpm from oracle , you can download from here for rhel7
i successfully installed oracleasm-support-2.1.11-2.el7.x86_64.rpm, but when i tried to install asmlib in CentOS i go below error.

[root@testhost software]# rpm -ivh oracleasmlib-2.0.12-1.el7.x86_64.rpm
warning: oracleasmlib-2.0.12-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.12-1.el7.x86_64

for oracle ASM we need three rpms, ie  oracleasm-support, oracleasmlib and also kmod-oracleasm required.
you need to install in order 
1- oracleasm-support
2- kmod-oracleasm 
3 - oracleasmlib

you can check rpms as below.

[root@testhost software]# rpm -qa | grep oracleasm
oracleasm-support-2.1.11-2.el7.x86_64

in my case kmod-oracleasm was missing, i installed it with yum install kmod-oracleasm as root user. after i could install oracleasmlib successfully.

if still you are not able to install, you can force install it as below.

rpm -Uvh --nodeps --force oracleasmlib-2.0.12-1.el7.x86_64.rpm


find grid configuration in linux here

Thursday, 20 February 2020

How to find latest patch releases for oracle database(RU and RUR releases)

How to find latest patch releases in oracle?

oracle will update latest patch releases in every quarter in the Master Note for Database Proactive Patch Program (Doc ID 756671.1).

it will include PSU for older version and RU and RUR for all latest versions.

Monday, 17 February 2020

PRCR-1070 : Failed to check if resource ora.asm is registered

----if you get error as bellow while starting ASM

[oracle@SDBORN21 ~]$ srvctl start asm -n SDBORN21
PRCR-1070 : Failed to check if resource ora.asm is registered
Cannot communicate with crsd


----follow as bellow

crsctl stat res -t -init

----check  ora.asm and ora.crsd are OFFLINE

crsctl start res ora.asm -init
crsctl start res ora.crsd -init

----if above commands succeeded then ASM must be up

ps -ef|grep pmon

----start database instance

srvctl start instance -i <instance_name>  -d <database_name>

Saturday, 15 February 2020

regular shell scripts for oracle database monitoring and sending mails(generic scripts)

Tablespace monitoring script

Below script monitors and send mail if TBS is reached 80%. this is generic script works for all the databases in one server.

#!/bin/bash
OUTPUT_LOC=/u01/oracle/admin/output
SCRIPT_LOC=/u01/oracle/admin/scripts
DB_LIST=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"|grep -v ASM`
for DB in $DB_LIST ; do
echo "HOST: `hostname`  DB Name: $DB" > $OUTPUT_LOC/tbs_mon.out
export ORACLE_SID=$DB
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:$PATH
TBS=`sqlplus -s "/ as sysdba" <<EOF
set heading off feedback off verify off
select tablespace_name from dba_tablespaces where contents != 'UNDO';
exit;
EOF`
for i in $TBS;
do
if [ ! -z "$i" ]
then
TBS_SPACE=`sqlplus -s "/ as sysdba" <<EOF
set pagesize 200
set linesize 121
set heading off feedback off verify off
SELECT tablespace_name,
ROUND(SUM(max_gb) - (SUM(total_gb)-SUM(free_gb))) FREE_SPACE_GB,
ROUND(SUM(max_gb)) MAX_SZ_GB, ROUND((SUM(total_gb)-SUM(free_gb))/SUM(max_gb)*100) PCT_FULL
FROM (
SELECT tablespace_name, SUM(bytes)/1024/1024/1024 FREE_GB,
0 TOTAL_GB, 0 MAX_GB
FROM dba_free_space
GROUP BY tablespace_name
UNION
SELECT tablespace_name, 0 CURRENT_GB,
SUM(bytes)/1024/1024/1024 TOTAL_GB,
SUM(DECODE(maxbytes,0,bytes, maxbytes))/1024/1024/1024 MAX_GB
FROM dba_data_files
GROUP BY tablespace_name) where tablespace_name='$i'
GROUP BY tablespace_name;
exit;
EOF`
TBS_NAME="`echo $TBS_SPACE|awk '{ print $1}'`"
PCT_FULL="`echo $TBS_SPACE|awk '{ print $4}'`"
if [ ! -z $PCT_FULL ]
then
if [ $PCT_FULL -ge 80 ]
then
echo "TBS:" $i "  PCT_FULL: " $PCT_FULL >>$OUTPUT_LOC/tbs_mon.out
fi
fi
fi
done
CHECK_FILE=`grep -i PCT_FULL $OUTPUT_LOC/tbs_mon.out`

if [ ! -z  "$CHECK_FILE" ]
then
cat -v $OUTPUT_LOC/tbs_mon.out | mail -r "sender@company.com" -s "`hostname`:oracle TBS utilization in critical" "whoever@company.com whoever2@company.com"
fi
done

trace files deletion script for oracle


House keeping script to delete trace files  and xml files older than 5 days.
It reads database names from oratab and delete trace files from all the databases listed in /etc/oratab.

#!/bin/bash
DB_LIST=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"`
for i in $DB_LIST ; do
export ORACLE_SID=$i
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:$PATH
TRACE_LOC=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       select VALUE from v\\$diag_info where NAME='Diag Trace';
       exit
EOF`
find $TRACE_LOC -name '*.trc' -mtime +5 -exec rm -f {} \;
find $TRACE_LOC -name '*.trm' -mtime +5 -exec rm -f {} \;
ALXML_LOC=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       select VALUE from v\\$diag_info where NAME='Diag Alert';
       exit
EOF`
find $ALXML_LOC -name 'log_*' -mtime +5 -exec rm -f {} \;
done


Oracle Listener log rotation script- Generic


Listener log rotation script(generic)- it works for what ever listeners currently running on the server.

#!/bin/bash
##Listener log rotation##
LSNR_NAME=`ps -ef|grep tnslsnr|grep -v grep|awk '{print $9}'`
for i in $LSNR_NAME; do
ORACLE_HOME=`ps -ef|grep tnslsnr|grep -v grep|awk '{print $8}'| rev | cut -d'/' -f3- | rev`
export PATH=$ORACLE_HOME/bin:$PATH
LSNR_LOG_LOC=`lsnrctl status ${LSNR_NAME} | grep "Listener Log File" | awk '{ print $4 }'|rev|cut -d '/' -f2-|rev`
find $LSNR_LOG_LOC -name 'log_*' -mtime +5 -exec rm -f {} \;
cd ../trace
LSNR_LOG_FILE=`ls -lrt *.log|awk '{print $9}'`
find -name '*.gz' -mtime +10 -exec rm -f {} \;
tar -cvzf $LSNR_LOG_FILE.`date '+%d%m%Y%H%M%S'`.tar.gz $LSNR_LOG_FILE
cat /dev/null > $LSNR_LOG_FILE
done

(or)

#!/bin/bash
##Listener log rotation##
LSNR_NAME=`ps -ef|grep tnslsnr|grep -v grep|awk '{print $9}'`
for i in $LSNR_NAME; do
ORACLE_HOME=`ps -ef|grep $i|grep -v grep|awk '{print $8}'| rev | cut -d'/' -f3- | rev`
export PATH=$ORACLE_HOME/bin:$PATH
LSNR_LOG_LOC=`lsnrctl <<-EOF | grep trc_directory | awk '{ print $6 }'
set displaymode normal
set current_listener ${i}
show trc_directory
EOF`
LSNR_XML_LOC=`lsnrctl <<-EOF | grep log_directory | awk '{ print $6 }'
set displaymode normal
set current_listener ${i}
show log_directory
EOF`
find $LSNR_XML_LOC -name 'log_*' -mtime +5 -exec rm -f {} \;
LSNR_LOG_FILE=`ls -lrt $LSNR_LOG_LOC/*.log|awk '{print $9}'`
find $LSNR_LOG_LOC -name '*.gz' -mtime +10 -exec rm -f {} \;
tar -cvzf $LSNR_LOG_FILE.`date '+%d%m%Y%H%M%S'`.tar.gz $LSNR_LOG_FILE
cat /dev/null > $LSNR_LOG_FILE
done


Script for ASM usage report from all the servers

Below script will be useful to gather ASM DG space usage details from all the servers and send a mail.

file1: db_serv_list.csv will have all IP/host names of the environment(you have to list all hosts or IPs in this file)
file2: check_ora_ASM_space.sh will be copied to all target server every time when ever you want to run the report and get the output by login to ASM instance.
file3ora_ASM_space_report.sh this is the main script you suppose to run, this will gather out put from all the servers to file  ora_ASM_space_report.log


ora_ASM_space_report.sh
==========================
#!/bin/bash
rm /opt/oracle/logs/ora_ASM_space_report.log
SERV_LIST=`egrep -v "#" /u01/scripts/db_serv_list.csv`
for i in $SERV_LIST; do
scp /opt/oracle/scripts/check_ora_ASM_space.sh $i:/tmp
ssh $i "sh /tmp/check_ora_ASM_space.sh" >> /u01/logs/ora_ASM_space_report.log
done
export PATH=/usr/sbin:$PATH

awk ' BEGIN {
 print "From: goldalerts@symphonyretailai.com"
 print "To: example1@oracmp.com example2@oracmp.com"
 print "MIME-Version: 1.0"
 print "Content-Type: text/html"
 print "Subject: Your Subject"
 print "<html><body><table border=1 BORDERCOLORDARK=BLUE cellspacing=1 cellpadding=5>"
 print "<tr bgcolor=navy>"
 print "<td><b>Hostname</b></td>";
 print "<td><b>DG_NAME</b></td>";
 print "<td><b>PCT_USED</b></td>";
 print "<td><b>Avail_GB</b></td>";
 print "</tr>"
} {
 print "<tr>"
 print "<td>"$1"</td>";
 print "<td>"$2"</td>";
 print "<td>"$3"</td>";
 print "<td>"$4"</td>";
  print "</tr>"
} END {
 print "</table></body></html>"
} ' /u01/logs/ora_ASM_space_report.log | sendmail -t


check_ora_ASM_space.sh
========================
#!/bin/bash
export ORACLE_SID=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"|grep ASM`
if [ -z "$ORACLE_SID" ]
then
exit;
else
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:$PATH
DG_SPACE=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       SELECT name  group_name,total_mb/1024,(total_mb-free_mb)/1024 Avail_GB,ROUND((1- (free_mb / total_mb))*100, 2)  pct_used FROM v\\$asm_diskgroup ORDER BY name;
       exit
EOF`
echo `hostname`  $DG_SPACE
fi

shell script to monitor ASM DG space to send alert

Script to monitor ASM DG space. it will send alert if space is reached to 90% full and also if its full 80% with less than 100 GB space. schedule it to run for every 15min

-->  90% full --- send alert
-->  80% and avail space less than 100GB -- send alert


#!/bin/bash
export ORACLE_SID=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"|grep ASM`
if [ -z "$ORACLE_SID" ]
then
exit;
else
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
DG_LIST=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       SELECT name from v\\$asm_diskgroup ORDER BY name;
       exit
EOF`
for i in $DG_LIST; do
DG_SPACE=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       SELECT name  group_name,total_mb/1024,ROUND((free_mb)/1024) Avail_GB,ROUND((1- (free_mb / total_mb))*100)  pct_used FROM v\\$asm_diskgroup where name='$i';
       exit
EOF`
DG_NAME="`echo $DG_SPACE|awk '{ print $1}'`"
PCT="`echo $DG_SPACE|awk '{ print $4}'`"
AVL_GB="`echo $DG_SPACE|awk '{ print $3}'`"
if [  $PCT -ge 80 ] && [ $PCT -lt 90 ] 
then 
 if [ $AVL_GB -lt 100 ]
 then 
 echo `hostname`  $DG_SPACE | mail -r "sender@company.com" -s "`hostname`:GOLD-oracle ASM-DG $DG_NAME utilization in critical" "yourmail@company.com"
 fi
 else if [ $PCT -ge 90 ]
 then
 echo `hostname`  $DG_SPACE | mail -r "sender@company.com" -s "`hostname`:GOLD-oracle ASM-DG $DG_NAME  utilization in critical" "yourmail@company.com"
 fi
 fi
done
fi

Tablespace monitoring script

Below script monitors and send mail if TBS is reached 80%. this is generic script works for all the databases in one server.
Note: it will not take undo tablespace into account.
you supposed to create directory /u01/oracle/admin/output to  create tbs_mon.out file   

#!/bin/bash
OUTPUT_LOC=/u01/oracle/admin/output
DB_LIST=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"|grep -v ASM`
for DB in $DB_LIST ; do
echo "HOST: `hostname`  DB Name: $DB" > $OUTPUT_LOC/tbs_mon.out
export ORACLE_SID=$DB
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:$PATH
TBS=`sqlplus -s "/ as sysdba" <<EOF
set heading off feedback off verify off
select tablespace_name from dba_tablespaces where contents != 'UNDO';
exit;
EOF`
for i in $TBS;
do
if [ ! -z "$i" ]
then
TBS_SPACE=`sqlplus -s "/ as sysdba" <<EOF
set pagesize 200
set linesize 121
set heading off feedback off verify off
SELECT tablespace_name,
ROUND(SUM(max_gb) - (SUM(total_gb)-SUM(free_gb))) FREE_SPACE_GB,
ROUND(SUM(max_gb)) MAX_SZ_GB, ROUND((SUM(total_gb)-SUM(free_gb))/SUM(max_gb)*100) PCT_FULL
FROM (
SELECT tablespace_name, SUM(bytes)/1024/1024/1024 FREE_GB,
0 TOTAL_GB, 0 MAX_GB
FROM dba_free_space
GROUP BY tablespace_name
UNION
SELECT tablespace_name, 0 CURRENT_GB,
SUM(bytes)/1024/1024/1024 TOTAL_GB,
SUM(DECODE(maxbytes,0,bytes, maxbytes))/1024/1024/1024 MAX_GB
FROM dba_data_files
GROUP BY tablespace_name) where tablespace_name='$i'
GROUP BY tablespace_name;
exit;
EOF`
TBS_NAME="`echo $TBS_SPACE|awk '{ print $1}'`"
PCT_FULL="`echo $TBS_SPACE|awk '{ print $4}'`"
if [ ! -z $PCT_FULL ]
then
if [ $PCT_FULL -ge 80 ]
then
echo "TBS:" $i "  PCT_FULL: " $PCT_FULL >>$OUTPUT_LOC/tbs_mon.out
fi
fi
fi
done
CHECK_FILE=`grep -i PCT_FULL $OUTPUT_LOC/tbs_mon.out`

if [ ! -z  "$CHECK_FILE" ]
then
cat -v $OUTPUT_LOC/tbs_mon.out | mail -r "sender@company.com" -s "`hostname`:oracle TBS utilization in critical" "whoever@company.com whoever2@company.com"
fi
done

Friday, 7 February 2020

shell script to monitor ASM DG space to send alert

Script to monitor ASM DG space. it will send alert if space is reached to 90% full and also if its full 80% with less than 100 GB space. schedule it to run for every 15min

-->  90% full --- send alert
-->  80% and avail space less than 100GB -- send alert


#!/bin/bash
export ORACLE_SID=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"|grep ASM`
if [ -z "$ORACLE_SID" ]
then
exit;
else
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
DG_LIST=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       SELECT name from v\\$asm_diskgroup ORDER BY name;
       exit
EOF`
for i in $DG_LIST; do
DG_SPACE=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       SELECT name  group_name,total_mb/1024,ROUND((free_mb)/1024) Avail_GB,ROUND((1- (free_mb / total_mb))*100)  pct_used FROM v\\$asm_diskgroup where name='$i';
       exit
EOF`
DG_NAME="`echo $DG_SPACE|awk '{ print $1}'`"
PCT="`echo $DG_SPACE|awk '{ print $4}'`"
AVL_GB="`echo $DG_SPACE|awk '{ print $3}'`"
if [  $PCT -ge 80 ] && [ $PCT -lt 90 ] 
then 
 if [ $AVL_GB -lt 100 ]
 then 
 echo `hostname`  $DG_SPACE | mail -r "sender@company.com" -s "`hostname`:GOLD-oracle ASM-DG $DG_NAME utilization in critical" "yourmail@company.com"
 fi
 else if [ $PCT -ge 90 ]
 then
 echo `hostname`  $DG_SPACE | mail -r "sender@company.com" -s "`hostname`:GOLD-oracle ASM-DG $DG_NAME  utilization in critical" "yourmail@company.com"
 fi
 fi
done
fi

ORA-00258: manual archiving in NOARCHIVELOG mode must identify log in RMAN logfile.

If you find below error in RMAN backup log file, you are trying to take online RMAN backup without database is in archivelog mode.

ORA-00258: manual archiving in NOARCHIVELOG mode must identify log

Solution:
Convert the database into archivelog mode and initiate backup.

Wednesday, 5 February 2020

Monitoring ASM DG space threshold using shell script

This script will be the best to monitor ASM space and send alert. i will send alert if its reaches 90% utilization and also send alert if space is less than 100GB if utilization is above 80%.

#!/bin/bash
export ORACLE_SID=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"|grep ASM`
if [ -z "$ORACLE_SID" ]
then
exit;
else
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
DG_SPACE=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       SELECT name  group_name,total_mb/1024,ROUND((free_mb)/1024) Avail_GB,ROUND((1- (free_mb / total_mb))*100)  pct_used FROM v\\$asm_diskgroup ORDER BY name;
       exit
EOF`
fi
PCT="`echo $DG_SPACE|awk '{ print $4}'`"
AVL_GB="`echo $DG_SPACE|awk '{ print $3}'`"
if [  $PCT -ge 80 ] && [ $PCT -lt 90 ] 
then 
 if [ $AVL_GB -lt 100 ]
 then 
 echo "$NUM_OF_REC" | mail -r "sender_mail_id@comp.com" -s "ASM disk space alert- critical" "email_id@comp.com"
 fi
 else if [ $PCT -ge 90 ]
 then
 echo "$NUM_OF_REC" | mail -r "sender_mail_id@comp.com" -s "ASM disk space alert- critical" "email_id@comp.com"
 fi
 fi


Monday, 3 February 2020

Script for ASM usage report from all the servers

Below script will be useful to gather ASM DG space usage details from all the servers and send a mail.

file1: db_serv_list.csv will have all IP/host names of the environment(you have to list all hosts or IPs in this file)
file2: check_ora_ASM_space.sh will be copied to all target server every time when ever you want to run the report and get the output by login to ASM instance.
file3: ora_ASM_space_report.sh this is the main script you suppose to run, this will gather out put from all the servers to file  ora_ASM_space_report.log


ora_ASM_space_report.sh
==========================
#!/bin/bash
rm /opt/oracle/logs/ora_ASM_space_report.log
SERV_LIST=`egrep -v "#" /u01/scripts/db_serv_list.csv`
for i in $SERV_LIST; do
scp /opt/oracle/scripts/check_ora_ASM_space.sh $i:/tmp
ssh $i "sh /tmp/check_ora_ASM_space.sh" >> /u01/logs/ora_ASM_space_report.log
done
export PATH=/usr/sbin:$PATH

awk ' BEGIN {
 print "From: goldalerts@symphonyretailai.com"
 print "To: example1@oracmp.com example2@oracmp.com"
 print "MIME-Version: 1.0"
 print "Content-Type: text/html"
 print "Subject: Your Subject"
 print "<html><body><table border=1 BORDERCOLORDARK=BLUE cellspacing=1 cellpadding=5>"
 print "<tr bgcolor=navy>"
 print "<td><b>Hostname</b></td>";
 print "<td><b>DG_NAME</b></td>";
 print "<td><b>PCT_USED</b></td>";
 print "<td><b>Avail_GB</b></td>";
 print "</tr>"
} {
 print "<tr>"
 print "<td>"$1"</td>";
 print "<td>"$2"</td>";
 print "<td>"$3"</td>";
 print "<td>"$4"</td>";
  print "</tr>"
} END {
 print "</table></body></html>"
} ' /u01/logs/ora_ASM_space_report.log | sendmail -t


check_ora_ASM_space.sh
========================
#!/bin/bash
export ORACLE_SID=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"|grep ASM`
if [ -z "$ORACLE_SID" ]
then
exit;
else
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:$PATH
DG_SPACE=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       SELECT name  group_name,total_mb/1024,(total_mb-free_mb)/1024 Avail_GB,ROUND((1- (free_mb / total_mb))*100, 2)  pct_used FROM v\\$asm_diskgroup ORDER BY name;
       exit
EOF`
echo `hostname`  $DG_SPACE
fi

Tuesday, 28 January 2020

sendmail: command not found)

i am not able to receive mail from my schedule job. when i check crontab log i find the below error.

 sendmail: command not found

So, Linux run crontab jobs with minimal environment variable settings. sendmail command located under /usr/sbin
so if you include PATH=/usr/sbin:$PATH is included in your script, issue will be fixed.

crontab log location in linux

crontab log location will be under /var/log.
log file name will be cron

[root@localhost]# ls -lrt /var/log/cron
-rw-------. 1 root root 1291442 Jan 28 16:00 /var/log/cron



running script in remote machine using ssh and redirecting output to local


If i want to run a script in remote server using ssh, the best method is copy using scp to any temp location in remote server then run using ssh, Lets say if you have numer of DB servers you want to check backup log status of all the servers and generate a report to get mail everyday. this post will be usefull.

in this case i want to run ora_fullbkp_check.sh in remote server and redirect output to local. this script will send hostname, db name, date, status

#!/bin/bash
Logfilecheck() {
DBNAME=`cat $LOGFILE|grep DBID|awk '{ print $5 }'`
DAY=`ls -lrt /u01/RMAN/logs/*FULL*|tail -1 |awk '{ print $6 $7}'`
ERRORLIST=`egrep "^RMAN-[0-9]*:|^ORA-[0-9]*:" $LOGFILE`
if [ -n "$ERRORLIST" ]
    then
        echo -e "`hostname`  $DBNAME  $DAY    Full_Backup    Failed"
    else
        echo -e "`hostname`  $DBNAME  $DAY    Full_Backup    success"
    fi
}

LOGFILE=`ls -lrt /u01/RMAN/logs/*FULL*|tail -2|head -1 |awk '{ print $9 }'`
if [ -n "$LOGFILE" ]; then
        Logfilecheck;
        else
        echo -e "`hostname`  NA  NA  Full_Backup    No_FUll_Backups"
        exit;
fi

we can run above script as below first scp then run using ssh, example as below:

scp ora_fullbkp_check.sh 192.168.52.101:/tmp/
ssh 192.168.52.101 "sh /tmp/ora_fullbkp_check.sh" > ora_full_bkp_report.log


output file ora_full_bkp_report.log will create locally and content as below.

test_serv oradb Jan28 success

oyou can put it in differnt shell script and run both commands in at a time as below.

cat  get_bkp_status.sh
scp ora_fullbkp_check.sh 192.168.52.101:/tmp/
ssh 192.168.52.101 "sh /tmp/ora_fullbkp_check.sh" > ora_full_bkp_report.log

Wednesday, 8 January 2020

ORA-19809: limit exceeded for recovery files


When i try to switch logfile am getting below error.

SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM ARCHIVE LOG CURRENT
*
ERROR at line 1:
ORA-16038: log 1 sequence# 6865 cannot be archived
ORA-19809: limit exceeded for recovery files
ORA-00312: online log 1 thread 1: '+DATA/ORCL/ONLINELOG/group_1.258.997872353'


 Check recovery dest and recovery dest size properly set or not. in my case recovery dest size set to 20 instead of 20G. it means its can alocate only 20 bytes and not sufficient for archive creation at all.

SQL> show parameter recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      +DATA
db_recovery_file_dest_size           big integer 20

i corrected it to 20G, issue resolved.

SQL> alter system set db_recovery_file_dest_size=20G;

System altered.

SQL> show parameter recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      +DATA
db_recovery_file_dest_size           big integer 20G


SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

System altered.


Saturday, 4 January 2020

ORA-27104: system-defined limits for shared memory was misconfigured

When i try to start the instance, i am getting below error.

ORA-27104: system-defined limits for shared memory was misconfigured


Solution:

In this case i have increased the kernel.shmmax to 75GB and SGA_TARGET is 50, after changes if i try to start the database getting below error.

SQL*Plus: Release 12.2.0.1.0 Production on Fri Jan 3 22:37:58 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup pfile='/tmp/pfile.ora';
ORA-27104: system-defined limits for shared memory was misconfigured


Note: when ever you increase shmmax we should also increase kernel.shmall.

Now kernal values as below:

kernel.shmmni = 4096
kernel.shmall = 12261931
kernel.shmmax = 75161927680

but shmall value should be as below.

kernel.shmall =  kernel.shmmax/kernel.shmmni

as per my kernal values  75161927680/4096=18350080, but currently its 12261931, i changed kernel.shmall  to 18350080, issue resolved i am able to start the database.

kernel.shmall = 18350080

Hope this help.

Thursday, 26 December 2019

How to find non system user in oracle?.

In dba_users there is a column ORACLE_MAINTAINED
if the value of this column is N then the user is created manually and its not created by oracle.

ex: below users are non oracle users created manually. which are not displayed here are all created by oracle while creating database.

SQL> select USERNAME from dba_users where ORACLE_MAINTAINED ='N';

USERNAME
--------------------------------------------------------------------------------
GITION
MTA
G2AC20
LAB_RITY
CRED20
MONITOR
SKELSR

Friday, 20 December 2019

Oracle Listener log rotation script- Generic


Listener log rotation script(generic)- it works for what ever listeners currently running on the server.

#!/bin/bash
##Listener log rotation##
LSNR_NAME=`ps -ef|grep tnslsnr|grep -v grep|awk '{print $9}'`
for i in $LSNR_NAME; do
ORACLE_HOME=`ps -ef|grep tnslsnr|grep -v grep|awk '{print $8}'| rev | cut -d'/' -f3- | rev`
export PATH=$ORACLE_HOME/bin:$PATH
LSNR_LOG_LOC=`lsnrctl status ${LSNR_NAME} | grep "Listener Log File" | awk '{ print $4 }'|rev|cut -d '/' -f2-|rev`
find $LSNR_LOG_LOC -name 'log_*' -mtime +5 -exec rm -f {} \;
cd ../trace
LSNR_LOG_FILE=`ls -lrt *.log|awk '{print $9}'`
find -name '*.gz' -mtime +10 -exec rm -f {} \;
tar -cvzf $LSNR_LOG_FILE.`date '+%d%m%Y%H%M%S'`.tar.gz $LSNR_LOG_FILE
cat /dev/null > $LSNR_LOG_FILE
done

(or)

#!/bin/bash
##Listener log rotation##
LSNR_NAME=`ps -ef|grep tnslsnr|grep -v grep|awk '{print $9}'`
for i in $LSNR_NAME; do
ORACLE_HOME=`ps -ef|grep $i|grep -v grep|awk '{print $8}'| rev | cut -d'/' -f3- | rev`
export PATH=$ORACLE_HOME/bin:$PATH
LSNR_LOG_LOC=`lsnrctl <<-EOF | grep trc_directory | awk '{ print $6 }'
set displaymode normal
set current_listener ${i}
show trc_directory
EOF`
LSNR_XML_LOC=`lsnrctl <<-EOF | grep log_directory | awk '{ print $6 }'
set displaymode normal
set current_listener ${i}
show log_directory
EOF`
find $LSNR_XML_LOC -name 'log_*' -mtime +5 -exec rm -f {} \;
LSNR_LOG_FILE=`ls -lrt $LSNR_LOG_LOC/*.log|awk '{print $9}'`
find $LSNR_LOG_LOC -name '*.gz' -mtime +10 -exec rm -f {} \;
tar -cvzf $LSNR_LOG_FILE.`date '+%d%m%Y%H%M%S'`.tar.gz $LSNR_LOG_FILE
cat /dev/null > $LSNR_LOG_FILE
done



Thursday, 19 December 2019

trace files deletion script for oracle


House keeping script to delete trace files  and xml files older than 5 days.
It reads database names from oratab and delete trace files from all the databases listed in /etc/oratab.

#!/bin/bash
DB_LIST=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"`
for i in $DB_LIST ; do
export ORACLE_SID=$i
export ORACLE_HOME=`egrep -i ":Y|:N" /etc/oratab |grep $ORACLE_SID| cut -d":" -f2 | grep -v "\#" | grep -v "\*"`
export PATH=$ORACLE_HOME/bin:$PATH
TRACE_LOC=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       select VALUE from v\\$diag_info where NAME='Diag Trace';
       exit
EOF`
find $TRACE_LOC -name '*.trc' -mtime +5 -exec rm -f {} \;
find $TRACE_LOC -name '*.trm' -mtime +5 -exec rm -f {} \;
ALXML_LOC=`sqlplus -s "/ as sysdba" <<EOF
       set heading off feedback off verify off
       select VALUE from v\\$diag_info where NAME='Diag Alert';
       exit
EOF`
find $ALXML_LOC -name 'log_*' -mtime +5 -exec rm -f {} \;
done

DBCA in silent mode(oracle database creation in silent mode)

DBCA in silent mode:

If we have to create database in silent mode, you need two files i.e template file and response file.
Template file decides the structure of the database like redo logs,redo logs size, datafiles structure... etc, response file to follow the database creation process.

modify the DBCA.rsp file as per requirement, commands to run dbca in silent mode:

dbca -silent -createDatabase -responseFile /opt/oracle/sh/DBCA.rsp

you can find the template_database.dbt and dbca.rsp files below.

template_database.dbt

<DatabaseTemplate name="New Database" description="" version="12.2.0.1.0">
   <CommonAttributes>
      <option name="OMS" value="false"/>
      <option name="JSERVER" value="true"/>
      <option name="SPATIAL" value="true"/>
      <option name="IMEDIA" value="true"/>
      <option name="ORACLE_TEXT" value="true">
         <tablespace id="SYSAUX"/>
      </option>
      <option name="CWMLITE" value="true">
         <tablespace id="SYSAUX"/>
      </option>
      <option name="SAMPLE_SCHEMA" value="false"/>
      <option name="APEX" value="true"/>
      <option name="DV" value="false"/>
   </CommonAttributes>
   <Variables/>
   <CustomScripts Execute="false"/>
   <InitParamAttributes>
      <InitParams>
         <initParam name="db_block_size" value="8" unit="KB"/>
         <initParam name="open_cursors" value="300"/>
         <initParam name="undo_tablespace" value="UNDOTBS1"/>
         <initParam name="control_files" value="(&quot;{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl&quot;, &quot;{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl&quot;)"/>

         <initParam name="compatible" value="12.2.0"/>
         <initParam name="audit_file_dest" value="{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump"/>
         <initParam name="audit_trail" value="db"/>
         <initParam name="diagnostic_dest" value="{ORACLE_BASE}"/>
         <initParam name="remote_login_passwordfile" value="EXCLUSIVE"/>
         <initParam name="dispatchers" value="(PROTOCOL=TCP) (SERVICE={SID}XDB)"/>
      </InitParams>
      <MiscParams>
         <databaseType>MULTIPURPOSE</databaseType>
         <maxUserConn>20</maxUserConn>
         <percentageMemTOSGA>40</percentageMemTOSGA>
         <archiveLogMode>false</archiveLogMode>
         <initParamFileName>{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/pfile/init.ora</initParamFileName>
      </MiscParams>
      <SPfile useSPFile="true">{ORACLE_HOME}/dbs/spfile{SID}.ora</SPfile>
   </InitParamAttributes>
   <StorageAttributes>
      <ControlfileAttributes id="Controlfile">
         <maxDatafiles>100</maxDatafiles>
         <maxLogfiles>16</maxLogfiles>
         <maxLogMembers>3</maxLogMembers>
         <maxLogHistory>1</maxLogHistory>
         <maxInstances>8</maxInstances>
         <image name="control01.ctl" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
         <image name="control02.ctl" filepath="{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/"/>

      </ControlfileAttributes>
      <DatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/sysaux01.dbf">
         <tablespace>SYSAUX</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">550</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">10240</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/users01.dbf">
         <tablespace>USERS</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">5</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">1280</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/system01.dbf">
         <tablespace>SYSTEM</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">700</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">10240</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/temp01.dbf">
         <tablespace>TEMP</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">20</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">640</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/undotbs01.dbf">
         <tablespace>UNDOTBS1</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">200</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">5120</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <TablespaceAttributes id="SYSAUX">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/sysaux01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="USERS">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">128</initSize>
         <increment unit="KB">128</increment>
         <incrementPercent>0</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">128</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/users01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="SYSTEM">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>3</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>-1</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/system01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="TEMP">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>true</temporary>
         <defaultTemp>true</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>0</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>0</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/temp01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="UNDOTBS1">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>true</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">512</initSize>
         <increment unit="KB">512</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>8</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">512</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/undotbs01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <RedoLogGroupAttributes id="1">
         <reuse>false</reuse>
         <fileSize unit="KB">204800</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo01.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="2">
         <reuse>false</reuse>
         <fileSize unit="KB">204800</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo02.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="3">
         <reuse>false</reuse>
         <fileSize unit="KB">204800</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo03.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
      </RedoLogGroupAttributes>
   </StorageAttributes>
</DatabaseTemplate>

Create response file for DBCA.
DBCA.rsp

#-------------------------------------------------------------------------------
# Do not change the following system generated value.
#-------------------------------------------------------------------------------
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0

#-----------------------------------------------------------------------------
# Name          : gdbName
# Datatype      : String
# Description   : Global database name of the database
# Valid values  : <db_name>.<db_domain> - when database domain isn't NULL
#                 <db_name>             - when database domain is NULL
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
gdbName=ORCL

#-----------------------------------------------------------------------------
# Name          : sid
# Datatype      : String
# Description   : System identifier (SID) of the database
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : <db_name> specified in GDBNAME
# Mandatory     : No
#-----------------------------------------------------------------------------
sid=ORCL

#-----------------------------------------------------------------------------
# Name          : databaseConfigType
# Datatype      : String
# Description   : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database
# Valid values  : SI\RAC\RACONENODE
# Default value : SI
# Mandatory     : No
#-----------------------------------------------------------------------------
databaseConfigType=SI

#-----------------------------------------------------------------------------
# Name          : RACOneNodeServiceName
# Datatype      : String
# Description   : Service is required by application to connect to RAC One
#                 Node Database
# Valid values  : Service Name
# Default value : None
# Mandatory     : No [required in case DATABASECONFTYPE is set to RACONENODE ]
#-----------------------------------------------------------------------------
RACOneNodeServiceName=

#-----------------------------------------------------------------------------
# Name          : policyManaged
# Datatype      : Boolean
# Description   : Set to true if Database is policy managed and
#                 set to false if  Database is admin managed
# Valid values  : TRUE\FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
policyManaged=false


#-----------------------------------------------------------------------------
# Name          : createServerPool
# Datatype      : Boolean
# Description   : Set to true if new server pool need to be created for database
#                 if this option is specified then the newly created database
#                 will use this newly created serverpool.
#                 Multiple serverpoolname can not be specified for database
# Valid values  : TRUE\FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
createServerPool=false

#-----------------------------------------------------------------------------
# Name          : serverPoolName
# Datatype      : String
# Description   : Only one serverpool name need to be specified
#                  if Create Server Pool option is specified.
#                  Comma-separated list of Serverpool names if db need to use
#                  multiple Server pool
# Valid values  : ServerPool name

# Default value : None
# Mandatory     : No [required in case of RAC service centric database]
#-----------------------------------------------------------------------------
serverPoolName=

#-----------------------------------------------------------------------------
# Name          : cardinality
# Datatype      : Number
# Description   : Specify Cardinality for create server pool operation

# Valid values  : any positive Integer value
# Default value : Number of qualified nodes on cluster
# Mandatory     : No [Required when a new serverpool need to be created]
#-----------------------------------------------------------------------------
cardinality=

#-----------------------------------------------------------------------------
# Name          : force
# Datatype      : Boolean
# Description   : Set to true if new server pool need to be created by force
#                 if this option is specified then the newly created serverpool
#                 will be assigned server even if no free servers are available.
#                 This may affect already running database.
#                 This flag can be specified for Admin managed as well as policy managed db.
# Valid values  : TRUE\FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
force=false

#-----------------------------------------------------------------------------
# Name          : pqPoolName
# Datatype      : String
# Description   : Only one serverpool name needs to be specified
#                  if create server pool option is specified.
#                  Comma-separated list of serverpool names if use
#                  server pool. This is required to
#                  create Parallel Query (PQ) database. Applicable to Big Cluster
# Valid values  :  Parallel Query (PQ) pool name
# Default value : None
# Mandatory     : No [required in case of RAC service centric database]
#-----------------------------------------------------------------------------
pqPoolName=

#-----------------------------------------------------------------------------
# Name          : pqCardinality
# Datatype      : Number
# Description   : Specify Cardinality for create server pool operation.
#                 Applicable to Big Cluster
# Valid values  : any positive Integer value
# Default value : Number of qualified nodes on cluster
# Mandatory     : No [Required when a new serverpool need to be created]
#-----------------------------------------------------------------------------
pqCardinality=

#-----------------------------------------------------------------------------
# Name          : createAsContainerDatabase
# Datatype      : boolean
# Description   : flag to create database as container database
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : false
# Mandatory     : No
#-----------------------------------------------------------------------------
createAsContainerDatabase=false

#-----------------------------------------------------------------------------
# Name          : numberOfPDBs
# Datatype      : Number
# Description   : Specify the number of pdb to be created
# Valid values  : 0 to 252
# Default value : 0
# Mandatory     : No
#-----------------------------------------------------------------------------
numberOfPDBs=0

#-----------------------------------------------------------------------------
# Name          : pdbName
# Datatype      : String
# Description   : Specify the pdbname/pdbanme prefix if one or more pdb need to be created
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
pdbName=

#-----------------------------------------------------------------------------
# Name          : useLocalUndoForPDBs
# Datatype      : boolean
# Description   : Flag to create local undo tablespace for all PDB's.
# Valid values  : TRUE\FALSE
# Default value : TRUE
# Mandatory     : No
#-----------------------------------------------------------------------------
useLocalUndoForPDBs=true

#-----------------------------------------------------------------------------
# Name          : pdbAdminPassword
# Datatype      : String
# Description   : PDB Administrator user password
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------

pdbAdminPassword=

#-----------------------------------------------------------------------------
# Name          : nodelist
# Datatype      : String
# Description   : Comma-separated list of cluster nodes
# Valid values  : Cluster node names
# Default value : None
# Mandatory     : No (Yes for RAC database-centric database )
#-----------------------------------------------------------------------------
nodelist=

#-----------------------------------------------------------------------------
# Name          : templateName
# Datatype      : String
# Description   : Name of the template
# Valid values  : Template file name
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
templateName=/opt/oracle/sh/templete_database.dbt

#-----------------------------------------------------------------------------
# Name          : sysPassword
# Datatype      : String
# Description   : Password for SYS user
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
sysPassword=Oracle123

#-----------------------------------------------------------------------------
# Name          : systemPassword
# Datatype      : String
# Description   : Password for SYSTEM user
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
systemPassword=Oracle123

#-----------------------------------------------------------------------------
# Name          : serviceUserPassword
# Datatype      : String
# Description   : Password for Windows Service user
# Default value : None
# Mandatory     : If Oracle home is installed with windows service user
#-----------------------------------------------------------------------------
serviceUserPassword=

#-----------------------------------------------------------------------------
# Name          : emConfiguration
# Datatype      : String
# Description   : Enterprise Manager Configuration Type
# Valid values  : CENTRAL|DBEXPRESS|BOTH|NONE
# Default value : NONE
# Mandatory     : No
#-----------------------------------------------------------------------------
emConfiguration=

#-----------------------------------------------------------------------------
# Name          : emExpressPort
# Datatype      : Number
# Description   : Enterprise Manager Configuration Type
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : NONE
# Mandatory     : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable
#                 or auto generates a free port between 5500 and 5599
#-----------------------------------------------------------------------------
emExpressPort=5500

#-----------------------------------------------------------------------------
# Name          : runCVUChecks
# Datatype      : Boolean
# Description   : Specify whether to run Cluster Verification Utility checks
#                 periodically in Cluster environment
# Valid values  : TRUE\FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
runCVUChecks=false

#-----------------------------------------------------------------------------
# Name          : dbsnmpPassword
# Datatype      : String
# Description   : Password for DBSNMP user
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes, if emConfiguration is specified or
#                 the value of runCVUChecks is TRUE
#-----------------------------------------------------------------------------
dbsnmpPassword=

#-----------------------------------------------------------------------------
# Name          : omsHost
# Datatype      : String
# Description   : EM management server host name
# Default value : None
# Mandatory     : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
omsHost=

#-----------------------------------------------------------------------------
# Name          : omsPort
# Datatype      : Number
# Description   : EM management server port number
# Default value : None
# Mandatory     : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
omsPort=0

#-----------------------------------------------------------------------------
# Name          : emUser
# Datatype      : String
# Description   : EM Admin username to add or modify targets
# Default value : None
# Mandatory     : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
emUser=

#-----------------------------------------------------------------------------
# Name          : emPassword
# Datatype      : String
# Description   : EM Admin user password
# Default value : None
# Mandatory     : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
emPassword=

#-----------------------------------------------------------------------------
# Name          : dvConfiguration
# Datatype      : Boolean
# Description   : Specify "True" to configure and enable Oracle Database vault
# Valid values  : True/False
# Default value : False
# Mandatory     : No
#-----------------------------------------------------------------------------
dvConfiguration=false

#-----------------------------------------------------------------------------
# Name          : dvUserName
# Datatype      : String
# Description   : DataVault Owner
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes, if DataVault option is chosen
#-----------------------------------------------------------------------------
dvUserName=

#-----------------------------------------------------------------------------
# Name          : dvUserPassword
# Datatype      : String
# Description   : Password for DataVault Owner
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes, if DataVault option is chosen
#-----------------------------------------------------------------------------
dvUserPassword=

#-----------------------------------------------------------------------------
# Name          : dvAccountManagerName
# Datatype      : String
# Description   : DataVault Account Manager
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
dvAccountManagerName=

#-----------------------------------------------------------------------------
# Name          : dvAccountManagerPassword
# Datatype      : String
# Description   : Password for  DataVault Account Manager
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
dvAccountManagerPassword=

#-----------------------------------------------------------------------------
# Name          : olsConfiguration
# Datatype      : Boolean
# Description   : Specify "True" to configure and enable Oracle Label Security
# Valid values  : True/False
# Default value : False
# Mandatory     : No
#-----------------------------------------------------------------------------
olsConfiguration=false

#-----------------------------------------------------------------------------
# Name          : datafileJarLocation
# Datatype      : String
# Description   : Location of the data file jar
# Valid values  : Directory containing compressed datafile jar
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/

#-----------------------------------------------------------------------------
# Name          : datafileDestination
# Datatype      : String
# Description   : Location of the data file's
# Valid values  : Directory for all the database files
# Default value : $ORACLE_BASE/oradata
# Mandatory     : No
#-----------------------------------------------------------------------------
datafileDestination=+DATA/{DB_UNIQUE_NAME}/

#-----------------------------------------------------------------------------
# Name          : recoveryAreaDestination
# Datatype      : String
# Description   : Location of the data file's
# Valid values  : Recovery Area location
# Default value : $ORACLE_BASE/flash_recovery_area
# Mandatory     : No
#-----------------------------------------------------------------------------
recoveryAreaDestination=+DATA

#-----------------------------------------------------------------------------
# Name          : storageType
# Datatype      : String
# Description   : Specifies the storage on which the database is to be created
# Valid values  : FS (CFS for RAC), ASM
# Default value : FS
# Mandatory     : No
#-----------------------------------------------------------------------------
storageType=ASM

#-----------------------------------------------------------------------------
# Name          : diskGroupName
# Datatype      : String
# Description   : Specifies the disk group name for the storage
# Default value : DATA
# Mandatory     : No
#-----------------------------------------------------------------------------
diskGroupName=+DATA/{DB_UNIQUE_NAME}/

#-----------------------------------------------------------------------------
# Name          : asmsnmpPassword
# Datatype      : String
# Description   : Password for ASM Monitoring
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
asmsnmpPassword=

#-----------------------------------------------------------------------------
# Name          : recoveryGroupName
# Datatype      : String
# Description   : Specifies the disk group name for the recovery area
# Default value : RECOVERY
# Mandatory     : No
#-----------------------------------------------------------------------------
recoveryGroupName=+DATA

#-----------------------------------------------------------------------------
# Name          : characterSet
# Datatype      : String
# Description   : Character set of the database
# Valid values  : Check Oracle12c National Language Support Guide
# Default value : "US7ASCII"
# Mandatory     : NO
#-----------------------------------------------------------------------------
characterSet=AL32UTF8

#-----------------------------------------------------------------------------
# Name          : nationalCharacterSet
# Datatype      : String
# Description   : National Character set of the database
# Valid values  : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide
# Default value : "AL16UTF16"
# Mandatory     : No
#-----------------------------------------------------------------------------
nationalCharacterSet=AL16UTF16

#-----------------------------------------------------------------------------
# Name          : registerWithDirService
# Datatype      : Boolean
# Description   : Specifies whether to register with Directory Service.
# Valid values  : TRUE \ FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
registerWithDirService=false


#-----------------------------------------------------------------------------
# Name          : dirServiceUserName
# Datatype      : String
# Description   : Specifies the name of the directory service user
# Mandatory     : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
dirServiceUserName=

#-----------------------------------------------------------------------------
# Name          : dirServicePassword
# Datatype      : String
# Description   : The password of the directory service user.
#                 You can also specify the password at the command prompt instead of here.
# Mandatory     : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
dirServicePassword=

#-----------------------------------------------------------------------------
# Name          : walletPassword
# Datatype      : String
# Description   : The password for wallet to created or modified.
#                 You can also specify the password at the command prompt instead of here.
# Mandatory     : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
walletPassword=

#-----------------------------------------------------------------------------
# Name          : listeners
# Datatype      : String
# Description   : Specifies list of listeners to register the database with.
#                 By default the database is configured for all the listeners specified in the
#                 $ORACLE_HOME/network/admin/listener.ora
# Valid values  : The list should be comma separated like "listener1,listener2".
# Mandatory     : NO
#-----------------------------------------------------------------------------
listeners=LISTENER

#-----------------------------------------------------------------------------
# Name          : variablesFile
# Datatype      : String
# Description   : Location of the file containing variable value pair
# Valid values  : A valid file-system file. The variable value pair format in this file
#                 is <variable>=<value>. Each pair should be in a new line.
# Default value : None
# Mandatory     : NO
#-----------------------------------------------------------------------------
variablesFile=

#-----------------------------------------------------------------------------
# Name          : variables
# Datatype      : String
# Description   : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates
# Default value : None
# Mandatory     : NO
#-----------------------------------------------------------------------------
variables=DB_UNIQUE_NAME=ORCL,ORACLE_BASE=/opt/oracle/oracle_base,PDB_NAME=,DB_NAME=SPARPRDD,ORACLE_HOME=/opt/oracle/product/12.2.0.1/dbhome_1,SID=ORCL

#-----------------------------------------------------------------------------
# Name          : initParams
# Datatype      : String
# Description   : comma separated list of name=value pairs. Overrides initialization parameters defined in templates
# Default value : None
# Mandatory     : NO
#-----------------------------------------------------------------------------
initParams=undo_tablespace=UNDOTBS1,processes=300,db_recovery_file_dest_size=20GB,log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST',nls_language=AMERICAN,pga_aggregate_target=3GB,sga_target=7GB,dispatchers=(PROTOCOL=TCP) (SERVICE=ORCLXDB),db_recovery_file_dest=+DATA,db_block_size=8192BYTES,diagnostic_dest={ORACLE_BASE},audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,db_create_file_dest=+DATA/{DB_UNIQUE_NAME}/,nls_territory=AMERICA,local_listener=LISTENER_ORCL,log_archive_format=%t_%s_%r.dbf,compatible=12.2.0,db_name=SPARPRDD,audit_trail=db,remote_login_passwordfile=EXCLUSIVE,db_unique_name=ORCL,open_cursors=300

#-----------------------------------------------------------------------------
# Name          : sampleSchema
# Datatype      : Boolean
# Description   : Specifies whether or not to add the Sample Schemas to your database
# Valid values  : TRUE \ FALSE
# Default value : FASLE
# Mandatory     : No
#-----------------------------------------------------------------------------
sampleSchema=false

#-----------------------------------------------------------------------------
# Name          : memoryPercentage
# Datatype      : String
# Description   : percentage of physical memory for Oracle
# Default value : None
# Mandatory     : NO
#-----------------------------------------------------------------------------
memoryPercentage=40

#-----------------------------------------------------------------------------
# Name          : databaseType
# Datatype      : String
# Description   : used for memory distribution when memoryPercentage specified
# Valid values  : MULTIPURPOSE|DATA_WAREHOUSING|OLTP
# Default value : MULTIPURPOSE
# Mandatory     : NO
#-----------------------------------------------------------------------------
databaseType=MULTIPURPOSE

#-----------------------------------------------------------------------------
# Name          : automaticMemoryManagement
# Datatype      : Boolean
# Description   : flag to indicate Automatic Memory Management is used
# Valid values  : TRUE/FALSE
# Default value : TRUE
# Mandatory     : NO
#-----------------------------------------------------------------------------
automaticMemoryManagement=false

#-----------------------------------------------------------------------------
# Name          : totalMemory
# Datatype      : String
# Description   : total memory in MB to allocate to Oracle
# Valid values  :
# Default value :
# Mandatory     : NO
#-----------------------------------------------------------------------------