• 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
  • 相关阅读:
    arcgis10.4.X的oracle数据库要求
    面试高峰期,如何应对面试官的jvm刁难,特写一篇jvm面经(第一部)
    某公司面试打分文档,75分通过
    git-github 提示Permission denied (publickey) (windows)
    jar项目 BeanDefinitionParsingException: Configuration problem:Unable to locate Spring NamespaceHandler for XML schema namespace
    关于No Spring WebApplicationInitializer types detected on classpath的提示,tomcat 卡主
    spring+orm框架的兼容问题
    程序员常用工具
    IDEA-常见问题
    IDEA-基本设置
  • 原文地址:https://www.cnblogs.com/Alex-Zeng/p/4284545.html
Copyright © 2020-2023  润新知