1
votes

I want to take Oracle database backup using RMAN directly into the Google Cloud Storage

I am unable to find the plugin to use to take the RMAN backups into Cloud Storage. We have a plugin for Amazon S3 and am looking for one such related to Google Cloud Storage.

2

2 Answers

0
votes

I don't believe there's an official way of doing this. Although I did file a Feature Request for the Cloud Storage engineering team to look into that you can find here.

I recommend you to star the Feature Request, for easy visibility and access, allowing you to view its status updates. The Cloud Storage team might ask questions there too.

0
votes

You can use gcsfuse to mount GCS bucket as file systems on your machine and use RMAN to create backups there.

You can find more information about gcsfuse on its github page. Here are the basic steps to mount a bucket and run RMAN:

  1. Create a bucket oracle_bucket. Check that it doesn't have a retention policy defined on it (it looks like gcsfuse has some issues with retention policies).

Please have a look at mounting.md that describes credentials for GCS. For example, I created a service account with Storage Admin role and created a JSON key for it.

  1. Next, set up credentials for gcsfuse on your machine. In my case, I set GOOGLE_APPLICATION_CREDENTIALS to the path to JSON key from step 1. Run:
sudo su - oracle  
mkdir ./mnt_bucket  
gcsfuse --dir-mode 755 --file-mode 777 --implicit-dirs --debug_fuse oracle_bucket ./mnt_bucket

From gcsfuse docs:

Important: You should run gcsfuse as the user who will be using the file system, not as root. Do not use sudo.

  1. Configure RMAN to create a backup in mnt_bucket. For example:
configure controlfile autobackup format for device type disk to '/home/oracle/mnt_bucket/%F'; 
configure channel device type disk format '/home/oracle/mnt_bucket/%U';
  1. After you run backup database you'll see a backup files created in your GCS bucket.