ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 数据文件丢失

数据文件丢失

原创 Linux操作系统 作者:gaiguoxiang 时间:2012-05-24 17:21:49 0 删除 编辑
环境:数据库无法关闭,发现数据文件对视。如果该数据文件不重要(可以删除),想要正常关闭数据库可以用参照以下:
 
 
 
 
SQL> shutdown immediate;
ORA-01116: error in opening database file 7
ORA-01110: data file 7: '/oradb/oradata/ggx/a2.dbf'
ORA-27041: unable to open file
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
SQL> select * from V$tablespace;
       TS# NAME                                     INC BIG FLA ENC
---------- ---------------------------------------- --- --- --- ---
         0 SYSTEM                                   YES NO  YES
         1 UNDOTBS1                                 YES NO  YES
         2 SYSAUX                                   YES NO  YES
         3 TEMP                                     NO  NO  YES
         4 USERS                                    YES NO  YES
         5 GGX                                      YES NO  YES
         7 A2                                       YES NO  YES
7 rows selected.
SQL> drop tablespace A2;
drop tablespace A2
*
ERROR at line 1:
ORA-01116: error in opening database file 7
ORA-01110: data file 7: '/oradb/oradata/ggx/a2.dbf'
ORA-27041: unable to open file
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3

SQL>
SQL>
SQL> alter database datafile '/oradb/oradata/ggx/a2.dbf' offline;
alter database datafile '/oradb/oradata/ggx/a2.dbf' offline
*
ERROR at line 1:
ORA-01145: offline immediate disallowed unless media recovery enabled

SQL> alter database datafile '/oradb/oradata/ggx/a2.dbf' offline drop;
Database altered.
SQL> select * from V$tablespace;
       TS# NAME                                     INC BIG FLA ENC
---------- ---------------------------------------- --- --- --- ---
         0 SYSTEM                                   YES NO  YES
         1 UNDOTBS1                                 YES NO  YES
         2 SYSAUX                                   YES NO  YES
         3 TEMP                                     NO  NO  YES
         4 USERS                                    YES NO  YES
         5 GGX                                      YES NO  YES
         7 A2                                       YES NO  YES
7 rows selected.
SQL> select name,status from V$datafile;
NAME                                     STATUS
---------------------------------------- -------
/oradb/oradata/ggx/system01.dbf          SYSTEM
/oradb/oradata/ggx/undotbs01.dbf         ONLINE
/oradb/oradata/ggx/sysaux01.dbf          ONLINE
/oradb/oradata/ggx/users01.dbf           ONLINE
/oradb/oradata/ggx/ggx01.dbf             ONLINE
/oradb/oradata/ggx/a2.dbf                RECOVER
6 rows selected.
SQL> alter database datafile '/oradb/oradata/ggx/a2.dbf' offline;
Database altered.
SQL> select name,status from V$datafile;
NAME                                     STATUS
---------------------------------------- -------
/oradb/oradata/ggx/system01.dbf          SYSTEM
/oradb/oradata/ggx/undotbs01.dbf         ONLINE
/oradb/oradata/ggx/sysaux01.dbf          ONLINE
/oradb/oradata/ggx/users01.dbf           ONLINE
/oradb/oradata/ggx/ggx01.dbf             ONLINE
/oradb/oradata/ggx/a2.dbf                RECOVER
6 rows selected.
SQL> drop tablespace a2;
Tablespace dropped.
SQL> select name,status from V$datafile;
NAME                                     STATUS
---------------------------------------- -------
/oradb/oradata/ggx/system01.dbf          SYSTEM
/oradb/oradata/ggx/undotbs01.dbf         ONLINE
/oradb/oradata/ggx/sysaux01.dbf          ONLINE
/oradb/oradata/ggx/users01.dbf           ONLINE
/oradb/oradata/ggx/ggx01.dbf             ONLINE
SQL> select * from V$tablespace;
       TS# NAME                                     INC BIG FLA ENC
---------- ---------------------------------------- --- --- --- ---
         0 SYSTEM                                   YES NO  YES
         1 UNDOTBS1                                 YES NO  YES
         2 SYSAUX                                   YES NO  YES
         3 TEMP                                     NO  NO  YES
         4 USERS                                    YES NO  YES
         5 GGX                                      YES NO  YES
6 rows selected.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25517773/viewspace-730865/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2011-06-22

  • 博文量
    41
  • 访问量
    105695