Skip to content

Instantly share code, notes, and snippets.

View dincosman's full-sized avatar

Osman DINC dincosman

View GitHub Profile
@dincosman
dincosman / deploy_oracle_fdw.txt
Last active April 20, 2024 19:41
Deploy Oracle Foreign Data Wrapper
[root@posvt01 postgres16]# yum install ./postgresql16-devel-16.2-1PGDG.rhel8.x86_64.rpm ./perl-IPC-Run-0.99-1.el8.noarch.rpm \
./perl-IO-Tty-1.12-11.el8.x86_64.rpm ./perl-Test-Simple-1.302135-1.el8.noarch.rpm ./perl-Time-HiRes-1.9758-2.el8.x86_64.rpm
[root@posvt01 Packages]# unzip oracle_fdw-ORACLE_FDW_2_6_0.zip
[root@posvt01 Packages]# cd oracle_fdw-ORACLE_FDW_2_6_0/
[root@posvt01 oracle_fdw-ORACLE_FDW_2_6_0]# export LD_LIBRARY_PATH=/usr/lib/oracle/19.14/client64
[root@posvt01 oracle_fdw-ORACLE_FDW_2_6_0]# export ORACLE_HOME=/usr/lib/oracle/19.14/client64
[root@posvt01 oracle_fdw-ORACLE_FDW_2_6_0]# make
[root@posvt01 oracle_fdw-ORACLE_FDW_2_6_0]# make install
/usr/bin/mkdir -p '/usr/pgsql-16/lib'
/usr/bin/mkdir -p '/usr/pgsql-16/share/extension'
@dincosman
dincosman / install_postgresql16.txt
Last active April 20, 2024 19:48
Install Postgresql16 database software and Postgis 3.4.2 for Postgresql16
[root@posvt01 postgres16]# yum install ./postgresql16-libs-16.2-1PGDG.rhel8.x86_64.rpm ./postgresql16-16.2-1PGDG.rhel8.x86_64.rpm
[root@posvt01 postgres16]# yum install ./postgresql16-server-16.2-1PGDG.rhel8.x86_64.rpm ./postgresql16-contrib-16.2-1PGDG.rhel8.x86_64.rpm
[root@posvt01 ~]# vi .bash_profile
...
PATH=$PATH:$HOME/bin:/usr/pgsql-16/bin
[root@posvt01 ~]# yum install ./Packages/postgres16/postgis34_16-3.4.2-3PGDG.rhel8.x86_64.rpm
@dincosman
dincosman / upgrade_postgis.sh
Last active June 24, 2024 11:28
Upgrade POSTGIS version
[root@posvt01 postgres16]# yum install ./libdeflate-1.9-3.el8.x86_64.rpm ./re2-20190801-1.el8.x86_64.rpm ./libkml-1.3.0-24.el8.x86_64.rpm \
./geos312-3.12.1-1PGDG.rhel8.x86_64.rpm ./libgeotiff17-1.7.1-6PGDG.rhel8.x86_64.rpm ./libgeotiff17-devel-1.7.1-6PGDG.rhel8.x86_64.rpm \
./proj94-9.4.0-1PGDG.rhel8.x86_64.rpm ./libspatialite50-5.1.0-5PGDG.rhel8.x86_64.rpm ./libspatialite50-devel-5.1.0-5PGDG.rhel8.x86_64.rpm \
./uriparser-0.9.7-1.el8.x86_64.rpm ./postgis34_14-3.4.2-3PGDG.rhel8.x86_64.rpm ./gdal38-libs-3.8.5-3PGDG.rhel8.x86_64.rpm \
./libqhull_r-2015.2-5.el8.x86_64.rpm ./libarrow-8.0.1-2.el8.x86_64.rpm ./armadillo-12.6.6-1.el8.x86_64.rpm --allowerasing
Dependencies resolved.
=========================================================================================================================================
Package Architecture Version Repository Size
@dincosman
dincosman / upgrade pgbackrest software.txt
Last active April 20, 2024 18:38
upgrade pgbackrest release
[root@posvt01 postgres16]# yum upgrade ./pgbackrest-2.51-1PGDG.rhel8.x86_64.rpm ./libssh2-1.8.0-8.module+el8.0.0+5339+ebcc8ca7.1.x86_64.rpm
@dincosman
dincosman / upgrade_patroni.sh
Last active June 26, 2024 18:38
Upgrade Patroni software
[root@posvt01 Packages]# pip3 show patroni
Name: patroni
Version: 3.0.1
Summary: PostgreSQL High-Available orchestrator and CLI
Home-page: https://github.com/zalando/patroni
Author: Alexander Kukushkin, Polina Bungina
Author-email: akukushkin@microsoft.com, polina.bungina@zalando.de
License: The MIT License
Location: /usr/local/lib/python3.9/site-packages
Requires: python-dateutil, psutil, ydiff, six, PyYAML, urllib3, click, prettytable
@dincosman
dincosman / start_recover_onremote.sh
Created March 26, 2024 15:56
Start recovery process on standby databases
#!/bin/bash
export ORACLE_SID=$1
export ORACLE_HOME=$2
$ORACLE_HOME/bin/sqlplus -s /nolog << END_SQL
conn / as sysdba
set serveroutput on feedback off;
DECLARE
inst_id number;
mrp number;
inst_name varchar2(50);
@dincosman
dincosman / apply_db_update_main.yml
Last active October 1, 2024 07:01
Apply database release update with a consolidated playbook.
- name: Import playbook to prepare new Oracle Database Home
ansible.builtin.import_playbook: prepare_dbru_allnodes.yml
- name: Import playbook to apply Oracle Oracle Database Release Update
ansible.builtin.import_playbook: apply_dbru_onfirstnode.yml
- name: Import playbook to run root.sh in new Oracle Database Homes
ansible.builtin.import_playbook: apply_dbru_runrootallnodes.yml
@dincosman
dincosman / apply_grid_update_main.yml
Last active October 1, 2024 07:00
Apply grid infrastructure release update with a consolidated playbook.
- name: Import playbook to prepare new Oracle Grid Infrastructure Home
ansible.builtin.import_playbook: prepare_grid_allnodes.yml
- name: Import playbook to apply Oracle Grid Infrastructure Release Update
ansible.builtin.import_playbook: apply_giru_onfirstnode.yml
- name: Import playbook to finish Oracle Grid Infrastructure Release Update
ansible.builtin.import_playbook: finish_giru_allnodes.yml
@dincosman
dincosman / start_recover_allnodes.yml
Last active October 1, 2024 07:00
Start Database Recovery Process on Standby Databases
- name: Start Database Recovery Process on Standby Databases
hosts: dbservers
remote_user: oracle
vars:
db_home: /u01/app/oracle/product/19.22/dbhome_1
recovery_script_dest_dir: /home/oracle
recovery_script_dir: /etc/ansible/projects
patch_dir: /u01/app/Setup
@dincosman
dincosman / apply_datapatch_onprimary.yml
Last active October 1, 2024 07:00
Applying datapatch on first instances of primary databases
[ansible@blt01 ansible]$ cat projects/dbru/apply_datapatch_onprimary.yml
- name: Apply Data Patch on First Nodes of Primary Databases
hosts: dbservers
vars:
new_db_home: /u01/app/oracle/product/19.22/dbhome_1
db_role: PRIMARY
remote_user: oracle
run_once: true