纸上得来终觉浅,绝知此事要躬行

将tablespace offline的几种方法

上一篇 / 下一篇  2008-04-10 15:47:53 / 个人分类:oracle管理

    最近生产库里有个表空间需要offline,为了慎重起见,查看了一下oracle 的document,如下:

Taking Tablespaces Offline

You may want to take a tablespace offline for any of the following reasons:

  • To make a portion of the database unavailable while allowing normal access to the remainder of the database
  • To perform. an offline tablespace backup (even though a tablespace can be backed up while online and in use)
  • To make an application and its group of tables temporarily unavailable while updating or maintaining the application

When a tablespace is taken offline, Oracle takes all the associated files offline. TheSYSTEMtablespace can never be taken offline.

You can specify any of the following options when taking a tablespace offline:

OptionDescription

NORMAL

A tablespace can be taken offline normally if no error conditions exist for any of the datafiles of the tablespace. No datafile in the tablespace can be currently offline as the result of a write error. WhenOFFLINE NORMALis specified, Oracle takes a checkpoint for all datafiles of the tablespace as it takes them offline.NORMALis the default.

TEMPORARY

A tablespace can be taken offline temporarily, even if there are error conditions for one or more files of the tablespace. WhenOFFLINE TEMPORARYis specified, Oracle takes offline the datafiles that are not already offline, checkpointing them as it does so.

If no files are offline, but you use the temporary option, media recovery is not required to bring the tablespace back online. However, if one or more files of the tablespace are offline because of write errors, and you take the tablespace offline temporarily, the tablespace requires recovery before you can bring it back online.

IMMEDIATE

A tablespace can be taken offline immediately, without Oracle taking a checkpoint on any of the datafiles. When you specifyOFFLINE IMMEDIATE, media recovery for the tablespace is required before the tablespace can be brought online. You cannot take a tablespace offline immediately if the database is running inNOARCHIVELOGmode.

FOR RECOVER

Takes the database tablespaces in the recovery set offline for tablespace point-in-time recovery. For additional information, seeOracle9i User-Managed Backup and Recovery Guide.

Caution:

If you must take a tablespace offline, use theNORMALoption (the default) if possible. This guarantees that the tablespace will not require recovery to come back online. It will not require recovery, even if after incomplete recovery you reset the redo log sequence using anALTER DATABASE OPEN RESETLOGSstatement.

SpecifyTEMPORARYonly when you cannot take the tablespace offline normally. In this case, only the files taken offline because of errors need to be recovered before the tablespace can be brought online. SpecifyIMMEDIATEonly after trying both the normal and temporary options.

The following example takes theuserstablespace offline normally:

ALTER TABLESPACE users OFFLINE NORMAL;

Before taking an online tablespace offline, consider taking the following actions:

  • Verify that the tablespace contains no active rollback segments. Such a tablespace cannot be taken offline.
  • You may want to alter the tablespace allocation of any users who have been assigned the tablespace as either a default or temporary tablespace. This is advisable because they will not be able to access objects or sort areas in the tablespace while it is offline.

    可以看出,normal是首选方式,这种情况下oracle发出一个checkpoint,当将表空间online时不需要recover,如果normal方式不行,则选用TEMPORARY方式 ,使用此方式offline后,在online时只需recover有error的数据文件。最后一种方式就是immediate方式,此种方式不发出checkpoint,online时需要recover.


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-12  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 2236
  • 日志数: 77
  • 图片数: 2
  • 影音数: 1
  • 建立时间: 2008-02-29
  • 更新时间: 2008-10-10

RSS订阅

Open Toolbar