B14231 第131页
alter system suspend语句挂起数据文件和控制文件的I/O操作。挂起状态可以避免备份数据库时的IO操作。当数据库试图进入挂起状态时,允许当前活动的事务完成,新发起的事务会进入队列中。
下面演示将数据库挂起以及恢复的过程
[@more@]登录数据
ora_test@oracle[/home/oracle]> sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Thu Mar 11 09:49:32 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options |
挂起数据库
sys@CNHTM> alter system suspend; System altered. |
查询数据库状态,显示为挂起
sys@CNHTM> select database_status from v$instance; DATABASE_STATUS ----------------- SUSPENDED |
这时,在另一窗口中用用scott用户登录,登录处于挂起状态
ora_test@oracle[/home/oracle]> sqlplus scott/tiger SQL*Plus: Release 10.2.0.1.0 - Production on Thu Mar 11 10:04:35 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. |
恢复数据库的正常状态
sys@CNHTM> alter system resume; System altered. |
这时,另一窗口中登录数据库的操作,已经成功
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options scott@CNHTM> |
查询数据库状态,显示为active
sys@CNHTM> select database_status from v$instance; DATABASE_STATUS ----------------- ACTIVE |
--end--
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22049049/viewspace-1031745/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22049049/viewspace-1031745/