Oracle Tutorial: Move all data files

Source: Internet
Author: User
Oracle Tutorial: Move all data files. Recently, there is a shortage of hard disk space in a development library. A new disk is added to move all the data files to the new disk.

Oracle Tutorial: Move all data files. Recently, there is a shortage of hard disk space in a development library. A new disk is added to move all the data files to the new disk.

For example, there is a shortage of hard disk space in a development library recently. A new disk is added to prepare to move all the data files to the new disk.
First, list the data files to be moved. The data files belong to the tablespace. The following table spaces can be used in different categories:
Control File
System tablespace
Undo tablespace
Temporary tablespace
Redo log file
User_data tablespace

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS
GTLIONS
GTLIONSTMP

SQL> select file_name, file_id, tablespace_name from dba_data_Files;
FILE_NAME FILE_ID TABLESPACE_NAME
------------------------------------------------------------------------------------------
/U01/Oracle/10g/oradata/gt10g/users01.dbf 4 USERS
/U01/oracle/10g/oradata/gt10g/sysaux01.dbf 3 SYSAUX
/U01/oracle/10g/oradata/gt10g/undotbs01.dbf 2 UNDOTBS1
/U01/oracle/10g/oradata/gt10g/system01.dbf 1 SYSTEM
/U01/oracle/10g/oradata/gt10g/gtlions01.ora 5 GTLIONS

SQL> select file_name, file_id, tablespace_name from dba_temp_Files;

FILE_NAME FILE_ID TABLESPACE_NAME
------------------------------------------------------------------------------------------
/U01/oracle/10g/oradata/gt10g/temp01.dbf 1 TEMP
/U01/oracle/10g/oradata/gt10g/gtlionstmp01.ora 2 GTLIONSTMP

SQL> select name from v $ controlfile;

NAME
Certificate ------------------------------------------------------------------------------------------------------------------------------------------------------
/U01/oracle/10g/oradata/gt10g/control01.ctl
/U01/oracle/10g/oradata/gt10g/control02.ctl
/U01/oracle/10g/oradata/gt10g/control03.ctl

SQL> select member from v $ logfile;

MEMBER
Certificate ------------------------------------------------------------------------------------------------------------------------------------------------------
/U01/oracle/10g/oradata/gt10g/redo03.log
/U01/oracle/10g/oradata/gt10g/redo02.log
/U01/oracle/10g/oradata/gt10g/redo01.log

For the undo tablespace, you can directly operate it when the data is opened:
SQL> create undo tablespace undotbs2 datafile '/u01/oracle/10g/oradata/gt10gnew/undotbs01.dbf' size 20 m autoextend on;

Tablespace created.

SQL> show parameter undo_tablespace;

NAME TYPE VALUE
-----------------------------------------------------------------------------
Undo_tablespace string UNDOTBS1
SQL> alter system set undo_tablespace = 'undotbs2 ';

System altered.

SQL> show parameter undo_tablespace;

NAME TYPE VALUE
-----------------------------------------------------------------------------
Undo_tablespace string undotbs2
SQL> drop tablespace undotbs1;

Tablespace dropped.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.