Sie sind auf Seite 1von 33

http://sapfreelancing.

com/blog/detail/id/x2x2o2/title/_DB_REFRESH/flag/BH

DB REFRESH

Activities to be carried on PRD System:

1. Take backup using BRTOOLS :


Here I have considered Offline Backup (Compression Mode).

Click Start -> Run -> Type BRTOOLS and click OK


The above window denotes that the backup has started and being saved in the location
D:oraclePRDsapbackup. Here the backup file name is bdjvujux.afd.
It shuts down the Database Instance as we are taking an Offline Backup.
The backup has been completed successfully.

Exit from the BRTOOLS by selecting option s and then select the option y.
2. Create a Control file.

Click Start -> Run -> Type sqlplus "/as sysdba" and click OK.
You can find the trace file in the following location D:oraclePRDsaptraceusertrace. Check the latest file
that is generated.
Copy that file and paste it onto the Desktop and rename it with control.sql .

Open the control.sql file and perform the following:


a. Remove the lines present above STARTUP NOMOUNT and below CHARACTER SET
UTF8; and save the file.
b. Replace <SOURCE SID> with <TARGET SID>. Here it is from PRD to QAS.
c. Replace REUSE with SET.
d. Replace NORESETLOGS with RESETLOGS
e. Replace ARCHIVELOG with NOARCHIVELOG.
Activities to be carried on NAG System:

1. Goto SE01 and create a Transport Request (Transport of Copies).


2. Specify the objects that you would like to backup from the QAS system, like USR01, USR02,
RFCDES, TBDLS etc as per your organization requirements and release the transport request.
Ensure that the target system is specified before releasing the TR.
3. Go to SE01

4. Click on create
5.

6. Save
7. Double click on change request

8. Click on change mode


9. (Tables: RFCDES,USR02,TBTCS,EDIPORT,USR03,USR04,TBDLS,USR11,USR10,USR12, USR13)
10. SAVE
11. The co-file and data files are generated in usrsaptranscofiles , usrsaptransdata locations. Backup
them onto a removable media.
12. Make screen captures of the following tcodes :
SM59 (RFC destinations)
BD54 (logical systems)
SPAD (printers --> could be done by export on flat file).
DB13 (export DBA scheduling calendar).
SM37 (export name of released jobs with details).
AL11 (SAP Directories)
WE20 (Partner profile)
WE21 (Post IDOCS Processing)
SMLG (Logon Group)
RZ12 (RFC Server Group)
RZ70 (SLD Configuration)
RZ04 (Operation Mode)
SM63 (Time Table)
SCC4 (Clients Overview)
SPAM (Package level)
13. Stop the SAP Instance, Oracle and Oracle services.
14. Delete the directories on the QAS system
Delete directories sapdata1, 2, 3, 4, 5, 6 (keep the tree structure D:oracleQAS).
Delete files redolog and mirrorlog (keep the tree structure)
Delete the three control files oracle (keep the tree structure)
Delete files from the directories sapbackup, sapcheck, sapreorg, saptracebackground,
saptraceusertrace (keep the tree structure).
15. Copy the sapbackup folder from PRD, along with the control.sql file pasted on the Desktop to
QAS (oracleQASsapbackup).
16. Open the .afd /.and backup file (Eg.: bdjvujux.afd) present in sapbackup directory. Replace the
PRD with the QAS and save it.
17. Go to oracleQASsapbackupxxxx (Eg.: bdjvujux) backup file name folder location. Rename the
files with PRD to QAS.
18. Start -> Run -> cmd. Goto the location oracleQASsapbackup and type :
brrestore m full b <filename> -c
Backup is restored successfully.

11. Check the presence of the paths for the creation of the control files oracle

oracleQASoriglogacntrl
oracleQASoriglogbcntrl
oracleQASsapdata1cntrl

If one of these paths is not present, create it.


12. Start the Oracle services.

13. Login to sql from the location where the control.sql file is located.

Arrange the Control file below like this;


After the control file is created, the Oracle is in Mounted state.
Now, the database is open status.

You can view the PRD OPS$ users in the above screen.
Goto location: C:Program Filessapinst_instdirERPSYSTEMORACENTRALAS. Copy the
ORADBUSR.SQL file and paste it in oracleQASsapbackup
Execute the ORADBUSR.SQL file and provide the inputs as follows:

Enter value for 1: SAPR3


Enter value for 2: NT
Enter value for 3: Target Hostname
Enter value for 4: Target <SID> ie.. QAS
Login to SQL and check the users.

Drop the Source System users ie.. PRD users.


Below screen displays the list of users available after dropping PRD users.

Provide permissions to the following QAS users as mentioned in the below screen.
After compilation of this steps .Unlock the schema USER, i.e SAPSR3

By using this command in sql prompt ,


SQL>Alter user SAPSR3 account unlock;

Note: After unlock user we give the role permeation to sap and DB, for this purpose we can execute the
Kernel file?

It should be located in Kernel directory :Usr/SAP/SID/Sys/exe/uc/NTI386/sapdba_role.sql

Copy the sapdba_role.sql after execute in sql prompt.

SQL> @c: sapdba_role.sql;

Start the SAP instance or MMC.

Install the License for the QAS system and remove the PRD system license..
saplicense show (Displays the licenses of both QAS and PRD systems.)
saplicense delete (Delete the PRD system license).
saplicense install (Install license for the QAS system).

Login through Client - 000 and User SAP*.

Perform post installation activities as shown below.

1. SICK
2. SE06 and select Database copy or Database migration option. Click Perform Post-Installation
Actions.
Click Yes.
Accept the source system.

Click Yes.

Accept.

Click Yes.

Click Yes.
Click Yes.

3. Configure STMS. Run TC-STMS.

NOTE: Here we are considering the system (NAG) as Domain Controller. If it is a child system, include
that system into the Domain Controller as per below screen.
3. Run RZ10

Select Extended maintenance and click on Display button


To delete profiles of PRD system. For that follow the below path
Profile -> Delete -> All versions -> Of a profile

Click Yes

Click No

Click on continue
Similarly delete Start profile and Default profile. As shown above screens.
After deleting all profiles of the PRD system then import profiles of NAG system by using below path.
Go to Utilities -> Import profile -> Of a active servers.