如何去掉Oracle数据文件名中空格

如题所述

1. 创建测试表空间
sys@ORCL>create tablespace aaa datafile '/11g/app/oracle/oradata/ORCL/aaa bbb.dbf' size 10m;
Tablespace created.
2. 将表空间offline
sys@ORCL>alter tablespace aaa offline;
Tablespace altered.
3. 直接修改数据文件名字报错
sys@ORCL>alter database rename file '/11g/app/oracle/oradata/ORCL/aaa bbb.dbf' to '/11g/app/oracle/oradata/ORCL/aaabbb.dbf';
alter database rename file '/11g/app/oracle/oradata/ORCL/aaa bbb.dbf' to '/11g/app/oracle/oradata/ORCL/aaabbb.dbf'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01141: error renaming data file 8 - new file '/11g/app/oracle/oradata/ORCL/aaabbb.dbf' not
found
ORA-01110: data file 8: '/11g/app/oracle/oradata/ORCL/aaa bbb.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
4. 修改操作系统级数据文件名字
[oracle@test ORCL]$ mv aaa\ bbb.dbf aaabbb.dbf
[oracle@test ORCL]$ ls
aaabbb.dbf redo01.log SYSAUX01.DBF TEST.DBF wmis01.dbf
control01.ctl redo02.log SYSTEM01.DBF UNDOTBS01.DBF
EXAMPLE01.DBF redo03.log temptbs01.dbf USERS01.DBF
5. 修改数据库级数据文件名字
sys@ORCL>alter database rename file '/11g/app/oracle/oradata/ORCL/aaa bbb.dbf' to '/11g/app/oracle/oradata/ORCL/aaabbb.dbf';
Database altered.
6. 将数据文件online
sys@ORCL>alter tablespace aaa online;
Tablespace altered.
sys@ORCL>select name from v$datafile where file#=8;
NAME
温馨提示:答案为网友推荐,仅供参考
相似回答