In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
OGG 12.2.0.1 is installed on the standby database
# # Software installation configuration # #
1. Set up ORACLE_HOME and ORACLE_SID (main library, standby library, target library)
If there is only one instance, you only need to set the environment variables ORACLE_HOME and ORACLE_SID. If you have multiple instances, you need to set them in the configuration file of each process group (process group):
two。 Set the path of library, the source side (main database, standby database, target database)
Export GG_HOME=/home/oracle/ogg
Export PATH=$PATH:$GG_HOME
Export LIBPATH=$GG_HOME:$ORACLE_HOME/lib
3. Execute runinstaller (main library, standby library, target library)
. / runinstaller
4. Modify log mode (main library)
SELECT supplemental_log_data_min, force_logging FROM v$database
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA
ALTER DATABASE FORCE LOGGING
SELECT supplemental_log_data_min, force_logging FROM v$database
5. Enable ogg in the database (main library, target library)
Alter system set ENABLE_GOLDENGATE_REPLICATION=true scope=both
6. Set up Flashback Query (primary and standby libraries)
UNDO_MANAGEMENT=AUTO
UNDO_RETENTION=86400 # needs to be calculated
8. Establish GoldenGate Credentials (main library, target library)
Create tablespace ogg_tbs datafile'/ home/db/oracle/oradata/bidb/ogg_tbs01.dbf' size 1m autoextend on next 1m maxsize unlimited
Create user ogg identified by ogg123 default tablespace ogg_tbs quota unlimited on ogg_tbs
9. Execute setup script (main library, target library)
@ marker_setup.sql
@ ddl_setup.sql
@ role_setup.sql
@ ddl_enable.sql
@ ddl_pin ogg
10. Security related authentication (main library, standby database, target library)
$. / ggsci
Note that there can be no semicolons at the end of the following two statements, otherwise report ERROR: Invalid command.
GGSCI > add credentialstore
GGSCI > alter credentialstore add user ogg,password ogg123
GGSCI > dblogin useridalias ogg
# add trandata## to the main library
11. Add trandata (main library) to the DG main library
$. / ggsci
GGSCI > dblogin useridalias ogg
GGSCI > add trandata scott.T
GGSCI > info trandata scott.*
# Source configuration # #
12 configure manager process (standby library)
$. / ggsci
GGSCI > edit params mgr
The contents are as follows:
PORT 7809
DYNAMICPORTLIST 7801-7809
-- AUTORESTART ER *, RETRIES 5 Magi WAITMINUTES 7
PURGEOLDEXTRACTS. / dirdat/*,usecheckpoints, minkeepdays 7
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45 13. Configure the extraction process:
GGSCI > add extract extncf, tranlog, begin now
GGSCI > add exttrail. / dirdat/et extract extncf, megabytes 100
GGSCI > edit params extncf
The contents are as follows:
EXTRACT extncf
-- SETENV (ORACLE_HOME= "/ home/db/oracle/product/11.2.0")
-setenv (NLS_LANG= "AMERICAN_AMERICA.AL32UTF8")
-setenv (ORACLE_SID= "stby")
Useridalias ogg
GETTRUNCATES
REPORTCOUNT EVERY 1 MINUTES, RATE
DISCARDFILE. / dirrpt/extncf.dsc,APPEND,MEGABYTES 1000
WARNLONGTRANS 2h,CHECKINTERVAL 10m
EXTTRAIL. / dirdat/et
-- TRANLOGOPTIONS CONVERTUCS2CLOBS
TRANLOGOPTIONS EXCLUDEUSER ogg
TRANLOGOPTIONS MINEFROMACTIVEDG
DBOPTIONS ALLOWUNUSEDCOLUMN
-- DYNAMICRESOLUTION
FETCHOPTIONS FETCHPKUPDATECOLS
-- table
Table SCOTT.T
14. Configure the datapump process
GGSCI > add extract dpencf, exttrailsource. / dirdat/et
GGSCI > add rmttrail. / dirdat/rt, extract dpencf, megabytes 100
GGSCI > edit params dpencf
The contents are as follows:
EXTRACT dpencf
RMTHOST 192.168.137.7, MGRPORT 7800, compress
PASSTHRU
RMTTRAIL. / dirdat/rt
DYNAMICRESOLUTION
-- table
Table SCOTT.T; 15. Start the process
$. / ggsci
GGSCI > start mgr
GGSCI > start extncf
# Target configuration # #
16. Destination side GLOBALS configuration:
GGSCI > edit params. / GLOBALS
The contents are as follows:
CHECKPOINTTABLE ogg.oggchkpt
GGSCI > exit
Shell > ggsci
(log in again to activate the GLOBALS parameter)
GGSCI > dblogin useridalias ogg
GGSCI > add checkpointtable
17 configure the target manager process:
GGSCI > edit params mgr
The contents are as follows:
Port 7800
DYNAMICPORTLIST 7801-7809
-- AUTORESTART ER *, RETRIES 5 Magi WAITMINUTES 7
PURGEOLDEXTRACTS. / dirdat/*,usecheckpoints, minkeepdays 7
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45
18 configure the destination side replication process:
GGSCI > add replicat repncf, exttrail. / dirdat/rt
GGSCI > edit params repncf
The contents are as follows:
REPLICAT repncf
SETENV (ORACLE_HOME= "/ home/db/oracle/product/11.2.0")
Setenv (NLS_LANG= "AMERICAN_AMERICA.AL32UTF8")
Setenv (ORACLE_SID= "bidb")
Useridalias ogg
-SQLEXEC "ALTER SESSION SET CONSTRAINTS=DEFERRED"
REPORT AT 01:59
REPORTCOUNT EVERY 30 MINUTES, RATE
REPERROR DEFAULT, ABEND
-- numfiles 5000
-- HANDLECOLLISIONS
Assumetargetdefs
DISCARDFILE. / dirrpt/repncf.dsc, APPEND, MEGABYTES 1000
GETTRUNCATES
ALLOWNOOPUPDATES
-- table
Map SCOTT.T, target SCOTT.T
# data initialization # #
19. Source-side export data (main database operation)
SQL > select dbms_flashback.get_system_change_number from dual
GET_SYSTEM_CHANGE_NUMBER
-
347494
Expdp\'/ as sysdba\ 'directory=dump_dir dumpfile=scott.dmp logfile=scott.log tables=scott.t flashback_scn=347494
Scp scott.dmp m3:/home/oracle/dump_dir
20. Destination side import
Cd / home/oracle/dump_dir
Impdp\'/ as sysdba\ 'directory=dump_dir dumpfile=scott.dmp logfile=scott.log # start the process # #
20. Start the process
Source side:
GGSCI > start extncf
Destination side:
GGSCI > alter replicat repncf extseqno 0, extrba 0
The 0 after extseqno here represents the sequence number of the trail file, which needs to be checked in dirdat under the root directory of ogg. If it is initially configured, it is 0.
GGSCI > start repncf aftercsn 347494
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.