Prev | Current Page 177 | Next

Richard Niemiec

"Oracle Database 10g Performance Tuning Tips & Techniques"


In the following example, we will show you how to move the datafile of the XPORT
tablespace from the file system /u04 to the file system /u06. First, you connect to the database
with SYSDBA privileges using the following command:
sqlplus / as sysdba
Next, you use a query against the dynamic performance views V$DATAFILE and
V$TABLESPACE to confirm the names of the datafiles in the XPORT tablespace:
SQL> select d.name from
2 v$datafile d join v$tablespace t using(ts#)
3 where t.name = 'XPORT';
NAME
-------------------------------------------------------------
/u04/oradata/xport.dbf
1 row selected.
SQL>
To complete step 1, shut down the database:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
Chapter 4: Physical Database Layouts and Storage Management 93
For step 2, you stay in SQL*Plus and use the ???!??? escape character to execute the operating
system command to move the datafile:
SQL> ! mv /u04/oradata/xport.dbf /u06/oradata
In step 3, you start up the database in MOUNT mode so that the control file is available
without opening the datafiles:
SQL> startup mount
ORACLE instance started.
Total System Global Area 422670336 bytes
Fixed Size 1299112 bytes
Variable Size 230690136 bytes
Database Buffers 184549376 bytes
Redo Buffers 6131712 bytes
Database mounted.
For step 4, you change the pathname reference in the control file to point to the new location
of the datafile:
SQL> alter database rename file
2 '/u04/oradata/xport.


Pages:
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189