19. Logical backup - sayanbhattacharya1234/Oracle_DBA GitHub Wiki

Logical Backup : These backup means when we are taking backup of a full database , it contains logical data such as single tables backup , individual schemas backup, single row backup , single tablespace backup . This backup is converted into dump file but inside that it will be sql statements written in binary , stored in sql format.

Schema : When we create an user this is user. and when this user create a table or any object then it is known as schema.

The tool is used for logical backup is expdp [ export datapromt ] .

for restore we used impdp [ import datapromt ].

Step 1 > set env of a server db , and satrtup.

for expdp we need to create a directory here created dump file , but in physical backup - bkp file created in rman.

set a location where backup is restore or copy, we are create a physical path [dir] $> mkdir /u01/exp_backup.

similarly we have to create a logical directory , in SQL> create directory expbackup as '/u01/exp_backup';

In this logical directory , i have to give permission to read and write to this directory, say user system .

alter user system identiifed by oracle ;

giving permissions > grant read,write on directory expbackup to system ;

to see other logical directories what we created , what logical directories have , there is a view to check what all directories we have

[ desc dba_directories ]

both backups are used physical and logical as per the choice.

I want to take full logical backup of database. and check the files are stored physically or not

expdp system/oracle directory=expbackup dumpfile=full_backup.dmp logfile=exp.log full=y parallel=4 .

I can take backup of a single USER or SCHEMA , which can not take backup in RMAN

expdp system/oracle directory=expbackup dumpfile=schema_backup.dmp logfile=exp1.log schemas=hr.

I can take backup of a single table

expdp system/oracle directory=expbackup dumpfile=table_backup.dmp logfile=exp2.log tables=hr.employees

I can take backup of a multiple tables including data.

expdp system/oracle directory=expbackup dumpfile=multi_table_backup.dmp logfile=exp3.log tables=hr.employees,hr.departments

I can take backup of a tablespace

expdp system/oracle directory=expbackup dumpfile=tablespace_backup.dmp logfile=exp4.log tablespaces=sales

i create a sales tablespace now i want backup this tablespace