- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
1#
发表于 2012-3-15 16:10:41
|
查看: 5991 |
回复: 0
SQL> col file_name for a90
SQL> set linesize 200 pagesize 1400
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> select tablespace_name,status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
TEMP ONLINE
USERS ONLINE
EXAMPLE ONLINE
MACLEAN ONLINE
UNDOMAC ONLINE
7 rows selected.
SQL> select file_name,file_id,tablespace_name from dba_data_Files;
FILE_NAME FILE_ID TABLESPACE_NAME
------------------------------------------------------------------------------------------ ---------- ------------------------------
/s01/oradata/G10R21/datafile/o1_mf_users_7h6t717x_.dbf 16 USERS
/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6yo0_.dbf 15 USERS
/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6w5w_.dbf 14 USERS
/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6stt_.dbf 13 USERS
/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6qc2_.dbf 12 USERS
/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6nxy_.dbf 11 USERS
/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6fdt_.dbf 10 USERS
/s01/oradata/G10R21/datafile/o1_mf_users_7gvd5pwh_.dbf 9 USERS
/s01/oradata/G10R21/datafile/o1_mf_example_7ch81ch3_.dbf 5 EXAMPLE
/s01/oradata/G10R21/datafile/o1_mf_users_7ch80085_.dbf 4 USERS
/s01/oradata/G10R21/datafile/o1_mf_sysaux_7ch8004x_.dbf 3 SYSAUX
/s01/oradata/G10R21/datafile/o1_mf_system_7ch8004t_.dbf 1 SYSTEM
/s01/oradata/G10R21/datafile/o1_mf_maclean_7oxhwz5l_.dbf 6 MACLEAN
/s01/oradata/G10R21/datafile/o1_mf_undomac_7p4z84cz_.dbf 7 UNDOMAC
14 rows selected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1048576000 bytes
Fixed Size 2026096 bytes
Variable Size 473957776 bytes
Database Buffers 566231040 bytes
Redo Buffers 6361088 bytes
Database mounted.
SQL> alter database datafile 7 offline;
Database altered.
SQL> alter database open;
Database altered.
SQL> select segment_name,status from dba_rollback_segs;
SEGMENT_NAME STATUS
------------------------------ ----------------
SYSTEM ONLINE
_SYSSMU11$ OFFLINE
_SYSSMU12$ OFFLINE
_SYSSMU13$ OFFLINE
_SYSSMU14$ OFFLINE
_SYSSMU15$ OFFLINE
_SYSSMU16$ OFFLINE
_SYSSMU17$ OFFLINE
_SYSSMU18$ OFFLINE
_SYSSMU19$ OFFLINE
_SYSSMU20$ OFFLINE
11 rows selected.
SQL> create table mac1(t1 int) tablespace users;
create table mac1(t1 int) tablespace users
*
ERROR at line 1:
ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'
SQL> alter tablespace undomac add datafile size 200M;
Tablespace altered.
SQL> create table mac1(t1 int) tablespace users;
create table mac1(t1 int) tablespace users
*
ERROR at line 1:
ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'
alter system set "_smu_debug_mode"=4;
SQL> create rollback segment roll1 tablespace undomac;
Rollback segment created.
SQL> select segment_name,status from dba_rollback_segs;
SEGMENT_NAME STATUS
------------------------------ ----------------
SYSTEM ONLINE
ROLL1 OFFLINE ==> 新建的ROLLBACK SEGMENT 直接置为 OFFLINE
_SYSSMU11$ OFFLINE
_SYSSMU12$ OFFLINE
_SYSSMU13$ OFFLINE
_SYSSMU14$ OFFLINE
_SYSSMU15$ OFFLINE
_SYSSMU16$ OFFLINE
_SYSSMU17$ OFFLINE
_SYSSMU18$ OFFLINE
_SYSSMU19$ OFFLINE
SEGMENT_NAME STATUS
------------------------------ ----------------
_SYSSMU20$ OFFLINE
12 rows selected.
SQL> alter rollback segment roll1 online;
Rollback segment altered.
SQL> select segment_name,status from dba_rollback_segs;
SEGMENT_NAME STATUS
------------------------------ ----------------
SYSTEM ONLINE
ROLL1 ONLINE
_SYSSMU11$ OFFLINE
_SYSSMU12$ OFFLINE
_SYSSMU13$ OFFLINE
_SYSSMU14$ OFFLINE
_SYSSMU15$ OFFLINE
_SYSSMU16$ OFFLINE
_SYSSMU17$ OFFLINE
_SYSSMU18$ OFFLINE
_SYSSMU19$ OFFLINE
SEGMENT_NAME STATUS
------------------------------ ----------------
_SYSSMU20$ OFFLINE
12 rows selected.
SQL> alter rollback segment "_SYSSMU11$" online;
alter rollback segment "_SYSSMU11$" online
*
ERROR at line 1:
ORA-01545: rollback segment '_SYSSMU11$' specified not available
SQL> create table mac1(t1 int) tablespace users;
Table created.
SQL> alter rollback segment roll1 offline;
Rollback segment altered.
SQL> create table mac2(t1 int) tablespace users;
create table mac2(t1 int) tablespace users
*
ERROR at line 1:
ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'
SQL> oradebug setmypid;
Statement processed.
SQL> oradebug event 1552 trace name errorstack level 4;
Statement processed.
SQL> create table mac2(t1 int) tablespace users;
create table mac2(t1 int) tablespace users
*
ERROR at line 1:
ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'
SQL> oradebug setmypid;
Statement processed.
SQL> oradebug event 10046 trace name context forever,level 12;
Statement processed.
SQL>
SQL> create rollback segment roll2 tablespace undomac;
Rollback segment created.
FROM 10046:
update undo$ set name=:2,file#=:3,block#=:4,status$=:5,user#=:6,undosqn=:7,xactsqn=:8,scnbas=:9,scnwrp=:10,inst#=:11,ts#=:12,spare1=:13 where us#=:1
Bind#0
oacdty=01 mxl=32(05) mxlc=00 mal=00 scl=00 pre=00
oacflg=18 fl2=0001 frm=01 csi=873 siz=32 off=0
kxsbbbfp=9e29e402 bln=32 avl=05 flg=09
value="ROLL2"
Bind#1
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=7f771d428950 bln=24 avl=02 flg=05
value=2
Bind#2
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=7f771d428920 bln=24 avl=02 flg=05
value=25
Bind#3
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=7f771d4288f0 bln=24 avl=02 flg=05
value=2
Bind#4
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=7f771d4288c0 bln=24 avl=01 flg=05
value=0
Bind#5
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=7f771d428890 bln=24 avl=03 flg=05
value=1135
status$=:5, ==> BIND #3 ==2 , 2 Means OFFLINE
DBA_ROLLBACK_SEGS:
select un.name,
decode(un.user#, 1, 'PUBLIC', 'SYS'),
ts.name,
un.us#,
f.file#,
un.block#,
s.iniexts * ts.blocksize,
decode(bitand(ts.flags, 3),
1,
to_number(NULL),
s.extsize * ts.blocksize),
s.minexts,
s.maxexts,
decode(bitand(ts.flags, 3), 1, to_number(NULL), s.extpct),
decode(un.status$,
2,
'OFFLINE',
3,
'ONLINE',
4,
'UNDEFINED',
5,
'NEEDS RECOVERY',
6,
'PARTLY AVAILABLE',
'UNDEFINED'),
decode(un.inst#, 0, NULL, un.inst#),
un.file#
from sys.undo$ un, sys.seg$ s, sys.ts$ ts, sys.file$ f
where un.status$ != 1
and un.ts# = s.ts#
and un.file# = s.file#
and un.block# = s.block#
and s.type# in (1, 10)
and s.ts# = ts.ts#
and un.ts# = f.ts#
and un.file# = f.relfile# |
|