Posts

PostgreSQL interview questions part2

 Explain about the PostgreSQL architecture  Background process  ================== postmaster process  : Listens for incoming connection postgres process  :  for every connection a new postgres process is created.  Stats collector  : for collecting statistics  Autovaccum process  : For vaccuming.  Background writer : For writing DB files WAL writer : for writing WAL/log files Memory Structure: ================ Shared_buffers Work_memory  Temp_memory maintenance_work_mem  autovacuum_work_mem  Logical Structure ================= Cluster which consists of database, users and tablespaces. Each database consist of schemas and tables. Physical Layout: ===============  Background folders and files  Base , global, pg_wal/pg_xlog , pg_clog etc  Files: postgresql.conf, pg_hba.conf, postmaster.pid  

Shell scripting cheatsheet

 SED :  it is used to replace a word  Replace a word in a file:sed 's/old_word/new_word/' file.txt Replace all occurrences of a word in a file:sed 's/old_word/new_word/g' file.txt Delete lines matching a pattern:sed '/pattern/d' file.txt AWK: Print specific columns from a CSV file:awk -F ',' '{print $1, $3}' file.csv Calculate the sum of a column in a numeric file: awk '{sum += $1} END {print sum}' file.txt Filter lines based on a condition:awk '$3 > 50 {print $1, $3}' file.txt Shebang: The shebang, also known as a hashbang, is the first line of a script and specifies the interpreter to use. For example, #!/bin/bash Variables: Variables store data for later use. $name. To declare a variable as global, use the export keyword. Command substitution: For example, files=$(ls) stores the output of the ls command in the files variable. Control structures: if-else: Conditionally execute code based on a condition. It has the form: if co...

logical standby database

 An Oracle Logical Standby Database is a type of standby database that provides transaction-level replication and is designed for high availability and disaster recovery purposes. It is a feature of Oracle's Data Guard technology. In a logical standby database configuration, changes made to the primary database are captured in the form of SQL statements, which are then transformed and applied to the logical standby database. Unlike a physical standby database that replicates data at the block level, a logical standby database replicates data at the SQL level. Here are some key features and characteristics of an Oracle Logical Standby Database: Read-Write Access Different Database Structures Data Filtering DML and DDL Replication Delayed Apply Switchover and Failover steps to create logical standby  Prepare the Primary Database:ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; Enable force logging: ALTER DATABASE FORCE LOGGING; Create a Standby Initialization Parameter File:DB_UNIQUE_N...

ZDLRA

  RPO focuses on the maximum acceptable data loss  RTO focuses on the maximum acceptable downtime. Oracle DG - RTO Active DG - RTO RAC  - RTO Golden Gate - RPO Flashback - RPO ZDRLA - RPO Oracle Zero Data Loss Recovery Appliance (ZDLRA) deliver to you the capacity to improve the reliability of your environment in more than one way. You can improve the RPO. It has  lot of new cool features  virtual backups Real-time redo Tape and cloud DG/MAA integration Incremental forever backup strategy ZDLRA is one Engineered System built over Exadata. Contains Exadata Storage and Database nodes, InfiniBand network, SAS drivers Exadata, it is not just hardware, it is software too. ZDLRA solve problems in more than one topic, it is not just a backup appliance where you redirect your backups, it is an appliance that provides zero data loss. To do that the key features are: Virtual backups: Based on the input backups (incremental) generate a virtual full backup for you. Real-tim...

Oracle database 19C new features

Installation and upgrades: Simplified image based installation of client  RPM Based Installation  install Oracle 19c Database using RPM method with Vagrant Virtual box and via ansible playbook Docker Container for Oracle 19c Auto Upgrade Utility for Oracle Database DryRun mode for GridSetup in Clusterware Installation  Auto upgrade: Download latest auto upgrade  Install the auto upgrade ./auto_upgrade.sh -config /path/to/config_file Review the report and fix the issues Run the auto upgrade script  RPM based installation  Install VirtualBox on your machine. Install Vagrant on your machine. Create a new directory for your Vagrant environment: mkdir oracle19c Navigate to the newly created directory: cd oracle19c Initialize the Vagrant environment: vagrant init General Clear flashback logs periodically Multimodel partitioning with Hybrid partitioning allowing some partitions in the database and some as external partitions even in HDFS Passwords removed from sch...

database Auditing

Every time a user attempts anything in the database where audit is enabled the Oracle kernel checks to see if an audit record should be created or updated (in the case or a session record) and generates the record in a table owned by the SYS user called AUD$. This table is, by default, located in the SYSTEM tablespace. This itself can cause problems with potential denial of service attacks. If the SYSTEM tablespace fills up, the database will hang. init parameters Until Oracle 10g, auditing is disabled by default, but can be enabled by setting the AUDIT_TRAIL static parameter in the init.ora file. From Oracle 11g, auditing is enabled for some system level privileges. SQL> show parameter audit NAME TYPE VALUE ---------------------- ------------ ------------- audit_file_dest string ?/rdbms/audit audit_sys_operations boolean FALSE audit_syslog_level string NONE audit_trail string DB transaction_auditing boolean TRUE AUDIT_TRAIL can have the following values....

what is data redaction

 What is Oracle Data Redaction with Examples (Mask your sensitive Data) Oracle Data Redaction is one of the new features introduced in Oracle Database Oracle 12c .This new feature is part of the Advanced Security option and enables the protection of data shown to the user in real-time, without requiring changes to the application. Oracle Data Redaction enables you to mask (redact) data that is returned from queries issued by applications. You can redact column data by using one of the following methods: Full redaction. You redact all of the contents of the column data. The redacted value returned to the querying application user depends on the data type of the column. For example, columns of the NUMBER data type are redacted with a zero (0), and character data types are redacted with a single space. Partial redaction. You redact a portion of the column data. For example, you can redact a Social Security number with asterisks (*), except for the last 4 digits. Regular expressions. Y...