虚拟主机域名注册-常见问题 → 其他问题 → 其他问题 | |||||||
[原创]ORACLE 丢失非关键数据文件的恢复-PHP空间
以下内容仅代表本人观点:http://blog.ccstock.cn/blog/84224-1439647.htmlhttp://www.joceancloud.com #本文描述丢失非关键数据文件的恢复 一.查看数据库当前状态 SQL> select open_mode from v$database; OPEN_MODE ---------- READ WRITE SQL> 二.移除数据文件模拟丢失 [oracle@ora10g ora10g]$ mv users.dbf /tmp 三.尝试在丢失数据文件的表空间上创建表 SQL> create table t0603(id number) tablespace users; create table t0603(id number) tablespace users * ERROR at line 1: ORA-01658: unable to create INITIAL extent for segment in tablespace USERS SQL> #创建失败,抛出错误. 四.修复数据文件 1.离线表空间 SQL> alter tablespace users offline immediate; Tablespace altered. SQL> 2.rman修复数据文件 [oracle@ora10g ora10g]$ rman target / Recovery Manager: Release 10.2.0.4.0 - Production on Mon Jun 4 13:18:59 2012 Copyright (c) 1982, 2007, Oracle. http://blog.10jqka.com.cn/account/3125/147683125/posts/8179436.shtml connected to target database: ORA10G (DBID=4103695467) RMAN> restore datafile 4; Starting restore at 04-JUN-12 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=37 devtype=DISK channel ORA_DISK_1: starting datafile backupset restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00004 to /oracle/oradata/ora10g/users.dbf channel ORA_DISK_1: reading from backup piece /oracle/product/10.2.0/db_1/dbs/03ncmlku_1_1 channel ORA_DISK_1: restored backup piece 1 piece handle=/oracle/product/10.2.0/db_1/dbs/03ncmlku_1_1 tag=TAG20120604T131157 channel ORA_DISK_1: restore complete, elapsed time: 00:00:03 Finished restore at 04-JUN-12 RMAN> recover datafile 4; Starting recover at 04-JUN-12 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:00 Finished recover at 04-JUN-12 RMAN> 五.联机表空间 http://www.joceancloud.comSQL> alter tablespace users online; Tablespace altered. SQL> create table t0603(id number) tablespace users; Table created. SQL> THE END 免费虚拟主机22US数码:http://windows.joceancloud.com 便宜空间:http://hk.joceancloud.com
|
|||||||
>> 相关文章 | |||||||