码迷,mamicode.com
首页 > 数据库 > 详细

Oracle datafile特殊字符处理

时间:2015-02-10 20:15:42      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:

1.发现数据库的数据文件有特殊字符:

技术分享

2.尝试在sqlplus下用将tablespace offline后修改

SQL> alter tablespace WST_DATA rename datafile D:\oracle11\oradata\teblespace\WST_DATA .DBF TO D:\oracle11\oradata\te
blespace\WST_DATA.DBF ;
alter tablespace WST_DATA rename datafile D:\oracle11\oradata\teblespace\WST_DATA .DBF TO D:\oracle11\oradata\teblesp
ace\WST_DATA.DBF*
ERROR at line 1:
ORA-01525: error in renaming data files
ORA-01141: error renaming data file 6 - new file D:\oracle11\oradata\teblespace\WST_DATA.DBF not found
ORA-01110: data file 6: D:\ORACLE11\ORADATA\TEBLESPACE\WST_DATA .DBF
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) 系统找不到指定的文件。

SQL> alter tablespace WST_DATA rename datafile 6 TO D:\oracle11\oradata\teblespace\WST_DATA.DBF ;
alter tablespace WST_DATA rename datafile 6 TO D:\oracle11\oradata\teblespace\WST_DATA.DBF
                                          *
ERROR at line 1:
ORA-02236: invalid file name

3.利用RMAN修改

G:\oraclebackup\InstanceNames>rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Feb 10 14:50:09 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: ORA11 (DBID=723822444)

RMAN> shutdown immediate;

using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area    1071333376 bytes

Fixed Size                     1375792 bytes
Variable Size                738197968 bytes
Database Buffers             327155712 bytes
Redo Buffers                   4603904 bytes

RMAN> copy datafile 6 to D:\oracle11\oradata\teblespace\WST_DATA.DBF;

Starting backup at 10-FEB-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00006 name=D:\ORACLE11\ORADATA\TEBLESPACE\WST_DATA .DBF
output filename=D:\ORACLE11\ORADATA\TEBLESPACE\WST_DATA.DBF tag=TAG20150210T145554 recid=1 stamp=871311470
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:56
Finished backup at 10-FEB-15

RMAN>run{ 
2> set newname for datafile 6 to D:\oracle11\oradata\teblespace\WST_DATA.DBF; 
3> switch datafile 6; 
4> }

executing command: SET NEWNAME

datafile 6 switched to datafile copy
input datafile copy recid=1 stamp=871311470 filename=D:\ORACLE11\ORADATA\TEBLESPACE\WST_DATA.DBF

RMAN> alter database open;

database opened

RMAN> exit


Recovery Manager complete.

4.查看修改情况

G:\oraclebackup\InstanceNames>sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 10 15:01:41 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> col name format a60;
SQL> set linesize 180;
SQL> select file#,status,name from v$datafile;

     FILE# STATUS  NAME
---------- ------- ------------------------------------------------------------
         1 SYSTEM  D:\ORACLE11\ORADATA\ORA11\SYSTEM01.DBF
         2 ONLINE  D:\ORACLE11\ORADATA\ORA11\SYSAUX01.DBF
         3 ONLINE  D:\ORACLE11\ORADATA\ORA11\UNDOTBS01.DBF
         4 ONLINE  D:\ORACLE11\ORADATA\ORA11\USERS01.DBF
         5 ONLINE  D:\ORACLE11\ORADATA\TEBLESPACE\WSTJFX_DATA.DBF
         6 OFFLINE D:\ORACLE11\ORADATA\TEBLESPACE\WST_DATA.DBF
         7 ONLINE  D:\ORACLE11\ORADATA\TEBLESPACE\WSXXZB_DATA.DBF
         8 ONLINE  D:\ORACLE11\ORADATA\TEBLESPACE\TESTBIRPT.DBF
         9 ONLINE  D:\ORACLE11\ORADATA\TEBLESPACE\WFGS.DBF
        10 ONLINE  D:\ORACLE11\ORADATA\TEBLESPACE\ZDJWBI.DBF
        11 ONLINE  E:\DATA\GYBANK\KHFX.DBF

 

Oracle datafile特殊字符处理

标签:

原文地址:http://www.cnblogs.com/Alex-Zeng/p/4284545.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!