Logical Backup - ORACLE-HELP (2024)

What is a logical backup?

Logical backups are backups in which the export utility (for example Exp) uses SQL to read database data and then export it into a binary file at the operating system level. You can then import the data back into a database using the import utility (Imp).The Oracle Export Utility can create a file that contains all the objects in a particular schema. The file that is created can then be imported to the same schema to recover from a failure or to a different instance or schema for archiving purposes.

Advantages of a logical backup are mention below:-

  • You should make a logical backup before you upgrade to a new version of DB2, Oracle, SQL Server, or Rational RequisitePro. Prior to an upgrade, a logical backup will provide the latest data in the event of a failure. Oracle may require a logical backup if the newer database format is not compatible with the older database format.
  • In Oracle, logical backups can be used to detect block corruptions. If a corrupt block is detected during an export, the export will fail. The corrupt blocks must be repaired before a successful export can be obtained.
  • Logical backups can be used to provide a test or development copy of your Rational RequisitePro projects. The test or development copy can be used to test a new release of Rational RequisitePro or to train new users.
  • In Oracle, logical backups can be used to in conjunction with COALESCE to defragment extents.
  • Logical backups can be used to significantly alter your database structure such as moving the Oracle schema for Rational RequisitePro from one Oracle tablespace to another or using a different Oracle schema name. It can also be used to move Rational RequisitePro data to a different database in SQL Server.
  • Logical backups are very useful when changing database servers.
  • Move data between different hardware and operating- system environments.
  • We can move data from one owner to another.
  • It canmove data from one tablespace or schema to another.

How do we can take logical backup in oracle?

Data Pump is often described as an upgraded version of the old exp/imp utilities. The depiction in inaccurate; it’s a bit like calling a modern smartphone a replacement for an old rotary-dial landline. Although the old utilities are dependable and work well. Data Pump encompasses that functionality and while adding completely new dimensions to how data can be lifted and move between environments.

Data Pump Architecture

Data Pump consists of the following components:

  • expdp (Data Pump export utility)
  • impdp(Data Pump import utility)
  • DBMS_DATAPUMP PL/SQL package(Data Pump application interface [API])
  • DBMS_METADATA PL/SQL package (Data Pump Metadata API)

The expdp and impdp utilities the DBMS_DATAPUMP and DBMS_METADATA built-in PL/SQL packages when exporting and importing data and metadata. The DBMS_DATAPUMP package moves entire databases or subsets of data between database environments. The DBMS_METADATA package exports and imports information about database objects;

Modes of Data Pump to export/import are mention below:-

  • Entire database
  • Schema level
  • Table level
  • Tablespace level
  • Transportable tablespace level

Entire database ( Data Pump Export/Import)

A full export is initiated with the FULL parameter set to Y and must be done with a user that has DBA privileges or that has the DATAPUMP_EXP_FULL_DATABASE role granted to it.

An example of Export:-

$ expdp mv_maint/foo directory=dp_dir dumpfile=full.dmp logfile=full.log full=y

An example of Import:-

$ impdp mv_maint/foo directory=dp_dir dumpfile=full.dmp logfile=fullimp.log full=y

Note:-

1) When we use export/import their full database can not be export. The contents of the SYS schema are not exported (there are a few exceptions to this, such as the AUD$ table). Consider what would happen if you could export the contents of the SYS schema from one database and import them into another. The SYS schema contents would overwrite internal data dictionary tables/views and thus corrupt the database. Therefore, DataPump never exports objects owned by SYS.

2) Index data are not exported, but rather, the index DDL that contains that SQL required to recreate the indexes during a subsequent import.

Schema Level(Data Pump Export/Import)

Data Pump starts a schema-level export for the user running the export job. User-level export is frequently used to copy a schema or set of schemas from one environment to another. the following commands starts a schema-level export for the Mv_MAINT user:-

An example of Export:-

$ exdp mv_maint/foo directory=dp_dir dumpfile=mv_maint.dmp logfile=mv_main.log

we can also initiate a schema-level export for users other than the one running the export job with the SCHEMAS parameter.

$ expdp mv_maint/foo directory=dp _dir dumpfile=user.dmp schemas=heera,chaya

An example of Import:-

we can initiate a schema-level import by referencing a dump file that was taken with a schema-level export.

$ imdp mv_maint/foo directory=dp_dir dumpfile=user.dmp

We can also initiate a schema-level import when using a full export dump.fille .

$impdp mv_maint/foo direcory=dp_dir dumpfile=full.dmp schemas=herra, chaya

Note: –When we initiate a schema-level import, there are some details to be aware of:-

  • No tablespace are included in a schema-level export.
  • The import job attempts to recreate any users in the dump file. If a user already exit, an error is thrown, and the import job continues.
  • The import job will reset the users’ passwords, based on the password that was exported.
  • Tables owned by the users will be imported and populated. If a table already exists, you must instruct DataPump on how to handle this with the TABLE_EXISTS_ACTION parameter.

Table Level(Data Pump Export/Import)

At this level, we export at the table level.

An example of Export:-

$ expdp mv_maint/foo directory=dp_dir dumpfile=tab.dmp \

tables=heera.inv, heera.inv_items

An example of Import:-

$impdp mv_maint/foo directory=dp_dir dumpfile=tab.dmp

A table- level import only attempts to import the tables and specified data. if a table already exists an error is thrown, and the import job continues, If a table already exists and contains data, you must specify how you want the export job to handle this.

We can also intiate a table-level import when full-export dump file or a schema-level export.

$ impdp mv_maint/foo directory=dp_dir dumpfile=full.dmp

Tablespace Level(DataPump Export/Import)

A tablespace -level export-imort operates on objects contained within specific tablespaces.

$ expdp mv_maint/foo dierectory=dp_dir dumpfile=tbsp.dmp tablespaces=users

we can intiate a tablespace-level import by specifying an export file that was created with a tablespace-level export.

$ impdp mv_maint/foo directory=dp_dir dumpfile=tbsp.dmp

We can also intiate a tablespace-level import by using a full export, but specifying the TABLESPACES parmeter:

$ impdp mv_maint/foo directory=dp_dir dumpfile=full.dmp tablespaces=users

A tablespace-level import willattempt to create any tables and indexes within the tablespace. The import doesn’t try to recreate the tablespace themselves.

Logical Backup - ORACLE-HELP (2024)

FAQs

How to take logical backup in Oracle? ›

Logical backups contain logical data such as tables and stored procedures. You can use Oracle Data Pump to export logical data to binary files, which you can later import into the database. The Data Pump command-line clients expdp and impdp use the DBMS_DATAPUMP and DBMS_METADATA PL/SQL packages.

What is the difference between logical and physical backup in Oracle? ›

In summary a logical database backup is a copy of the logical information of a database extracted and stored in a binary format. A physical database backup is a copy of the complete database contents , structure, tables and all relevant transactions you need to restore your database.

Which Oracle utility is used for logical backup of database? ›

Physical backups can be supplemented by using the Oracle Data Pump (export/import) utilities to make logical backups of data. Logical backups store information about the schema objects created for a database.

What is the recommended method for backing up your Oracle database? ›

Oracle Recovery Manager (RMAN), a command-line tool, is the method preferred by Oracle for efficiently backing up and recovering your Oracle database. The files protected by the backup and recovery facilities built into RMAN include data files, control files, server parameter files, and archived redo log files.

What are the advantages of logical backup? ›

Logical backups have a few benefits: they are portable and can be restored to different platforms or versions of the database software; they allow selective backup or restoration of specific objects or schemas; and they can be used to transfer data between different database systems or formats.

What is the difference between physical dump and logical dump? ›

Physical database backups are backups of physical files that are used to store and recover databases. Logical database backups are backups of logical files that are retrieved from the database. It contains data files, control files, and archived redo logs.

How to take an Oracle database backup step by step? ›

Setting Export Environment: In SQL developer, Go to Tools-->Preferences-->Expand Database--> Expand Utilities-->Select the Export option (Here you can choose Export Data Format) Set it for 'insert'-->Select Save As 'Single File' to export data into a single file.

What is the command for backup in Oracle? ›

You can use the Web Console or the command-line interface to create a database backup. In the command-line interface, use the command odacli create-backup for a specified Database. Before creating a database backup, you must have a backup policy.

What is logical storage in Oracle database? ›

Oracle Database allocates logical space for all data in the database. The logical units of database space allocation are data blocks, extents, segments, and tablespaces. At a physical level, the data is stored in data files on disk. The data in the data files is stored in operating system blocks.

What is your backup strategy in Oracle? ›

A typical incremental strategy makes level 1 backups at regular intervals such as once each day. During recovery, Oracle Recovery Manager (RMAN) will automatically apply both incremental backups and redo logs as required, to recover the database to the exact point in time desired.

How to take a full database backup in Oracle 19C? ›

Perform a Whole Database Backup
  1. Invoke RMAN and connect to the target database as the SYSBACKUP user. $ rman target sysbackup. Fri Mar 29 00:57:29 2019 Version 18.3. ...
  2. Execute the following command to back up the database files, including the archive redo log files. RMAN> backup database plus archivelog; Click the output.

How many types of backups are there in Oracle? ›

Full backup: Backs up all data contained in the DB system. In some cases, the full backup size is larger than the data volume size due to block volume backups. See Volume Backup Size. Incremental backup: Backs up only the data that was added or changed since the last full or incremental backup.

How to drop logical directory in Oracle? ›

Use the DROP DIRECTORY statement to remove a directory object from the database. To drop a directory, you must have the DROP ANY DIRECTORY system privilege. Note: Do not drop a directory when files in the associated file system are being accessed by PL/SQL or OCI programs.

How to take backup from Oracle database? ›

Perform the following steps to navigate to the list of standalone backups in your compartment.
  1. Open the navigation menu. Select Oracle Database, then select Oracle Base Database.
  2. Under Resources, click Standalone Backups. A list of standalone backups is displayed.

How to take encrypted backup in Oracle? ›

Here's a test scenario of encryption RMAN backup sets on disk:
  1. 1) use Oracle Wallet Manager to store the encryption key. ...
  2. 2) create a wallet used by transparent data encryption. ...
  3. 3) configure RMAN to use encryption. ...
  4. 4) test encryption. ...
  5. 5) restore backup. ...
  6. 6) when there's a standby.

How to take Oracle binaries backup? ›

To Back Up Your Directory Data

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help. Back up your directory data. Note - By default, binary backup commands will run a database recovery on the backup databases.

Top Articles
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 6129

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.