AWS using Ansible? Yes, it's possible!

  Although, I've used Ansible extensively for a lot of automation and orchestration tasks, using Ansible for AWS was indeed, a new territory for me.  This turned out to be a blessing, since along with using Ansible for AWS tasks, I also learnt how to use WSL (Windows Subsystem for Linux) on a Windows machine. Though WSL's been around for some time, I still hadn't come around to using it since I was mostly using my Macbook pro. Not anymore, though!  Anyway, I have listed below the steps to: Install WSL on Windows 11 23H2 patch Install AWS CLI on Ubuntu 22.04 (Exact version - 22.04.3 LTS) Install Ansible and the amazon.aws collection Use AWS CLI to get the list of  VPCs in the region - us-east-1 (or a region of your choice) Create a python file/script to get the list of VPCs in the region - us-east-1 (or a region of your choice) Create an Ansible playbook to get the list of VPCs in the region - us-east-1 (or a region of your choice.   You may download the comple...

Extract Controlfile from a backupset using RMAN

In my previous post, I had talked about extracting controlfiles, datafiles and archivelogs from RMAN backupsets using the package dbms_backup_restore.



In this post, I would like to throw light upon using RMAN as an alternate method that could be employed to extract controlfiles from RMAN backupsets. This method uses the RMAN command "restore controlfile from '<FULL_PATH_TO_CONTROLFILE_BACKUP>'".



The RMAN method can be used in 3 scenarios. So, make sure that at least any one of the backups is indeed available. Else, you are DOOMED!


I. the controlfile autobackup is turned on in RMAN. In this case the file format would be "c<DBID>-<DATE>-<COUNT>".

It is turned on using the command:

configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/opt/apps/vision/backup/%F';

II. the controlfile snapshot backup is configured in RMAN.

It is turned on using the command:

configure snapshot controlfile name to '<FULL_PATH_TO_SNAP_CTRL_FILE>';

III. the controlfile is included in the RMAN backupset i.e., using the clause "include current controlfile" in the backup database command.


Scenario I - Restoring controlfile using RMAN and controlfile autobackup.

a. Startup the database in nomount state.



b. Run RMAN commands as below:


$ rman target /


Recovery Manager: Release 9.2.0.6.0 - 64bit Production


Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.


connected to target database: BKP (not mounted)


RMAN> restore controlfile from '/opt/apps/vision/backup/c-261506738-20090722-02';
Starting restore at 23-JUL-09
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=16 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/opt/apps/vision/bkpdata/bkpdatacontrol01.ctl
output filename=/opt/apps/vision/bkpdata/bkpdatacontrol02.ctl
output filename=/opt/apps/vision/bkpdata/bkpdatacontrol03.ctl

Finished restore at 23-JUL-09

RMAN>


Scenario II - Restoring controlfile using RMAN and controlfile snapshot.



a. Startup the database in nomount state.

b. Run RMAN commands as below:


$ rman target /


Recovery Manager: Release 9.2.0.6.0 - 64bit Production


Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.


connected to target database: BKP (not mounted)


RMAN> restore controlfile from '/opt/apps/vision/backup/snap_BKP_controlfile.ctl';


Starting restore at 23-JUL-09

using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=16 devtype=DISK
channel ORA_DISK_1: copied controlfile copy
replicating controlfile
input filename=/opt/apps/vision/bkpdata/bkpdatacontrol01.ctl
output filename=/opt/apps/vision/bkpdata/bkpdatacontrol02.ctl
output filename=/opt/apps/vision/bkpdata/bkpdatacontrol03.ctl

Finished restore at 23-JUL-09


RMAN>


Scenario III - Restoring controlfile using RMAN and backupsets (provided backup is taken using the "include current controlfile" clause).


Note: The RMAN backup log would record the backup piece name which includes the controlfile. If you are not sure which backup pice contains the controlfile, then try this on all the backup pieces till the controlfile is restored.


a. Startup the database in nomount state.

b. Run RMAN commands as below:


$ rman target /


Recovery Manager: Release 9.2.0.6.0 - 64bit Production


Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.


connected to target database: BKP (not mounted)


RMAN> restore controlfile from '/opt/apps/vision/backup/BKP_LVL0_20090722_09kkof7i_s9_p1';

Starting restore at 23-JUL-09


using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=16 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/opt/apps/vision/bkpdata/bkpdatacontrol01.ctl
output filename=/opt/apps/vision/bkpdata/bkpdatacontrol02.ctl
output filename=/opt/apps/vision/bkpdata/bkpdatacontrol03.ctl

Finished restore at 23-JUL-09


RMAN>

Comments

Popular posts from this blog

Check if UTL_FILE and FND_FILE are working fine

Modify retention period of workflow queues

Clone database home (clone.pl) deprecated in Oracle 19c