Here are the steps we use and I will see if I can attach the procedures we use as well in SQL
Steps to do a spec and data refresh
1. Backup PS_PD811 to PS_PD811*Today’s Date*
a. Set Disk as destination then click Add and select the location to place the backup file
2. Backup PS_PROD to PS_PROD*Today’s Date*
a. Set Disk as destination then click Add and select the location to place the backup file
3. Restore PS_PD811*Today’s Date* to PS_PY811 or PS_DV811
a. Restore from Device and then select the backup file you saved from step 1.
b. In Options, check “Overwrite existing database”
c. Change file locations for .MDF , .NDF and .LDF files to match the locations for the PY or DV environment
4. Restore PS_PROD*Today’s Date* to PS_CRP
a. Restore from Device and then select the backup file you saved from step 1.
b. In Options, check “Overwrite existing database”
c. Change file locations for .MDF and .LDF files to match the locations for the PY or DV environment
5. Run change owner script for PS_PY811 or PS_DV811
a. Open sp_chobjowner script
b. Change database to PS_PY811 or PS_DV811
c. Execute Script
d. Create a new query and enter “chobjowner pd811, py811” substitute dv811 for py811 depending on environment
e. In the results window, select all text that has been created and copy it.
f. Open new query and paste text then execute. Errors on primary key entries are ok
6. Script grant all to public for PS_PY811 or PS_DV811
a. Open SP_grantalltopublic script
b. Change database to PS_PY811 or PS_DV811
c. Execute Script
d. Create a new query and enter “grantalltopublic py811, py811” substitute dv811 for py811 depending on environment
e. In the results window, select all text that has been created and copy it.
f. Open new query and paste text then execute. Errors on primary key entries are ok
7. Run change owner script for PS_CRP or PS_DEV
a. Open sp_chobjowner script
b. Change database to PS_CRP or PS_DEV
c. Execute Script
d. Create a new query and enter “chobjowner proddta, crpdta” substitute testdta for crpdta depending on environment
e. In the results window, select all text that has been created and copy it.
f. Open new query and paste text then execute. Errors on primary key entries are ok
g. Open sp_chobjowner script
h. Change database to PS_CRP or PS_DEV
i. Execute Script
j. Create a new query and enter “chobjowner prodctl, crpctl” substitute testctl for crpctl depending on environment
k. Execute Script
l. In the results window, select all text that has been created and copy it.
m. Open new query and paste text then execute. Errors on primary key entries are ok
8. Script grant all to public for PS_CRPDTA and PS_CRPCTL run script. Script creates procedure which is ran again for example grantallpublic py811, py811
a. Open SP_grantalltopublic script
b. Change database to PS_CRP or PS_DEV
c. Execute Script
d. Create a new query and enter “grantalltopublic crpdta, crpdta” substitute crpdta for testdta depending on environment
e. Execute Script
f. In the results window, select all text that has been created and copy it.
g. Open new query and paste text then execute. Errors on primary key entries are ok
h. Go back to previous query and change to “grantalltopublic crpctl, crpctl” substitute crpdta for testdta depending on environment
i. Execute Script
j. In the results window, select all text that has been created and copy it.
k. Open new query and paste text then execute. Errors on primary key entries are ok
9. On ODEP, Backup PY811 pathcode by renaming it to PY811BAK (substitute PY811 for DV811 depending on environment)
10. On ODEP, Copy PD811 pathcode with all subdirectories except package to PY811 or DV811
11. On ODEP, Copy package subdirectory from PY811BAK to PY811(DV811BAK to DV811)
12. Copy SY811.F9861 table on OENT enterprise server to ol811.F9861*Today’s Date*
a. Open script backup_ol811_F9861
b. Change date in script to current date
c. Execute Script
13. Delete PY811 or DV811 records from original F9861 table
a. Open script Delete_ol811_F9861_DV811 or Delete_ol811_F9861_PY811
b. Execute Script
14. Insert PY811 or DV811 records into SY811.F9861
a. On ODEP log into JDE in the DEP811 environment
b. Go to BV and run R989861
c. Current pathcode=PD811
d. New pathcode=PY811 or DV811
15. Log onto development machine and build a full package and gen specs.
Sql backup to disk. Name with todays date
Restore from disk. Options tab overwrite existing database or force overwrite. Right click tasks, restore, database. Choose source from device add find file I did for backup. Check box restore. Upper left options. Check box that says overwrite existing database. Restore as mdf mlf
Data refresh is less steps. Only deal with PS_DEV or PS_CRP