ITPub博客

首页 > 数据库 > Oracle > 含有特殊字符的数据文件处理

含有特殊字符的数据文件处理

原创 Oracle 作者:super_sky 时间:2014-02-12 08:46:29 0 删除 编辑

检查数据文件,以24号数据文件存在特殊字符为例。
SQL> select file#,name from v$datafile;
     FILE# NAME
---------- ------------------------------------------------------------
        23 /ora10g/oradata/ssc620.data11
        24 /ora10g/oradata/sscusr.data1
        25 /ora10g/oradata/ssc.data10
        26 /ora10g/oradata/ssc620.data12
        27 /ora10g/oradata/ssc.data11
        28 /ora10g/oradata/jtitsm.data1
        29 /ora10g/oradata/ssc.data12
        30 /ora10g/oradata/ssc.data13
        31 /ora10g/oradata/rmants01.dbf

31 rows selected.

SQL>

关闭数据库
RMAN> shutdown immediate;

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

将数据库启动到mount状态
RMAN> startup mount;

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

Total System Global Area   10737418240 bytes

Fixed Size                     2098896 bytes
Variable Size               1560283440 bytes
Database Buffers            9160359936 bytes
Redo Buffers                  14675968 bytes

使用rman copy命令,将有问题的数据文件重新命名。
RMAN> copy datafile 24 to '/ora10g/oradata/new_data/sscusr.data1_1';

Starting backup at 11-MAY-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=386 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00024 name=/ora10g/oradata/sscusr.data1
output filename=/ora10g/oradata/new_data/sscusr.data1_1 tag=TAG20130511T132942 recid=65 stamp=815146183
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 11-MAY-13

修改控制文件中对应的文件内容。
RMAN> run{
2> set newname for datafile 24 to '/ora10g/oradata/new_data/sscusr.data1_1';
3> switch datafile 24;
4> }

executing command: SET NEWNAME

datafile 24 switched to datafile copy
input datafile copy recid=65 stamp=815146183 filename=/ora10g/oradata/new_data/sscusr.data1_1

打开数据库。
RMAN> alter database open;

database opened

RMAN>

检查24号文件
SQL> select file#,name from v$datafile;
     FILE# NAME
---------- ------------------------------------------------------------
        23 /ora10g/oradata/ssc620.data11
        24 /ora10g/oradata/new_data/sscusr.data1_1
        25 /ora10g/oradata/ssc.data10
        26 /ora10g/oradata/ssc620.data12
        27 /ora10g/oradata/ssc.data11
        28 /ora10g/oradata/jtitsm.data1
        29 /ora10g/oradata/ssc.data12
        30 /ora10g/oradata/ssc.data13
        31 /ora10g/oradata/rmants01.dbf

31 rows selected.

SQL>
这时,24号文件对应的文件已经修改为新的文件了。

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

请登录后发表评论 登录
全部评论

注册时间:2011-01-11

  • 博文量
    77
  • 访问量
    758008