Now that we've done the initial backup of our database,
we'll go and populate it with some data.
At the shell prompt, type "sqlplus".
For the user name, type "system".
Enter the password you set during the initial Oracle setup for the system user.
You are now connected to your database.
Let's go ahead and create a table called hello.
Now we'll insert some data into our table.
We will save our data by typing "commit;" and hitting enter.
Type "exit" to leave the sqlplus client, and you will be returned to the shell prompt.
Now that we have a table, and some data in populating that table,
we're going to create some trouble.
Type "cd /u01/oradata/testdb"
to enter the directory where our important database files are kept.
Let's start deleting some files.
Type "rm users01.dbf".
While this will doubtless cause some problems, we want to really break things,
so we're also going to remove the file that contains
the data dictionary tables for the entire database.
Type "rm system01.dbf".
We've created some data loss,
so let's go do some simple database operations to see what happens.
At the shell prompt, type "sqlplus", and login as the system user.
We should still be able to access the data we created earlier.
Let's go ahead and do a select against that table.
That worked, but what happens when we try to create a new table?
Uh oh. Now we have a problem.
It can't find the system01.dbf file, which is unsurprising
considering that we just deleted it.
Type "exit" to be returned to the shell prompt.
Don't panic; we can do a restore.
Now, when using a remote disaster recovery site to store your tape backups,
you would have to deal with the hassle of contacting someone
at that remote location to have the tape loaded or shipped to you.
All the time you spend waiting for that process to complete,
your database is down.
But since we're using the OSB Cloud Module to store our backups on Amazon S3,
we can start the restore process ourselves immediately.
At the shell prompt, type "rman target /".
We'll need to remount our database with restricted access
so we can perform administrative commands.
Type "startup force mount;".
Now we can start the restore.
Type "restore database;".
There are no options or special commands to use
to tell your database to restore from Amazon S3.
Since we configured the OSB Cloud module earlier, it's going to use S3 automatically.
The restore has completed, but we had written data since our last backup.
Type "recover database;", and RMAN will recover that data from the redo logs.
The database has been restored and recovered,
so we'll open it back up for normal use again.
Type "alter database open;".
Type "exit" to leave RMAN and return to the shell prompt.
Now we'll make sure all our data is there,
and that the database is back into a working state.
Type "sqlplus" and log in as the system user.
We'll run a select against the first table that we created,
and you'll see that the data we entered earlier was recovered successfully.
Let's try to create another table again.
The database will confirm that the table was successfully created.
That's it.
You now know how easy it us to use the AWS Cloud to store your Oracle database backups.
In this set of videos, you've setup an Oracle database on EC2,
configured the OSB Cloud Module,
and performed a backup and restore from Amazon S3 using Oracle RMAN.
While we have used EC2 for our Oracle database,
you also have the option to use a database in your own datacenter.
Also, we set up Oracle Database Standard Edition.
If you use Oracle Database Enterprise Edition,
you can enable compression as well as encryption
during the backup for added security.
For more information on using the AWS Cloud to archive your data,
go to aws.amazon.com/archive.