All pages
Powered by GitBook
1 of 8

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Database backup

Preparing Linux to backup Oracle
Changing Oracle database mode
Changing the temporary dump folder
Oracle database backup
MySQL database backup
Microsoft SQL database backup
PostgreSQL database backup
Cover
Cover
Cover
Cover
Cover
Cover
Cover

Changing Oracle database mode

This article describes how to change the Oracle database mode.

Changing the Oracle database mode is crucial for the correct backup execution.


Executing the following operations will temporarily make the Oracle database environment unavailable.

Prerequisites

Before starting the Oracle database backup task, make sure that the database mode is set to ARCHIVELOG. To verify that the mode is configured correctly or to change it, open the command line as the user configured in the backup plan and run the sqlplus tool using the following command:

sqlplus / as sysdba

You can then close this tool using the QUIT; command.


Verifying the settings

To verify that the database mode is correctly set to ARCHIVELOG, run the following command:

SELECT LOG_MODE FROM v$database;
Incorrect database mode example.

If the database mode is set to NOARCHIVELOG, change it to ARCHIVELOG.


You can switch the database mode from NOARCHIVELOG to ARCHIVELOG using the following commands:

Now, verify that the database mode has been changed successfully by running the following command:


Changing the temporary dump folder

This article describes how to change the temporary folder used for database backup dumps.

Database backup involves generating a database dump and then backing up the resulting dump file.


Data to protect

When creating a backup plan, in the Data to protect section, select the folder where database dumps will be stored. You can choose either Select from device or Select path or variable — switch between these options by clicking on the text in the list.

If the specified folder is deleted, you will not be able to select it from the list of available folders on the device — in that case, switch to Select path or variable.


Changing the temporary dump folder

  1. Create a new temporary folder.

  2. Go to the Plans tab and edit the plan you want to change or create a new one.

  3. In the Data to protect section, uncheck the old folder and select the new one (if you're creating a new plan, simply select the newly created temporary folder from the list).

  4. Next, go to Advanced settings, then Backup scripts, and update the script arguments to the new database dump location.

  5. Save the changes.

If you delete the old directory first, you will not be able to deselect the folder in the Select from device section — switch to Select path or variable and remove the old directory.

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
QUIT;
SELECT LOG_MODE FROM v$database;

Changing the database mode

Useful links and items

Oracle database backup

This article describes how to configure the Oracle database environment in Xopero ONE.

In Xopero ONE, you can back up a variety of databases, including MySQL, Microsoft SQL, PostgreSQL, and Oracle.


General information

The Oracle database backup process in Xopero ONE consists of two stages:

  1. Creating a database dump using backup scripts.

  2. Backing up the created dump file.

The first stage is executed through Xopero ONE using the backup scripts feature, while the second stage is performed as a standard file-level backup.

Xopero ONE creates a full database copy using the RMAN tool. It does not interfere with other copies performed by RMAN, but the backup created by Xopero ONE will be visible in RMAN.


The Oracle database environment must operate in ARCHIVELOG mode. For instructions on how to change the database mode, refer to .


1

Log in to XMS, go to the Backup tab (Plans > Backup) and click the + Add plan button in the top toolbar.

2

Select Devices from the platforms list.

3

  1. Add a new user (for example, dbuser) to the Linux operating system by executing the following command:

  1. Add the user to the dba group, which has permission to perform backups:

  1. Finally, configure the system environment variables by following the instructions in .

In the next aside, select Files & folders option and choose one or more devices for the plan to apply to (you can also select the plan to include all activated devices).

4

Define the name of the backup plan.

5

Configure your backup plan according to your needs (more information about the backup plan setup can be found in this article).

6

Go to the Advanced settings section and click Edit to customize additional options.

7

Scroll down to the Backup scripts section and click the Pre-task script toggle to turn it on.

8

Select the script dedicated to backing up the Oracle database environment.

9

Set up the script arguments — it should be entered in the Script arguments field as follows:

ORACLE_SID;dbuser;temp_directory
  1. ORACLE_SID — the database identifier.

  2. dbuser — the name of the user with backup privileges (for example, database_user). This must be a local Linux OS user with permissions to back up the Oracle environment. Instructions for creating this user are provided in the section of this article.

  3. temp_directory — the directory where the Oracle tool will temporarily write backup files. After the backup tasks are complete, these files will be deleted. This directory must also be included in the Data to protect section when creating a .

10

You can enable the two additional options using the checkboxes:

  1. Wait for the script to continue the task — the application will wait until the dump is ready.

  2. Fail the task if the script fails — if the script fails, the system will notify you of the backup error.

11

Double-check your settings and click Save to close the Advanced settings aside.

12

After completing the configuration, click the Save button. The protection plan will then automatically begin protecting your devices and databases according to the schedule you defined.

You can also click Save&Run button to immediately start the backup process, regardless of schedule.

sudo useradd dbuser
sudo usermod -a -G dba dbuser

The backup reflects the database state at the moment the dump creation task finishes, as Xopero ONE attaches the archive logs to ensure data consistency.

Requirements and limitations

Xopero ONE supports Oracle database environments starting from version 19c.

Xopero ONE supports Oracle database backup only on supported Linux operating systems.

Backup configuration

If a file-level backup plan has already been created and is running, you can skip directly to step 6.

Creating a user to back up Oracle

Oracle tools may require additional permissions, such as access to the file system — in that case, you may need to add the user to other groups depending on your system configuration.

this article
this article
Creating a user to back up Oracle
file-level backup plan

MySQL database backup

This article explains how to use backup scripts to create a MySQL database dump and include it in a backup plan.

In Xopero ONE, you can back up a variety of databases, including Oracle, Microsoft SQL, PostgreSQL, and MySQL.


General information

The MySQL database backup process in Xopero ONE consists of two steps:

  1. Creating a database dump using backup scripts.

  2. Backing up the database dump.

The first step is performed through Xopero ONE using the backup scripts feature. The second step is a standard file-level or image-level backup executed directly by Xopero ONE.

By using the mysqldump tool, Xopero ONE supports all MySQL versions that are officially supported by Oracle.


1

Log in to XMS, go to the Backup tab (Plans > Backup) and click the + Add plan button in the top toolbar.

2

Select Devices from the platforms list.

3

Preparing Linux to backup Oracle

This article describes how to prepare a Linux operating system for backing up an Oracle database environment.

Oracle database backup involves generating a database dump using backup scripts and then backing up the resulting dump file.


Linux preparation process

Xopero ONE agent requires the availability of the rman and sqlplus tools. Before starting, ensure that these tools are installed and accessible.

1

Using the Linux command line, log in to the account used for backing up your Oracle database and execute the following commands:

echo 'connect target /; quit' | rman
echo 'SELECT INSTANCE_NAME FROM V$INSTANCE;' | sqlplus / as sysdba
2

If these tools are unavailable (example below) you need to configure the environment variables.

  1. Edit the /home//.bash_profile file and add the following records:

  1. Now, after logging in again, executing the following commands should complete successfully.

3

Once done, your Linux system should now be ready to backup an Oracle environment.

The database_directory specifies the location of the Oracle database.

Example of correctly configured environment variables.
export ORACLE_SID=<database_ID>
export ORACLE_HOME=database_directory
export PATH=$ORACLE_HOME/bin:$PATH
echo 'connect target /; quit' | rman
echo 'SELECT INSTANCE_NAME FROM V$INSTANCE;' | sqlplus / as sysdba

In the next aside, select one of the available options and choose one or more devices for the plan to apply to (you can also select the plan to include all activated devices).

4

Define the name of the backup plan.

5

Configure your backup plan according to your needs (more information about the backup plan setup can be found in File-level backup and Image-level backup articles).

6

Go to the Advanced settings section and click Edit to customize additional options.

7

Scroll down to the Backup scripts section and click the Pre-task script toggle to turn it on.

8

Select one of the scripts dedicated to backing up the MySQL database environment (Windows or Linux).

9

Type your database username into the Database user field.

It is strongly recommended to create a dedicated user specifically for database backup operations.

10

Choose the user password by opening the Password Manager, where you can either add a new password or select an existing one.

11

Set up the script arguments — it should be entered in the Script arguments field as follows:

Windows
database output_dir mysqldump_dir port
Linux
database output_dir port
  1. database — the name of the database. To include multiple databases in one backup plan, enter their names in the following format: [database1 database2 database3]. To back up all databases, use the --all parameter instead of specifying a database name.

  2. output_dir — the directory where the database dump will be saved. This directory must also be selected in the Data to protect section when creating a backup plan.

  3. mysqldump_dir — the path to the mysqldump utility.

  4. port — an optional parameter. Enter the port number only if a non-standard port is used. The default port is 3306.

For example, to back up all databases from the MySQL environment, use the following arguments:

If you want to back up only selected databases from the MySQL environment (for example, two out of seven), use the following arguments:

12

Enable the two additional options using the checkboxes:

  1. Wait for the script to continue the task — the application will wait until the dump is ready.

  2. Fail the task if the script fails — if the script fails, the system will notify you of the backup error.

13

Double-check your settings and click Save to close the Advanced settings aside.

14

After completing the configuration, click the Save button. The protection plan will then automatically begin protecting your devices and databases according to the schedule you defined.

You can also click Save&Run button to immediately start the backup process, regardless of schedule.

15

That’s all you need to do to create the database dump — this file should now be included in the Data to protect section if you are performing a file-level backup (to back up only the database). Alternatively, you can run an image-level backup to protect the entire drive.

Backup configuration

If a file-level backup plan has already been created and is running, you can skip directly to step 6.

Useful links and items

Microsoft SQL database backup

This article explains how to configure the Microsoft SQL database environment using Xopero ONE.

In Xopero ONE, you can back up a variety of databases, including Oracle, MySQL, PostgreSQL, and Microsoft SQL.


General information

The Microsoft SQL database backup process in Xopero ONE consists of two steps:

  1. Creating a database dump using backup scripts.

  2. Backing up the database dump.

The first step is performed through Xopero ONE using the backup scripts feature. The second step is a standard file-level or image-level backup executed directly by Xopero ONE.


1

Log in to XMS, go to the Backup tab (Plans > Backup) and click the + Add plan button in the top toolbar.

2

Select Devices from the platforms list.

3

In the next aside, select one of the available options and choose one or more devices for the plan to apply to (you can also select the plan to include all activated devices).

4

Define the name of the backup plan.

5

Configure your backup plan according to your needs (more information about the backup plan setup can be found in File-level backup and Image-level backup articles).

6

Go to the Advanced settings section and click Edit to customize additional options.

7

Scroll down to the Backup scripts section and click the Pre-task script toggle to turn it on.

8

Select the script dedicated to backing up the Microsoft SQL database environment (Windows).

9

Type your database username into the Database user field.

It is strongly recommended to create a dedicated user specifically for database backup operations.

10

Choose the user password by opening the Password Manager, where you can either add a new password or select an existing one.

The user entered in the Database user field must use SQL Server authentication.

11

Set up the script arguments — it should be entered in the Script arguments field as follows:

copy_type server_name "output_dir" database1 database2 ... databaseN
  1. copy_type — defines the type of copy to be performed. You can choose one of three options: full_only, full_diff, or copy_only:

    1. full_only — always performs a full copy.

    2. full_diff — performs differential copies with periodic full copies.

    3. copy_only — creates a full database copy without affecting the regular backup cycle.

  1. server_name — the name of the Microsoft SQL server along with its instance.

  2. output_dir — the directory where database dumps will be saved. This directory must also be selected as the location to back up.

  3. database1 database2 (...) — names of databases to be backed up, separated by spaces. You can leave this parameter empty — if no database is specified,

12

You can enable the two additional options using the checkboxes:

  1. Wait for the script to continue the task — the application will wait until the dump is ready.

  2. Fail the task if the script fails — if the script fails, the system will notify you of the backup error.

13

Double-check your settings and click Save to close the Advanced settings aside.

14

After completing the configuration, click the Save button. The protection plan will then automatically begin protecting your devices and databases according to the schedule you defined.

You can also click Save&Run button to immediately start the backup process, regardless of schedule.

15

That’s all you need to do to create the database dump — this file should now be included in the Data to protect section if you are performing a file-level backup (to back up only the database). Alternatively, you can run an image-level backup to protect the entire drive.

Backup configuration

If a file-level backup plan has already been created and is running, you can skip directly to step 6.

--all C:\MySQLBackup\ "C:\Program Files\MySQL\MySQL Server 8.0\bin"
database1 database2 C:\MySQLBackup\ "C:\Program Files\MySQL\MySQL Server 8.0\bin"

When using the mysqldump utility on Linux, connections to the host named 'localhost' are established through a socket file. If you do not specify a port in the configuration, the tool will connect correctly even when using a non-standard port. However, if you connect via 127.0.0.1, specifying a non-standard port is required.

Important! The mysqldump tool is part of the MySQL server and should be installed by default. If, for any reason, it is not available, you can download the MySQL Utilities package, which includes the mysqldump tool.

PostgreSQL database backup

This article explains how to configure the PostgreSQL database environment in Xopero ONE.


To maintain data consistency, Xopero recommends using a dedicated backup type: a file-based backup with a pre-backup script for the PostgreSQL database.

Database backup begins with a script that requests the database server to create a dump in a temporary directory. Once the dump is complete, Xopero ONE backs up the generated dump file.

Xopero ONE uses the pg_dump utility to back up PostgreSQL databases.


1

Xopero ONE
will automatically back up all databases from the server specified in the database access parameters.

If your operating system runs other backup software or schedulers that perform additional database dumps, use full_only dumps. Using other types (full_diff or copy_only) may cause issues when other processes on the system also create database dumps.

Full copies are executed according to the defined schedule. Differential copies are performed whenever differential or incremental backups are scheduled. If a file containing a differential copy is deleted, the next differential copy will be created based on the most recent full copy.

Example database script arguments
full_diff WINSRV-2019\SQLEXPRESS "C:\MsSQLDumps" database1 database2
Log in to XMS, go to the Backup tab (Plans > Backup) and click the + Add plan button in the top toolbar.
2

Select Devices from the platforms list.

3

In the next aside, select one of the available options and choose one or more devices for the plan to apply to (you can also select the plan to include all activated devices).

4

Define the name of the backup plan.

5

Configure your backup plan according to your needs (more information about the backup plan setup can be found in File-level backup and Image-level backup articles).

6

Go to the Advanced settings section and click Edit to customize additional options.

7

Scroll down to the Backup scripts section and click the Pre-task script toggle to turn it on.

8

Select the script dedicated to backing up the PostgreSQL database environment.

9

Type your database username into the Database user field.

It is strongly recommended to create a dedicated user specifically for database backup operations.

10

Choose the user password by opening the Password Manager, where you can either add a new password or select an existing one.

11

Set up the script arguments — it should be entered in the Script arguments field as follows:

database output_dir "pg_dump_dir" port_number
  1. database — the name of the database to back up. A backup plan can target a single database or all databases. To back up all databases, use the --all parameter instead of specifying a database name.

  2. output_dir — the directory where the database dump will be created; this is also the folder that Xopero ONE will back up.

  3. pg_dump_dir — the path to the pg_dump utility. This is required only for PostgreSQL databases hosted on Windows.

  4. port_number — required only if your PostgreSQL server uses a non-standard port (other than 5432).

12

You can enable the two additional options using the checkboxes:

  1. Wait for the script to continue the task — the application will wait until the dump is ready.

  2. Fail the task if the script fails — if the script fails, the system will notify you of the backup error.

13

Double-check your settings and click Save to close the Advanced settings aside.

14

After completing the configuration, click the Save button. The protection plan will then automatically begin protecting your devices and databases according to the schedule you defined.


In Xopero ONE, you can back up a variety of databases, including Oracle, MySQL, Microsoft SQL, and PostgreSQL.

Prerequisites

The pre-backup script can also be used to generate a database dump before performing a disk-level backup.

Backup configuration

Useful links and items

File-level backup recovery
File-level backup
Restoring PostgreSQL database

Specifying the port is optional. If no port is provided, the default port (5432) will be used. Use the port_number parameter only if your PostgreSQL server uses a non-standard port.

Database 2 Day DBAdocs.oracle.com
Logo
MySQL :: Download MySQL Utilities (Archived Versions)downloads.mysql.com