From the course: Oracle Database 12c: Backup and Recovery

Performing user-managed backups of datafiles - Oracle Database Tutorial

From the course: Oracle Database 12c: Backup and Recovery

Start my 1-month free trial

Performing user-managed backups of datafiles

- [Narrator] So let's start with User Manage Backups in Oracle. We'll start by performing a backup of our database data file. In order to accomplish that, we will need to first connect to the plug-able database we wish to backup. For example, on my local virtual machine, I have the ORCL plug-able database. So I'll type, "sqlplus system/oracle@localhost: - specify the listener port number 1-5-2-1 in my case - /orcl. This connects me to the ORCL plug-able database. Remember to change the plug-able database name to what is appropriate in your own local Oracle environment, in case you are not using the same virtual machine that I'm using. The first step in order to perform user managed backups of our data files would be to obtain the least of all the data files that are part of this plug-able database. We can easily do that by running a query against [mumbles] dollar sign data file view. You can find the query included in your exercise file. So let's copy the command, and paste it to our sequel plus window. Pressing enter, we'll see the least of all of the data files which are part of this plug-able database. Before you can initiate a user managed backup of these data files, you'll first have to set the Oracle database into backup mode by running the "alter database begin backup" command. We will now either need to manually copy all of these data files to a safe location, that will be used as our backup destination, or have our storage administrators take a storage snapshot, or a volume snapshot, or a disc copy of the disc that Oracle is using to store these data files. As mentioned earlier, because we cannot assume students watching this course have will access to such high-end storage devices, we will now need to manually copy all of these data files which are the data files for this plug-able database, to a safe location that will be used as our backup destination. This can be done by either exiting Sequel Plus, and running Linux or operating system copy commands, or in case your Oracle database is connected to an enterprise grade storage that provides snapshots, or disc cloning capabilities, this will be the time you will tell your Storage Administrator to snapshot the volume or disc that your Oracle database is using. And as I mentioned earlier, because we cannot assume students watching this course have access to such high end storage devices, we won't actually be taking a backup at this point, but in the real production Oracle environment, this is the point where your Storage Administrators would have initiated a storage copy, disc snapshot, or volume clone of your Oracle discs. After the clone, copy, or snapshot is done, you'll need to exit the backup mode by running "alter database end backup" command. The "alter database begin backup" and "alter database end backup" commands can also be done on a paired table space level. You will need to perform this process for each plug-able database you wish to backup, as well as for the root container itself. The seed plug-able database will also need to be backed up, but because it's read only, you don't need to run the "begin backup" and "end backup" commands before you copy its data files.

Contents