renaming Datafile

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
lobo
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 19
Joined: Tue, 09 May 2006 2:04 pm
Location: Suzano
Valeu!!!!

Hello friends from Forum I am a beginner in Oracle.
I created a Datafile without the Example DBF Example:

Select all

alter tablespace DAN add datafile '/oradbs/oradata/dan/tsd01' size 200M; 
Now I do not know how to do to rename and place the extension .dbf
99] Somebody can help me please.

Thanks.

Daniel
gilbertoca
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 372
Joined: Tue, 24 Jan 2006 3:33 pm
Location: Palmas - TO
Contact:

Good morning, Daniel!

maybe this http://jroller.com/page/gilbertoca?entr ... les_oracle
help.

Gilberto
lobo
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 19
Joined: Tue, 09 May 2006 2:04 pm
Location: Suzano
Valeu!!!!

Hi Gilberto I saw the example that you put in the forum ... but in my case when I created I added a Datafile I did not put the .dbf extension

I would like to know if this can imply some error.

Please need help

Thanks.
gilbertoca
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 372
Joined: Tue, 24 Jan 2006 3:33 pm
Location: Palmas - TO
Contact:

I think not!
But it will surely cause headache in the future.
Management and maintenance of these files will be compromised because someone may forget that that file without extension belongs to a database.

Gilberto
lobo
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 19
Joined: Tue, 09 May 2006 2:04 pm
Location: Suzano
Valeu!!!!

Valeu Gilberto,

But you know some solution for me to change this file without the Extesão .dbf or I can use that example of renaming:
Ex:

0]]

Using this command, it does not work any extension.
gilbertoca
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 372
Joined: Tue, 24 Jan 2006 3:33 pm
Location: Palmas - TO
Contact:

Select all

alter tablespace tablespace_name rename datafile 
'/var/local/oradata/desenv/file_name' to 
'/var/local/oradata/desenv/file_name.dbf';
Using this command, it does not work any extension.
Daniel, not just that!
In that link I passed you have the necessary steps.
I will post here the most important part (cake recipe):

Well, come on! I know the steps to rename / move a Datafile is as follows:

* 1. Put the tablespace in question offline:

Select all

 alter tablespace tablespace_name offline;
* 2. Move / rename files from this tablespace through the operating system:

Select all

mv /var/local/oradata/desenv/file_name.ora /var/local/oradata/desenv/file_name.dbf
* 3. Inform the database on the new name:

Select all

alter tablespace tablespace_name RENAME DATAFILE '/var/local/oradata/desenv/file_name.ora' TO '/var/local/oradata/desenv/file_name.dbf';
* 4. Return the tablespace to the state online:

Select all

 alter tablespace tablespace_name online
Gilberto
lobo
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 19
Joined: Tue, 09 May 2006 2:04 pm
Location: Suzano
Valeu!!!!

It worked here ... Here in Parana I'm starting with Oracle ..

Embrace,

Daniel
pereira_antonio
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Posts: 1
Joined: Fri, 03 Aug 2018 11:11 am

Even Oracle 12C, to rename a Datafile it was necessary to make it OFLINE, as well explained in this post. With the advent of 12C, rename or move to another location can be easily done only with the command below:

Select all

ALTER DATABASE MOVE DATAFILE '/var/local/oradata/desenv/file_name' to '/var/local/oradata/desenv/file_name.dbf';
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests