RMAN Script

My favorite RMAN script thus far:

run {
CROSSCHECK ARCHIVELOG ALL DEVICE TYPE DISK;
CROSSCHECK BACKUP DEVICE TYPE DISK;
DELETE FORCE NOPROMPT EXPIRED ARCHIVELOG ALL DEVICE TYPE DISK;
DELETE FORCE NOPROMPT EXPIRED BACKUP DEVICE TYPE DISK;
RECOVER COPY OF DATABASE WITH TAG “whole_db_copy”;
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG “whole_db_copy” DATABASE PLUS ARCHIVELOG DELETE ALL INPUT;
BACKUP RECOVERY AREA;
DELETE FORCE NOPROMPT OBSOLETE DEVICE TYPE DISK;
}

Advertisements
Posted in Uncategorized | Tagged | Leave a comment

OEM Cleanup of Alerts (Warnings and Criticals) for All Targets

Make sure you want to do this before hand!

From your OEM Server:

alter session set current_schema=sysman;

SELECT ‘EXEC EM_SEVERITY.DELETE_CURRENT_SEVERITY(”’||TARGET_GUID||”’,”’||METRIC_GUID||”’,”’ ||KEY_VALUE||”’);’ MCS FROM MGMT_CURRENT_SEVERITY;

Then run the output generated.  This will cleanup and reset the value to Zero for all Warnings and Critical Alerts for All Targets being monitored.

Posted in Uncategorized | Tagged | Leave a comment

ASM Management: Add Disk, Drop Disk, and Rebalance within a single statement

select GROUP_NUMBER, DISK_NUMBER, STATE, MOUNT_STATUS, HEADER_STATUS, MODE_STATUS, OS_MB, TOTAL_MB, FREE_MB, NAME, PATH, UDID from v$asm_disk;

alter diskgroup DISKGROUP
add disk ‘ORCL:DISK4‘ NAME DISK4, ‘ORCL:DISK5‘ NAME DISK5, ‘ORCL:DISK6‘ NAME DISK6
drop disk DISK1, DISK2, DISK3
rebalance power 7;

select * from gv$asm_operation;  <– Run this to view the status of the rebalance operation

Posted in Uncategorized | Tagged | Leave a comment

CRS re-install via silent install and re-link DB and ASM to CRS Stack

Below are instructions to perform the following:

1. Cleanly remove CRS Configuration from all nodes
2. Drop and Re-create Quorum Disks (Voting/OCR)
3. Re-install CRS using RSP File
4. Re-link the DB and ASM to the newly installed CRS Stack

Version: 11gR2 (11.2.0.2)

1. cd $GI_HOME
node1: ./rootcrs.pl -deconfig -force
node2: ./rootcrs.pl -deconfig -force -lastnode

2. Fix GI_HOME perm

chown -R grid:oinstall $GI_HOME

Re-present QUORUM disks to oracleasm

NODE1: Validate disks and record mpath

oracleasm querydisk -p DISK_LABEL

node1# oracleasm querydisk -p QUORUM
node2# oracleasm querydisk -p QUORUM

NODE1: Drop disks

oracleasm deletedisk DISK_LABEL

node1# oracleasm deletedisk QUORUM1
Clearing disk header: done
Dropping disk: done
node1# oracleasm deletedisk QUORUM2
Clearing disk header: done
Dropping disk: done
node1# oracleasm deletedisk QUORUM3
Clearing disk header: done
Dropping disk: done

NODE1: Re-create disks based on the mpath obtained from step (a)

oracleasm createdisk DISK_LABEL /path/to/mpath

node1# oracleasm createdisk QUORUM1 /dev/mapper/mpath
Writing disk header: done
Instantiating disk: done
node1# oracleasm createdisk QUORUM2 /dev/mapper/mpath
Writing disk header: done
Instantiating disk: done
node1# oracleasm createdisk QUORUM3 /dev/mapper/mpath
Writing disk header: done
Instantiating disk: done

NODE1: List/validate disks

oracleasm listdisks
oracleasm querydisk -p DISK_LABEL

***SHOULD BE THE SAME OUTPUT IN STEP (a)

NODE2: Scan disks and list

oracleasm scandisks
oracleasm listdisks

node2# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks…
Scanning system for ASM disks…
node2# oracleasm listdisks

3. On all nodes:
cd /ContentsXML/
cp inventory.xml inventory.xml.bk
vi inventory.xml and remove CRS/GI Entry.
cd $GRID_SOFTWARE
./runInstaller -silent -responseFile /$RSP_LOC/grid.rsp
cd $GI_HOME/cfgtoollogs/
./configToolAllCommands

4. Mount all Disk Groups except for the OCR/VOTING Disk Group since this will already be mounted due to the CRS Install.

asmcmd
mount DISKGROUP1
mount DISKGROUP2

srvctl config database -d db
srvctl add database -d db -o $ORACLE_HOME
srvctl add instance -d db -i instance1 -n node1
srvctl add instance -d db -i instance2 -n node2
srvctl modify database -d db -m domain
srvctl modify database -d db -n db_name
srvctl modify database -d db -a ‘DISKGROUP1,DISKGROUP2
srvctl modify database -d db -p ‘SPFILE_LOC/spfile.ora
crsctl pin css -n node1 node2
$GI_HOME/bin/olsnodes -t -n

crsctl stat res -p

Posted in Uncategorized | Tagged | Leave a comment

Why it’s important for DBA’s and Developers to work as One

On many occasions, I see the usual break in communications between the Development Team and the DBA Team. Where “DBA” ends up standing for “Don’t Bother Asking”, and at the same time, the development team doesn’t perform the due-dillegence necessary to build a properly tuned application which will reside and function within an Oracle Eco-System.

Now an Eco-System? Really? Yes, and we’ll get to that later.

So what practices should be adopted between keeping communications between both team as efficient and accurate as possible? Well, as Tom Kyte so adequately put it, “I don’t believe in the DBA/Developer Wall, Tear Down that Wall”. How right he was..

An SME DBA’s job is not of just function, it’s to be integrated with your environments.. your Eco-Systems, as humanly possible. You have to listen to your Eco-System’s Breath, your applications are alive within it. The Middle-Tier is constantly communicating with it. Treat it as such, and show this amount of respect to your environments and, above all, to your teams. The developers will help your Eco-System grow in an effortless concert of transactional vectors.

As Oracle starts to incorporate Cloud Computing Initiatives into the backbone and neurons of the Oracle Platform via Exadata Logistics and beyond, it’s imperative that we as SME DBA’s do not, under any circumstance, build a wall between the DBA’s and the Developer’s. It will only influence poor structural and logical design practices among other things. We all see how Salesforce.com is approaching software as a service. But as SME’s, we are bound to provide much more than a service, we grow the Eco-system as a whole. We push the standards and protect the infrastructure. SME DBA’s and Developers prevent the line-of-business from under-performing at an architectural level and from an application level. Together we are the Core. Alone, we both Fail.

Posted in Uncategorized | Tagged | 1 Comment

Welcome Welcome!

Hope everyone is doing well.  I will be posting as much valuable information as possible. Hope to help the Oracle Community as much as it has inspired me.

Thanks,

Thomas Baran

Posted in Uncategorized | Tagged | 1 Comment