<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    計(jì)算機(jī)學(xué)習(xí)積累

    ----轉(zhuǎn)載有理,轉(zhuǎn)載是想研究,想研究才會(huì)看,看了才會(huì)有感想,轉(zhuǎn)載后我有時(shí)會(huì)寫一些自己的感受
    數(shù)據(jù)加載中……

    Oracle數(shù)據(jù)文件移動(dòng)方法 - 轉(zhuǎn)

    6.2 參考資料:Oracle數(shù)據(jù)庫移動(dòng)方法
    這里所指“數(shù)據(jù)庫移動(dòng)”是將Oracle數(shù)據(jù)文件(系統(tǒng)數(shù)據(jù)文件或用戶數(shù)據(jù)文件)、控制文件、重做日志移動(dòng)至新的存儲(chǔ)路徑,并修改Oracle相關(guān)配置,使之可以重新正常啟動(dòng)。這種應(yīng)用常見于系統(tǒng)擴(kuò)容后的Oracle數(shù)據(jù)存儲(chǔ)路徑的調(diào)整。
    以下面為例,移動(dòng)系統(tǒng)表空間的相關(guān)文件位置,并重新配置Oracle。假設(shè)原存儲(chǔ)路徑為/oradata,新存儲(chǔ)路徑為/oratest。
    6.2.1 移動(dòng)數(shù)據(jù)庫文件
    1) 獲取數(shù)據(jù)庫相關(guān)信息
    查看一下數(shù)據(jù)庫的文件內(nèi)容:
    sqlplus /nolog
    SQL> connect /as sysdba
    SQL> select * from v$datafile;
    SQL> select * from v$controlfile
    SQL> select * from v$logfile;

    2) 移動(dòng)數(shù)據(jù)庫文件
    以shutdown immediate模式關(guān)閉數(shù)據(jù)庫,復(fù)制數(shù)據(jù)文件到新路徑/oratest/下。需復(fù)制的文件有:
    system01.dbf
    indx01.dbf
    undotbs01.dbf
    drsys01.dbf
    users01.dbf
    tools01.dbf
    control01.ctl
    control02.ctl
    control03.ctl
    redo01.log
    redo02.log
    redo03.log

    3)修改數(shù)據(jù)文件的位置
    以mount模式啟動(dòng)Oracle,
    SQL>startup mount;
    SQL>alter database rename file '/oradata/system01.dbf' to '/oratest/system01.dbf" ;
    SQL>alter database rename file '/oradata/indx01.dbf' to '/oratest/indx01.dbf" ;
    SQL>alter database rename file '/oradata/undotbs01.dbf' to '/oratest/undotbs01.dbf" ;
    SQL>alter database rename file '/oradata/drsys01.dbf' to '/oratest/drsys01.dbf" ;
    SQL>alter database rename file '/oradata/users01.dbf' to '/oratest/users01.dbf" ;
    SQL>alter database rename file '/oradata/tools01.dbf' to '/oratest/tools01.dbf" ;

    注意:在此步驟只能更改已移動(dòng)的數(shù)據(jù)庫文件,不能更改控制文件、日志文件和TEMP文件。
    6.2.2 移動(dòng)控制文件
    1)備份SPFILE中的內(nèi)容:
    重新啟動(dòng)數(shù)據(jù)庫:
    SQL> startup;
    SQL> create pfile=’/init.ora’ from spfile;

    2)修改init.ora文件內(nèi)容:
    將*.control_files='/oradata/control01.ctl','/oradata/control02.ctl','/oradata/control03.ctl' 更改為新目錄位置的控制文件,如:
    *.control_files='/oratest/control01.ctl','/oratest/control02.ctl','/oratest/control03.ctl'
    關(guān)閉數(shù)據(jù)庫。

    3)倒入?yún)?shù)文件
    以init.ora為參數(shù)啟動(dòng)數(shù)據(jù)庫,
    SQL> startup pfile=’/init.ora’;
    SQL> create spfile from pfile=’/ init.ora’;
    SQL> shutdown immediate;
    從spfile中進(jìn)行啟動(dòng),
    SQL> startup;
    控制文件移動(dòng)更改完成。
    6.2.3 重定位LOG文件
    日志文件的移動(dòng)方式有兩種,一種是移動(dòng)(rename方式),另一種是重建。下面僅舉例說明移動(dòng)方式。
    移動(dòng)Redo Log文件:
    SQL>alter database rename file '/oradata/redo01.log' to '/oratest/redo01.log" ;
    SQL>alter database rename file '/oradata/redo02.log' to '/oratest/redo02.log" ;
    SQL>alter database rename file '/oradata/redo03.log' to '/oratest/redo03.log" ;
    6.2.4 重建系統(tǒng)臨時(shí)(temp)文件系統(tǒng)
    在移動(dòng)數(shù)據(jù)庫表空間時(shí),TEMP文件是不能被移動(dòng)的,可以重建一個(gè)TEMP表空間,并設(shè)置為系統(tǒng)默認(rèn)的TEMP文件系統(tǒng)。再刪除原來的TEMP表空間,達(dá)到移動(dòng)表空間的目的。
    SQL>create temporary tablespace TEMP02 tempfile ‘/oratest/temp02.dbf’ size 500m extent management local uniform size 10m;
    SQL>alter database default temporary tablespace TEMP02;

    確認(rèn)創(chuàng)建設(shè)置成功后,再刪除原來的TEMP文件。
    SQL>drop tablespace TEMP including contents and datafiles;
    6.2.5 測試數(shù)據(jù)庫
    重啟ORACLE數(shù)據(jù)
    $ sqlplus “/as sysdba”
    SQL> startup;
    SQL> show sga;
    SQL>


    這看來相當(dāng)于SQLSERVER的附加數(shù)據(jù)庫了,即為oracle的冷備份。
    oracle看來主要有三種文件:數(shù)據(jù)庫文件、控件文件、日志文件
    依次對(duì)以上三種文件進(jìn)行移動(dòng)和修改。

    posted on 2009-08-02 15:39 freebird 閱讀(775) 評(píng)論(0)  編輯  收藏 所屬分類: 數(shù)據(jù)庫

    主站蜘蛛池模板: 日日夜夜精品免费视频| 婷婷亚洲久悠悠色悠在线播放 | jizz在线免费观看| 亚洲综合国产精品| 国产免费卡一卡三卡乱码| 成人爽a毛片免费| 亚洲精品无码久久| 亚洲va中文字幕无码久久不卡| 永久免费毛片在线播放| 国产vA免费精品高清在线观看 | 日本亚洲免费无线码 | 亚洲精品午夜国产VA久久成人| 青娱分类视频精品免费2| xxxxx做受大片在线观看免费| 亚洲精品视频在线观看视频| 亚洲A∨午夜成人片精品网站| 亚洲免费观看在线视频| 一个人看www免费高清字幕| 亚洲人成网站18禁止久久影院 | 亚洲欧美中文日韩视频| 亚洲AV色香蕉一区二区| 亚洲福利中文字幕在线网址| 在线视频精品免费| 老司机69精品成免费视频| 偷自拍亚洲视频在线观看99| 亚洲中文无码a∨在线观看| 曰韩亚洲av人人夜夜澡人人爽| 免费高清小黄站在线观看| av免费不卡国产观看| a级精品九九九大片免费看| 国产亚洲精品美女久久久久久下载| 中文字幕在线观看亚洲| 亚洲乱码一区二区三区在线观看 | 亚洲午夜福利精品久久| 全免费a级毛片免费看无码| 免费成人福利视频| 99re6热视频精品免费观看| 中文在线观看免费网站| 免费一级毛片在线播放放视频| 亚洲日韩av无码中文| 亚洲不卡视频在线观看|