answersLogoWhite

0


Best Answer
â–º Rename a Datafile in Oracle(10g):-SQL> select name from v$datafile;

NAME

--------------------------------------------------------------------------------

/u01/app/oracle/product/10.2.0/oradata/abab/system.dbf

/u01/app/oracle/product/10.2.0/oradata/abab/undo.dbf

/u01/app/oracle/product/10.2.0/oradata/abab/sysaux.dbf

/u01/app/oracle/product/10.2.0/oradata/abab/usr01.dbf

/u01/app/oracle/product/10.2.0/oradata/abab/usr02.dbf

/u01/app/oracle/product/10.2.0/oradata/abab/asm01.dbf

/u01/app/oracle/product/10.2.0/oradata/abab/usr04.dbf

/u01/app/oracle/product/10.2.0/oradata/abab/m123.dbf

8 rows selected.

SQL> alter tablespace msb read only;

Tablespace altered.

SQL> select TABLESPACE_NAME, status from dba_tablespaces;

TABLESPACE_NAME STATUS

------------------------------ ---------

SYSTEM ONLINE

UNDOTBS1 ONLINE

SYSAUX ONLINE

TEMP ONLINE

USR01 ONLINE

USR02 ONLINE

TEMP01 ONLINE

INNER ONLINE

ASM ONLINE

MSB READ ONLY

TEMPORARY ONLINE

TABLESPACE_NAME STATUS

------------------------------ ---------

TSPUNDO ONLINE

12 rows selected.

SQL> alter tablespace msb offline;

Tablespace altered.

============================================================

Work on OS level:-

[oracle@abab-YYY-XXX abab]$ CD /u01/app/oracle/product/10.2.0/oradata/nisi/

[oracle@abab-YYY-XXX abab]$ ls

asm01.dbf redo1.log sysaux.dbf undo.dbf usr04.dbf

m123.dbf redo2.log system.dbf usr01.dbf

redo3.log temporary.dbf usr02.dbf

[oracle@abab-YYY-XXX abab]$ cp m123.dbf mmm.dbf

[oracle@abab-YYY-XXX abab]$ ls

asm01.dbf redo1.log sysaux.dbf undo.dbf usr04.dbf

m123.dbf redo2.log system.dbf usr01.dbf

mmm.dbf redo3.log temporary.dbf usr02.dbf

[oracle@abab-YYY-XXX abab]$

============================================================

SQL> alter database rename file

2 '/u01/app/oracle/product/10.2.0/oradata/abab/m123.dbf'

3 to

4 '/u01/app/oracle/product/10.2.0/oradata/abab/mmm.dbf';

Database altered.

SQL> alter tablespace msb online;

Tablespace altered.

SQL> alter tablespace msb read write;

Tablespace altered.

SQL> select name, status from v$datafile;

NAME STATUS

------------------------------------------------------------ -------

/u01/app/oracle/product/10.2.0/oradata/abab/system.dbf SYSTEM

/u01/app/oracle/product/10.2.0/oradata/abab/undo.dbf ONLINE

/u01/app/oracle/product/10.2.0/oradata/abab/sysaux.dbf ONLINE

/u01/app/oracle/product/10.2.0/oradata/abab/usr01.dbf ONLINE

/u01/app/oracle/product/10.2.0/oradata/abab/usr02.dbf ONLINE

/u01/app/oracle/product/10.2.0/oradata/abab/asm01.dbf ONLINE

/u01/app/oracle/product/10.2.0/oradata/abab/usr04.dbf ONLINE

/u01/app/oracle/product/10.2.0/oradata/abab/mmm.dbf ONLINE

8 rows selected.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you rename a datafile in Oracle?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between database file and datafile?

Datafile is a group of files in each table space in an Oracle database. Database files are all files that are found within the database.


What oracle will do in datafile media recovery?

first of all ur database in mount mode.... and then enable archieve log and then check


What is the meaning of i in oracle9i?

Oracle i means "Internet", that means oracle manipulate data via internet. But next oracle comes with "Grid Computing" and rename with 'g'


How do you rellocate a datafile?

Alter tablespace is the command


What is a Checkpoint in oracle?

A checkpoint performs the following three operations:Every dirty block in the buffer cache is written to the data files. That is, it synchronizes the datablocks in the buffer cache with the datafiles on disk. It's the DBWR that writes all modified databaseblocks back to the datafiles.The latest SCN is written (updated) into the datafile header.The latest SCN is also written to the controlfiles.The update of the datafile headers and the control files is done by the LGWR(CKPT if CKPT is enabled). As of version 8.0, CKPT is enabled by default.


What is the industry average for Capital Expenditure?

http://people.stern.nyu.edu/adamodar/New_Home_Page/datafile/capex.html


What has the author Neil Webster written?

Neil Webster has written: 'DMU Datafile' 'European Locomotive Pocket Book' 'DMU and Light Rail Datafile' 'Locomotive Hauled Travel' 'European Loco Pocket Book' 'EMU Datafile' 'European Railways' 'Panchayati raj and the decentralisation of development planning in West Bengal' -- subject(s): Panchayat, Local government


How do you rename a directory in UNIX?

You rename a directory the same way you rename a file. Use the 'mv' command to rename it.


You are given a text file named datatxt The file contains a list of integer scores The number of scores is unknown You are required to write a C program to read ALL the scores from the?

#include #include #include using std::cin;using std::cout;using std::endl;using std::ifstream;//function prototypesint numberOfElements(ifstream& inData);void readDataFromFile(ifstream& inData, long* dataFile, int arraySize);int main(){const char fileName[] = "data.txt";ifstream inData;inData.open(fileName, std::ios::in);if (inData.fail()){cout


What are modules of oracle?

Oracle sells many functional modules which use the Oracle RDBMS as a back-end, notably Oracle Financials, Oracle HRMS, Oracle SCM, Oracle Projects, Oracle CRM, Oracle Procurement.


What is sql loader?

SQL LOADER is an Oracle utility used to load data into table given a datafile which has the records that need to be loaded. SQL*Loader takes data file, as well as a control file, to insert data into the table. When a Control file is executed, it can create Three (3) files called a log file, bad file or reject file, discard file. * Log file tells you the state of the tables and indexes and the number of logical records already read from the input datafile. This information can be used to resume the load where it left off. * Bad file or reject file gives you the records that were rejected because of formatting errors or because they caused Oracle errors. * Discard filespecifies the records that do not meet any of the loading criteria like when any of the WHEN clauses specified in the control file. These records differ from rejected records.


What is the meaning of i in oracle 9i?

The i in Oracle 8i and Oracle 9i stands for INTERNET....The i in Oracle 8i and Oracle 9i stands for INTERNET....The i in Oracle 8i and Oracle 9i stands for INTERNET....The i in Oracle 8i and Oracle 9i stands for INTERNET....