Thursday, June 17, 2021

Why and How to setup Network Time Protocol (NTP) in Linux

 ** This is applicable in Linux environment (red hat , Centos , Amazon linux ..etc) .

 Why ?

Having different time in each server/client in same environment will lead you with issue in your platform , thus; you will need to configure NTP services in all your server to sync the time via network from same source .

How ?

 

To setup NTP server we use chronyd service as below :

1- make sure chronyd is started and enabled :

systemctl status chronyd

2- if it is not started and enabled use :

systemctl enable --now chronyd

check the status to make sure it is working properly

you can use as well to check all setting : timedatectl

3- Edit the /etc/chrony.conf :

vim /etc/chrony.conf

4- line "pool 2.rhel.pool.ntp.org iburst" , make it with comment to be

 " #pool 2.rhel.pool.ntp.org iburst"

5- now add your ntp server :

server ntp.example.com iburst

where ntp.example.com is ntp server , or ip can be instead of url

6- to check it is work use " :

chronyc sources -v

or use :

 timedatectl

Wednesday, June 16, 2021

Why and How to clean up (delete) archive log in Oracle

 Why ?

You will need to clean up archive log if you are running your database in  archivelog mode to avoid disk filled up with these files.

How ?

 

Before you delete archive log files, you need to take a backup of these file or you will not be able to restore/recover your DB and make it consistent again in case of failure , also , you have to make sure it is been shipped to standby database in case you are running a data guard for your primary database :

RMAN utility is your connection and manager of these file , no OS commands is needed if you setup your things correctly , however; you may run OS crontab and shell scripts to automate these files .

I am creating a shell script with below details to keep last day files in system only:

rman target / << __EOF__

 crosscheck archivelog all;

DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE -1';

EXIT

__EOF__

and in RMAN policy I configure two things,

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY BACKED UP 1 TIMES TO 'SBT_TAPE';

You can check all configuration of RMAN by running the below:

RMAN> show all;




Tuesday, June 15, 2021

Why and How to enable archive log mode in Oracle

 Why ?

You will need to enable archivelog mode if you need any one of the below ::

  • To restore your DB to last change occur in case of failure in the case of an operating system or disk failure.

  • To take online backup -hot backup- backup while database is open.

  • To use Data guard feature (standby DB) you need to enable this as well.

How ?

Before you enable archive log mode , you can check the current situation mode and set the location the archive log:

  1. To check current archive log status
archive log list;
       2.To set archive log location

alter system set log_archive_dest_1='LOCATION=/disk/archive' scope=spfile ;
The following steps switch the database archiving mode from NOARCHIVELOG to ARCHIVELOG:
  1. Shut down the database instance.

    SHUTDOWN immediate ;
  2. Start a new instance and mount, but do not open, the database.

    STARTUP MOUNT;
    

    To enable or disable archiving, the database must be mounted but not open.

  3. Change the database archiving mode. Then open the database for normal operations.

    ALTER DATABASE ARCHIVELOG;
    ALTER DATABASE OPEN;

** In case you need to stop archive log mode, in mount state you may use the below :

ALTER DATABASE NOARCHIVELOG;

Why and How to install Grid 19c on RHEL 8?

  Why ? Simply we will be requested to install Oracle Grid RAC DB on Redhat RHEL 8, below is my note for this installation . How ? 1-  OS in...