Friday 23 April 2021

Change tde password using dbaascli

Use dbaascli to change tde password

[root@racnode01 ~]# dbaascli tde changepassword --dbname proddb01

DBAAS CLI version 21.3.1.0.1

Executing command tde changepassword

Enter Old keystore password:

Enter New keystore password:

Re-enter New keystore password:



Doing some pre-check...done.

Changing TDE keystore password...done.

Synching the TDE wallet to other nodes...done.

Changing DB wallet password for the alias tde_ks_passwd...done.

Synching DB wallet to other nodes...done.


Successfully changed the TDE keystore password and DB wallet password for the alias tde_ks_passd.

[root@racnode01 ~]#



Check tde status:

[root@racnode01 ~]# dbaascli tde status --dbname proddb01

DBAAS CLI version 21.3.1.0.1

Executing command tde status

TDE is configured on this instance with:

 keystore login: auto

 keystore status: <open>

 keystore type: autologin


Checking wallet consistency.

Master keys compared successfully.

Wednesday 21 April 2021

Insert '&' into a oracle table

By default, SQL*Plus treats the ampersand character (&) as a substitution variable prefix. It prompts for user input and replaces the variable with the entered value in the SQL statement. However, sometimes you may want to use the ampersand character as a literal character in your SQL statement, without triggering substitution.

To disable the substitution variable feature and treat the ampersand character as a literal, you can use the "SET DEFINE OFF" command. Once this command is executed, SQL*Plus will not prompt for variable substitution when encountering an ampersand.

Example:

SET DEFINE OFF
SELECT 'This is & just a sample' FROM dual;
 

With "SET DEFINE OFF" enabled, the above query would simply return the string 'This is & just a sample', without prompting for substitution.

OCI DB Autobackup Configuration on Exacs using bkup_api

we can use bkup_api to configure db autobackup in exacs machines , Below are the steps to schedule autobackups 


1.Generate Sample Config file:

As a root user generate config file using  get config


# /var/opt/oracle/bkup_api/bkup_api get config --file=/home/oracle/exadb01_oss_bkp.conf --dbname=exadb01

DBaaS Backup API V1.5 @2021 Multi-Oracle home

-> Action : get_config

-> logfile: /var/opt/oracle/log/exadb01/bkup_api_log/bkup_api_33d2001b_20210328113456.136826.log

File /home/oracle/exadb01_oss_bkp.conf created

#


2.Modify Config File:

# cat /home/oracle/exadb01_oss_bkp.conf

####

#### This is the Backup config for the DB : exadb01

#### Please refer to <link> for more details about each parameter

####

#### Instance Level Parameters ####

# Enable automatic backup. Can be set to yes or no

bkup_cron_entry=yes


# Enable automatic cleanup of archive logs when backups are not

# configured using tooling. Can be set to yes or no

bkup_archlog_cron_entry=yes


#Enable backup of config files. Can be set to yes or no

bkup_cfg_files=yes


# Time of the daily incremental backup. The format must be hh:mm

bkup_daily_time=0:11


# Archive log frequency in minutes. Valid values are 15,20,30,60,120....

bkup_archlog_frequency=30


#### This section is applicable for configuring backups to Disk  ####

#Enable backup to disk. Can be set to yes or no

bkup_disk=no


#Recovery window of disk. Must be between 1 and 14

bkup_disk_recovery_window=


#### This section is applicable for configuring backups to OSS  ####

# Enable backup to oss container. Can be set to yes or no

bkup_oss=yes


## Below parameters are required if backups to OSS are configured

# Recovery window of oss. Must be between 1 and 90

bkup_oss_recovery_window=15


# OSS url. Example:  https://storage.oraclecorp.com/v1/Storage-test/test

bkup_oss_url=


# OSS username

bkup_oss_user=


# OSS password

#bkup_oss_passwd=


#*(Will be deprecated, please use bkup_l0_day) Default day on which level0 backups are taken for OSS

bkup_oss_l0_day=


#Default day on which level0 backups are taken

bkup_l0_day=Sun


#### This section is applicable for configuring backups to ZDLRA  ####

# Enable backup to ZDLRA. Can be set to yes or no

bkup_zdlra=no


# ZDLRA url

bkup_zdlra_url=


# ZDLRA username

bkup_zdlra_user=


# ZDLRA password

#bkup_zdlra_passwd=


#### This section is applicable for configuring backups to NFS  ####

#Enable backup to nfs. Can be set to yes or no

bkup_nfs=no


#Recovery window of nfs backups. Must be between 1 and 90

bkup_nfs_recovery_window=30


#NFS mount point location

bkup_nfs_loc=


#####RMAN custom configuration such as compression, section size #########

#compression, valid values are none,basic,low,medium,high

bkup_rman_compression=low


#If custom section size is preferred, set the following two values.

#bkup_set_section_size to yes and a valid bkup_section_size.

bkup_set_section_size=


#section size value in G, example 20G

bkup_section_size=


#parallelism, number of channels per node to be used by RMAN

#set value to default for using recommended values based on service, operation

bkup_channels_node=default


# To turn on/off Backup encryption. Valid values True/False

bkup_encryption=true


#### This section is applicable when using a rman catalog ####

# Enables RMAN catalog. Can be set to yes or no.

bkup_use_rcat=no


## Below parameters are required if rman catalog is enabled

# RMAN catalog user

bkup_rcat_user=


# RMAN catalog password

#bkup_rcat_passwd=


# RMAN catalog conn string

bkup_rcat_conn=



3.Config or Update backup schedule:

run Set config to scheduled backups using updated config details

#/var/opt/oracle/bkup_api/bkup_api set config --file=/home/oracle/exadb01_oss_bkp.conf --dbname=exadb01



4.Check config status:

# /var/opt/oracle/bkup_api/bkup_api configure_status --dbname=exadb01

DBaaS Backup API V1.5 @2021 Multi-Oracle home

-> Action : configure_status

-> logfile: /var/opt/oracle/log/exadb01/bkup_api_log/bkup_api_8bbe7547_20210328113514.050123.log

API::ERROR configure_status will be deprecated. To get operation progress,

please execute bkup_api --uuid <uuid generated by set config> --dbname=<dbname>

* Last registered operation: 2021-03-23 18:03:09 UTC

* Configure backup status: finished

**************************************************

* API History: API steps

  API:: NEW PROCESS 204647

*

* RETURN CODE:0

##################################################


5.validate Backup schedule in /etc/crontab

cat /etc/crontab

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=""


# For details see man 4 crontabs


# Example of job definition:

# .---------------- minute (0 - 59)

# |  .------------- hour (0 - 23)

# |  |  .---------- day of month (1 - 31)

# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...

# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

# |  |  |  |  |

# *  *  *  *  * user-name  command to be executed

11 0 * * * oracle /var/opt/oracle/bkup_api/bkup_api bkup_start --cron --dbname=exadb01

26,56 * * * * oracle /var/opt/oracle/bkup_api/bkup_api bkup_archlogs --cron --dbname=exadb01