标签云
asm恢复 bbed bootstrap$ dul kcbzib_kcrsds_1 kccpb_sanity_check_2 kcratr_nab_less_than_odr kgegpa MySQL恢复 ORA-00312 ORA-00704 ORA-00742 ORA-01110 ORA-01200 ORA-01555 ORA-01578 ORA-01595 ORA-600 2662 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-600 kdsgrp1 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (110)
- 数据库 (1,821)
- DB2 (22)
- MySQL (80)
- Oracle (1,651)
- Data Guard (53)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (168)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (69)
- Oracle Bug (8)
- Oracle RAC (54)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (29)
- Oracle备份恢复 (620)
- Oracle安装升级 (102)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (86)
- PostgreSQL (36)
- pdu工具 (7)
- PostgreSQL恢复 (13)
- SQL Server (34)
- SQL Server恢复 (14)
- TimesTen (7)
- 达梦数据库 (3)
- 达梦恢复 (1)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (45)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (28)
-
最近发表
- Patch_SCN快速解决ORA-600 2663故障
- 在生产环境错误执行dd命令破坏asm磁盘故障恢复
- obet实现对数据文件坏块检测功能
- oracle linux 8.10注意pmlogger导致空间被大量占用
- obet快速修改scn/resetlogs恢复数据库(缺少归档,ORA-00308)
- 使用DBMS_PDB.RECOVER抢救单个pdb
- aix环境写入大文件设置combehin提高效率
- 记录一次国产数据库被rm -rf /*删除的救援过程
- 数据库启动报 maximum number of processes () exceeded分析
- ORA-600 [ksunfy : too few sessions]
- 由于数据块scn大于数据库scn导致ORA-600 kcbzib_kcrsds_1错误
- ORA-600 ktbair2: illegal inheritance恢复
- 一键恢复ORA-00704 ORA-00702故障—202512
- PostgreSQL查询一个表相关的所有oid
- PostgreSQL oid文件替换实现数据访问
- 模拟sql server故障备份完成恢复实现数据0丢失
- sql server 事务日志备份异常恢复案例
- win平台挂起Oracle数据库启动进程
- linux异常磁盘lvm恢复操作演示
- open数据库报ora-600 kdsgrp1故障处理
标签归档:alter system suspend;
Oracle 暂定和恢复功能
以前一直没有注意到oracle有暂定和恢复功能(SUSPEND/RESUME)[从oracle 8i开始有的特性],一下是官方描述:
The Database Suspend/Resume feature provides a mechanism by which all disk I/O
(datafile, controlfile and file header I/Os) in a database (in all instances)
can be suspended making it easier to make a copy of the database. When an
ALTER SYSTEM SUSPEND command is issued, it will wait for any ongoing instance
recovery to complete and then set a flag in all running instances to stop all
new lock and I/O activity. The command may return before the last I/O is
issued because the check for the flag might have been before the suspend and
the I/O might have been issued after the suspend. So, reads, typically are not
allowed when the database is suspended but may still be active for a period of
time. However, this command does ensure that no new I/Os will be issued.
Once all instances of a database are suspended, a copy of the database can be
made by making a copy of all the files (i.e. the control file, online logs and
all data files). The copy can have uncommitted updates and therefore the only
way a copy of the database can be used in this scenerio is to do an instance
recovery and then open it.
The database can be suspended or resumed through an ALTER SYSTEM call. You can
issue this statement as the user SYSTEM or SYS (the user must have DBA
privileges).
The syntax for these two commands is as follows:
ALTER SYSTEM <options>;
<options> = SUSPEND | RESUME | <existing options>
The database will remain in the suspended state until the ALTER SYSTEM RESUME
command is issued. The database will remain suspended even if the process
issuing the ALTER SYSTEM SUSPEND command dies or exists. However, if all
instances are shutdown and started again, the database is no longer in a
suspended state.
The ALTER SYSTEM RESUME command has the effect of blocking the I/O since the
SUSPEND command. When the RESUME command is issued, it might cause a burst in
the I/O, which may take a while to even out. A message is written to the alert
log everytime the database is suspended or resumed, as shown by the example
below:
Mon Nov 29 11:32:22 1999
Completed: alter database open
Wed Dec 1 12:56:53 1999
Starting ORACLE instance (normal)
Wed Dec 1 22:03:50 1999
Suspending database following alter system suspend command.
Wed Dec 1 22:06:14 1999
Resuming database following alter system resume command.
Wed Dec 1 22:07:08 1999
The following is an example of using the SUSPEND and RESUME feature:
SVRMGR> connect system/manager
Connected.
SVRMGR> alter system suspend;
Statement processed.
SVRMGR> select * from user_source;
^X^Cselect * from user_source ----- (at this stage the statement will
just hang. A Ctrl-X Ctrl-C was
issued to kill the statement)
*
ORA-00604: error occurred at recursive SQL level 1
ORA-01013: user requested cancel of current operation
SVRMGR>
SVRMGR> alter system resume;
Statement processed.
Considerations and Restrictions:
--------------------------------
- The files in the copy database can not be used as backups of the original
database for media recovery. (If the direct path option is in use at the
time, there may be corrupted blocks).
- A new instance cannot be started during the SUSPEND state of the database.
If one is started, it will not be included in the SUSPEND process and thus no
I/O suspension guarantees are provided in this case.
- Creation of backups or archived logs will not be affected by the
ALTER SYSTEM SUSPEND command.
- The two different commands can be issued from two different instances or
processes.
- If the SUSPEND command during execution may fail for some reason yet
result in some of the instances being suspended, the command can be issued
again since the instances in suspend status will ignore the command.
- Also database queries will hang when the database is in suspend mode
按照描述SUSPEND 操作会挂起所有io,只要涉及到io操作就会挂起,如果操作的所有请求都可以在内存中完成(buffer cache/shared pool等),那这样的操作是可以直接完成的.
C:\Users\XFF>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 14 21:51:53 2025
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter system suspend;
System altered.
SQL> select database_status from v$instance;
DATABASE_STATUS
-----------------
SUSPENDED
SQL> create table t1 as select * from dba_users;
create table t1 as select * from dba_users
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
SQL> create table t_xff as select * from dba_users;
^C
C:\Users\XFF>
C:\Users\XFF>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 14 21:53:19 2025
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter system resume;
System altered.
SQL> select database_status from v$instance;
DATABASE_STATUS
-----------------
ACTIVE
SQL> create table t_xff as select * from dba_users;
Table created.
SQL> alter system suspend;
System altered.
SQL> select count(1) from user$;
COUNT(1)
----------
94
SQL> select count(1) from t_xff;
^C
C:\Users\XFF>
在某些情况下,可以通过这类操作来挂起数据库,做一些特殊的操作.

加我微信(17813235971)
加我QQ(107644445)

