NexentaStor is often used to provide database storage for Oracle, MySQL, Microsoft SQL and other database servers. Based on a popular request, we have added NexentaStor plugins that extend the appliance's capability to take consistent database snapshots. The latter must include an extra step of "quiescing a database": that is, flushing all in-progress transactions, so that the resulting ZFS snapshot is internally consistent and can be used to backup the database, rollback the database, etc.
There are two fundamental ways to implement consistent database snapshotting:
The agent-less approach implies that the entire logic to quiesce a database and take a ZFS snapshot is executed on the NexentaStor appliance. Respectively, agent-based approach requires an agent to be installed and run on the Database Server itself. Each approach has its own tradeoffs. One particular tradeoff is related to the fact that quiescing a database is always done is a database-specific way, and it is not possible (or at least very difficult) to create a NexentaStor plugin that would work with all databases.
Starting with the version 2.2, NexentaStor adds two related capabilities:
Rest of this article introduces these two NexentaStor extensions in greater detail.
You can backup Oracle database directly from Nexenta Management Console, without shutting down the database. The operation can be done on-the-fly, with existing Oracle clients (if any) executing in parallel and NOT losing their connections to the database.
To perform this operation, a given Oracle database is temporarily and for a very short time get suspended. Note that the operation of creating ZFS snapshot is almost instantaneous. That is why the Oracle clients will not lose their connections during the entire transaction, and may not even notice the slowdown.
(a) First, install the plugin:
nmc$ setup plugin install oracle-backup
You can use NMC 'show plugin' command, to show already installed plugins. You can also use Nexenta Management View UI to administer all available plugins, as per F.A.Q. article "What is NexentaStor plugin".
(b) Next, put database in the backup state:
nmc$ setup db oracle begin-backup
You will be prompted to specify location of the Oracle server
(c) Now make ZFS snapshot, by using any available NexentaStor client interface or API. One of the many possible ways to take snapshot would be NMC 'create snapshot' command.
(d) and finally, return the database to its normal operational state:
nmc$ setup db oracle end-backup
For a quick help, use NMC -h option that is universally provided to display embedded manual pages and user guide:
nmc$ setup db oracle -h
Note that oracle-backup extension is open sourced: the entire source of the plugin is available at http://www.nexentastor.org (lookup "Oracle Backup Client" under Projects; the sources are under Repository).
This source code can be used both to enhance or customize the existing functionality and to extend this plugin to "cover" other database engines.
The utility to take ZFS snapshots from any remote system is open source and is currently part of the NexentaStor SDK. It exists in two forms: a Perl script and as a C code that can be compiled on any platform. In both cases the functionality is exactly the same: use NexentaStor API (SA-API) to create ZFS snapshot.
To get started with remsnap Perl script, run:
# remsnap.pl --help
For the C program, run:
# remsnap --help
This will provide quick usage guide. For further instructions and details, please see README.remsnap provided along with the remsnap source code.