Oracle資料表空間資料檔案轉移方法____Oracle

來源:互聯網
上載者:User


Bywhhuang 問題:

         Oracle安裝到了根目錄下,根目錄的空間不足下,增加一個硬碟掛載到home下,把資料表空間的資料檔案轉移到home目錄下。

  硬碟格式化

新增加的硬碟需要格式化。方法如下:

查看分區格式:

[root@centos iavp]# df -TH

Filesystem    Type    Size   Used  Avail Use% Mounted on

/dev/vda2     ext4     53G    33G    18G 65% /

tmpfs       tmpfs     4.2G      0  4.2G   0% /dev/shm

/dev/vda1     ext4    204M    27M   167M 14% /boot

/dev/vdd      ext4     53G    33G    18G 65% /

/dev/vdd      ext4    212G    16G   185G  8% /home

 

格式化:

#mfks -t ext4/dev/vdd

 

掛載:

# mount /dev/vdd /home

 

備忘:如提busy錯誤,則執行如下命令:

#fuser -km /home 轉移方法

         使用root賬戶登入伺服器

1、將新掛載的home目錄賦許可權

#chmod -R 777/home

 

以下使用oracle賬戶登入伺服器

2、將資料表空間離線處理

alter tablespace ms50testlogs offline;

 

3、跳躍表空間檔案

cp/opt/oracle/oradata/iavp/ms50testlogs_data.dbf ms50testlogs_data.dbf

 

3、使用oracle賬戶登入伺服器,使用命令sqlplus/ as sysdba登入oracle資料庫,執行轉移sql

altertablespace ms50testlogs

  renamedatafile

    '/opt/oracle/oradata/iavp/ms50testlogs_data.dbf'

  to

'/home/oracle/ms50testlogs_data.dbf';

4、執行recover命令

alterdatabaserecoverdatafile  '/home/oracle/ms50testlogs_data.dbf';

 

5、將資料表空間聯機處理

alter tablespace ms50testlogs online;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.