|
附(不推荐)在目的地转换的convert命令:
- 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@663:krbtdb_gcvs(): STARTUP NOMOUNT PFILE = 'C:\DOWNLOAD\INIT_WIN12ORCL00V779Q5_1_0.ORA';
- 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@673:krbtdb_gcvs(): RUN {
- 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@674:krbtdb_gcvs(): CONVERT
- 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@677:krbtdb_gcvs(): FROM PLATFORM 'Microsoft Windows x86 64-bit'
- 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@680:krbtdb_gcvs(): PARALLELISM 1
- 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'
- 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'
- 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'
- 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'
- 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'
- 2020-08-06 22:22:18.224923*:KRB:krbtdb.c@696:krbtdb_gcvs(): ; }
-
复制代码
改过的控制文件:
- CREATE CONTROLFILE REUSE SET DATABASE "win12orc" RESETLOGS NOARCHIVELOG
- MAXLOGFILES 16
- MAXLOGMEMBERS 3
- MAXDATAFILES 100
- MAXINSTANCES 8
- MAXLOGHISTORY 292
- LOGFILE
- GROUP 1 '/u01/app/oracle/oradata/orcl2/redo01.log' SIZE 200M,
- GROUP 2 '/u01/app/oracle/oradata/orcl2/redo02.log' SIZE 200M,
- GROUP 3 '/u01/app/oracle/oradata/orcl2/redo03.log' SIZE 200M
- DATAFILE
- '/u01/app/oracle/oradata/orcl2/system01.dbf',
- '/u01/app/oracle/oradata/orcl2/sysaux01.dbf',
- '/u01/app/oracle/oradata/orcl2/undotbs1.dbf',
- '/u01/app/oracle/oradata/orcl2/users01.dbf',
- '/u01/app/oracle/oradata/orcl2/example01.dbf'
- CHARACTER SET AL32UTF8
- ;
复制代码
修改过的参数文件:
- control_files = '/u01/app/oracle/oradata/orcl2/control01.ctl','/u01/app/oracle/oradata/orcl2/control02.ctl','/u01/app/oracle/oradata/orcl2/control03.ctl'
- db_recovery_file_dest = '/u01/app/oracle/fast_recovery_area'
- db_recovery_file_dest_size= 10G
- audit_file_dest = '/u01/app/oracle/admin/orcl2/adump'
- db_name = win12orc
- processes = 300
- memory_target = 1677721600
- db_block_size = 8192
- undo_tablespace = UNDOTBS1
- audit_trail = OS
- open_cursors = 300
- compatible = 12.1.0.2.0
-
复制代码
改数据库名和ID之前:
- SQL> select name , DBID from v$database;
- NAME DBID
- --------- ----------
- WIN12ORC 2899287675
复制代码 总结创建控制文件语句:
模板建库:
- Create controlfile reuse set database "em12rep"
复制代码 跨平台迁移:
- CREATE CONTROLFILE REUSE SET DATABASE "win12orc" RESETLOGS NOARCHIVELOG
复制代码 改名字:
- CREATE CONTROLFILE set DATABASE "NEWEXAM" RESETLOGS NOARCHIVELOG
复制代码 用脚本(set2) 重新创建控制文件:
- CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS NOARCHIVELOG
- MAXLOGFILES 16
- MAXLOGMEMBERS 3
- MAXDATAFILES 100
- MAXINSTANCES 8
- MAXLOGHISTORY 292
- LOGFILE
- GROUP 1 (
- '+DATA/ORCL/ONLINELOG/group_1.277.1049406741',
- '+FRA/ORCL/ONLINELOG/group_1.281.1049406743'
- ) SIZE 100M BLOCKSIZE 512,
- GROUP 2 (
- '+DATA/ORCL/ONLINELOG/group_2.275.1049406501',
- '+FRA/ORCL/ONLINELOG/group_2.279.1049406503'
- ) SIZE 100M BLOCKSIZE 512,
- GROUP 3 (
- '+DATA/ORCL/ONLINELOG/group_3.276.1049406593',
- '+FRA/ORCL/ONLINELOG/group_3.280.1049406595'
- ) SIZE 100M BLOCKSIZE 512
- -- STANDBY LOGFILE
- DATAFILE
- '/u01/app/oracle/oradata/orcl/system01.dbf',
- '/u01/app/oracle/oradata/orcl/sysaux01.dbf',
- '/u01/app/oracle/oradata/orcl/undotbs01.dbf',
- '/u01/app/oracle/oradata/orcl/users01.dbf'
- CHARACTER SET AL32UTF8
复制代码
- [oracle@classroom dbhome_1]$ nid
- DBNEWID: Release 12.1.0.2.0 - Production on Sun Aug 9 16:54:03 2020
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- Keyword Description (Default)
- ----------------------------------------------------
- TARGET Username/Password (NONE)
- DBNAME New database name (NONE)
- LOGFILE Output Log (NONE)
- REVERT Revert failed change NO
- SETNAME Set a new database name only NO
- APPEND Append to output log NO
- HELP Displays these messages NO
- [oracle@classroom dbhome_1]$ nid target=sys/oracle_4U DBNAME=orcl2
- DBNEWID: Release 12.1.0.2.0 - Production on Sun Aug 9 16:55:27 2020
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- NID-00115: Database should be mounted
- Change of database name failed during validation - database is intact.
- DBNEWID - Completed with validation errors.
- [oracle@classroom dbhome_1]$ sqlplus /nolog
- SQL*Plus: Release 12.1.0.2.0 Production on Sun Aug 9 16:55:35 2020
- Copyright (c) 1982, 2014, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> alter database mount
- 2 ;
- Database altered.
- SQL> exit
- Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
- With the Partitioning, OLAP, Advanced Analytics, Real Application Testing
- and Unified Auditing options
- [oracle@classroom dbhome_1]$ nid target=sys/oracle_4U DBNAME=orcl2
- DBNEWID: Release 12.1.0.2.0 - Production on Sun Aug 9 16:55:58 2020
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- Connected to database WIN12ORC (DBID=2899287675)
- Connected to server version 12.1.0
- Control Files in database:
- /u01/app/oracle/oradata/orcl2/control01.ctl
- /u01/app/oracle/oradata/orcl2/control02.ctl
- /u01/app/oracle/oradata/orcl2/control03.ctl
- Change database ID and database name WIN12ORC to ORCL2? (Y/[N]) => Y
- Proceeding with operation
- Changing database ID from 2899287675 to 1028822302
- Changing database name from WIN12ORC to ORCL2
- Control File /u01/app/oracle/oradata/orcl2/control01.ctl - modified
- Control File /u01/app/oracle/oradata/orcl2/control02.ctl - modified
- Control File /u01/app/oracle/oradata/orcl2/control03.ctl - modified
- Datafile /u01/app/oracle/oradata/orcl2/system01.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/orcl2/sysaux01.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/orcl2/undotbs1.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/orcl2/users01.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/orcl2/example01.db - dbid changed, wrote new name
- Datafile /u01/app/oracle/oradata/orcl2/temp01.db - dbid changed, wrote new name
- Control File /u01/app/oracle/oradata/orcl2/control01.ctl - dbid changed, wrote new name
- Control File /u01/app/oracle/oradata/orcl2/control02.ctl - dbid changed, wrote new name
- Control File /u01/app/oracle/oradata/orcl2/control03.ctl - dbid changed, wrote new name
- Instance shut down
- Database name changed to ORCL2.
- Modify parameter file and generate a new password file before restarting.
- Database ID for database ORCL2 changed to 1028822302.
- All previous backups and archived redo logs for this database are unusable.
- Database is not aware of previous backups and archived logs in Recovery Area.
- Database has been shutdown, open database with RESETLOGS option.
- Succesfully changed database name and ID.
- DBNEWID - Completed succesfully.
- [oracle@classroom dbhome_1]$
复制代码- [oracle@classroom dbs]$ orapwd file=orapworcl2 password=oracle_4U
复制代码
|
|