Skip to main content

Posts

Showing posts from March, 2023

RMAN Backup Delete Commands

RMAN Backup Delete Commands I was being asked how to delete the RMAN backup. So I thought lets write a quick post on this Delete All Backups RMAN> DELETE BACKUP; The above command will prompt you to confirm the deletion.  Delete the backups and want to skip the confirmation prompt then use below command RMAN> DELETE NOPROMPT BACKUP; Delete Archivelog Backup To delete archivelog files from disk (NOT BACKUP), use below commands RMAN> DELETE ARCHIVELOG ALL; RMAN> DELETE ARCHIVELOG UNTIL SEQUENCE 1000; RMAN> DELETE ARCHIVELOG ALL COMPLETED BEFORE ‘sysdate-7; RMAN> DELETE ARCHIVELOG ALL BACKED UP 1 TIMES to disk; To delete archivelog files from the RMAN backups (NOT ON DISK) RMAN> DELETE BACKUP OF ARCHIVELOG ALL; RMAN> DELETE BACKUP OF ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7'; Delete Backup Tag Delete all the backup files associated with tag RMAN> DELETE BACKUP TAG <tag>; Delete Expired Backups Run RMAN CROSSCHECK command and then delete all the e...

Shell Script to Check Status ,Start and Stop Docker Services on a Linux Server

Shell Script to Check Status, Start and Stop Docker Services on a Linux Server Scenario: I was managing docker services so every time , I have start stop services I need to do that ,manually. So I thought to write a shell script to do that for me easily. I had created a menu based script . Script: #!/bin/bash #Terminal Prompt PS3="Enter the option number:" # Menu options options=("Check running Docker services" "Stop a Docker service" "Start a Docker service" "Quit") # Function to check running Docker services check_services() {   docker ps } # Function to stop a Docker service stop_service() {   docker ps   read -p "Enter the ID or name of the service to stop: " service_id   docker stop $service_id } # Function to start a Docker service start_service() {   docker ps -a   read -p "Enter the ID or name of the service to start: " service_id   docker start $service_id } # Loop through menu options until user quits while...

TDE -Transparent Data Encryption in Oracle 19c Database and Step By Step Approach

TDE -Transparent Data Encryption in Oracle 19c Database TDE (Transparent Data Encryption) in Oracle is a feature that enables you to encrypt sensitive data stored in database columns, tablespaces, and backups. The encryption process is transparent to applications that access the data, which means that users and applications can continue to work with the data without any changes to the way they access it. When TDE is enabled, the data is automatically encrypted when it is written to disk and decrypted when it is read from disk. This helps protect the data from unauthorized access by individuals or applications that may try to steal or manipulate the data. When Working on Public Cloud TDE is an important security feature that should be enabled on the database to encrypt the data. In Oracle Cloud DBCS this is enabled. Data can be encrypted at the column level or tablespace level. One important thing to keep in mind when using TDE is that it can have a performance impact on your database. ...

Deploy a Oracle Database in OCI from OCI Market Place

Deploy a Oracle Database in OCI from OCI Market Place In OCI Market place we can leverage the opportunity to easily and quickly deploy an Oracle Database single Instance for valuation and testing purposes. This provision is rather very quick and just use for few clicks to make a database ready. It is deployed on Oracle Linux. The method can be helpful for quickly and easily deploy the database and destroy is when required. Note: I will not recommend the method for a Production Database. Steps: 1) Login to OCI Console and Open MarketPlace. Search for Oracle Database. 2) We have an opportunity to select the required version of DB and comaprtment. As of writing this post the version available are as below 3) Once we Launch the Instance we will get an option to select the required the Compute Instance details. Please note the db will be hosted on a Compute instance in this method. Enter the required details for creating a compute instance. 4) Once all values are entered, Please Click on cr...

How to remove/mask the Workflow email address to avoid mails being sent to user from TEST/DEV Oracle Apps Instance

How to remove/mask the email address to avoid mails being sent to user from TEST/DEV Oracle Apps Instance Scenario: Whenever we are cloning EBS applications we might need to go ahead and might need to start the workflow notification mailer. But starting workflow mailer might cause sending mails to business user or end users which would be irrelevant to them and cause confusion. Solution: As part for post cloning steps we should mask/remove email address for user. You can change scripts as per the needs 1) Connect as apps Create table per_all_people_f_bakup as select * From per_all_people_f; 2) Connect as apps Create table fnd_user_bakup as select * From fnd_user; 3) Now lets mask the email address Connect as apps Update per_all_people_f set email_Address='dummy@xyz.com' where email_Address is not null; Update fnd_user set email_Address='dummy@xyz.com' where email_Address is not null ; commit; per_all_people_f and fnd_user join  fnd_user ==> Employee_Id   Per_all_peop...

How to rename Datafile(s) in Standby Database In Oracle

How to rename Datafile(s) in Standby Database In Oracle Scenario: I was working for customer where they have space issue on DR server. Now the issue is that we are not in position to add new space. So certain directories was already having free spaces around 150GB.  So as a solution I thought of renaming the  datafile and moving it in new mount which have already have some space.  Renaming a datafile on standby database is a quite simple process. Steps: 1) Cancel the managed recovery and bring physical standby database to mount state. SQL> Alter database recover managed standby database cancel; SQL> shutdown immediate SQL> startup mount 2) Change value of standby_file_management parameter to MANUAL. This parameter is set to AUTO by default, which means that standby datafiles will be added automatically as soon as a datafile is added in the primary database. SQL> alter system set standby_file_management=MANUAL; 3) Move the datafile to new location using OS comm...

How to auto logout(timeout) a regular user and root user in Linux?

How to auto logout(timeout) a regular user and root user in Linux? I want to set shell auto logout for multiple users with multiple timeout in linux Steps: # touch /etc/profile.d/log-out.sh # cd /etc/profile.d Modify your log-out.sh script as below #!/bin/bash # Log out in 2 minutes if the session is idle if [ `id -nu` == "root" ];then    export TMOUT=120    readonly TMOUT elif [ `id -nu` == "himanshu" ];then    export TMOUT=60    readonly TMOUT fi Log out and re-login to validate your new changes If you like please follow and comment

Ubuntu remove SSH welcome message

Ubuntu remove SSH welcome message When you login to an Ubuntu server using SSH, we get welcome message To disable MOTD on Ubuntu, just delete the scripts from /etc/update-motd.d/ First Method: rm -f /etc/update-motd.d/* If you want a differnt motd, you can put a shell script in this folder. Second Method: Disable motd is by disabling pam_motd.so module. Edit files /etc/pam.d/login /etc/pam.d/sshd Comment out the lines related to pam_motd.so session    optional     pam_motd.so  motd=/run/motd.dynamic session    optional     pam_motd.so noupdate If you like please follow and comment