oracle表空间 online,表空间offline和online的研究

SQL*Plus: Release 9.2.0.1.0 - Production on Tue Apr 12 10:58:27 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

SQL> create tablespace hc datafile 'e:\1.dbf' size 10M;

Tablespace created.

SQL> alter tablespace hc add datafile 'e:\2.dbf'size 10M;

Tablespace altered.

SQL> alter database datafile 'e:\2.dbf' offline drop;

Database altered.

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> create table test (a number) tablespace hc;

Table created.

SQL> insert into test values(1);

1 row created.

SQL> commit;

Commit complete.

SQL> alter tablespace hc offline temporary;

Tablespace altered.

SQL> alter tablespace hc online;

alter tablespace hc online

*

ERROR at line 1:

ORA-01113: file 7 needs media recovery

ORA-01110: data file 7: 'E:\2.DBF'

SQL> recover datafile 7

ORA-00279: change 2154323474 generated at 04/12/2005 10:58:59 needed for threa

1

ORA-00289: suggestion : D:\ORACLE9I\ARCHIVE\PRIMARY\ARC00306.001

ORA-00280: change 2154323474 for thread 1 is in sequence #306

Specify log: {=suggested | filename | AUTO | CANCEL}

auto

ORA-00308: cannot open archived log 'D:\ORACLE9I\ARCHIVE\PRIMARY\ARC00306.001'

ORA-27041: unable to open file

OSD-04002: unable to open file

O/S-Error: (OS 2) 系统找不到指定的文件。

ORA-00308: cannot open archived log 'D:\ORACLE9I\ARCHIVE\PRIMARY\ARC00306.001'

ORA-27041: unable to open file

OSD-04002: unable to open file

O/S-Error: (OS 2) 系统找不到指定的文件。

SQL> select *from test;

select *from test

*

ERROR at line 1:

ORA-00376: file 6 cannot be read at this time

ORA-01110: data file 6: 'E:\1.DBF'

SQL> select ts#,undofile#,undoblock# from ts$;

TS#  UNDOFILE# UNDOBLOCK#

---------- ---------- ----------

0          0          0

1          0          0

2          0          0

3          0          0

4          0          0

5          0          0

6          0          0

7          0          0

8          0          0

9          1      23913

10          0          0

TS#  UNDOFILE# UNDOBLOCK#

---------- ---------- ----------

11          0          0

12          1      23865

13 rows selected.

SQL> select ts#,name,undofile#,undoblock# from ts$;

TS# NAME                            UNDOFILE# UNDOBLOCK#

---------- ------------------------------ ---------- ----------

0 SYSTEM                                  0          0

1 UNDOTBS1                                0          0

2 TEMP                                    0          0

3 EXAMPLE                                 0          0

4 TOOLS                                   0          0

5 USERS                                   0          0

6 TEST                                    0          0

7 TEST_TBS                                0          0

8 TEST2                                   0          0

9 TEST3                                   1      23913

10 AAA                                     0          0

TS# NAME                            UNDOFILE# UNDOBLOCK#

---------- ------------------------------ ---------- ----------

11 LOGZGH                                  0          0

12 HC                                      1      23865

13 rows selected.

SQL> update ts$ set scnwrp=65536,scnbas=3445667786 where ts#=12;

1 row updated.

SQL> commit;

Commit complete.

SQL> update ts$ set online$=1,scnbas=0,scnwrp=0 where ts#=12;

1 row updated.

SQL> commit;

Commit complete.

SQL> update seg$ set type#=3 where file#=1 and block#=23865;

1 row updated.

SQL> commit;

Commit complete.

SQL> update ts$ set undofile#=0,undoblock#=0 where ts#=12;

1 row updated.

SQL> delete from seg$ where file#=1 and block#=23865;

1 row deleted.

SQL> commit;

Commit complete.

SQL> select *from test;

select *from test

*

ERROR at line 1:

ORA-00376: file 6 cannot be read at this time

ORA-01110: data file 6: 'E:\1.DBF'

SQL> alter tablespace hc online;

alter tablespace hc online

*

ERROR at line 1:

ORA-01113: file 7 needs media recovery

ORA-01110: data file 7: 'E:\2.DBF'

SQL> select *from test;

select *from test

*

ERROR at line 1:

ORA-00376: file 6 cannot be read at this time

ORA-01110: data file 6: 'E:\1.DBF'

SQL> alter tablespace hc offline;

alter tablespace hc offline

*

ERROR at line 1:

ORA-01191: file 6 is already offline - cannot do a normal offline

ORA-01110: data file 6: 'E:\1.DBF'

SQL> alter tablespace hc online;

alter tablespace hc online

*

ERROR at line 1:

ORA-01113: file 7 needs media recovery

ORA-01110: data file 7: 'E:\2.DBF'

SQL> select *from test;

select *from test

*

ERROR at line 1:

ORA-00376: file 6 cannot be read at this time

ORA-01110: data file 6: 'E:\1.DBF'

SQL> alter database datafile 6 online;

Database altered.

SQL> select *from test;

A

----------

1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值