• Oracle datafile特殊字符处理


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

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

    SQL> alter tablespace WST_DATA rename datafile 'D:oracle11oradata	eblespaceWST_DATA .DBF' TO 'D:oracle11oradata	e
    blespaceWST_DATA.DBF' ;
    alter tablespace WST_DATA rename datafile 'D:oracle11oradata	eblespaceWST_DATA .DBF' TO 'D:oracle11oradata	eblesp
    aceWST_DATA.DBF'
    *
    ERROR at line 1:
    ORA-01525: error in renaming data files
    ORA-01141: error renaming data file 6 - new file 'D:oracle11oradata	eblespaceWST_DATA.DBF' not found
    ORA-01110: data file 6: 'D:ORACLE11ORADATATEBLESPACEWST_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:oracle11oradata	eblespaceWST_DATA.DBF' ;
    alter tablespace WST_DATA rename datafile 6 TO 'D:oracle11oradata	eblespaceWST_DATA.DBF'
                                              *
    ERROR at line 1:
    ORA-02236: invalid file name

    3.利用RMAN修改

    G:oraclebackupInstanceNames>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:oracle11oradata	eblespaceWST_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:ORACLE11ORADATATEBLESPACEWST_DATA .DBF
    output filename=D:ORACLE11ORADATATEBLESPACEWST_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:oracle11oradata	eblespaceWST_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:ORACLE11ORADATATEBLESPACEWST_DATA.DBF
    
    RMAN> alter database open;
    
    database opened
    
    RMAN> exit
    
    
    Recovery Manager complete.

    4.查看修改情况

    G:oraclebackupInstanceNames>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:ORACLE11ORADATAORA11SYSTEM01.DBF
             2 ONLINE  D:ORACLE11ORADATAORA11SYSAUX01.DBF
             3 ONLINE  D:ORACLE11ORADATAORA11UNDOTBS01.DBF
             4 ONLINE  D:ORACLE11ORADATAORA11USERS01.DBF
             5 ONLINE  D:ORACLE11ORADATATEBLESPACEWSTJFX_DATA.DBF
             6 OFFLINE D:ORACLE11ORADATATEBLESPACEWST_DATA.DBF
             7 ONLINE  D:ORACLE11ORADATATEBLESPACEWSXXZB_DATA.DBF
             8 ONLINE  D:ORACLE11ORADATATEBLESPACETESTBIRPT.DBF
             9 ONLINE  D:ORACLE11ORADATATEBLESPACEWFGS.DBF
            10 ONLINE  D:ORACLE11ORADATATEBLESPACEDJWBI.DBF
            11 ONLINE  E:DATAGYBANKKHFX.DBF
  • 相关阅读:
    Android牟利之道(四)如何推广你的产品,即你的APP
    android权限
    OpenGL 中文 API
    为何不能上网浏览网页 但是可以用QQ聊天
    安装任何软件都提示不能访问windows Installer服务
    初识WAP
    用asp.net 2.0实现网站二级域名(转)
    Visual Studio .NET已检测到指定的Web服务器运行的不是ASP.NET 1.1 版
    用EasyBoot轻松做启动光盘
    我心中的痛房子
  • 原文地址:https://www.cnblogs.com/Alex-Zeng/p/4284545.html
Copyright © 2020-2023  润新知