I was preparing for my weekend patch of our Exadata system and I needed to back up all of our Oracle homes and inventories on our production system. On our 2 node dev and qa clusters I just ran the backups by hand like this:
login as root cd /u01/app/oracle/product/188.8.131.52 tar -cvf - dbhome_1 | gzip > dbhome_1-20150211.tgz cd /u01/app cp -r oraInventory oraInventory.20150211
But the production cluster has 12 nodes so I had to figure out how to use DCLI to run the equivalent on all 12 nodes instead of doing them one at a time. To run a DCLI command you need go to the directory that has the list of database server host names. So, first you do this:
login as root cd /opt/oracle.SupportTools/onecommand
The file dbs_group contains a list of the database server host names.
Next, I wanted to check how much space was free on the filesystem and how much space the Oracle home occupied so I ran these commands:
dcli -g dbs_group -l root "df|grep u01" dcli -g dbs_group -l root "cd /u01/app/oracle/product/184.108.40.206;du -ks ."
The first command gave me how much space was free on the /u01 filesystem on all database nodes. The second command gave me how much space the 220.127.116.11 home consumed. I should have done “du -ks dbhome_1” since I’m backing up dbhome_1 instead of everything under 18.104.22.168, but there wasn’t much else under 22.214.171.124 so it worked out.
Now that I knew that there was enough space I ran the backup commands using DCLI.
dcli -g dbs_group -l root "cd /u01/app/oracle/product/126.96.36.199;tar -cvf - dbhome_1 | gzip > dbhome_1-20150316.tgz" dcli -g dbs_group -l root "cd /u01/app;cp -r oraInventory oraInventory.20150316"
I keep forgetting how to do this so I thought I would post it. I can refer back to this later and perhaps it will be helpful to others.