Bo's Oracle Station

查看: 838|回复: 0

WIN10跨平台迁移到LINUX

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-8-6 22:26:52 | 显示全部楼层 |阅读模式
附(不推荐)在目的地转换的convert命令:
  1. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@663:krbtdb_gcvs(): STARTUP NOMOUNT PFILE = 'C:\DOWNLOAD\INIT_WIN12ORCL00V779Q5_1_0.ORA';
  2. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@673:krbtdb_gcvs(): RUN {
  3. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@674:krbtdb_gcvs():   CONVERT
  4. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@677:krbtdb_gcvs():   FROM PLATFORM 'Microsoft Windows x86 64-bit'
  5. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@680:krbtdb_gcvs():   PARALLELISM 1
  6. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@687:krbtdb_gcvs(): DATAFILE 'C:\APP\APPLE\ORADATA\WIN12ORCL\EXAMPLE01.DBF' FORMAT 'C:\DOWNLOAD\WIN12ORCLDATA_D-WIN12ORC_I-2899287675_TS-EXAMPLE_FNO-7_03V779Q5'
  7. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@687:krbtdb_gcvs(): DATAFILE 'C:\APP\APPLE\ORADATA\WIN12ORCL\SYSTEM01.DBF' FORMAT 'C:\DOWNLOAD\WIN12ORCLDATA_D-WIN12ORC_I-2899287675_TS-SYSTEM_FNO-1_04V779R9'
  8. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@687:krbtdb_gcvs(): DATAFILE 'C:\APP\APPLE\ORADATA\WIN12ORCL\SYSAUX01.DBF' FORMAT 'C:\DOWNLOAD\WIN12ORCLDATA_D-WIN12ORC_I-2899287675_TS-SYSAUX_FNO-3_05V779RO'
  9. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@687:krbtdb_gcvs(): DATAFILE 'C:\APP\APPLE\ORADATA\WIN12ORCL\UNDOTBS01.DBF' FORMAT 'C:\DOWNLOAD\WIN12ORCLDATA_D-WIN12ORC_I-2899287675_TS-UNDOTBS1_FNO-5_06V779S8'
  10. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@687:krbtdb_gcvs(): DATAFILE 'C:\APP\APPLE\ORADATA\WIN12ORCL\USERS01.DBF' FORMAT 'C:\DOWNLOAD\WIN12ORCLDATA_D-WIN12ORC_I-2899287675_TS-USERS_FNO-6_07V779SN'
  11. 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@696:krbtdb_gcvs(): ; }
  12.                                                                            
复制代码

改过的控制文件:
  1. CREATE CONTROLFILE REUSE SET DATABASE "win12orc" RESETLOGS  NOARCHIVELOG
  2.     MAXLOGFILES 16
  3.     MAXLOGMEMBERS 3
  4.     MAXDATAFILES 100
  5.     MAXINSTANCES 8
  6.     MAXLOGHISTORY 292
  7. LOGFILE
  8.   GROUP 1 '/u01/app/oracle/oradata/orcl2/redo01.log'  SIZE 200M,
  9.   GROUP 2 '/u01/app/oracle/oradata/orcl2/redo02.log'  SIZE 200M,
  10.   GROUP 3 '/u01/app/oracle/oradata/orcl2/redo03.log'  SIZE 200M
  11. DATAFILE
  12.   '/u01/app/oracle/oradata/orcl2/system01.dbf',
  13.   '/u01/app/oracle/oradata/orcl2/sysaux01.dbf',
  14.   '/u01/app/oracle/oradata/orcl2/undotbs1.dbf',
  15.   '/u01/app/oracle/oradata/orcl2/users01.dbf',
  16.   '/u01/app/oracle/oradata/orcl2/example01.dbf'
  17. CHARACTER SET AL32UTF8
  18. ;
复制代码

修改过的参数文件:
  1.   control_files            = '/u01/app/oracle/oradata/orcl2/control01.ctl','/u01/app/oracle/oradata/orcl2/control02.ctl','/u01/app/oracle/oradata/orcl2/control03.ctl'
  2.   db_recovery_file_dest    = '/u01/app/oracle/fast_recovery_area'
  3.   db_recovery_file_dest_size= 10G
  4.   audit_file_dest          = '/u01/app/oracle/admin/orcl2/adump'
  5.   db_name                  = win12orc
  6.   processes                = 300
  7.   memory_target            = 1677721600
  8.   db_block_size            = 8192
  9.   undo_tablespace          = UNDOTBS1
  10.   audit_trail              = OS
  11.   open_cursors             = 300
  12.   compatible             = 12.1.0.2.0
  13.                              
复制代码

改数据库名和ID之前:
  1. SQL> select  name , DBID  from v$database;

  2. NAME                DBID
  3. --------- ----------
  4. WIN12ORC  2899287675
复制代码
总结创建控制文件语句:
模板建库:

  1. Create controlfile reuse set database "em12rep"
复制代码
跨平台迁移:
  1. CREATE CONTROLFILE REUSE SET DATABASE "win12orc" RESETLOGS  NOARCHIVELOG
复制代码
改名字:
  1. CREATE CONTROLFILE  set  DATABASE  "NEWEXAM"   RESETLOGS  NOARCHIVELOG
复制代码
用脚本(set2) 重新创建控制文件:

  1. CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  NOARCHIVELOG
  2.     MAXLOGFILES 16
  3.     MAXLOGMEMBERS 3
  4.     MAXDATAFILES 100
  5.     MAXINSTANCES 8
  6.     MAXLOGHISTORY 292
  7. LOGFILE
  8.   GROUP 1 (
  9.     '+DATA/ORCL/ONLINELOG/group_1.277.1049406741',
  10.     '+FRA/ORCL/ONLINELOG/group_1.281.1049406743'
  11.   ) SIZE 100M BLOCKSIZE 512,
  12.   GROUP 2 (
  13.     '+DATA/ORCL/ONLINELOG/group_2.275.1049406501',
  14.     '+FRA/ORCL/ONLINELOG/group_2.279.1049406503'
  15.   ) SIZE 100M BLOCKSIZE 512,
  16.   GROUP 3 (
  17.     '+DATA/ORCL/ONLINELOG/group_3.276.1049406593',
  18.     '+FRA/ORCL/ONLINELOG/group_3.280.1049406595'
  19.   ) SIZE 100M BLOCKSIZE 512
  20. -- STANDBY LOGFILE
  21. DATAFILE
  22.   '/u01/app/oracle/oradata/orcl/system01.dbf',
  23.   '/u01/app/oracle/oradata/orcl/sysaux01.dbf',
  24.   '/u01/app/oracle/oradata/orcl/undotbs01.dbf',
  25.   '/u01/app/oracle/oradata/orcl/users01.dbf'
  26. CHARACTER SET AL32UTF8
复制代码


  1. [oracle@classroom dbhome_1]$ nid

  2. DBNEWID: Release 12.1.0.2.0 - Production on Sun Aug 9 16:54:03 2020

  3. Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

  4. Keyword     Description                    (Default)
  5. ----------------------------------------------------
  6. TARGET      Username/Password              (NONE)
  7. DBNAME      New database name              (NONE)
  8. LOGFILE     Output Log                     (NONE)
  9. REVERT      Revert failed change           NO
  10. SETNAME     Set a new database name only   NO
  11. APPEND      Append to output log           NO
  12. HELP        Displays these messages        NO

  13. [oracle@classroom dbhome_1]$ nid target=sys/oracle_4U DBNAME=orcl2

  14. DBNEWID: Release 12.1.0.2.0 - Production on Sun Aug 9 16:55:27 2020

  15. Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.


  16. NID-00115: Database should be mounted


  17. Change of database name failed during validation - database is intact.
  18. DBNEWID - Completed with validation errors.

  19. [oracle@classroom dbhome_1]$ sqlplus /nolog

  20. SQL*Plus: Release 12.1.0.2.0 Production on Sun Aug 9 16:55:35 2020

  21. Copyright (c) 1982, 2014, Oracle.  All rights reserved.

  22. SQL> conn / as sysdba
  23. Connected.
  24. SQL> alter database mount
  25.   2  ;

  26. Database altered.

  27. SQL> exit
  28. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  29. With the Partitioning, OLAP, Advanced Analytics, Real Application Testing
  30. and Unified Auditing options
  31. [oracle@classroom dbhome_1]$ nid target=sys/oracle_4U DBNAME=orcl2

  32. DBNEWID: Release 12.1.0.2.0 - Production on Sun Aug 9 16:55:58 2020

  33. Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

  34. Connected to database WIN12ORC (DBID=2899287675)

  35. Connected to server version 12.1.0

  36. Control Files in database:
  37.     /u01/app/oracle/oradata/orcl2/control01.ctl
  38.     /u01/app/oracle/oradata/orcl2/control02.ctl
  39.     /u01/app/oracle/oradata/orcl2/control03.ctl

  40. Change database ID and database name WIN12ORC to ORCL2? (Y/[N]) => Y

  41. Proceeding with operation
  42. Changing database ID from 2899287675 to 1028822302
  43. Changing database name from WIN12ORC to ORCL2
  44.     Control File /u01/app/oracle/oradata/orcl2/control01.ctl - modified
  45.     Control File /u01/app/oracle/oradata/orcl2/control02.ctl - modified
  46.     Control File /u01/app/oracle/oradata/orcl2/control03.ctl - modified
  47.     Datafile /u01/app/oracle/oradata/orcl2/system01.db - dbid changed, wrote new name
  48.     Datafile /u01/app/oracle/oradata/orcl2/sysaux01.db - dbid changed, wrote new name
  49.     Datafile /u01/app/oracle/oradata/orcl2/undotbs1.db - dbid changed, wrote new name
  50.     Datafile /u01/app/oracle/oradata/orcl2/users01.db - dbid changed, wrote new name
  51.     Datafile /u01/app/oracle/oradata/orcl2/example01.db - dbid changed, wrote new name
  52.     Datafile /u01/app/oracle/oradata/orcl2/temp01.db - dbid changed, wrote new name
  53.     Control File /u01/app/oracle/oradata/orcl2/control01.ctl - dbid changed, wrote new name
  54.     Control File /u01/app/oracle/oradata/orcl2/control02.ctl - dbid changed, wrote new name
  55.     Control File /u01/app/oracle/oradata/orcl2/control03.ctl - dbid changed, wrote new name
  56.     Instance shut down

  57. Database name changed to ORCL2.
  58. Modify parameter file and generate a new password file before restarting.
  59. Database ID for database ORCL2 changed to 1028822302.
  60. All previous backups and archived redo logs for this database are unusable.
  61. Database is not aware of previous backups and archived logs in Recovery Area.
  62. Database has been shutdown, open database with RESETLOGS option.
  63. Succesfully changed database name and ID.
  64. DBNEWID - Completed succesfully.

  65. [oracle@classroom dbhome_1]$
复制代码
  1. [oracle@classroom dbs]$ orapwd file=orapworcl2  password=oracle_4U
复制代码

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-3 20:43 , Processed in 0.037727 second(s), 24 queries .

快速回复 返回顶部 返回列表