10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 9 RECOVERING EXADATA/dev/mapper/VGExaDb-LVDbOra1 99G 14G 80G 15% /u01tmpfs 81G 200M 81G 1% /dev/shm/dev/mapper/VGExaDb-sysback 25G 173M 25G 1% /mnt/sysbackNow that we have a place to stage our backup images and we know the logical volumes we want toback up, we’re ready to create snapshots for the / and /u01 file systems. Using the Linux time commandwe can see that it took just over 1 second to create a snapshot for the root volume:[root@enkdb01 ~]# time lvcreate -L1G -s -n root_snap /dev/VGExaDb/LVDbSys1Logical volume "root_snap" createdreal 0m1.066suser 0m0.005ssys 0m0.013s[root@enkdb01 ~]# lvcreate -L5G -s -n u01_snap /dev/VGExaDb/LVDbOra1Logical volume "u01_snap" createdNotice the –L1G and -L5G options we used to create these snapshots. The –L parameter determinesthe size of the snapshot volume. When data blocks are modified or deleted after the snapshot is created,the original copy of the block is written to the snapshot. It is important to size the snapshot sufficientlyto store an original copy of all changed blocks. If the snapshot runs out of space, it will be deactivated.Now that we have snapshots tracking changes to the / and /u01 file systems, we are ready to take abackup. To prove that these snapshots are consistent, we’ll copy the /etc/hosts file to a test file in the/root directory. If snapshots work as they are supposed to, this file will not be included our backup,because it was created after the snapshot was created. The command looks like this:[root@enkdb01 ~]# cp /etc/hosts /root/test_file.txtMount the snapshots as you would any other file system. First, we’ll create a directory to use as amount point for our snapshots. Then we’ll mount the root and u01 snapshots.[root@enkdb01 ~]# mkdir /mnt/snap[root@enkdb01 ~]# mount /dev/VGExaDb/root_snap /root/mnt/snap[root@enkdb01 ~]# mount /dev/VGExaDb/u01_snap /mnt/snap/u01Now that the snapshots are mounted, we can browse them just like any other file system. They lookand feel just like the original file systems, with one exception. If we look in the mounted snapshot for thetest file we created, we don’t see it. It’s not there because it was created after the snapshots were createdand started tracking changes to the file system:[root@enkdb01 ~]# ls -l /root/testfile-rw-r--r-- 1 root root 1023 Jan 23 13:30 /root/test_file.txt /tmp/enkdb01_system_backup.stderr286

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!