WindowsIn the environment10gDatabase to11gDatabase MigrationA. 10gEnvironmentPrepare for Migration
Create a test table in the database and insert a piece of data to confirm that the migration was successful
Sql> CREATE TABLE Test (ID number,name varchar (20));
sql> INSERT INTO Test (Id,name) VALUES (1, ' Test '
since the 10.2.0.1 version cannot be upgraded directly to 11GR2, the source database needs to be upgraded to 10.2.0.2 first
Landing Rman
C:\Documentsand Settings\administrator>rman Target/
Recovery Manager : release10.2.0.1.0-production on Tuesday 4 months 14 16:47:24 2015
Copyright (c) 1982, 2005, Oracle. All rightsreserved.
Connect to target database : TEST (dbid=2175164748)
Modify rman parameters
Rman>configure Controlfile autobackup on;
Rman>configure datafile backup copies for device type disk to ' D:\backup\%F ';
Ramn>configureretention POLICY to redundancy 2;
Backing up databases and archiving log files
$ORACLE _home/rdbms/adminunder theUtlu112i.sqlScriptCopyto the10gof the$ORACLE _home/rdbms/adminunder, and in10gon the execution
Backing up databases and archiving log files
rman> backupdatabase format '/data/backup/2014-04-17-allbackup,Full_%d_%t_%s_p.bak ';
rman> backuparchivelog all Format/data/backup/2014-04-17-allbackup/arch_%d_%t_%s_%p.bak ';
Copy all generated backup sets to the new environment (to copy a password file)
=========================== New ===========================================
set up oracle-sid , login Rman
ORADIM-NEW-SID Test--- create test instance
C:\users\administrator>rmantarget/nocatalogg
Exportoracle_sid=test
restore spfile to the specified directory
Startup Nomount;
Rman>restore SPFile to
' C:\app\Administrator\product\11.2.0\dbhome_1\dbs\spfiletest.ora ' from
' C:\backup\C-2175164748-20150416-00 ';
Create The pfile and modify the parameters and create the relevant folders (all paths need to match the current installation path)
sql> Create Pfilefrom spfile= ' C:\app\Administrator\product\11.2.0\dbhome_1\dbs\
Spfiletest.ora ';
test.__db_cache_size=167772160
test.__java_pool_size=4194304
test.__large_pool_size=4194304
test.__shared_pool_size=109051904
Test.__streams_pool_size=0
*.audit_file_dest= ' C:\oracle\product\10.2.0/admin/test/adump '
*.background_dump_dest= ' C:\oracle\product\10.2.0/admin/test/bdump '--delete
*.compatible= ' 10.2.0.1.0 '-- Modify to current database version
*.control_files= ' C:\oracle\product\10.2.0/oradata/test/\control01.ctl ', ' c:\oracle\product\10.2.0/oradata/test/ \control02.ctl ', ' c:\oracle\product\10.2.0/oradata/test/\control03.ctl '
*.core_dump_dest= ' C:\oracle\product\10.2.0/admin/test/cdump '--delete
*.db_block_size=8192
*.db_domain= "
*.db_file_multiblock_read_count=16--delete
*.db_name= ' Test '
*.db_recovery_file_dest= ' C:\oracle\product\10.2.0/flash_recovery_area '
*.db_recovery_file_dest_size=2147483648
*.dispatchers= ' (protocol=tcp) (SERVICE=TESTXDB) '
*.job_queue_processes=10
*.log_archive_format= ' arc%s_%r.%t '
*.nls_language= ' Simplified Chinese '
*.nls_territory= ' China '
*.open_cursors=300
*.pga_aggregate_target=96468992
*.processes=150
*.remote_login_passwordfile= ' EXCLUSIVE '
*.sga_target=290455552
*.undo_management= ' AUTO '
*.undo_tablespace= ' UNDOTBS1 '
*.user_dump_dest= ' c:\oracle\product\10.2.0/admin/test/udump '--delete
Recovery control files
Rman>restorecontrolfile from ' C:\backup\C-2175164748-20150416-00 ';
Need to change the extension from . Ora to. ctl
boot to Mount state, recover data file
ALTER DATABASE Mount;
Resetting the data file path and recovering the database
run{
Set newname for datafile 1 to ' C:\app\Administrator\oradata\test\SYSTEM01. DBF ';
Set newname for datafile 2 to ' C:\app\Administrator\oradata\test\UNDOTBS01. DBF ';
Set newname for DataFile 3 to ' C:\app\Administrator\oradata\test\SYSAUX01. DBF ';
Set newname for datafile 4 to ' C:\app\Administrator\oradata\test\USERS01. DBF ';
Restore database;
SWITCH datafile All;
SWITCH Tempfile all;
}
Repairing the database
Recover database;
Rename the Redo log and open the database in resetlogs mode
Alter DATABASE rename file ' C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO03. LOG ' to
' C:\app\Administrator\oradata\test\redo03.log ';
ALTER DATABASE RenameFile ' C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO02. LOG ' to ' C:\app\Administrator\oradata\test\redo02.log ';
ALTER DATABASE RenameFile ' C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01. LOG ' to ' C:\app\Administrator\oradata\test\redo01.log ';
Open a database in upgrade mode
Sqlplus/as SYSDBA
Startup upgrade
Execute upgrade Script
Sql>@?/rdbms/admin/utlu112i.sql
Sql>@?/rdbms/admin/catupgrd.sql
sql> @?/rdbms/admin/catuppst.sql
This article is from the "Sunny" blog, make sure to keep this source http://dbasunny.blog.51cto.com/9192126/1654844
10.2.0.1 to 11GR2 migration upgrade in the Windows environment