In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how windows2008 Oracle can migrate incrementally through rman. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Environment introduction: windows2008R2 Oracle11.2.0.1 non-archiving mode
Migration process:
Modify the archive:
Click (here) to collapse or open
Alter system set log_archive_dest_1='location=d:\ archivelog' scope=spfile
Shutdown immediate
Startup mount
Alter database archivelog
Alter database open
Complete through rman. Of course, you can also perform level 0 backups and subsequent incremental backups. Here, archive logs are used to append data.
Click (here) to collapse or open
Run {
Allocate channel ch2 type disk
Allocate channel ch3 type disk
Allocate channel ch4 type disk
Allocate channel ch5 type disk
Sql 'alter system archive log current'
Sql 'alter system archive log current'
Backup format'e:\ rmanbackup\ orcl_full_%T_%s_%p' database plus archivelog delete all input
Backup format'e:\ rmanbackup\ orcl_controlfile_%T_%s_%p' current controlfile
Sql 'alter system archive log current'
Backup format'e:\ rmanbackup\ orcl_arch_%Y%M%D_%s_%p' archivelog all
Release channel ch2
Release channel ch3
Release channel ch4
Release channel ch5
}
Generate pfile file
Click (here) to collapse or open
Create pfile='d:\ pfile20170721.ora' from spfile
Create an instance on the destination side:
Click (here) to collapse or open
Oradim-new-sid orcl
Copy backup files, parameter files, and password files to the destination side
Edit pfile files, create related directories, and modify related parameters (such as sga, pga, etc.)
Click (here) to collapse or open
Md D:\ app\ Administrator\ admin\ orcl\ adump
Md D:\ app\ Administrator\ admin\ orcl\ dpdump
Md D:\ app\ Administrator\ oradata\ orcl
Start the nomount phase
Click (here) to collapse or open
Create spfile from pfile='d:\ pfile20170721.ora'
Startup nomount
Restore the control file:
Click (here) to collapse or open
-- restore the control file, and pay attention to modifying the control file name of the backup
Restore controlfile from'D:\ rmanbackup\ ORCL_CONTROLFILE_20170731_74_1'
-- start to the mount phase
Sql 'alter database mount'
Restore the data file:
Click (here) to collapse or open
Catalog start with'd:\ rmanbackup'
-- View the corresponding data file
-- View the corresponding tablespace and data file information
Set lines 150
Col tname for a10
Col dname for a65
Select t. Tsz report.name tname,d.file#,d.name dname,d.status from v$tablespace tmeme vandalism datafile d where t.ts#=d.ts#
Rename the query statement to the data file
Select 'set newname for datafile' | | d.file# | |'to''| | d.name | |''; 'from v$datafile dGrader vested tablespace t where d.ts#=t.ts# and t.INCLUDEDINTATABASEDACKUPASE
-- change the target drive letter. Here is d: originally E
-
-- restore the data file to communicate with the customer, and the data file directory XHLISDB remains unchanged
Run {
Set newname for datafile 1 to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ SYSTEM01.DBF'
Set newname for datafile 2 to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ SYSAUX01.DBF'
Set newname for datafile 3 to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ UNDOTBS01.DBF'
Set newname for datafile 4 to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ USERS01.DBF'
.
Restore database
Switch datafile all
}
-- modify the redo location
Click (here) to collapse or open
-- View the redo path
Select * from v$logfile
-- modify the redo path. After viewing the path, if the path is wrong, modify it to the target path.
Select 'alter database rename file''| | member | |''to''| | member | |''; 'from v$logfile
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO002.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO002.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO003.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO003.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO001.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO001.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO004.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO004.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO005.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO005.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO006.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO006.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO007.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO007.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO008.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO008.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO009.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO009.LOG'
Alter database rename file'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO010.LOG' to'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO010.LOG'
=
Start switching databases:
Click (here) to collapse or open
-- stop monitoring the original library and manually switch archives for several times
Alter system archive log current
-- make sure the database data is consistent, restart the database instance, and switch archives several times again.
Alter system archive log current
-- backup archiv
Backup format'e:\ rmanbackup\ orcl_arch_%T_%s_%p' archivelog all
Attached: use increment
Click (here) to collapse or open
-- you can also use increments (main related statements, refer to other files)
Select current_scn from v$database
BACKUP INCREMENTAL FROM SCN 1013684 DATABASE FORMAT'E:\ rmanbackup\ orcl_incr_%T_%s_%p'
Backup current controlfile format'e:\ rmanbackup\ orcl_arch_%T_%s_%p'
Recover database noredo
Copy the file to the target server:
Start recovery:
Click (here) to collapse or open
Catalog start with'D:\ rmanbackup\ ORCL_ARCH_20170721_61_1'
List backup of archivelog all
-- Archive log backup starts with the earliest sequence number
Restore archivelog from sequence 57
-- restore the database instance to the last archive file sequence number
Recover database until sequence 63
-- open
Alter database open resetlogs
-- modify temporary tablespaces
Alter database tempfile'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ TEMP01.DBF' drop
ALTER TABLESPACE TEMP ADD TEMPFILE'D:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ TEMP01.DBF' SIZE 10G autoextend on
Note: create an instance through the oradim command, boot can not start the instance automatically, you can modify the registry. ORA_CTY1_AUTOSTART defaults to false and is modified to true. You can also execute the following command:
Click (here) to collapse or open
Oradim.exe-NEW-SID orcl-INTPWD oracle-STARTMODE auto-PFILE "D:\ Agilent\ Oracle\ Admin\..\ initorcl.ora"
After recovery, it is recommended to check the database and system.
The above is how windows2008 Oracle can migrate incrementally through rman. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.