Beruflich Dokumente
Kultur Dokumente
Windows server <source> MS SQL Server <dsn> Source <schema> Manager Manager
<target> server
Network
Log
Extract
Collector
Trails
Oracle
Replicat
Target
<owner/schema>
Page 1
Overview of Tasks
Prepare the Environment
In order to execute this lesson, the GoldenGate application must be installed on both the source and target systems. The installation includes a sample database and scripts to generate initial data as well as subsequent update operations. The source and target tables are created and loaded with initial data. The GoldenGate Manager processes are also started so that other processes may be configured and started. And finally, source definitions are generated and transfer to the target system.
Source
<owner/schema>
Page 2
Exercise Name
Exercise 1.
Objective
The goals of this exercise are to: Create the database Create SQL Server logins and users Create ODBC data source. Set up transaction logging. Create tables and populate source data.
Prerequisites
This lab assumes that the GLOBALS parameters have been created with a <mgr service> name and that the Manager service has been added. This should have been done when installing GoldenGate for Windows.
In the parameter file, enter the following parameter, then save and close the file.
PORT <port>
Start Manager.
GGSCI> START MANAGER
Exercise Name
Note: These instructions assume SQL Server Authentication which requires the more complex, double layer, of authentication. SQL Server Authentication is an option only if it is permitted at the server level, and only Windows Authentication is enabled by default. If you are using Windows Authentication, you can leave out most of the login and password entries. This displays the main SQL Server Management Studio dialog box. Right, right-click Database and select the New Database option.
Page 4
Exercise Name
The New Database dialog box appears. In the Name box, type the <database> from the Lab Preparation worksheet.
Page 5
Exercise Name
Click OK to add the database. The main SQL Server Management Studio dialog box reappears.
Page 6
Exercise Name
Page 7
Exercise Name
If you selected SQL Server Authentication, type the <password> in the two Password fields. Under Defaults, select your <database> for Database, and leave Language set to the default. Do not click OK. Instead, from Select a page in the upper left-hand box, double click Server Roles.
Under Server Role, check the box for the System Administrators role. Click OK to exit. The next step creates a schema that you will associate with the new user. While you have the database selected, click on the New Query button in the main menu. The right side of the dialog displays the SQL Query interface. Type in:
Page 8
Exercise Name
Now you need to associate the new user with the login and the schema that you have created with the new database. In the SQL Query interface, type in:
create user <user_name> for login <select login_name> with default_schema=<schema_name>;
Page 9
Exercise Name
Page 10
Exercise Name
Select the SQL Server Native Client 10.0 driver and then click Finish. The Create a New Data Source to SQL Server dialog box appears.
Page 11
Exercise Name
Optionally type in a description, type for this source DSN. For Which SQL Server do you want to connect to, select local if SQL Server is on the local system, or enter the server name at your SQL Server location. Click Next. Answer the question about how SQL Server should verify the login by selecting the option that you entered when creating the <login>. Then type <login> in Login ID and <password> in Password.
Click Next. Make certain the default database is set to the database that you created; otherwise select Change the default database to: and select it. Leave the other settings to their defaults to use ANSI.
Page 12
Exercise Name
Click Next. Leave the next dialog box set to the defaults, and click Finish. In the confirmation, click Test Data Source to test the connection. Close the confirmation dialog box and the Create a New Data Source box. You can leave the SQL Server Management Studio running on the source system, because you will be using it later.
Exercise Name
Verify the results using the following commands in the input window:
sp_help tcustmer go sp_help tcustord go
Click the X button to close the input tab. Click New Query whenever you need to run another SQL command. Following the steps you used to execute the table create script, run the demo_mss_insert.sql script to insert source data into the source tcustmer and tcustord tables. Note! Run this on the source only. Verify the results as you did before. Leave the SQL Management Studio running on the source system.
Page 14
Exercise Name
The following response appears in the results (lower) window with a status of either ON or OFF.
The output should now show a CurrentSetting of OFF. Check the status of the non-logged bulk copy option by executing the following command:
exec sp_dboption '<database>', 'select into/bulkcopy'
7. Execute backup
Still in SQL Server Management Studio:
Page 15
Exercise Name
In the console tree, right-click the database name and select Tasks > Backup. The Back Up Database dialog box displays. If the backup destination is correct, skip the next two bulleted steps and initiate the backup as explained in the last step. If it is not correct, change the backup destination and click ADD. The Select Backup Destination appears, where you can select File Name and then click the navigation (...) button to navigate to a directory and specify the backup file name. Click OK to close the Select Backup Destination dialog box. The backup file is added to the Destination list box in the SQL Server Backup dialog box. Click OK to start the backup. This procedure ensures that no transaction log information is lost when GoldenGate starts up.
Issue the following commands to force the logging of the full before and after image for updates.
GGSCI > ADD TRANDATA <owner/schema>.tcustmer GGSCI > ADD TRANDATA <owner/schema>.tcustord
Verify that supplemental logging has been turned on for these tables.
GGSCI> INFO TRANDATA <owner/schema>.tcust*
Page 16
Exercise Name
SOURCEDB <dsn>, USERID <login>, PASSWORD <password> TABLE <owner/schema>.TCUSTMER; TABLE <owner/schema>.TCUSTORD;
Note: To avoid overlaying existing definition files, always put the file as <db type>.def instead of source.def (e.g. MSSQL.def).
Page 17
Exercise Name
Start Manager
GGSCI> START MANAGER
Page 18
Exercise 2.
The process names used in lab exercises, for example EINIBD, are made up of 1) one character for the GoldenGate process (E for Extract, R for Replicat); 2) three or four to describe the process type (INI for initial data load, ORA for capture from or delivery to an Oracle database, etc.) and 3) two characters to create a unique identifier (usually your initials). Page 19
Note: Remember to use <db type>.def if you renamed the source.def when you transferred it to the <target>.
Execute the following commands on the <target> system. Verify the results:
GGSCI> VIEW REPORT RINI<unique id> Page 20
Page 21
Exercise 3.
Note: Record the two characters selected for your <trail id>: ______. You will need this in the next step and when you set up the Replicat.
Page 22
Page 23
Exercise 4.
Set up checkpoints
1. Edit a GLOBALS file on the target system
Execute the following commands on the <target> system. Edit the GLOBALS parameter file to add the checkpoint table.
Shell> cd <install location> Shell> ggsci GGSCI> EDIT PARAMS ./GLOBALS
Record the checkpoint table owner and name, then save and close the file. Table owner ____________________ name ___________________ Note: You could name the table anything you want, but for training purposes we are using ggschkpt.
Page 24
Configure delivery
4. Add the Replicat checkpoint group
Execute the following commands on the <target> system to create the Replicat group named RMSS<unique id>.
GGSCI> ADD REPLICAT RMSS<unique id>, EXTTRAIL ./dirdat/<trail id>
Note: Refer to your Extract set up for the correct two-character <trail id>.
Note: Remember to use <db type>.def if you renamed the source.def when you transferred it to the the <target>.
Page 25
Discussion points
Search in the Windows//UNIX Reference Guide for the information on the following questions.
Page 26
Exercise 5.
___________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ ___________________________________________________________________ Verify the data by executing the following commands in the New Query window of SQL Server Management Studio on the source:
select * from TCUSTMER; select * from TCUSTORD;
Page 27
Page 28
Exercise Name
Page 29