rman將linux平臺資料庫遷移到window平臺資料庫
今天測試了一下將linux平臺的oracle資料庫遷移到windows平臺下[@more@]
1.準備pfile,將linux上的pfile copy到window下,修改相應的目錄
2.啟動到nomount 階段orcl.__db_cache_size=134217728orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__oracle_base='D:app'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=218103808
orcl.__sga_target=411041792
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=247463936
orcl.__streams_pool_size=8388608
*._kghdsidx_count=4
*.audit_file_dest='D:appadminorcladump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='D:apporadataorclcontrol01.ctl','D:apporadataorclcontrol02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.diagnostic_dest='D:app'
*.memory_max_target=629145600
*.memory_target=629145600
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'*.undo_tablespace='UNDOTBS1'
oradim –new –sid prod –startmode manual –pfile d:oracle…….pfileinitprod.ora
C:>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期六 1月 5 11:11:21 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 626327552 bytes
Fixed Size 2178336 bytes
Variable Size 482345696 bytes
Database Buffers 134217728 bytes
Redo Buffers 7585792 bytes
SQL> create spfile from pfile;
File created.
SQL> shutdown immediate
ORA-01507: ??????
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 626327552 bytes
Fixed Size 2178336 bytes
Variable Size 482345696 bytes
Database Buffers 134217728 bytes
Redo Buffers 7585792 bytes
3.啟動到mount階段
C:>rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on 星期六 1月 5 11:14:13 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (not mounted)
RMAN> restore controlfile from 'd:c-1326955037-20130103-00';
Starting restore at 05-1月 -13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=D:APPORADATAORCLCONTROL01.CTL
output file name=D:APPORADATAORCLCONTROL02.CTL
Finished restore at 05-1月 -13
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
4.將從linux上copy到window下的備份 加入到controlfile中.
RMAN> catalog backuppiece 'd:201212302unu6mab_1_1';
cataloged backup piece
backup piece handle=D:201212302UNU6MAB_1_1 RECID=102 STAMP=803906255
RMAN> catalog backuppiece 'd:2012123130nu9amd_1_1';
cataloged backup piece
backup piece handle=D:2012123130NU9AMD_1_1 RECID=103 STAMP=803906256
RMAN> catalog backuppiece 'd:2013010132nubv2c_1_1';
cataloged backup piece
backup piece handle=D:2013010132NUBV2C_1_1 RECID=104 STAMP=803906256
RMAN> catalog backuppiece 'd:2013010234nuejed_1_1';
cataloged backup piece
backup piece handle=D:2013010234NUEJED_1_1 RECID=105 STAMP=803906257
RMAN> catalog backuppiece 'd:2013010336nuh7qd_1_1';
cataloged backup piece
backup piece handle=D:2013010336NUH7QD_1_1 RECID=106 STAMP=803906261
5.restore database
RMAN> run{2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> set newname for datafile 1 to 'D:apporadataorclsystem01.dbf';
5> set newname for datafile 2 to 'D:apporadataorclsysaux01.dbf';
6> set newname for datafile 3 to 'D:apporadataorclundotbs01.dbf';
7> set newname for datafile 4 to 'D:apporadataorclusers01.dbf';
8> set newname for datafile 5 to 'D:apporadataorclhissaas_data01.dbf';
9> set newname for datafile 6 to 'D:apporadataorclhissaas_data02.dbf';
10> set newname for datafile 7 to 'D:apporadataorclsaas_data01.dbf';
11> restore database;
12> switch datafile all;
13> release channel c1;
14> release channel c2;
15> }
allocated channel: c1
channel c1: SID=192 device type=DISK
allocated channel: c2
channel c2: SID=5 device type=DISK
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 05-1月 -13
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to D:apporadataorclsystem01.dbf
channel c1: restoring datafile 00002 to D:apporadataorclsysaux01.dbf
channel c1: restoring datafile 00003 to D:apporadataorclundotbs01.dbf
channel c1: restoring datafile 00004 to D:apporadataorclusers01.dbf
channel c1: restoring datafile 00005 to D:apporadataorclhissaas_data01.dbf
channel c1: restoring datafile 00006 to D:apporadataorclhissaas_data02.dbf
channel c1: restoring datafile 00007 to D:apporadataorclsaas_data01.dbf
channel c1: reading from backup piece /rmanbackup/201212302unu6mab_1_1
channel c1: errors found reading piece handle=/rmanbackup/201212302unu6mab_1_1
channel c1: failover to piece handle=D:201212302UNU6MAB_1_1 tag=TAG20121230T223803
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:09:56
Finished restore at 05-1月 -13
datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=803908655 file name=D:APPORADATAORCLSYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=803908656 file name=D:APPORADATAORCLSYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=803908656 file name=D:APPORADATAORCLUNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=803908656 file name=D:APPORADATAORCLUSERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=803908657 file name=D:APPORADATAORCLHISSAAS_DATA01.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=803908657 file name=D:APPORADATAORCLHISSAAS_DATA02.DBF
datafile 7 switched to datafile copy
input datafile copy RECID=14 STAMP=803908658 file name=D:APPORADATAORCLSAAS_DATA01.DBF
released channel: c1
released channel: c2
5.recover database
有個奇怪的問題,把recover database放在上面的restore指令碼中,會有ora-01110,ora-01157的錯誤,奇怪了
RMAN> run{
2> recover database;
3> }
6.接下來就是開啟資料庫
SQL> alter database backup controlfile to trace as 'd:bakcontrol.sql';Database altered.SQL> STARTUP NOMOUNT
ORACLE instance started.
Total System Global Area 626327552 bytes
Fixed Size 2178336 bytes
Variable Size 482345696 bytes
Database Buffers 134217728 bytes
Redo Buffers 7585792 bytesSQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS NOARCHIVELOG2 MAXLOGFILES 163 MAXLOGMEMBERS 34 MAXDATAFILES 1005 MAXINSTANCES 86 MAXLOGHISTORY 2927 LOGFILE8 GROUP 1 'D:APPORADATAORCLredo01.log' SIZE 50M BLOCKSIZE 512,9 GROUP 2 'D:APPORADATAORCLredo02.log' SIZE 50M BLOCKSIZE 512,10 GROUP 3 'D:APPORADATAORCLredo03.log' SIZE 50M BLOCKSIZE 512,11 GROUP 4 'D:APPORADATAORCLredo04.log' SIZE 50M BLOCKSIZE 51212 DATAFILE13 'D:APPORADATAORCLSYSTEM01.DBF',14 'D:APPORADATAORCLSYSAUX01.DBF',15 'D:APPORADATAORCLUNDOTBS01.DBF',16 'D:APPORADATAORCLUSERS01.DBF',17 'D:APPORADATAORCLHISSAAS_DATA01.DBF',18 'D:APPORADATAORCLHISSAAS_DATA02.DBF',19 'D:APPORADATAORCLSAAS_DATA01.DBF'20 CHARACTER SET AL32UTF821 ;Control file created.SQL> alter database open resetlogs;Database altered.SQL> ALTER TABLESPACE TEMP ADD TEMPFILE 'D:APPORADATAORCLtemp01.dbf' size 10m;
Tablespace altered.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1060004/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- hp-ux利用rman將資料庫跨平臺遷移到aix平臺上UX資料庫AI
- 利用RMAN跨平臺遷移資料庫資料庫
- windows平臺下Oracle10.2 RMAN資料庫遷移至Linux平臺下WindowsOracle資料庫Linux
- 利用rman來實現linux平臺資料庫複製到windows平臺資料庫Linux資料庫Windows
- window平臺下手動建立資料庫演示資料庫
- 資料庫平臺資料庫
- 使用rman將資料庫遷移到ASM例項資料庫ASM
- 跨平臺遷移oracle資料庫指南Oracle資料庫
- 將pentaho資料庫遷移到oracle資料庫資料庫Oracle
- RMAN同位元組序跨平臺跨版本遷移資料庫資料庫
- 應用RMAN Transportable Database進行資料庫跨平臺遷移Database資料庫
- rman 資料庫從一臺機器遷移到另外的一臺機器資料庫
- 使用RMAN完成跨平臺資料遷移
- rman進行跨平臺資料遷移
- 從linux平臺移值資料庫到windows平臺Linux資料庫Windows
- 使用rman copy將資料庫遷移到ASM例項資料庫ASM
- 大型資料庫跨平臺遷移總結資料庫
- 直接複製資料檔案實現linux平臺資料庫複製到windows平臺資料庫Linux資料庫Windows
- RMAN同位元組序跨平臺跨版本遷移資料庫(一)資料庫
- RMAN同位元組序跨平臺跨版本遷移資料庫(二)資料庫
- 將SAP 後臺資料庫從DB2 遷移到ORACLE資料庫DB2Oracle
- 資料庫中跨平臺遷移方法介紹資料庫
- 將OPEN BRAVO後臺資料庫從ORACLE遷移到DB2資料庫OracleDB2
- 【資料庫學習】資料庫平臺:mysql,sql server資料庫MySqlServer
- RMAN跨平臺傳輸資料庫和表空間資料庫
- 利用RMAN將資料庫從檔案系統遷移到ASM資料庫ASM
- 資料庫遷移到ASM資料庫ASM
- AIX 資料庫遷移到z/linuxAI資料庫Linux
- RMAN跨平臺可傳輸表空間和資料庫資料庫
- 案例:資料庫windows切換至linux平臺資料庫WindowsLinux
- Linux將替代Solaris 成甲骨文資料庫主流平臺(轉)Linux資料庫
- MySQL資料庫遷移到PostgresMySql資料庫
- Linux平臺上手動解除安裝Oracle資料庫LinuxOracle資料庫
- Linux平臺下MySQL資料庫定時備份LinuxMySql資料庫
- DBA福利-資料庫線上實訓平臺資料庫
- 跨平臺資料庫 Realm 整合實踐資料庫
- 利用Oracle Data Guard完成跨平臺的資料庫遷移案例Oracle資料庫
- 通過RMAN遷移資料並升級資料庫10.2.0.3->11.2.0.3【相同位數與平臺版】資料庫