oracle替换undo表空间

 ---添加错文件名!


04:28:34 SYS@ntxdb(ntxdb)> alter tablespace UNDOTBS1 add datafile '/u01/app/oracle/oradata/ntxdb/users02.dbf' size 30g autoextend off;

Tablespace altered.

04:30:20 SYS@ntxdb(ntxdb)> alter tablespace UNDOTBS1 add datafile '/u01/app/oracle/oradata/ntxdb/users03.dbf' size 30g autoextend off;

Tablespace altered.


--undo创建错误
create tablespace UNDOTBS2 datafile '/u01/app/oracle/oradata/ntxdb/undotbs2_01.dbf' size 5G autoextend off;

create pfile='/home/oracle/pfile_0421' from spfile;

--导致替换报错

05:39:11 > alter system set undo_tablespace=undotbs2 scope=both;
alter system set undo_tablespace=undotbs2 scope=both
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-30012: undo tablespace 'UNDOTBS2' does not exist or of wrong type


--删除错误的 undotbs2
05:43:26 > DROP TABLESPACE UNDOTBS2 INCLUDING CONTENTS AND DATAFILES;

Tablespace dropped.

05:43:34 >

--创建正确的 undo
create undo tablespace undotbs2 datafile '/u01/app/oracle/oradata/ntxdb/undotbs2_01.dbf' size 10G ;

--替换
alter system set undo_tablespace=undotbs2 scope=both;

--查询 undo 段 是否全是 离线

select tablespace_name,segment_name,status from dba_rollback_segs where TABLESPACE_NAME='UNDOTBS2';

 

--删除
drop tablespace undotbs1 including contents and datafiles;

--重新替换回来!
create undo tablespace undotbs1 datafile '/u01/app/oracle/oradata/ntxdb/undotbs01.dbf' size 30G autoextend off;

alter system set undo_tablespace=undotbs1 scope=both;

--查询 undo 段 是否全是 离线

select tablespace_name,segment_name,status from dba_rollback_segs where TABLESPACE_NAME='UNDOTBS1';

 

drop tablespace undotbs2 including contents and datafiles;

--更新 pfile
create pfile from spfile;

alter tablespace UNDOTBS1 add datafile '/u01/app/oracle/oradata/ntxdb/undotbs02.dbf' size 30g autoextend off;

alter tablespace UNDOTBS1 add datafile '/u01/app/oracle/oradata/ntxdb/undotbs03.dbf' size 30g autoextend off;

posted @   钱若梨花落  阅读(258)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示