国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

如何對非系統表空間的數據文件進行改名

2024-07-21 02:43:54
字體:
來源:轉載
供稿:網友
如何在數據庫打開時對非系統表空間的數據文件改名,參考下面步驟:

1. 確定數據文件狀態

select file_name, status

from dba_data_files

where tablespace_name ='tablespace_name';

2. 將表空間置為read-only(時間可能會很長,比重啟數據庫的時間還長)

alter tablespace tablespace_name read only;

3. 確定表空間狀態為read-only

select tablespace_name, status

from dba_tablespaces

where tablespace_name = 'tablespace_name';

4. 用操作系統命令將數據文件拷貝為新的文件名,確認大小一樣

5. 將表空間offline(這時用戶就不能訪問這個表空間了)

alter tablespace tablespace_name offline;

6. 修改控制文件中的相應記錄

alter database rename file

'/full_path_of_old_location/and_datafile_name.dbf'

to

'/full_path_of_new_location/and_datafile_name.dbf';

7. 將表空間online

alter tablespace tablespace_name online;

8. 將表空間置回為read-write

alter tablespace tablespace_name read write;

9. 備份控制文件

alter database backup controlfile to trace;

10. 在操作系統上刪除原來的數據文件

 

說明:

1. 將表空間先置為read-only,是讓用戶不能訪問(read)的時間盡量少點(少的時間為拷貝文件所需的時間)

2. 如果是standby環境,對standby的恢復沒有影響,如果要保持一致的話,mount standby后用cp然后alter database rename file ..... 即可。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巴彦县| 建德市| 霍邱县| 巩义市| 定结县| 镇沅| 蓬莱市| 万全县| 裕民县| 西安市| 凤翔县| 钟山县| 福贡县| 密云县| 黄冈市| 那坡县| 塔河县| 营口市| 凉城县| 应用必备| 甘谷县| 泸西县| 枣庄市| 白河县| 台南县| 汝州市| 松潘县| 涿鹿县| 汕尾市| 灵台县| 广东省| 大渡口区| 三门县| 于都县| 南投县| 屏边| 海丰县| 临高县| 静乐县| 凤庆县| 阿尔山市|