oracle資料庫遷移的步驟

來源:互聯網
上載者:User

標籤:oracle資料庫遷移

目的:將192.168.9.102上GGWSXT/[email protected]:1521/ORACLE部署到104上

1、查看原使用者資料表空間

select tablespace_name,count(0) from dba_segments where owner=upper(‘GGWSXT‘) group by tablespace_name;

2、查看原使用者建立資料表空間的目錄

select * from dba_data_files;

3、為原使用者建立資料表空間

create tablespace TS_GGWSXT_XT

datafile ‘/步驟2/TS_GGWSXT_XT.bdf‘ size 2048M

AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED

EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT auto;

4、建立新使用者

Create user GGWSXT_01

Identified by GGWSXT_01

Default tablespace TS_GGWSXT_XT

Temporary tablespace TEMP

5、為新使用者賦許可權

Grant connect,resource,dba,select any table to GGWSXT_01;

grant read,write on directory dpdir to GGWSXT_01;

select * from dba_directories

6、為原使用者賦目錄許可權

grant read,write on directory dpdir to GGWSXT_01;

7、通過expdp(資料泵方式)匯出原使用者資料 [如果時從11g遷移到10g後面添加 version=10.2.0.1.0低版本]    su - oralce 下執行 

nohup expdp ggwsxt/[email protected]/oracle schemas=ggwsxt dumpfile=ggwsxt_20150713.dmp DIRECTORY=dpdir &

tail -f nohup.out

8、資料庫不在一台伺服器上,備份檔案目錄不同時;

select * from dba_directories; 查詢匯入匯出dmp檔案的路徑 

scp /匯出庫路徑/GGWSXT_20150713.dmp [email protected]:/匯入庫路徑/GGWSXT_20150713.dmp

9、chown oralce.oinstall(或者是dba) GGWSXT_20150713.dmp 

10、通過impdp將資料匯入新使用者,語句中間無換行

nohup impdp GGWSXT_01/[email protected]/ORACLE directory=dpdir dumpfile=GGWSXT_20150713.dmp remap_schema=GGWSXT:GGWSXT01 remap_tablespace=原使用者資料表空間名:新使用者資料表空間名,原使用者資料表空間名:新使用者資料表空間名 &

(注釋:資料表空間名查詢方式select tablespace_name,count(0) from dba_segments where owner=upper(‘使用者名稱‘) group by tablespace_name;)

11、資料匯入後,需執行一下語句以實現使用者物件的重新編譯  在plsql中

execute dbms_utility.compile_schema(upper(‘新使用者名稱GGWSXT_01‘));


註:11.5:若匯入的是兩個有關聯的庫,請匯入之後更新新使用者同義字








本文出自 “學習感悟” 部落格,請務必保留此出處http://10183596.blog.51cto.com/10173596/1673821

oracle資料庫遷移的步驟

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.