Академический Документы
Профессиональный Документы
Культура Документы
<h3>Snapcopy DR to CC1</h3>
<xmp>
PR2 on sap0001
PR2-DR on sap0301
CC1 on sap0591
###################################################################################
############################
###################################################################################
############################
On sap0001 as db2pr2
cd
brdb6brt -bm RETRIEVE_RELOCATE -replace PR2=CC1,db2pr2=db2cc1
scp -p PR2_NODE0000.scr db2cc1@sap0591:
LOG_DIR=/db2/PR2/log_dir/NODE0000/LOGSTREAM0000/,/db2/CC1/log_dir/NODE0000/LOGSTREA
M0000/
to
LOG_DIR=/db2/PR2/log_dir,/db2/CC1/log_dir
MIRRORLOG_PATH=/db2/PR2/log_dir2,/db2/CC1/log_dir2
Have the AIX Admins initiate the UFS snapshots from PR2-DR to CC1
Source: sap0301 Target: sap0591
------------------- -------------------
/db2/PR2/db2pr2 /db2/CC1/db2cc1
/db2/PR2/log_dir /db2/CC1/log_dir
/db2/PR2/log_dir2 /db2/CC1/log_dir2
/db2/PR2/sapdata1 /db2/CC1/sapdata1
/db2/PR2/sapdata2 /db2/CC1/sapdata2
/db2/PR2/sapdata3 /db2/CC1/sapdata3
/db2/PR2/sapdata4 /db2/CC1/sapdata4
/db2/PR2/sapdata5 /db2/CC1/sapdata5
/db2/PR2/sapdata6 /db2/CC1/sapdata6
/db2/PR2/sapdata7 /db2/CC1/sapdata7
/db2/PR2/sapdata8 /db2/CC1/sapdata8
/db2/PR2/sapdata9 /db2/CC1/sapdata9
/db2/PR2/sapdata10 /db2/CC1/sapdata10
/db2/PR2/sapdata11 /db2/CC1/sapdata11
/db2/PR2/sapdata12 /db2/CC1/sapdata12
/db2/PR2/sapdata13 /db2/CC1/sapdata13
/db2/PR2/sapdata14 /db2/CC1/sapdata14
/db2/PR2/sapdata15 /db2/CC1/sapdata15
/db2/PR2/sapdata16 /db2/CC1/sapdata16
a) shutdown_DB2
# ( Possibly make this a separate UFS 1GB and snap it in the future )
Restart the standby on the DR Server (wait until refreshed DB has been opened
successfully)
db2start
db2 start hadr on database ${DB2DBDFT} as standby
CC1
SID=CC1
sid=`echo ${SID}| awk '{ print tolower($0)}'`
OLD_SID=PR2
old_sid=`echo ${OLD_SID}| awk '{ print tolower($0)}'`
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
do
find /db2/${SID}/sapdata${i} | grep -v "lost+found" | xargs chown db2$
{sid}:db${sid}adm
done
CC1
cd /db2/PR2
ln -s /db2/CC1/db2dump/PR2/log_archive2
cd /db2/CC1/db2dump
mkdir PR2
cd PR2
mkdir log_archive2
for CC1
db2start
db2inidb CC1 as snapshot relocate using PR2_NODE0000.scr
Relocating database...
Files and control structures were changed successfully.
Database was catalogued successfully.
DBT1000I The tool completed successfully.
Database relocation was successful.
DBT1008N Database "CC1" is not a split mirror image.
CVNAME=SAPCC1-AIX
db2stop
db2start
10a) Temporary step for CC1 only - change the logprimary and logsecondary counts
before the rollforward.
10b) Temporary step for CC1 only - remove the mirrorlog to speed up the rollforward
process.
for CC1
db2 update db cfg for ${DB2DBDFT} USING LOGFILSIZ 524288
for all
shutdown_DB2
startup_DB2
14) update security settings, Change ownership of DB2 tables: on CC1 as db2pr2
# CC1
#
# * The db2pr2 AIX account needs to be created on sap0591
#
# User NAME : db2pr2
# User ID : 60018
# Primary Group : dbcc1adm
# Group SET : dbcc1adm,sapinst,sapsys,dbcc1mnt
# HOME directory : /db2/db2pr2
# Initial PROGRAM : /usr/bin/ksh
#
# set the password to 0myG...
#######################################################################
su - db2pr2
.profile
PATH=$PATH:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/ccs/bin:/usr/ucb:/usr/local/bin:/et
c:/opt/perf/bin:/usr/contrib/bin:.:/db2/db2cc1/db2_software/bin:/db2/db2cc1/db2sa/b
in:/db2cc1/db2sa/scripts
export PATH
db2 -t
connect to CC1;
grant dbadm , secadm, sqladm, wlmadm on database to user db2cc1;
grant dbadm on database to user cc1adm;
for CC1
cd $BIN
for i in `ls -1 *.bnd`
do
db2 bind ${i} ACTION REPLACE OWNER `whoami` COLLECTION db2dba
done
config.sh
check clean
db2set DB2_USE_ALTERNATE_PAGE_CLEANING=ON
check clean
shutdown_DB2
startup_DB2
17) rename tablespaces and update tablespaces in virtual table views on CC1
CC1
cd to $HOME/refresh
./Step_15_tablespace_rename.sql
Make sure the final result is 0 rows. The following SQL is executed at the
end:
Open several windows to submit several virtual table renames at once. The
commands are in the file $HOME/refresh/update_virtual_tables.
Make sure to group both the data and index tablespaces when running the
updates. Run the POOLD and POOLI tablespaces first.
The commands will look like this:
CC1
In the $HOME/refresh directory. Run the following three scripts in any order
and verify the output:
./Step_16_tsdb6_cleanup.sql
./Step_16_tadb6_cleanup.sql
./Step_16_iadb6_cleanup.sql
20) Review the Post conversion steps/ DBA Team Post work
materialize_virtual_tables | materialize_virtual_tables.log
truncate_objects |tee truncate_objects.log
import_refresh_objects |tee import_refresh_objects.log
b) Before running updates, set the num_log_span to 0 and LOGSECOND to 160 for
the updates:
db2 connect
db2 update db cfg for ${DB2DBDFT} USING NUM_LOG_SPAN 0 immediate
db2 get db cfg for $DB2DBDFT show detail | grep NUM_LOG_SPAN
db2 update db cfg for ${DB2DBDFT} USING LOGSECOND 160
db2 get db cfg for $DB2DBDFT show detail | grep LOGSECOND
c) Set the mirrlog destination and do the required database bounce before
starting the NAST update:
nast_update.sql |nast_update.log
e) After NAST update has finished, set num_log_span back to 20 and logsecond
back to 40:
db2 connect
db2 update db cfg for ${DB2DBDFT} USING NUM_LOG_SPAN 20 immediate
db2 get db cfg for $DB2DBDFT show detail | grep NUM_LOG_SPAN
db2 update db cfg for ${DB2DBDFT} USING LOGSECOND 40
db2 get db cfg for $DB2DBDFT show detail | grep LOGSECOND
log_config
logprimary should be 40
shutdown_DB2
startup_DB2
Count the actual logs on the system (should be 40) - cycle again if needed.
###################################################################################
############################
22) Enter Trouble Ticket to continue scheduled CV Hot backups on refreshed systems
to TEIS Backup Team (specify date on when they should once again start)
###################################################################################
############################
crontab /var/spool/cron/crontabs/db2${sid}
25) After systems have been turned over to users, go into DBACOCKPIT and set up the
REORGCHK job to run on Sundays at noon.
a) sign onto SAP for that system and run the DBACOCKPIT transaction.
b) if given the option at the main screen, choose sapgui for the display
c) expand the Jobs tab on the left side of screen
d) double click on the "DBA Planning Calendar" option
e) on the top right hand side of the screen will be a box titled "Action Pad".
Scroll down to the "REORGCHK for all Tables" choice and double click it.
f) a window will pop up. clock on the tab titled Recurrence.
g) on that screen, under Recurrence Pattern, select Week(s) and make sure only
Sunday is checked.
h) under Recurrence Range, the start date should be the following Sunday. If
it isn't, correct it.
i) At the top of the screen, set the time to 12:00:00 and press enter.
j) If all looks right, click the Add button at the bottom of the screen to
schedule the job.
k) This will take you back to the DBA Planning Calendar screen. Refresh the
screen and verify the job is scheduled to run on the next Sunday.