Oracle

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDatabasesOracle

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old March 26th, 2012, 02:43 PM
nitrofuture nitrofuture is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2012
Posts: 1 nitrofuture User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 14 sec
Reputation Power: 0
How to take a Hot backup of Oracle database

1: put the db in archive log mode

2: set the db_sid to correct one

3: login to sqlplus

4: verify the name of the db that you are connected to

select name from v$database;

5: check if the db is in archive log made

select log_mode from v$database;

if not in archive log mode


another command to check

archive log list;

6: find where on disk oracle writes archive log when it is in archive log mode

sql> show parameter log_archive_dest_1;

if the value is found to be 0, that means no values will be recorded, so we need to change it

sql> alter system set log_archive_dest_1='LOCATION=c:\database\oradata\f inance\archived_logs\'
scope=spfile;

7: shutdown immediate; < this is done just to prepare the db for hot backups >

8: startup the db in mount mode

startup mount;

( 3 startup types : nomount - just starts the instance, mount - locates the control files and open up according to the values, open - finds the datafiles from the control files and opens up the db )


9: put the db in archive log mode

alter database archivelog;

10: open the database

alter database open;

11: check the status of the db

select log_mode from v$database;

SQL> archive log list;

12: create a directory for archived log

check if its empty, if empty we need to switch

sql> alter system archive log current;

run it 5 times < need to put / and enter > , then check the archive log dir , we will find files


13: make a table in the database and insert data in it

create table employees (fname varchar(2));

check the table

desc employees;

insert values

insert into employees values ('Mica');

14: tablespace must be in hot backup mode

check the status

select * from v$backup;

if found not active, then we need to change

we cannot put the db in hot backup mode, unless it is archive log mode

change to hot backup mode

alter database begin backup;

check the status

select * from v$backup;

15: now we can only COPY DBF FILES

copy *dbf <distination location>

16: need to take the db out to hot backup mode

alter database end backup;

17: need to make another archive log switch

alter system archive log current;

18: need to copy control files now, need to do a binary bckup

alter database backup controlfile to '<location>\controlbackup';

19: insert more values to the table

insert into employess values ('NASH')

COMMIT;

make another archive log switch : alter system archive log current;

do the same process for more values

20 : backup all the archive logs to a new location

21: shutdown the db and simulate a hw error, delete all the files from the database folder

22: try to start the sqlplus and db ::: error

23: copy all the backups to the db dir

need to copy the control files, rename the binary backup of the control file and make the copies as needed

24: try to mount the db, error < must use reset logs or noreset logs >

25: need to do a recovering of the database

shutdown

restore the archive logs

startup mount;

recover database until cancel using backup controlfile;

it will ask for a log file :

yes for recovery

cancel for cancelling recovery

26: check status: open the database in readonly

alter database open read only;

check the tables to see the data


shutdown immediate

shartup mount;

recover again : recover database until cancel using backup controlfile;

if oracle is asking for a log that do nto exist , all we have to do is type cancel

27: open the database

alter database open;

need to do reset logs

alter database open resetlogs;

28: check the db that you are connected, check the tables

thanks and regards

VKN
site admin
nitrofuture.com

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesOracle > How to take a Hot backup of Oracle database


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap