`

undo 表空间丢失之恢复(ORA-01548)

阅读更多

SYS@huiche>startup
ORACLE 例程已经启动。
Total System Global Area  264241152 bytes
Fixed Size                  1296208 bytes
Variable Size              92276912 bytes
Database Buffers          163577856 bytes
Redo Buffers                7090176 bytes
数据库装载完毕。
数据库已经打开。
SYS@huiche>desc test;
 名称                                                                                                                                               是否为空? 类型
 -------------------------------------------------------------------------------------------------------------------------------------------------- -------- ---------------------------------------------------------------------------------------------------
 ID                                                                                                                                                          NUMBER(10)
 NAME                                                                                                                                                        VARCHAR2(20)

SYS@huiche>select * from test;

未选定行

已用时间:  00: 00: 00.12
SYS@huiche>set wrap off;
SYS@huiche>select * from v$rollstat;
       USN      LATCH    EXTENTS     RSSIZE     WRITES      XACTS       GETS      WAITS    OPTSIZE    HWMSIZE    SHRINKS      WRAPS    EXTENDS  AVESHRINK  AVEACTIVE STATUS                                                           CUREXT     CURBLK
---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------------------------------------------------------------ ---------- ----------
         0          0          6     385024       5000          0         47          0                385024          0          0          0          0          0 ONLINE                                                                0          2
         1          1         17    2088960        670          0         13          0               2088960          0          0          0          0          0 ONLINE                                                               10        109
         2          2          4     253952        796          0         15          0                253952          0          0          0          0          0 ONLINE                                                                0          3
         3          0         17    2088960       2412          0         15          0               2088960          0          0          0          0          0 ONLINE                                                               10        126
         4          1         17    2088960        772          0         13          0               2088960          0          0          0          0          0 ONLINE                                                               11          6
         5          2          5     319488        358          0         13          0                319488          0          0          0          0          0 ONLINE                                                                2          4
         6          0         12    2744320       1022          0         17          0               2744320          0          0          0          0          0 ONLINE                                                               11        125
         7          1          4     253952        228          0         11          0                253952          0          0          0          0          0 ONLINE                                                                2          3
         8          2         18    2154496       1820          0         13          0               2154496          0          0          0          0          0 ONLINE                                                               13          5
         9          0          3     188416       1594          0         17          0                188416          0          0          0          0          0 ONLINE                                                                2          7
        10          1          5     319488        664          0         13          0                319488          0          0          0          0          0 ONLINE                                                                1          4

已选择11行。

已用时间:  00: 00: 00.06
SYS@huiche>insert into test values (1,'libin');

已创建 1 行。

已用时间:  00: 00: 00.03
SYS@huiche>select * from v$rollstat;
       USN      LATCH    EXTENTS     RSSIZE     WRITES      XACTS       GETS      WAITS    OPTSIZE    HWMSIZE    SHRINKS      WRAPS    EXTENDS  AVESHRINK  AVEACTIVE STATUS                                                           CUREXT     CURBLK
---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------------------------------------------------------------ ---------- ----------
         0          0          6     385024       5000          0         48          0                385024          0          0          0          0          0 ONLINE                                                                0          2
         1          1         17    2088960       1520          0         16          0               2088960          0          0          0          0          0 ONLINE                                                               10        109
         2          2          4     253952        796          0         16          0                253952          0          0          0          0          0 ONLINE                                                                0          3
         3          0         17    2088960       2542          0         18          0               2088960          0          0          0          0          0 ONLINE                                                               10        126
         4          1         17    2088960        772          0         14          0               2088960          0          0          0          0          0 ONLINE                                                               11          6
         5          2          5     319488        878          0         16          0                319488          0          0          0          0          0 ONLINE                                                                2          4
         6          0         12    2744320       1386          0         20          0               2744320          0          0          0          0          0 ONLINE                                                               11        125
         7          1          4     253952        582          0         14          0                253952          0          0          0          0          0 ONLINE                                                                2          3
         8          2         18    2154496       1926          1            15          0               2154496          0          0          0          0          0 ONLINE                                                               13          5
         9          0          3     188416       2346          0         20          0                188416          0          0          0          0          0 ONLINE                                                                2          7
        10          1          5     319488        878          0         16          0                319488          0          0          0          0          0 ONLINE                                                                1          4

已选择11行。

已用时间:  00: 00: 00.04
SYS@huiche>shutdown abort
ORACLE 例程已经关闭。
删除D:\ORACLE\PRODUCT\10.2.0\ORADATA\HUICHE\UNDOTBS01.DBF
SYS@huiche>startup
ORACLE 例程已经启动。
Total System Global Area  264241152 bytes
Fixed Size                  1296208 bytes
Variable Size              92276912 bytes
Database Buffers          163577856 bytes
Redo Buffers                7090176 bytes
数据库装载完毕。
ORA-01157: 无法标识/锁定数据文件 2 - 请参阅 DBWR 跟踪文件
ORA-01110: 数据文件 2: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\HUICHE\UNDOTBS01.DBF'


SYS@huiche>alter database datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\HUICHE\UNDOTBS01.DBF' offline drop;

数据库已更改。

已用时间:  00: 00: 00.07
SYS@huiche>alter database open;

数据库已更改。

已用时间:  00: 00: 08.12
SYS@huiche>select * from dba_data_files;
在列 MAXBLOCKS 前截断 (按要求)

在列 INCREMENT_BY 前截断 (按要求)

在列 USER_BYTES 前截断 (按要求)

在列 USER_BLOCKS 前截断 (按要求)

FILE_NAME                                                       FILE_ID TABLESPACE_NAME                                                   BYTES     BLOCKS STATUS                                                       RELATIVE_FNO AUTOEX   MAXBYTES ONLINE_ST
------------------------------------------------------------ ---------- ------------------------------------------------------------ ---------- ---------- ------------------------------------------------------------ ------------ ------ ---------- ---------
D:\ORACLE\PRODUCT\10.2.0\ORADATA\HUICHE\USERS01.DBF                   4 USERS                                                         106168320      12960 AVAILABLE                                                               4 YES    3.4360E+10 ONLINE
D:\ORACLE\PRODUCT\10.2.0\ORADATA\HUICHE\SYSAUX01.DBF                  3 SYSAUX                                                        262144000      32000 AVAILABLE                                                               3 YES    3.4360E+10 ONLINE
D:\ORACLE\PRODUCT\10.2.0\ORADATA\HUICHE\UNDOTBS01.DBF                 2 UNDOTBS1                                                                           AVAILABLE                                                               2                   RECOVER
D:\ORACLE\PRODUCT\10.2.0\ORADATA\HUICHE\SYSTEM01.DBF                  1 SYSTEM                                                        681574400      83200 AVAILABLE                                                               1 YES    3.4360E+10 SYSTEM

已用时间:  00: 00: 00.12
SYS@huiche>create undo tablespace undotbs02 datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\HUICHE\UNDOTBS02.DBF' size 25m;

表空间已创建。

已用时间:  00: 00: 01.32
SYS@huiche>show parameter undo
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
undo_management                      string                 AUTO
undo_retention                       integer                900
undo_tablespace                      string                 UNDOTBS1
SYS@huiche>alter system set undo_tablespace=undotbs02;

系统已更改。

已用时间:  00: 00: 00.10
SYS@huiche>select segment_name,status from dba_rollback_segs;
SEGMENT_NAME                                                 STATUS
------------------------------------------------------------ ------------------------------------------------------------
SYSTEM                                                       ONLINE
_SYSSMU10$                                                   NEEDS RECOVERY
_SYSSMU9$                                                    NEEDS RECOVERY
_SYSSMU8$                                                    NEEDS RECOVERY
_SYSSMU7$                                                    NEEDS RECOVERY
_SYSSMU6$                                                    NEEDS RECOVERY
_SYSSMU5$                                                    NEEDS RECOVERY
_SYSSMU4$                                                    NEEDS RECOVERY
_SYSSMU3$                                                    NEEDS RECOVERY
_SYSSMU2$                                                    NEEDS RECOVERY
_SYSSMU1$                                                    NEEDS RECOVERY
_SYSSMU20$                                                   ONLINE
_SYSSMU19$                                                   ONLINE
_SYSSMU18$                                                   ONLINE
_SYSSMU17$                                                   ONLINE
_SYSSMU16$                                                   ONLINE
_SYSSMU15$                                                   ONLINE
_SYSSMU14$                                                   ONLINE
_SYSSMU13$                                                   ONLINE
_SYSSMU12$                                                   ONLINE
_SYSSMU11$                                                   ONLINE

已选择21行。

已用时间:  00: 00: 00.07
SYS@huiche>drop tablespace undotbs1 including contents and datafiles;
drop tablespace undotbs1 including contents and datafiles
*
第 1 行出现错误:
ORA-01548: 已找到活动回退段 '_SYSSMU1$', 终止删除表空间


已用时间:  00: 00: 00.04
SYS@huiche>create pfile from spfile;

 

pfile内容如下:

huiche.__db_cache_size=163577856
huiche.__java_pool_size=4194304
huiche.__large_pool_size=4194304
huiche.__shared_pool_size=83886080
huiche.__streams_pool_size=0

*.audit_file_dest='D:\oracle\product\10.2.0\admin\HUICHE\adump'
*.background_dump_dest='D:\oracle\product\10.2.0\admin\HUICHE\bdump'
*.compatible='10.2.0.3.0'
*.control_files='D:\oracle\product\10.2.0\oradata\HUICHE\control01.ctl','D:\oracle\product\10.2.0\oradata\HUICHE\control02.ctl','D:\oracle\product\10.2.0\oradata\HUICHE\control03.ctl'
*.core_dump_dest='D:\oracle\product\10.2.0\admin\HUICHE\cdump'
*.db_block_size=8192
*.db_cache_size=113246208
*.db_domain='COM'
*.db_file_multiblock_read_count=16
*.db_name='HUICHE'
*.db_recovery_file_dest='D:\oracle\product\10.2.0\flash_recovery_area'
*.db_recovery_file_dest_size=4294967296
*.dispatchers='(PROTOCOL=TCP) (SERVICE=HUICHEXDB)'
*.java_pool_size=4194304
*.job_queue_processes=10
*.large_pool_size=4194304
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=300
*.pga_aggregate_target=69206016
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=262144000
*.sga_target=264241152
*.shared_pool_size=79691776
*.streams_pool_size=0
*.undo_management='auto'
*.undo_tablespace='UNDOTBS02'
*.user_dump_dest='D:\oracle\product\10.2.0\admin\HUICHE\udump'
_corrupted_rollback_segments=(_SYSSMU10$,_SYSSMU9$,_SYSSMU8$,_SYSSMU7$,_SYSSMU6$,_SYSSMU5$,_SYSSMU4$,_SYSSMU3$,_SYSSMU2$,_SYSSMU1$)
_offline_rollback_segments=true

 

SYS@huiche>startup pfile=D:\oracle\product\10.2.0\db_1\database\INIThuiche.ORA
ORACLE 例程已经启动。
Total System Global Area  264241152 bytes
Fixed Size                  1296208 bytes
Variable Size              92276912 bytes
Database Buffers          163577856 bytes
Redo Buffers                7090176 bytes
数据库装载完毕。
数据库已经打开。
SYS@huiche>select segment_name,status from dba_rollback_segs ;
SEGMENT_NAME                                                 STATUS
------------------------------------------------------------ ------------------------------------------------------------
SYSTEM                                                       ONLINE
_SYSSMU10$                                                   NEEDS RECOVERY
_SYSSMU9$                                                    NEEDS RECOVERY
_SYSSMU8$                                                    NEEDS RECOVERY
_SYSSMU7$                                                    NEEDS RECOVERY
_SYSSMU6$                                                    NEEDS RECOVERY
_SYSSMU5$                                                    NEEDS RECOVERY
_SYSSMU4$                                                    NEEDS RECOVERY
_SYSSMU3$                                                    NEEDS RECOVERY
_SYSSMU2$                                                    NEEDS RECOVERY
_SYSSMU1$                                                    NEEDS RECOVERY
_SYSSMU20$                                                   ONLINE
_SYSSMU19$                                                   ONLINE
_SYSSMU18$                                                   ONLINE
_SYSSMU17$                                                   ONLINE
_SYSSMU16$                                                   ONLINE
_SYSSMU15$                                                   ONLINE
_SYSSMU14$                                                   ONLINE
_SYSSMU13$                                                   ONLINE
_SYSSMU12$                                                   ONLINE
_SYSSMU11$                                                   ONLINE

已选择21行。

已用时间:  00: 00: 00.31
SYS@huiche>drop tablespace undotbs1 including contents and datafiles;

表空间已删除。

已用时间:  00: 00: 01.39
SYS@huiche>select segment_name,status from dba_rollback_segs;
SEGMENT_NAME                                                 STATUS
------------------------------------------------------------ ------------------------------------------------------------
SYSTEM                                                       ONLINE
_SYSSMU20$                                                   ONLINE
_SYSSMU19$                                                   ONLINE
_SYSSMU18$                                                   ONLINE
_SYSSMU17$                                                   ONLINE
_SYSSMU16$                                                   ONLINE
_SYSSMU15$                                                   ONLINE
_SYSSMU14$                                                   ONLINE
_SYSSMU13$                                                   ONLINE
_SYSSMU12$                                                   ONLINE
_SYSSMU11$                                                   ONLINE

已选择11行。

已用时间:  00: 00: 00.04
SYS@huiche>show parameter undo
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
undo_management                      string                 AUTO
undo_retention                       integer                900
undo_tablespace                      string                 UNDOTBS02
SYS@huiche>create spfile from pfile;

文件已创建。

已用时间:  00: 00: 00.12
SYS@huiche>shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SYS@huiche>startup
ORACLE 例程已经启动。
Total System Global Area  264241152 bytes
Fixed Size                  1296208 bytes
Variable Size              92276912 bytes
Database Buffers          163577856 bytes
Redo Buffers                7090176 bytes
数据库装载完毕。
数据库已经打开。
SYS@huiche>show parameter undo
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
undo_management                      string                 MANUAL
undo_retention                       integer                900
undo_tablespace                      string                 UNDOTBS02
SYS@huiche>alter system set undo_management=auto scope=spfile;

系统已更改。

已用时间:  00: 00: 00.03

 

分享到:
评论

相关推荐

    undo表空间恢复

    标题和描述均提到了“undo表...综上所述,undo表空间的管理和恢复是Oracle数据库管理员必须掌握的关键技能之一,它直接影响到数据的完整性和系统的稳定性。通过合理配置和及时维护,可以有效提升数据库的性能和可靠性。

    操作系统崩溃,数据库全部文件都在时,数据库恢复方法.pdf

    除了数据文件(如`.DBF`)、控制文件(如`.CTL`)、日志文件(如`.LOG`)外,还应考虑重做日志文件、回滚段文件(Undo `.DBF`)以及临时表空间文件(Temp `.DBF`)。此外,用户提到可能丢失了部分索引文件(如`INDEX...

    oracle 错误一览表

    - **解决方法**:检查撤销表空间的状态,并采取措施恢复其有效性。 #### ORA-00034: Unable to open current PL/SQL undo tablespace - **描述**:无法打开当前的PL/SQL撤销表空间。 - **解决方法**:确认撤销表...

    orale创建表空间

    虽然这可以加快表空间的创建速度,但在数据丢失时无法恢复。 ##### 3. `DATAFILE` 此选项用于指定表空间中数据文件的位置和大小: - `DATAFILE 'D:\ORACLE\ORADATA\ORA92\LUNTAN.ora'`:指定数据文件的路径和文件名...

    Oracle 闪回技术详解

    与闪回表不同的是,闪回归档不依赖于undo表空间,而是存储在独立的归档区域。 4. **利用闪回日志 (Flashback Log)** - **闪回数据库 (Flashback Database)** - 可以将整个数据库恢复到某个时间点的状态。这是最高...

    Oracle undo_management参数不一致错误

    3. UNDO_MANAGEMENT参数:此参数控制是否自动管理undo空间。设置为"AUTO"表示使用自动管理的undo表空间,Oracle会自动分配和管理undo段。如果设置为"MANUAL",则需要手动管理undo表空间。 4. AUTOEXTEND选项:当...

    一次简单的Oracle恢复Case实战记录

    5. **重建UNDO表空间**:如果回滚段是问题根源,重建UNDO可以解决问题,但需谨慎操作,避免数据丢失。 6. **检查数据库状态**:数据库打开后,定期监控alert log,确保没有新的错误出现。 7. **执行DBCC检查**:使用...

    [Oracle] 解析在没有备份的情况下undo损坏怎么办

    例如,错误提示ORA-01157和ORA-01110表明相应的数据文件已经损坏或丢失,需要将其offline并drop。 在执行上述操作时,务必确保对Oracle数据库的结构和操作有充分的了解,因为操作不当可能会导致数据丢失或其他不可...

    Oracle 备份恢复闪回技术实战

    - 如果原来的UNDO表空间被删除,那么就无法再通过闪回查询来访问之前的数据,会出现`ORA-01555: snapshot too old`的错误。 7. **解决办法**: - 创建新的UNDO表空间: ```sql create undo tablespace undotbs...

    ORACLE数据库物资管理系统磁盘损坏数据恢复处理报告 UNDO文件损坏

    - 尝试登录数据库时出现`ORA-12560`错误。 - 经过检查,确认数据库的相关服务已启动,并通过设置`ORACLE_SID`环境变量成功登录到数据库。 - **深入分析**: - 在尝试启动数据库时,发现系统无法识别`UNDOTBS01.DBF...

    如何恢复只有完好数据文件的oracle数据库

    在数据库管理过程中,数据丢失或损坏是常见的问题之一。对于Oracle数据库来说,当遭遇数据文件损坏时,如果仅保留有完好的数据文件,那么恢复过程将更加复杂。本文将详细介绍在这种情况下如何恢复Oracle数据库,并...

    oracle 1Z0-053 PDF题库

    比如SQL计划基线(SQL Plan Baselines)、动态性能视图(Dynamic Performance Views)、撤销保留(Undo Retention)等,是获取Oracle认证专家(OCP)资格的关键考试之一。 从给定文件的内容部分,我们可以了解到几...

    exp/imp2导入导出

    - 在 Oracle 中,表空间可以分为临时表空间(Temporary Tablespace)、撤销表空间(Undo Tablespace)和普通表空间。 **2. LOGGING** - LOGGING 指定此表空间的数据更改将被记录到重做日志中。 - NOLOGGING:...

    Oracle备份详解

    - 恢复表空间:`recover tablespace xxxx` - 恢复数据文件:`recover datafile 'DBF文件';` - 打开数据库:`alter database open;` ##### 2. 不完全恢复操作 - **不完全恢复准备** - 启动数据库至挂载状态:`...

    HairOracle数据库运维手册.docx

    - **UNDO表空间**:管理和配置UNDO表空间。 - **TEMP表空间**:管理和配置临时表空间。 - **重做日志文件管理** - **增加REDO日志组**:增加重做日志文件组的数量。 - **删除日志组**:删除不再需要的重做日志...

    深入解析Oracle--DBA入门、进阶与诊断案例

    3. 问题修复:处理常见的Oracle错误,如ORA-00001、ORA-01555等,学习如何解决数据不一致、数据丢失等问题。 4. 性能诊断:通过AWR(Automatic Workload Repository)和ASH(Active Session History)报告,进行性能...

    Oracle诊断案例专刊

    - **背景介绍**:在Oracle数据库管理中,经常会遇到各种棘手的问题,其中之一就是UNDO表空间丢失的情况。传统上,我们通常会通过修改参数文件(PFILE)来解决这类问题,但这种方式存在一定的风险和局限性。 - **解决...

Global site tag (gtag.js) - Google Analytics