Skip to Main Content
  • Questions
  • Purposes of ALTER SYSTEM SUSPEND/RESUME

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question.

Asked: June 29, 2000 - 4:17 pm UTC

Last updated: October 15, 2007 - 12:35 pm UTC

Version: 8.1.5

Viewed 1000+ times

You Asked

What are the purposes of ALTER SYSTEM SUSPEND/RESUME ?
The 8.1.5 doc says "uspends all I/O (datafile, control file, and file header) as well as queries, in all
instances, enabling you to make copies of the database without having to handle
ongoing transactions."
When ALTER SYSTEM SUSPEND is issued and I alter tablespace users begin backup,
the begin backup statement waits in sever manager.
It suspends the begin backup statement as well.
It seems that V$instance and V$database are the only views that queries can be run against.
Even V$thread , v$backup are not allowed.
So how can it speed up the backup ?

Thanks


and Tom said...

It is intended to be used in extremely special cases. One case where it might come in handy is when you are using a triple mirrored disk array from EMC for example. You put your tablespaces into backup mode, alter system suspend IO -- use EMC software to "break" the mirrors into a pair and one singleton. You then resume IO on the mirrored pairs and the database continues on. You then backup the singleton set of disks at your leisure. Later, you "resilver" the 3'rd disk back into the mirror and away you go.

Very very specialized command for a particular implementation. 99.999% of the people out there will never use it.

<quote 8i backup and recovery guide>

Splitting Mirrors in Suspend Mode

Sometimes systems allow you to mirror a disk or file, i.e., maintain an exact duplicate of the primary data in another location, and then split the mirror. Splitting the mirror involves separating the copies so that you can use them independently of one another.

Some RAID devices benefit from suspending writes while the split operation is occurring; your RAID vendor can advise you on whether your system would benefit from this feature.

The basic steps for using SUSPEND and RESUME are as follows:

Place the database tablespaces in hot backup mode using the ALTER TABLESPACE BEGIN BACKUP statement. For example, to place tablespace USERS in hot backup mode enter:

ALTER TABLESPACE users BEGIN BACKUP;



If your mirror system has problems with splitting a mirror while disk writes are occurring, issue the following:

ALTER SYSTEM SUSPEND;



Split your mirrors at the O/S or hardware level.

Issue the following:

ALTER SYSTEM RESUME;



Take the specified tablespaces out of hot backup mode. For example, to take tablespace USERS out of hot backup mode enter:

ALTER TABLESPACE users END BACKUP;



Copy the control file and archive the online redo logs as usual for a backup.
</quote>

Rating

  (11 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Nystel, December 15, 2002 - 11:11 pm UTC

When the database is not having any activity, will Oracle processes be still performing I/O's against the database? If yes then what process and what activity is it performing against the files?


Regards


Tom Kyte
December 16, 2002 - 7:38 am UTC

DBWR -- flushing blocks.
LGWR -- flushing redo buffers (every 3 seconds)
CKPT -- updating datafile headers

constrol files getting written to every 3 seconds at least...

yes, a database with no active sessions could be doing tons and tons of IO (writes).

what is there to flush?

GUY, December 16, 2002 - 1:17 pm UTC

tom you said
---------------
DBWR -- flushing blocks.
LGWR -- flushing redo buffers (every 3 seconds)
CKPT -- updating datafile headers

constrol files getting written to every 3 seconds at least...

yes, a database with no active sessions could be doing tons and tons of IO
(writes).
------------
but if there is no activity then
DBWR -- no blocks for flushing blocks.
LGWR -- no activity so no flushing redo buffers (every 3 seconds)
CKPT -- updating datafile headers -- update for what?

It would really help if you could explain with examples.



Tom Kyte
December 16, 2002 - 1:50 pm UTC

you do an update. you go away. you don't commit.

database has no active sessions now....


LGWR -- flushes redo from your update after a bit... sure, you haven't committed but your redo is flushed

DBWR -- times out, time for a checkpoint, finds dirty blocks from 1/2 hour ago and writes them out.

CKPT -- signalled by end of checkpoint to update datafile headers....

SMON wakes up and coalesces free space, generating log, dirty blocks and eventually causing a checkpoint. SMON does tons in the background -- all of the time.


Datafiles are constantly being written to, even when "nothing is happening"

Nystel, December 16, 2002 - 6:31 pm UTC

If there is no database activity then what information is being written into the control files every three seconds?

If the redo log buffers are not written to (since database is not active), then what is the reason to flush the redo log buffers? Does that mean when there is no db activity still we will see online redo log file switched at the same frequency (since redo log buffers gets flushed to online redo log files)?

Regards

Tom Kyte
December 17, 2002 - 7:45 am UTC

stuff -- just stuff. stuff we have no control over. look at your disk drive light and you'll see it like clockwork (it is clockwork stuff that is written).

SMON is doing stuff. SMON is generating redo. Your inactive database isn't INACTIVE, you have taken the premise that "if I'm not doing anything, it is not". well, that premise is wrong.

SMON is just one of them, SNPn's, intermedia, AQ, many other background processes out there with the potential to do stuff


redo logs will only switch as they fill -- smon may eventually fill one and switch it sure. will it be at the same rate as when you have tons of users? of course not, it'll be much slower.

suspend activity

Baqir Hussain, January 21, 2003 - 7:10 pm UTC

Tom,
When the database was put into suspend mode
alter system suspend;
then any kind of activities being happened to redo logs and control files??
can we achive a consistent redo logs and control file during the following:
1. Alter tablespace user begin backup;
2. Alter system suspend;
3. copy data , redo and control files

4. alter system resume;
5. alter tablespace user end backup;



Tom Kyte
January 21, 2003 - 7:34 pm UTC

You will NOT achieve consistent backups, they will be HOT FUZZY backups.


The only way to get "consistent" (and here consistent is not a goal, not a "good" thing) is a cold backup after a normal or immediate shutdown.


Those are normal (good, desirable) fuzzy hot backups. I would NOT use suspend/resume for that purpose. only for the purpose above.

A reader, September 16, 2003 - 5:21 pm UTC

Sorry I think I misplaced the link. This is what I meant:
</code> http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:373618158622, <code>

How is db consistency achieved with tripple mirrors silvering/resilvering

Anil, September 02, 2004 - 4:23 am UTC

Hey Tom,

1. Can you please explain how three way mirrors work, in essence how is the database consistency achieved?
Also:

2. On idle db: We had a simple test, we had a dummy database rnning for three days, doing nothing, it was just there, no queries, no dml nothing whatsoever. we copied the dbf's online got rid of those files, restored them with the earlier "backup" and opened the db, and it opens. Was curios, if something being written to, I thought our backup shouldn't have worked at all! Please help!

Really appreciate your inputs.

Tom Kyte
September 02, 2004 - 8:54 am UTC

1) to us, to the database, raid mirroring is totally 100% transparent, we don't "see it"

You have to ask the hardware vendors, the raid makers how they do it :) to us, it is just a disk...

unless you are talking about ASM in 10g, then we do it. We do it by simply maintaining 1 or 2 copies (mirror or triple mirror) of extents on different failure groups.


2) you can get "lucky", you should never count on getting "lucky".

you got "lucky" is all.

PMON

Shahid I Siddique, September 24, 2004 - 1:40 am UTC

My question is regarding backgroung processes.
PMON releases the lock and resources held by user and is managed by Oracle Server, right!!

Is there any way by which a DBA can "control" the PMON?

Thanks in advance



Tom Kyte
September 24, 2004 - 10:48 am UTC

in which circumstances?

no, pmon does not "releases the lock and resources held by user", the user does that normally.

Alter system suspend/resume usefull when using snapcloning?

PaulS, March 04, 2005 - 6:25 am UTC

I wonder if suspend/resume is a method to use for making full database backup's using snapshot/snapclone?
What is an acceptable period of time between the suspend and the resume command? Making a snapshot wil take some 2-3 minutes.


Tom Kyte
March 04, 2005 - 8:22 am UTC

depends on the vendor, otn has papers on this, you would want to work with you vendor (hardware) on this as well.

alter system suspend

abz, October 15, 2007 - 10:36 am UTC

Version 10g Release 2 and 11g Releae 1.

Please confirm this statement.

The database is up and running, I issued
ALTER SYSTEM SUSPEND, note that I did not made any tablespace in BEGIN BACKUP mode at all (not before suspend command and not after suspend command).

are the all the following files be freezed:
1- All controlfiles
2- All datafiles
3- All online redolog files.

Can I copy all the above three type of files in this state to another machine and startup the database at that new machine.
Tom Kyte
October 15, 2007 - 12:35 pm UTC

well, if you are going to take a copy at that point, why not just shutdown abort.

the suspend is for breaking BCV's (business continuity volumes). It is not really intended for copying the entire database while suspended - the database will appear totally broken to everyone - it would be a 'bad idea'.

we are using flash copy

abz, October 15, 2007 - 3:10 pm UTC

If shutdown was possible for us, I didnt need to ask this question, but we dont want to shutdown the database for some reason.
I understand its for BCV, but I just want to know that,
are all control files , datafiles and online redolog files
on disk are freezed after suspend? Please give answer of this specifically.

By the way we are using IBM flash copy to copy the files.
May be you will say to ALTER DATABASE BEGIN BACKUP, and then copy files and archived log files and apply the archived logs on target, but we also dont want to apply archived logs for some reason.


SUSPEND I/O

abz, October 17, 2007 - 10:51 am UTC

Why is file INPUT and OUTPUT both are suspended in SUSPEND?
Why not only suspending file output is sufficient for the purpose SUSPEND serves.


More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.