Oracle DBA Scripts All in One -7 – Useful Linux Scripts for Oracle DBA

Hi,

I will share all Oracle DBA Scripts ( Oracle RAC, Dataguard, Performance Tuning, Monitoring and etc.. ) in this tutorial series.

 

Oracle DBA ( Database Administrator ) needs useful scripts to monitor, analyze and check Oracle database for routine database operations and monitoring.

 

Oracle DBA Scripts All in One post will be updated with new Oracle DBA Scripts.

 

 

Before Oracle DBA Scripts, If you don’t know Oracle database and want to learn, click following link to start learning Oracle database with this tutorial.

 

 

 

 

Useful Linux Scripts for Oracle DBA

 

You can use following query to learn the biggest size directory and files

du -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh |more




You need killing all processes of any user , then you can use following code.

[root@MehmetSalih ~]#  kill -9 `ps -ef|grep oracle | awk '{print $2}'`


For example, You have stopped Oracle EBS with adstpall.sh, but you have still EBS Process belong to applmgr, You can kill all processes of applmgr user like following.

 

[root@MehmetSalih ~]#  kill -9 `ps -ef|grep applmgr | awk '{print $2}'`


You can change *aud extension to the *trc or *trm. You can delete all trc extension files like following if their argument list too long.

[root@MehmetSalih audit]#  find . -name "*trc" -print | xargs rm -rf

 

[root@MehmetSalih audit]#  find . -name "*trm" -print | xargs rm -rf

[root@MehmetSalih audit]#  find . -name "*.log" -print | xargs rm -rf
  

 

–For IBM AIX, Delete all files which extensions are like .trc Under /oracle directory

find /oracle -name "*.trc" -type f -exec rm -f {} \;

 

— For Linux, Delete all files which extensions are like .aud Under /u01 directory

find /u01 -name "*aud" -print | xargs rm -rf

 

You may want to delete files older than 3 days, you can use following query.

find / -name "*.log" -mtime +3 -print | xargs rm -rf

 

You can change extension name and directory name to delete according to your need

 

 

If your application and security rules don’t need any firewall then you can disable it with below script.

service iptables stop
chkconfig iptables off

service ip6tables stop
chkconfig ip6tables off

 

 

You can disable firewall in Redhat with below script.

systemctl stop firewalld
systemctl disable firewalld


You can install VNC Server on Oracle Linux with below yum packages.

yum install tigervnc-server

yum install xterm
yum install twm

yum install xhost

 

 

You can access the third Oracle DBA scripts related to Blocking Sessions and Lock Kill Scripts with following link.

Mehmet Salih Deveci

I am Founder of IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress mehmetsalih.deveci@outlook.com.-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *