Home » RDBMS Server » Server Administration » Rename datafile With spaces
Rename datafile With spaces [message #274620] Tue, 16 October 2007 10:55 Go to next message
Nokia
Messages: 15
Registered: July 2007
Junior Member
I created a tablespace but there is a space in the datafile how can i change or rename it without dropping or recreating.

SQL> create tablespace  abc datafile 'c:\ abc01.dbf' size 5m;

Tablespace created.


 


When tried to rename

SQL> alter tablespace abc offline;

Tablespace altered.

SQL> alter tablespace abc rename datafile  'c:\ abc01.dbf' to 'c:\oracle\abc01.dbf' ;
alter tablespace abc rename datafile  'c:\ abc01.dbf' to 'c:\oracle\abc01.dbf'
*
ERROR at line 1:
ORA-01525: error in renaming data files
ORA-01141: error renaming data file 7 - new file 'c:\oracle\abc01.dbf' not
found
ORA-01110: data file 7: 'C:\ ABC01.DBF'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.

Re: Rename datafile With spaces [message #274624 is a reply to message #274620] Tue, 16 October 2007 11:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to move the file to its final location between "offline" and "rename".

Regards
Michel
Re: Rename datafile With spaces [message #274627 is a reply to message #274624] Tue, 16 October 2007 11:12 Go to previous messageGo to next message
Nokia
Messages: 15
Registered: July 2007
Junior Member
Yes i manually copied file after OFFLINE command and then i issued rename command.
Re: Rename datafile With spaces [message #274630 is a reply to message #274627] Tue, 16 October 2007 11:24 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> create tablespace  abc datafile 'c:\ abc01.dbf' size 5m;

Tablespace created.

SQL> alter tablespace abc offline;

Tablespace altered.

SQL> alter tablespace abc rename datafile  'c:\ abc01.dbf' to 'c:\def.dbf';
alter tablespace abc rename datafile  'c:\ abc01.dbf' to 'c:\def.dbf'
*
ERROR at line 1:
ORA-01525: error in renaming data files
ORA-01141: error renaming data file 13 - new file 'c:\def.dbf' not found
ORA-01110: data file 13: 'C:\ ABC01.DBF'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) Le fichier sp┌cifi┌ est introuvable.


SQL> host move "c:\ abc01.dbf" c:\def.dbf

SQL> alter tablespace abc rename datafile  'c:\ abc01.dbf' to 'c:\def.dbf';

Tablespace altered.

SQL> alter tablespace abc online;

Tablespace altered.

SQL> drop tablespace abc including contents and datafiles;

Tablespace dropped.

Regards
Michel
Re: Rename datafile With spaces [message #274632 is a reply to message #274630] Tue, 16 October 2007 11:42 Go to previous messageGo to next message
Nokia
Messages: 15
Registered: July 2007
Junior Member
Thank you.I also tried it with import and export.
Re: Rename datafile With spaces [message #274636 is a reply to message #274632] Tue, 16 October 2007 11:55 Go to previous messageGo to next message
Nokia
Messages: 15
Registered: July 2007
Junior Member
I'm unable to use CP or MV command on the file name which have space while creating datafile.


$ cp QLINK3_TB_PT_TRANS_LDCONN_L2TS.DBF QLINK3_TB_PT_TRANS_LDCONN_L2TS.DBF.bak
cp: cannot access QLINK3_TB_PT_TRANS_LDCONN_L2TS.DBF



but when i issue the same command on different file name it copy.
$ cp QLINK3_DEL_HISTORY_IDX_TS.DBF QLINK3_DEL_HISTORY_IDX_TS.DBF.bak
$
Re: Rename datafile With spaces [message #274638 is a reply to message #274636] Tue, 16 October 2007 12:03 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Either put the filename in quotes or escape the filename

$ touch " test.txt"
$ ls test.txt
ls: cannot access test.txt: No such file or directory
$ ls " test.txt"
 test.txt
$ ls \ test.txt
 test.txt
$ rm \ test.txt
$

Re: Rename datafile With spaces [message #274647 is a reply to message #274636] Tue, 16 October 2007 12:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't hijack a topic, create your own, your question is
1/ not related to Oracle
2/ not related to first question

Regards
Michel
Re: Rename datafile With spaces [message #274657 is a reply to message #274638] Tue, 16 October 2007 13:26 Go to previous messageGo to next message
Nokia
Messages: 15
Registered: July 2007
Junior Member
Thank You....
Re: Rename datafile With spaces [message #274658 is a reply to message #274647] Tue, 16 October 2007 13:28 Go to previous messageGo to next message
Nokia
Messages: 15
Registered: July 2007
Junior Member
Michel Cadot wrote on Tue, 16 October 2007 12:27

Don't hijack a topic, create your own, your question is
1/ not related to Oracle
2/ not related to first question

Regards
Michel




For me??
Re: Rename datafile With spaces [message #274659 is a reply to message #274658] Tue, 16 October 2007 13:34 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes for you, I didn't see it is YOUR topic (sorry) but it is not the same question or if it is then you did not read carefully the move command I posted.

Regards
Michel
Re: Rename datafile With spaces [message #274669 is a reply to message #274659] Tue, 16 October 2007 14:53 Go to previous message
Nokia
Messages: 15
Registered: July 2007
Junior Member
Sorry yes that was mine mistake.



Thanks a lot...
Previous Topic: oracle packs
Next Topic: append hint with dblink.
Goto Forum:
  


Current Time: Sat Dec 03 22:22:10 CST 2016

Total time taken to generate the page: 0.05287 seconds