Saturday, June 7, 2008

User Managed Backups

USER MANAGED BACKUPS

SQL>select name from v$controlfile;

SQL>select member from V$logfile;

SQL>select name from v$datafile;

SQL>shu immediate;

Now copy all the above files at a backup location manually using OS Command.

SQL>startup ;

  • WHOLE DATABASE ONLINE / HOT / INCONSISTENT BACKUP

Database must be in archive log mode

SQL> alter database begin backup;

Copy all datafiles to backup location

SQL> alter database end backup;

Switch logfile

SQL> alter system switch logfile;

Create controlfile backup

SQL> alter database backup controlfile to 'e:\backup\control01.ctl';

Create spfile backup

SQL> create pfile='e:\backup\init.ora' from spfile;

Now user managed hot backup is complete.


  • ONLINE TABLESPACE BACKUP

Database must be in archive log mode

SQL> alter tablespace example begin backup;

Copy the datafile of the tablespace example to a backup location

To check the status of the file which are left active in backup mode

SQL>select file#, status from v$backup;

SQL>alter tablespace example end backup;

  • METHODS OF TAKING CONTROL FILE BACKUP

Two ways with which one you can create a binary file and with other a text file.

For Binary file creation

SQL>alter database backup controlfile to ‘D:\backup\ctrl.ctl’;

For Text File

SQL>alter database backup controlfile to trace;

( It will be created in UDUMP folder )

7 comments:

Samira K. said...

Hi Amjadali
It is a nice article, specially so as in one post it gives all the backups of Usermanaged , very detailed and very easy to understand....
Looking forward for more article...
Regards,
Samira K.

Samira K. said...
This comment has been removed by a blog administrator.
Samira K. said...

Hi,
Forget to mention, your baby ( in a photo ) is very cute and beautiful.....
Samira K.

Unknown said...

hi amjadali

Nice to get allthe usermanaged types of backup in one article...

Thanks
Raj Iyer

Amita Makijani said...

Hi Amjadalli,

First time today I am on your blog, its very refreshing and still in detail I totally agree with samiras comment....
Lookin forward for your more post and cooperaion... Its very helpful....
Amita Makijani

Anonymous said...

Assalamwalikum,
Amjad Jiju felt very proud to see your web page with cute little babli (saher).My allah fullfill all your wishes and desires you wish to Ameeennn.

Zamie said...

Hi Sir,
Its a great blog. thanks for that. keep up the good work.
You daughter is more sweet n smart than u from what we can make out of the picture.

from,
Atif and Zameer