In this blog I will going to show how to take logical and physical backup in hotline or offline.

In this blog I will going to show how to take logical and physical backup in hotline or offline.

Logical Backup : expdp & impdp

:

Start to create Logical Backup

First need to create a directory

So here I have created the directory name

[oracle@qp01 app]$ mkdir today_backup

After that login to sqlplus and create directory path with same name

SQL> create directory today_backup as ‘/u01/app/today_backup’;

After that we can check the directory list appear or not for conformation

SQL> desc dba_directories;

We can check here created directory appearing

SQL> select DIRECTORY_NAME,DIRECTORY_PATH from dba_directories;

userid=’/ as sysdba’  – (admin)

tables=querypanel_india.india (username & tables name)

directory=today_backup (backup directory name)

dumpfile=todat_querypanel_backup.dmp

logfile=todat_querypanel_backup.log

[oracle@qp01 ~]$ cat todat_querypanel_backup.par

Expdp cmd for exporting data

[oracle@qp01 ~]$ expdp parfile=todat_querypanel_backup.par

So I am going to delete the particular database table which I have been took the backup

Connect with sqlplus

Drop the particular database

SQL> drop table querypanel_india.india;

So here we can check user tables has been deleted

SQL> select * from querypanel_india.india;

Now exit the sqlplus for importing the data which we have deleted

So we can check here data successfully imported 

Now we have to check the imported user table

Need to login with sqlplus or sql developer

So here data imported

SQL> select * from querypanel_india.india;

Now here Physical Level Backup (RMAN)

First need to set database in archivelog

Whenever we will take the Logical backup need to start with mount status

SQL> startup mount 

If we will face any issue during nor-archivelog to archivelog we can user

SQL> startup mount force;

SQL> select name,log_mode from v$database;

Now this is set as noarchivelog we will update with archivelog

SQL> alter database archivelog;

if we are facing the issue to noarchive to archive will will used to open the database from mount mode

SQL> alter database open;

SQL>  select INSTANCE_NAME,HOST_NAME,STATUS from v$instance;

Shutdown the database

SQL> shutdown immediate;

Again start the database

SQL> startup mount;

SQL> select INSTANCE_NAME,STATUS from v$instance;

So now need to open the database

SQL> select INSTANCE_NAME,STATUS from v$instance;

SQL> select name,log_mode from v$database;

In app directory I have created directory

[oracle@qp01 app]$ mkdir physical_backup_today

After that connect with sqlplus

Allocate the file destination size

SQL>alter system set db_recovery_file_dest_size=50G scope=both; (here we don’t use sid)

SQL> alter system set db_recovery_file_dest_size=50G scope=both sid=’*’;

SQL> alter system set db_recovery_file_dest = ‘/u01/app/physical_backup_today’ scope = both;

SQL> alter system switch logfile;

RMAN  connection command

[oracle@qp01 ~]$ rman target /

Show all used for recovery

RMAN> show all;

RMAN> backup database

it will take overall backup

After that we can check the physical database backup

After exit RMAN

RMAN> exit

Recovery Manager complete.

[oracle@qp01 ~]$ cd /u01/app/

[oracle@qp01 app]$ ls

backupdir  oracle  oraInventory  physical_backup_today  querypanel_india_bck.par  todat_querypanel_backup.par  today_backup

[oracle@qp01 app]$ cd physical_backup_today

[oracle@qp01 physical_backup_today]$ ls

QUERYPANEL01

[oracle@qp01 physical_backup_today]$ cd QUERYPANEL01

[oracle@qp01 QUERYPANEL01]$ ls

A7FC3FBD1FD22EF2E053C400A8C04388  A7FC5C4CEE79395AE053C400A8C03117  archivelog  autobackup  backupset

[oracle@qp01 QUERYPANEL01]$

One thought on “In this blog I will going to show how to take logical and physical backup in hotline or offline.

  • August 20, 2022 at 5:24 am
    Permalink

    Hey! I know this is kind of off topic but I was wondering which blog platform are you using for this site? I’m getting fed up of WordPress because I’ve had issues with hackers and I’m looking at alternatives for another platform. I would be great if you could point me in the direction of a good platform.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *