Oracle goldengate 初始化資料的方法(轉MOS:ID 1276058.1)
Oracle goldengate 初始化資料的方法
Oracle goldengate instantiation 方法:
一、 coning with oracle rman
二、 oracle EXPDP/IMPDP or EXP/IMP Utilities
一、coning with oracle rman
On the Source (RMAN refers to as target):
Add and Start Rxtract:
Enable Minimal Supplemental Logging in Oracle
SQLPLUS > alter database add supplemental log data
Enable Supplemental Logging at Table Level
GGSCI> dblogin userid xxxxx password xxxxxx
GGSCI> add trandata
Add Extract, Add Exttrail, Add Pump, Add Rmttrail
Start Extract, Start Pump
Recover database on target database:
Create init.ora file for the destination .
Run the following SQL (if you currently use an spfile; if you already use a pfile then you can use the pfile and skip this step)
SQLPLUS> create pfile=‘
Copy
init
sftp> put
init
Backup source database
OS> RMAN target /
RMAN> backup database plus archivelog ;
Copy backup files to destination located in the same location as they were written on the source (default is $ORACLE_HOME/dbs but it may have been changed using the CONFIGURE command in RMAN).
sftp>
Once backup completes, capture SCN to clear datafile fuzziness
Instantiation from an Oracle Source Database: Oracle GoldenGate
RMAN> restore database preview summary;
Note the SCN returned, it will appear at the end of the command like:
Media recovery start SCN is 34822578
Recovery must be done beyond SCN 34822578 to clear datafile fuzziness
Finished restore at 10-OCT-10
On the Destination (RMAN refers to as auxiliary) :
Add a tnsnames.ora entry (in $ORACLE_HOME/network/admin) for the source database.
Create the password file (in the $ORACLE_HOME/dbs directory):
$ORACLE_HOME/dbs> orapwd
file=orapw
Start
up auxiliary instance (make sure the $ORACLE_SID is set correctly and the
init
SQLPLUS> startup nomount
Create duplicate database. This step will open the database
OS> RMAN target
sys/
RMAN> connect auxiliary /
RMAN> duplicate target
database to
Note:
you can also run the duplicate database command by running RMAN on the source.
In that case you use connect target / on the source, and connect auxiliary
sys@
In either case you must copy the backup files to the destination server. Also for this scenario you must include a tnsnames entry for the target database which would be added to the tnsnames.ora file on the host with the auxiliary. In addition, on the source server, you must have listener configured to accept requests for the destination database in a nomount state. This is done by explicitly including the service/SID in the listener.ora configuration file.
Once complete review the Oracle alert log to get last SCN that the database was recovered to. Look in the oracle alert log for the following entry:
RESETLOGS after incomplete recovery UNTIL CHANGE 34822578
After 34822578 in this sample is the SCN where we want Replicat to start processing
Add Temp file (before Oracle 10.2; starting with Oracle 10.2 Oracle will automatically add temp files and you can skip this step)
SQLPLUS> alter tablespace
temp add tempfile ‘
Create spfile (if you want to use an spfile; if not you can skip this step and the next step below):
SQLPLUS> create spfile
from pfile=‘$ORACLE_HOME/dbs/init
Stop and Restart Database to pick up spfile:
SQLPLUS> shutdown immediate
SQLPLUS> startup
Add and Start Replicat:
GGSCI> add replicat
GGSCI> start replicat
二、oracle EXPDP/IMPDP or EXP/IMP Utilities
Example 1: full database export using expdp
Add and Start Rxtract:
Enable Minimal Supplemental Logging in Oracle on source
alter database add supplemental log data ;
Enable Supplemental Logging at Table Level on source
GGSCI> dblogin userid xxxxx password xxxxxx
GGSCI> add trandata
Add Extract, Add Exttrail, Add Pump, Add Rmttrail on source
Start Extract, Start Pump on source
Create a database directory:
SQLPLUS> create directory
dumpdir as ‘
Get the current SCN on the source database:
SQLPLUS> select current_scn from v$database ;
CURRENT_SCN
-----------------------
28318029
Run the Data Pump Export using the flashback SCN you obtained in the previous step. The following example shows running the expdp utility at a Degree Of Parallelism (DOP) of 4. If you have sufficient system resources (CPU, memory and IO) then running at a higher DOP will decrease the amount of time it takes to take the export (up to 4x for a DOP of 4). Note that expdp uses Oracle Database parallel execution settings (e.g. parallel_max_servers) which have to be set appropriately in order to take advantage of parallelism. Other processes running in parallel may be competing for those resources. See the Oracle Documentation for more details.
>expdp directory=dumpdir full=y parallel=4 dumpfile=ora102_%u.dmp flashback_scn=28318029
>Username: system
NOTE: any DB user with DBA privileges will do
>Password:
Note: The export log needs to be checked for errors.
Start an import using impdp to the target database when the export step is complete.
Add and Start Replicat after import is complete:
GGSCI> add replicat
GGSCI> start replicat
Example 2: schema export using exp
Enable Minimal Supplemental Logging in Oracle on source
SQLPLUS > alter database add supplemental log data;
Enable Supplemental Logging at Table Level on source
GGSCI> dblogin userid xxxxx password xxxxxx
GGSCI> add trandata
Add Extract, Add ExtTrail FileTrail File, Add Pump, Add RmtTrail FileTrail File on source
Start Extract, Start Pump on source
Get the current SCN on the source database:
SQLPLUS> select current_scn from v$database ;
CURRENT_SCN
-----------------------
3410138433
Get a flashback snapshot from the SCN that you obtained in the previous step. You can do this with exp or expdp utility. The following example shows the use of export utility (exp):
>exp
Note: Undo_retention has to be set high enough, and the export log needs to be checked for errors. You can speed up exp by running multiple session in parallel but you have to manually configure subsets of the data you want to export (e.g. different tables for different export files). Make sure to use the same FLASHBACK_SCN for all export sessions to ensure taking a read consistent backup.
Start an import to the target database when export is complete.
Add and Start Replicat:
GGSCI> add replicat
GGSCI> start replicat
總結:
轉MOS:ID 1276058.1 ;以備日後參考
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-764412/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle GoldenGate系統之----資料初始化OracleGo
- Oracle goldengate初始化資料注意事項OracleGo
- Oracle Goldengate重新初始化的 3種方法OracleGo
- oracle goldengate 初始化OracleGo
- 轉:Oracle GoldenGate VeridataOracleGo
- oracle goldengate 引數詳解(轉MOS:Oracle GoldenGates ample parameter files)OracleGo
- Oracle GoldenGate 資料同步初始化最佳實戰(Data Pump)OracleGo
- Oracle GoldenGate安裝應用及初始化資料示例OracleGo
- GoldenGate初始化資料載入Go
- Oracle Dataguard + Goldengate資料同步OracleGo
- oracle goldengate 初始化實驗步驟OracleGo
- oracle資料庫配置goldengate同步Oracle資料庫Go
- oracle GoldenGate Veridata配置OracleGo
- GoldenGate同步初始化Go
- 【GoldenGate】Oracle GoldenGate(四) 壓力測試同步百萬行資料GoOracle
- 深入解析oracle--資料庫的初始化Oracle資料庫
- Oracle GoldenGate容災專案初始化調研模板OracleGo
- Oracle GoldenGate Veridata 12.1.3OracleGo
- 【goldengate】官方文件筆記四 Oracle GoldenGate實時資料分佈Go筆記Oracle
- 【goldengate】官方文件筆記五 Oracle GoldenGate實時資料倉儲Go筆記Oracle
- Oracle資料庫的備份方法-冷備份(轉)Oracle資料庫
- 使用goldengate的資料泵進行Oracle-Oracle的單向複製GoOracle
- goldengate不使用資料泵完成Oracle-Oracle的雙向複製GoOracle
- 實戰goldengate:安裝配置+資料初始化+單向DML複製Go
- Oracle GoldenGate資料同步備份軟體概述OracleGo
- [轉載]ORACLE GOLDENGATE的主要元件詳解OracleGo元件
- 【GoldenGate】Oracle GoldenGate Veridata 安裝配置與應用GoOracle
- 【轉】GoldenGate資料庫複製實施案例Go資料庫
- 使用GoldenGate初始化的兩種方式Go
- 我的oracle mos accountOracle
- 【轉】【News】Oracle收購GoldenGate有感OracleGo
- Oracle中大批量刪除資料的方法(轉自)Oracle
- Oracle資料庫中分割槽表的操作方法(轉)Oracle資料庫
- Oracle GoldenGate系統之----單向同步資料表OracleGo
- Oracle GoldenGate系統之----雙向同步資料表OracleGo
- GoldenGate實現oracle和sqlserver雙向資料同步GoOracleSQLServer
- Oracle插入Blob資料的方法Oracle
- clone oracle資料庫的方法Oracle資料庫