首页 > Linux操作系统 > Linux操作系统 > 2008.1.8 suspend

2008.1.8 suspend

原创 Linux操作系统 作者:guo_li_yuan 时间:2008-01-08 14:22:42 0 删除 编辑

参考metalink   282764.1

 SQL> alter tablespace users begin backup;


SQL> alter system suspend ;


SQL> host copy E:\oradata\orcl\USERS01.DBF E:\oradata\orcl\USERS01.BAK            //// Take the snapview of the datafiles (This is very fast normally takes a few seconds for a medium sized DB)
已复制         1 个文件。

SQL> alter system resume;


SQL> alter tablespace users end backup;


alter 日志会记录操作

These two commands are used when the DB backup is to taken using a SnapView. A snapshot (NOT related to replication) is the snapshot of the datafiles under hotbackup mode, to an intermediate location.
The backup utility then forms the actual hotbackup files in the backup location that is done offline to DB.
Taking a snapshot of the DB is very fast and this time the backup utility (e.g EMC Clarion / Veritas) needs the DB Not to have any I/O.

The ALTER SYSTEM SUSPEND statement halts all input and output (I/O) to datafiles (file header and file data) and control files. The suspended state lets you back up a database without I/O interference. When the database is suspended all preexisting I/O operations are allowed to complete and any new database accesses are placed in a queued state.

C:\Documents and Settings\abc>sqlplus "/as sysdba"

SQL*Plus: Release - Production on 星期二 1月 8 14:24:40 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Oracle Database 10g Enterprise Edition Release - Production
With the Partitioning, OLAP and Data Mining options

SQL> conn scott/tiger
SQL> select * from emp where deptno=10;

     EMPNO ENAME      JOB              MGR HIREDATE              SAL       COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
      7782 CLARK      MANAGER         7839 09-6月 -81           2450
SQL> alter system suspend;


SQL> select * from dept;   

/// 无结果输出 回车后hang住 , suspend效果体现   开启一个新的会话 d:/sqlplus "/as sysdba"

SQL> select * from emp;

     EMPNO ENAME      JOB              MGR HIREDATE              SAL       COM
---------- ---------- --------- ---------- -------------- ---------- ---------
      7369 SMITH      CLERK           7902 17-12月-80            800
  7499 ALLEN      SALESMAN        7698 20-2月 -81           1600        300

结论 :   其实此时对emp 的访问是从内存提取 而非I/O操作得来  下为 metalink参考

o From scott/tiger the "select * from emp;" will succeed as the required information is already available in shared pool and buffer cache

o But a select on dept table will Hang as this incurs I/O

o Even if we connect as SYSDBA the I/O restriction is there.

o shutdown immediate will also hang for a DB in SUSPEND mode

o shutdown abort however succeeds as it kills the instance (there by clearing the flag) and the does the I/O

o restarting the DB will clear the SUSPEND flag

 It has been reported that sometimes the new SYSDBA connections to a SUSPENDed 8i DB hangs (Bug: 1657819)
Here we can possibly use 'alter system flush shared_pool;' as an workaround. The issue has been fixed in 9i releases.  -- 
10g好像没有修正 :suspend状态  ,执行 alter system flush shared_pool;   开启新的 sqlplus "/as sysdba"  回车hang住 ;  没有执行flush 操作  ,sqlplus "/as sysdba" 正常操作



来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

下一篇: metalink文章统计
请登录后发表评论 登录


  • 博文量
  • 访问量