Cloud Snapshot Manager provides the ability to create application consistent snapshots of Oracle database running on Linux instances using the Cloud Snapshot Manager Custom scripts feature.
To run an Oracle backup, you need to set the database to backup mode before the snapshot is created and exit the backup mode after the snapshot is created. To achieve that, you need to create two SSM documents, one for the script to set the database to backup mode, and another to exit the backup mode.
It is recommended to consult with your database administrator prior to running any of the sample scripts provided in this document.
To create SSM documents from the AWS management console, using the Systems Manager service, navigate to the Documents page, and click Create command or session as shown in the following figure. The SSM documents should be created in every region that you want to use them.
Then create the pre-backup and the post-backup SSM documents, as shown in the following figure:
Use the Script samples for the JSON body and click on the Create document button:
Do the same for the post-backup script. You’ll be able to see all your SSM owned documents:
To create a snapshot and run the pre and the post snapshot scripts, select the instance(s) in the Resources page or configure it in a Protection Plan. Select the Application Consistency checkbox, and then select the Execute Custom Scripts option, as shown in the following figure:
The names in the fields must be the names of the SSM documents that you created in your AWS account, and the SSM documents need to be in the same region that the instances are running on.
Cloud Snapshot manager runs the pre-script SSM document before creating the snapshot of the instance and the post-script SSM document after the snapshot is created. Snapshots are created regardless of the document execution success or failure.
It is important to ensure that you meet the prerequisites to run the SSM documents (see Permissions of the CSM IAM User/Role to run custom scripts).
The following SSM documents are examples of pre and post backup scripts and might not work in all environments. In case the script in the SSM document doesn’t work, you’ll need to modify the document to fit your environment.
The following is an SSM document example that uses SQL Plus to set the Oracle database to backup mode before a snapshot is created:
The following is an SSM document example that uses SQL Plus to exit the Oracle database backup mode after a snapshot is created: