window2012 oracle 遷移 centos6 oracle

來源:互聯網
上載者:User

標籤:例子   port   mit   架構   loop   redhat   force   png   dba   

本文目的:

  oracle是大型資料庫WangWang年限和版本及環境都比較陳舊,效能影響了業務正常,近日公司需求從Windows2003 32bit的Oracle伺服器上將資料移轉到Windows2012/Linux Redhat 64bit Oracle,就涉及一個轉碼

 

Oracle 架構:

  Oracle Server = 執行個體 + 資料庫 (Instance和Database是相互獨立的)

運行原理:

  舉個例子來看看Oracle RDBMS是怎麼運作的 

    1. User訪問Oracle Server之前提交一個請求(包含了db_name、instance_name、username、password等資訊),Oracle Server接收到請求並通過Password File的驗證後,分配SGA記憶體池,啟動後台進程同時建立並啟動執行個體。
    2. 在啟動執行個體之後User Process與Server Process建立Connect。
    3. 再通過Server process和Oracle Instance完成建立Sesscion。
    4. 使用者執行SQL語句,由server process接收到並直接與Oracle互動。
    5. SQL語句通過Server Process到達Oracle Instance,再將SQL載入資料庫緩衝區。
    6. Server Process通知Oracle Database將與SQL語句相關的資料區塊副本載入到緩衝區中。
    7. 在資料庫緩衝區執行SQL語句,併產生”髒緩衝區”。
    8. 由CKPT檢查點進程檢查到”髒緩衝區”,並調用DBWn資料庫寫進程,但在DBWn執行之前,應該由LGWR先將資料檔案的原始狀態、資料庫的改變等資訊記錄到Redo Log Files。
    9. 將更新的內容寫入到磁碟中的資料檔案。
    10. 返回結果給使用者

具體也不贅述了;詳細可參考http://blog.csdn.net/Jmilk/article/details/51583799

 

首先配置好遷移目標Linux伺服器參數

確認:

  selinux、iptables、sysctl、limits.conf 等

SPOOL c:test.sql             //c:test.sql  這是檔案儲存的位置,從SPOOL開始所有的操作記錄到SPOOL OFF結束select * from tablename;SPOOL OFF

 

1.建立測試表(Windows)

create table pp(num int);begin         for j in 1 .. 100 loop             insert into pp  values ( j );         end loop;         commit; end; /

2.建立rman使用者(Windows)

sql sysdbacreate tablespace rman datafile ‘e:\app\rman.dat‘ size 100m autoextend on next 10m; create user rman identified by rman default tablespace rman; grant recovery_catalog_owner to rman; grant connect,resource to rman; 
rman connect catalog rman/rman create catalog;rman catalog rman/rman@orcl target sys/密碼@網路連接服務名; register database; 

3.進入唯讀

run {select PLATFORM_NAME from v$database;select PLATFORM_NAME,ENDIAN_FORMAT from v$transportable_platform order by 1,2;shutdown immediatestartup mountalter database open read only;set serveroutput ondeclarev_check boolean;beginv_check:=dbms_tdb.check_db(‘Linux x86 64-bit‘,dbms_tdb.skip_none);end;/declarev_ext boolean;beginv_ext:=dbms_tdb.check_external;end;/}

4.進入RMAN備份轉碼(Windows)

rman target /convert database new database ‘orcl‘ transport script ‘e:\bak\trans.sql‘ to platform ‘Linux x86 64-bit‘ db_file_name_convert ‘e:\app\Administrator\oradata\orcl‘ ‘e:\bak‘;

5.將備份匯出到

e:\bak 下的所有資料以及INIT_00SDUAAM_1_0.ORA檔案上傳至Linux伺服器中分別的位置/home/oracle/app/oradata/orcl和INIT_00SDUAAM_1_0.ORA對應的目錄下
修改INIT_00SDUAAM_1_0.ORA檔案中的路徑和記憶體大小

6.匯入資料(Linux)

sqlplus / as sysdbaSTARTUP NOMOUNT PFILE=‘INIT_00SDUAAM_1_0.ORA‘create spfile from pfile=‘INIT_00SDUAAM_1_0.ORA‘;startup force nomountCREATE CONTROLFILE REUSE SET DATABASE "ORCL" RESETLOGS  NOARCHIVELOG      MAXLOGFILES 16      MAXLOGMEMBERS 3      MAXDATAFILES 100      MAXINSTANCES 8      MAXLOGHISTORY 292LOGFILE    GROUP 1 ‘/home/oracle/app/oradata/orcl/redolog01.log‘  SIZE 50M,    GROUP 2 ‘/home/oracle/app/oradata/orcl/redolog02.log‘  SIZE 50M,    GROUP 3 ‘/home/oracle/app/oradata/orcl/redolog03.log‘  SIZE 50MDATAFILE    ‘/home/oracle/app/oradata/orcl/SYSTEM01.DBF‘,    ‘/home/oracle/app/oradata/orcl/UNDOTBS01.DBF‘,    ‘/home/oracle/app/oradata/orcl/SYSAUX01.DBF‘,    ‘/home/oracle/app/oradata/orcl/USERS01.DBF‘,    ‘/home/oracle/app/oradata/orcl/EXAMPLE01.DBF‘CHARACTER SET ZHS16GBK;ALTER DATABASE OPEN RESETLOGS;ALTER TABLESPACE TEMP ADD TEMPFILE ‘/home/oracle/app/oradata/orcl/temp01.dbf‘ SIZE 20971520  AUTOEXTEND ON;SHUTDOWN IMMEDIATE  STARTUP UPGRADE  @?/rdbms/admin/utlirp.sql

7.驗證(Linux)

sqlplus / as sysdbastartupconn mologa/mologaselect * from tab;select * from pp;

 

window2012 oracle 遷移 centos6 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.