Wednesday, December 14, 2022

Write Bash script for reding aws rds logfile


To read the AWS RDS logfile using Bash, you can use the following script:


#!/bin/bash


# Set the path to the RDS logfile

LOGFILE="/path/to/rds/logfile"


# Read the logfile line by line

while read line; do

  # Print each line to the console

  echo "$line"

done < "$LOGFILE"


In this script, we first set the path to the RDS logfile in the LOGFILE variable. Then, we use a while loop to read the logfile line by line and print each line to the console.

Note that you will need to replace /path/to/rds/logfile with the actual path to the logfile on your system. Also, make sure the script has the correct permissions to read the logfile. You can set the correct permissions by running the following command:


chmod +x /path/to/script.sh



After setting the correct permissions, you can run the script using the following command:

./path/to/script.sh


This will run the script and print the contents of the RDS logfile to the console. You can also redirect the output of the script to a file if you want to save the logfile contents to a file, like this:

./path/to/script.sh > /path/to/output/file.txt


 

Sunday, August 14, 2022

Oracle Database Interview Q&A – Part 1

I have started a youtube channel -- cloudstation2020 

I am going to answer these questions with some explanation 

Q1. As Oracle DBA what are your daily activities ? 

Q2. What is SGA 

Q3. What is Shared Pool ? 

Q4. What is shared memory segment ? 

Q5 .What is data segment ? Stay tuned . I will update blog as i upload the vedio

Wednesday, April 22, 2015

This is oracle blog ☰ Service Startup Issues

☰ Backup and Recovery

☰ Data Guard

☰ Installation

☰ Performance tuning

☰ RAC

☰ Database Upgradation

☰ Miscellaneous

Monday, April 20, 2015

Untitled 1

Oracle Database Security

1)       Database Auditing

2)       Native Network Encryption

3)       String authentication (PKI,KERBEROS,RADIUS)

4)       Database Encryption

5)       Virtual Private Database (8i)

6)       Global Roles

7)       Enterprise User Security

8)       Proxy Authentication

9)       Oracle Label Security

10)    Client Identifier/Identity Propagation

11)    Secure Application Roles

12)    Fine Grained Auditing (9i)

13)    EM Configuration Scanning

14)    Transparent Data Encryption

15)    DB Security Evaluation

16)    Oracle Database Vault

17)    Oracle Audit Vault

18)    Data Redaction

19)    Oracle Key Vault

Thursday, April 16, 2015

Common Oracle DBA Tasks

1)      Installing Oracle Software

2)      Creating Oracle database

3)      Performing upgrades of the database and software to new release levels

4)      starting and shutting down database instances

5)      Managing the storage structure of the databases

6)      Managing users and security

7)      Managing database objects such as tables,indexes and views

8)      Backing up the database and performing recovery operation when necessary

9)      Monitoring the state of the database and performing the recovery operation when necessary

10)   Monitoring and tuning database performance

11)   Diagnosing and reporting critical errors to oracle support services

Tools for Administering the database

1)      OUI :-- Oracle Universal Installer .. Install Oracle software and options .

2)      DBCA :-- Database Configuration Assistant .. For creating database , Managing Instance

3)      DBUA :-- Database Upgarde Assistant .. Guides you to install database from exisiting version to new version

4)      NETCA :-- Network Configuration Assistant ..enables to configures listeners and naming methods

5)      Oracle Enterprise Manager Database Control :-- Web Based Oracle Database Management Tool

Oracle Database 11gR2 Version 11.2.0.3 Installation

Note :-- # is root user
               $ is oracle user

Enviornment

1)      OS RHEL 5.8

2)      Database Version 11.2.0.3

3)      Filesystem

Steps

1)      Execute below command for pre-install the requisite
# yum install oracle-rdbms-server-11gR2-preinstall

2)      After transferring the software to server .unzip and set DISPLAY value

[oracle@rac4 software]$ export DISPLAY=192.168.56.1:0.0

[oracle@rac4 software]$ cd database

[oracle@rac4 database]$ pwd

/u03/software/database

[oracle@rac4 database]$ ls -ltr

total 64

-rwxr-xr-x  1 oracle oinstall  5466 Aug 22  2011 welcome.html

drwxr-xr-x 12 oracle oinstall  4096 Sep 18  2011 doc

-rwxr-xr-x  1 oracle oinstall  3226 Sep 22  2011 runInstaller

drwxr-xr-x  2 oracle oinstall  4096 Sep 22  2011 rpm

drwxr-xr-x  2 oracle oinstall  4096 Sep 22  2011 response

drwxr-xr-x  4 oracle oinstall  4096 Sep 22  2011 install

drwxr-xr-x 14 oracle oinstall  4096 Sep 22  2011 stage

drwxr-xr-x  2 oracle oinstall  4096 Sep 22  2011 sshsetup

-rwxr-xr-x  1 oracle oinstall 28122 Sep 22  2011 readme.html

 

3)      Execute runInstaller

[oracle@rac4 database]$ ./runInstaller

Starting Oracle Universal Installer...

 

Checking Temp space: must be greater than 120 MB.   Actual 8955 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 10236 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-04-16_05-22-12PM. Please wait ...[oracle@rac4 database]$

 

4)      Uncheck the “I wish to receive …”

5)      Click next .. Check Skip software updates

6)      Check install software only

7)      Check single instance database installation

8)      Select Language English

9)      select enterprise edition

10)   Specify path

11)   select value

12)   Fix any error or warning . If not click install

13)   Installation in progress

14)   Run the script as root user

[root@rac4 ~]# /u01/app/oracle/product/11.2.0/dbhome_2/root.sh

Performing root user operation for Oracle 11g

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_2

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...

 

 

Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Finished product-specific root actions.

[root@rac4 ~]#

15)   Look for the below message

The installation of oracle database was successful

16)   Run dbca after setting oracle home

17)   select create a database

18)   select general purpose or transaction processing

19)   provide database name

20)   click next for couple of screen and provide input as asked

Wednesday, April 15, 2015

Untitled 1

 

Day 53.1:-- 04/15/2015

Cluster Commands for 11gR2 Release 11.2.0.3

Note :-- In Command database name is db and instance are db1,db2,db3
               $ ->> oracle user
               # ->> root user

After Cluster start execute below command to check cluster status

1)      crsctl check cluster –all

2)      crsctl status resource –t

Checking status of different component

1)      Checking CRS of specific node

n  $ crsctl check crs

2)      Checking database status

n  $ srvctl status database –d db

3)      Checking the instance status

n  $ srvctl status instance -d db -i db1,db2,db3

4)      service status

n  $ srvctl status service –d db

5)      nodeapps status

n  $ srvctl status nodeapps

6)      asm status

n  $ srvctl status asm

7)      type status

n  $ crsctl status type

8)      ip status

n  $ crsctl status ip -A {<IP_name>|<IP_address>}

9)      server status

n  $ crsctl status server

10)   serverpool status

n  $ crsctl status serverpool

11)   testdns status

n  $ crsctl status testdns

12)   cvu status

n  $ srvctl status cvu

13)   Datagroup status

n  $ srvctl status diskgroup -g data_dg1

14)   filesystem status

n  $ srvctl status filesystem -d db

15)   gns status

n  $ srvctl status gns

16)   home status

n  # srvctl status home -o /u02/app/11.2.0.3/grid -s as -n rac1

17)   Listener status

n  $ srvctl status listener

18)   oc4j status

n  $ srvctl status oc4j

19)   SCAN VIP status

n  $ srvctl status scan

20)   scan_listener status

n  $ srvctl status scan_listener

21)   srvpool status

n  $ srvctl status srvpool

22)   vip status

n  $ srvctl status vip –n rac1

Check Configuration of different component

23)   config database

n  $ srvctl config database –d db

24)   config service

n  $ srvctl config service –d db

25)   config nodeapps

n  $ srvctl config nodeapps

26)   config asm

n  $ srvctl config asm

27)   config listener

n  $ srvctl config listener

28)   config has

n  # crsctl config has

29)   config cvu

n  $ srvctl config cvu

30)   config filesystem

n  $ srvctl config filesystem –d db

31)   config gns

n  $ srvctl config gns

32)   config oc4j

n  $ srvctl config oc4j

33)   config scan-vip

n  $ srvctl config scan

34)   config scan listener

n  $ srvctl config scan_listener

35)   config srvpool

n  $ srvctl config srvpool

36)   config vip

n  $ srvctl config vip –n rac1

Checking getenv of different component

37)   getenv asm

n  $ srvctl getenv asm

38)   getenv database

n  $ srvctl getenv database -d db

39)   getenv listener

n  $ srvctl getenv listener

40)   getenv nodeapps

n  $ srvctl getenv nodeapps

 

  Diagnosing a long parsing issue in Oracle Database Slide 1: Topic: Diagnosing a Long Parsing Issue in Oracle Database Slide 2: Parsing is ...