Cross-platform oracle database migration guide

Source: Internet
Author: User

Oracle 10 Gbit/s provides powerful cross-platform database migration functions to migrate oracle databases between different architectures and operating systems! However, endianess must be the same, and different endianess may be migrated between 11 GB! The following example shows how to migrate the oracle database on windows 32-bit to rhel6 64-bit.

I. Prepare a windows Environment
Here we use a 32-bit winxp system. If you have installed an oracle Server or a client before, you must uninstall it (clear the registry). Otherwise, an error will be reported during installation. The oracle version is 10.2.0 . 1

1. SQL> select * from v $ transportable_platform; 2. 3. PLATF PLATFORM_NAME ENDIAN_FORMAT 4. ----- ---------------------------------------- -------------- 5. 1 Solaris [tm] OE (32-bit) Big 6. 2 Solaris [tm] OE (64-bit) Big 7. 7 Microsoft Windows IA (32-bit) Little 8. 10 Linux IA (32-bit) Little 9. 6 AIX-Based Systems (64-bit) Big 10. 3 HP-UX (64-bit) Big 11. 5 HP Tru64 UNIX Little 12. 4 HP-UX IA (64-bi T) Big 13. 11 Linux IA (64-bit) Little 14. 15 HP Open VMS Little 15. 8 Microsoft Windows IA (64-bit) Little 16. 9 IBM zSeries Based Linux Big 17. 13 Linux 64-bit for AMD Little 18. 16 Apple Mac OS Big 19. 12 Microsoft Windows 64-bit for AMD Little 20. 17 Solaris Operating System (x86) Little 21. 18 IBM Power Based Linux Big 22. 17 rows selected1.1 create a custom tablespace, create a table on the tablespace, and insert data 1. SQL> create tablespace Win_migrate 2. 2 datafile 'e: \ oracle \ product \ 10.2.0 \ oradata \ winorcl \ win_migrate01.dbf' 3. 3 size 10 M; 4. The tablespace has been created. 5. 6. SQL> create table t_migrate (a number) tablespace win_migrate; 7. the table has been created. 8. 9. SQL> insert into t_migrate values (1); 10. 1 row has been created. 11. 12. SQL> commit; 13. Submit 1.2. On the source server, convert the database to read mode and use rman to convert the copy. 1. SQL> shutdown immediate 2. The database has been disabled. 3. The database has been detached. 4. The ORACLE routine has been disabled. 5. SQL> startup mount 6. The ORACLE routine has been started. 612368384. Total System Global Area 1292036 bytes 9. Fixed Size 188745980 bytes 10. Variable Size 415236096 bytes 11. Database Buffers 7094272 bytes 12. Redo Buffers bytes 13. The Database has been loaded. 14. 15. SQL> alter database open read only; 16. The database has been changed. 17. 18. c: \ Users \ Naruto> rman target/19. recovery MANAGER: Release 10.2.0.3.0-Production on Sunday July 17 19:57:49 2011 20. copyright (c) 1982,200 5, Oracle. all rights reserved. 21. connect to the target database: WINORCL (DBID = 1904834971) 22. 23. RMAN> convert database to platform 'linux 64-bit for AMD 'format' e: \ data \ % U'; 24. 25. start convert from 17-7-11 26. use the target database control file instead of the recovery directory 27. allocated channel: ORA_DISK_1 28. channel ORA_DISK_1: sid = 147 devt Ype = DISK29. 30. find the External table SH in the database. SALES_TRANSACTIONS_EXT 31. 32. find the SYS directory in the database. SUBDIR 33. find the SYS directory in the database. XMLDIR 34. find the SYS directory in the database. MEDIA_DIR 35. find the SYS directory in the database. LOG_FILE_DIR 36. find the SYS directory in the database. DATA_FILE_DIR 37. find the SYS directory in the database. WORK_DIR 38. find the SYS directory in the database. ADMIN_DIR 39. find the SYS directory in the database. DATA_PUMP_DIR 40. 41. find bfile pm in the database. PRINT_MEDIA 42. 43. in the password file, find the user SYS (with SYSDBA and SYSOPER permissions) 44. channel ORA_DISK_1: starts data file conversion 45. input data file fno = 00001 name = E: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ WINORCL \ SYSTEM01.DBF ---------- other output omitted ------------ 2: Convert e: copy the tracking scripts of all files and control files under the \ data directory to the linux server. You can use tools such as winscp and ftp. samba sharing is directly used here. SQL> select p. spid from v $ session s, v $ process p 2. 2 where p. addr = s. paddr 3. 3 and s. username = 'sys 'and s. program like '% rman %'; 4. 5. SPID 6. ------------ 7. 476 8. 3488 4056 III. prepare a directory on the linux server, move the uploaded files to the directory, and modify the control file. Script and initialization parameter file 1. [root @ rhel6 ~] # Mount-t cifs-o username = yang // 192.168.50.195/data/mnt 2. Password: 3. [root @ rhel6 ~] # Ls/mnt 4. DATA_D-WINORCL_I-1904915064_TS-EXAMPLE_FNO-5_03MHMQUN DATA_D-WINORCL_I-1904915064_TS-UNDOTBS1_FNO-2_04MHMQUU init_00mhmqte_00000.ora 5. DATA_D-WINORCL_I-1904915064_TS-SYSAUX_FNO-3_02MHMQU8 DATA_D-WINORCL_I-1904915064_TS-USERS_FNO-4_06MHMQV3 DATA_D-WINORCL_I-1904915064_TS-SYSTEM_FNO-1_01MHMQTF winorcl_ora_4056.trc 6. DATA_D-WINORCL_I-1904915064_TS-WIN_MIGRATE_FNO-6_05MHMQV2 7. 8. [oracle @ Rhel6 ~] $ Mkdir-p/u01/app/admin/winorcl/{adump, bdump, cdump, udump} 9. [oracle @ rhel6 ~] $ Mkdir-p/u01/app/oradata/winorcl 10. [oracle @ rhel6 ~] $ Mkdir-p/u01/app/flash_recovery_area/WINORCL 11. 12. [oracle @ rhel6 ~] $ Cp/mnt/DATA_D-WINORCL_I-1904915064_TS-*/u01/app/oradata/winorcl/13. [oracle @ rhel6 ~] $ Cp/mnt/init_00mhmqte_00000.ora $ ORACLE_HOME/dbs/initwinorcl. ora 14. [oracle @ rhel6 ~] $ Cp/mnt/winorcl_ora_4056.trc ~ /Winorcl. SQL 15. 16. [oracle @ rhel6 ~] $ Cd/u01/app/oradata/winorcl 17. [oracle @ rhel6 winorcl] $ mv DATA_D-WINORCL_I-1904915064_TS-EXAMPLE_FNO-5_03MHMQUN example01.dbf 18. [oracle @ rhel6 winorcl] $ mv DATA_D-WINORCL_I-1904915064_TS-SYSAUX_FNO-3_02MHMQU8 sysaux01.dbf 19. [oracle @ rhel6 winorcl] $ mv DATA_D-WINORCL_I-1904915064_TS-SYSTEM_FNO-1_01MHMQTF system01.dbf 20. [oracle @ rhel6 winorcl] $ mv DATA_D-WINORCL_I-1904915064_TS-UNDOTBS1_FNO-2_0 4 MHMQUU undotbs1.dbf 21. [oracle @ rhel6 winorcl] $ mv DATA_D-WINORCL_I-1904915064_TS-USERS_FNO-4_06MHMQV3 users01.dbf 22. [oracle @ rhel6 winorcl] $ mv DATA_D-WINORCL_I-1904915064_TS-WIN_MIGRATE_FNO-6_05MHMQV2 win_migrate01.dbf 23. 24. [oracle @ rhel6 ~ $ Cat winorcl. SQL 25. create controlfile reuse set database "winorcl" resetlogs archivelog 26. MAXLOGFILES 16 27. MAXLOGMEMBERS 3 28. MAXDATAFILES 100 29. MAXINSTANCES 8 30. MAXLOGHISTORY 292 31. LOGFILE 32. GROUP 1'/u01/app/oradata/winorcl/redo01.dbf' SIZE 50 M, 33. GROUP 2'/u01/app/oradata/winorcl/redo02.dbf' SIZE 50 M, 34. GROUP 3 '/u01/app/oradata/winorcl/redo03.dbf' SIZE 50 M 35. DATAFILE 36.' /U01/app/oradata/winorcl/system01.dbf ', 37. '/u01/app/oradata/winorcl/undotbs1.dbf', 38. '/u01/app/oradata/winorcl/sysaux01.dbf', 39. '/u01/app/oradata/winorcl/users01.dbf', 40. '/u01/app/oradata/winorcl/example01.dbf', 41. '/u01/app/oradata/winorcl/win_migrate01.dbf' 42. character set ZHS16GBK 43 .; 44. 45. [oracle @ rhel6 dbs] $ grep-v '^ $ 'initwinorcl. ora 46. # Please change the values of the fol Lowing parameters: 47. control_files = "/u01/app/oradata/winorcl/control01.dbf", "/u01/app/oradata/winorcl/control02.dbf" 48. db_recovery_file_dest = "/u01/app/flash_recovery_area" 49. db_recovery_file_dest_size = 2147483648050. audit_file_dest = "/u01/app/admin/winorcl/adump" 51. background_dump_dest = "/u01/app/admin/winorcl/bdump" 52. user_dump_dest = "/u01/app/admin/winorcl/udump" 53. core_dump_dest = "/U01/app/admin/winorcl/cdump" 54. db_name = "winorcl" 55. # Please review the values of the following parameters: 56. _ shared_pool_size = 16777216057. _ large_pool_size = 419430458. _ java_pool_size = 1677721659. _ streams_pool_size = 060. _ db_cache_size = 41523609661. remote_login_passwordfile = "EXCLUSIVE" 62. db_domain = "766.com" 63. dispatchers = "(PROTOCOL = TCP) (SERVICE = winorclXDB)" 64. # Th E values of the following parameters are from source database: 65. processes = 15066. nls_language = "simplified chinese" 67. nls_territory = "CHINA" 68. sga_target = 61236838469. DB _ block_size = 819270. compatible = "10.2.0.1.0" 71. log_archive_format = "ARC % S _ % R. % T "72. db_file_multiblock_read_count = 1673. undo_management = "AUTO" 74. undo_tablespace = "UNDOTBS1" 75. job_queue_processes = 1076. open_c Ursors = 30077. pga_aggregate_target = 203423744 4: Start migration 1. [oracle @ rhel6 ~] $ Export ORACLE_SID = winorcl2. [oracle @ rhel6 ~] $ Sqlplus/nolog 3. SQL * Plus: Release 10.2.0.1.0-Production on Sun Jul 17 20:25:10 2011 4. copyright (c) 1982,200 5, Oracle. all rights reserved. 5. 6. SQL> conn/as sysdba 7. connected to an idle instance. 8. SQL> create spfile from pfile; 9. file created. 10. 11. SQL> startup nomount 12. ORACLE instance started. 13. total System Global Area 612368384 bytes 14. fixed Size 2022696 bytes 15. varia Ble Size 188744408 bytes 16. database Buffers 415236096 bytes 17. redo Buffers 6365184 bytes 18. 19. SQL> @/home/oracle/winorcl. SQL; 20. control file created. 21. 22. 23. SQL> alter database open resetlogs; 24. database altered. 25. 26. SQL> select dbid, name from v $ database; 27. 28. dbid name 29. ---------- --------------------------- 30. 1904915064 WINORCL 31. 32. SQL> select * from t_migrate; 33. 34. A 35. ---------- 36. 1 37. 38. SQL> select tablespace_name from dba_tablespaces; 39. 40. TABLESPACE_NAME 41. -------------------------------------------------------------------------------- 42. SYSTEM 43. UNDOTBS1 44. SYSAUX 45. TEMP 46. USERS 47. EXAMPLE 48. WIN_MIGRATE 49. 50. 7 rows selected. 51. 52. SQL> alter tablespace temp add tempfile '/u01/app/oradata/winorcl/temp01.dbf' size 50 M; 5 3. tablespace altered. v. finishing work 1. SQL> shutdown immediate 2. database closed. 3. database dismounted. 4. ORACLE instance shut down. 5. SQL> startup upgrade 6. ORACLE instance started. 7. 8. total System Global Area 268435456 bytes 9. fixed Size 2020056 bytes 10. variable Size 83889448 bytes 11. database Buffers 176160768 bytes 12. redo Buffers 6365184 bytes 13. database mounted. 14. database opened. 15. 16. SQL> @? /Rdbms/admin/utlirp. SQL; 17. SQL> spool/tmp/upgrade. log 18. SQL> @? /Rdbms/admin/utlrp. SQL; 19. SQL> startup force this article is from the "yueda tianchong" blog

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.