Sei sulla pagina 1di 37

BPD Restore Procedures from Disk BackupPage 1 of 37

Prepared By: Fatima Cabanes


BPD Restore Procedures from BPP (bpoierpprod)
Disk Backup

Contents
I. Execute Backup . 1
II. Restore of BPP DB as BPD. 5
III. Recover of DB and archivelog files 10
IV. Create OPS$ users and import of roles .. 15
V. Start SAP .. 18
VI. Conduct Checks .. 19
VII. Java instance reconfiguration 30
VIII. System BPF ready for hand-off . 37




I. Execute Backup
Backups can be obtained via the scheduled backup plans or can be run specifically as shown below:


A) Schedule via DB13
.
Go to transaction DB13 -> Date -> Add to schedule a backup.

BPP
BPD Restore Procedures from Disk BackupPage 2 of 37


Prepared By: Fatima Cabanes
Schedule the type of backup you wish to execute. Note that Online Backups can be run even if SAP
instance is up and running and Offline Backups requires downtime of the SAP instance. For Backup to
Tape, schedule initialization of Tape prior to the backup itself.



After defining the type of backup, there are actually two options which is to Execute Immediately or to
just Add and have the backup run at a later time. If you wish to have the backup run at a later time,
be sure to indicate the date/time in the Planned Start.




B) Run backup via BRTOOLS in command line


If you wish to run an Offline Backup via the command line thru BRTOOLS, bring down the SAP
instance first then the SAP services as well. Otherwise, skip this step and proceed with calling
BRTOOLS.

initbpp.sap
initbpp.sap
BPD Restore Procedures from Disk BackupPage 3 of 37


Prepared By: Fatima Cabanes




Open a command prompt and execute brtools -> 4 Backup and Database Copy



Select 1 Database Backup



BPD Restore Procedures from Disk BackupPage 4 of 37


Prepared By: Fatima Cabanes
Here, you have the option to define the backup type, whether online or offline, by choosing 6
Backup type <type> alter the value and hit enter. If the backup is to be saved on tape, alter the value
of 2 Backup device type <device>. After changing the parameters, enter C to continue.



Same goes with the below parameters. Should you wish to have the backup compressed so as to save
space especially if backup is to be saved on disk, select 4 Verification mode <verify> and enter yes.
However, please note that compression is not recommended for backup to disk. Hardware
Compression is more suitable for this. If parameters are okay, enter C to continue.



Select C to continue and wait for the backup to finish successfully.

BPD Restore Procedures from Disk BackupPage 5 of 37


Prepared By: Fatima Cabanes
II. Restore BPP DB as BPD

Verify that the backup files are complete and in place on the OS from NFS. Any directory with an
adequate space would do.

Right click on BPD in SAP MCC Shutdown



Stop SAP services



Open a command prompt issue command: sqlplus /as sysdba -> issue command: shutdown
immediate; as shown below.



Stop Oracle services

BPD Restore Procedures from Disk BackupPage 6 of 37


Prepared By: Fatima Cabanes
Delete all files inside the following directories:
1) F:\oracle\BPD\origlogA\*
2) F:\oracle\BPD\origlogB\*
3) F:\oracle\BPD\mirrlogA\*
4) F:\oracle\BPD\mirrlogB\*
5) F:\oracle\BPD\sapdata1
6) F:\oracle\BPD\saparch\*
7) F:\oracle\BPD\sapbackup\*
8) F:\oracle\BPD\saptrace\usertrace\*
9) F:\oracle\BPD\saptrace\background
10) H:\oracle\BPD\sapdata1\*
11) H:\oracle\BPD\sapdata2\*
12) H:\oracle\BPD\sapdata3\*
13) H:\oracle\BPD\sapdata4\*


Specify the following entries in initBPD.sap found in H:\oracle\BPD\102\database:
1) backup_type [type of backup of the source system]
2) backup_dev_type [device used for the backup]
3) compression [mode of compression used]
4) backup_root_dir [the location of the backup file in the target system]




BPD Restore Procedures from Disk BackupPage 7 of 37


Prepared By: Fatima Cabanes
Edit the log file of the source backup of the restore which is among the backup files and place it in
F:\oracle\BPD\sapbackup. Adapt the current location (target system) of the directories found in this
file.



Open a command prompt and go to the sapback directory. Execute brrestore m full b
<file_name_of_log_backup_of_source> -c to start the restore. For some differences other than that
shown below, it should be edited on the logfile inside the sapbackup, then re-run the command. To
confirm the values, key in C to continue.

BPD Restore Procedures from Disk BackupPage 8 of 37


Prepared By: Fatima Cabanes
The deleted directories on the previous step, will now be created upon continuation of the restore
command.




Enter C to continue

BPD Restore Procedures from Disk BackupPage 9 of 37


Prepared By: Fatima Cabanes
Wait for the restore to finish. Warning/s is okay and is still acceptable.



III. Recover DB and archivelog files

Go to the target system (which in this case is BPD), open a command prompt and login to SQLPLUS
by entering sqlplus as sysdba and excute alter database backup to controlfile;.



Get the control file which is usually located in \oracle\<SID>\saptrace\usertace and move it to the
target system of the restore (bpoifs) in the same location.



BPD Restore Procedures from Disk BackupPage 10 of 37


Prepared By: Fatima Cabanes
Edit the file so that the directories would be pointed to the correct drives in the target system and
save as an SQL file (eg. rename_<date>.sql).



Start Oracle services.



Open a command prompt and locate the usertrace directory. Login to sqlplus by executing sqlplus /as
sysdba and run the sql file to create controlfile, by entering @<file_name>.sql;


BPD Restore Procedures from Disk BackupPage 11 of 37


Prepared By: Fatima Cabanes
Start recovering the archivelog files by running the following command, recover automatic database
until cancel using backup controlfile;



It will ask for the location of a particular archivelog file that comes with the DB backup. Specify the
location and the filename of the logfile.





It will again ask for another log, here, enter CANCEL. The output should be Media recovery cancelled.



Execute alter database open resetlogs; to open the database using resetlogs


BPD Restore Procedures from Disk BackupPage 12 of 37


Prepared By: Fatima Cabanes
Check the status of the datafiles by executing select file#, status from v$datafile; The first datafile
should have SYSTEM status and the rest in ONLINE status.




Shutdown the database by executing shutdown;

BPD Restore Procedures from Disk BackupPage 13 of 37


Prepared By: Fatima Cabanes
Start the database again by executing startup;



Check the connection of SAP to the Oracle database by executing R3trans x and R3trans d. Take
note of the directory where you ran the command. A logfile (trans.log) will be generated and can be
found there, which contains the errors.



The cause of the RC=0012 above is ORA-1017 as shown in below trans.log located in
E:\usr\sap\trans, the directory where R3trans d/-x was executed.



To correct this, a database user (OPS$ user) needs to be created and roles need to be assigned as
well. These will be discussed on the next part.
BPD Restore Procedures from Disk BackupPage 14 of 37


Prepared By: Fatima Cabanes
IV. Create OPS$ users and import of roles

To create an OPS$ user, oradbusr.sql needs to be downloaded first. This is attached in SAP Note
50088 Creating OPS$ users on Windows NT/Oracle. Open a command prompt and go to the
directory where the script is located. Execute the following command sqlplus /nolog @oradbusrl.sql
SAPSR3 NT bpoifs




Enter the SID, in this case BPD

BPD Restore Procedures from Disk BackupPage 15 of 37


Prepared By: Fatima Cabanes
User OPS$<DOMAIN>\<SID>ADM and OPS$<DOMAIN>\SAPSERVICE<SID> will be created. In this
particular case, users are OPS$BPOIFS\BPDADM and OPS$BPOIFS\SAPSERVICEBPD.



Check for the existing users in the database via sqlplus /as sysdba and execute select owner from
dba_tables where table_name=SAPUSER; Notice that there would be an OWNER with a domain
different from the current (eg. OPS$BPOIERPDEV\BPDADM) which needs to be deleted.



To delete OPS$BPOIERPPROD\BPPADM from dba_tables, execute drop table
OPS$BPOIERPPROD\BPPADM.SAPUSER;



Table dba_tables should only have one owner with the correct domain as shown below.



BPD Restore Procedures from Disk BackupPage 16 of 37


Prepared By: Fatima Cabanes
Synonyms should also be checked, to do this execute select owner, table_name, table_owner from
dba_synonyms where synonym_name=SAPUSER; Check for incorrect OWNER entries with a domain
different from the current one (eg. OPS$BPOIERPPROD\SAPSERVICEBPP), this needs to be deleted
from the table.



To have it deleted, execute drop synonym OPS$BPOIERPPROD\SAPSERVICEBPP.SAPUSER;



Table dba_synonyms should only have one owner as shown below.



After creating the OPS$ user, roles need to be imported and assigned. This is done by running a script
which can be downloaded from and discussed furher in SAP Note 134592 Importing the SAPDBA role
(sapdba_role.sql). Note that the file is in SAR format, thus needs to be uncar by using sapcar xvf
<file_name> command in the CMD prompt.

BPD Restore Procedures from Disk BackupPage 17 of 37


Prepared By: Fatima Cabanes
To run the sql script, open a command prompt and go to the directory where the file is uncared.
Execute sqlplus /nolog @sapdba_role.sql SR3



V. Start SAP

To start an SAP instance, go to SERVICES (Right-click on My Computer -> Manage -> Services) and
ensure that below Oracle services are started.



Same goes with SAP services as shown below.



Start SAP in MMC (Right-click <SID>, in this case BPD -> Start)

BPD Restore Procedures from Disk BackupPage 18 of 37


Prepared By: Fatima Cabanes
VI. Conduct Checks

This error message might be encountered upon attempt to login as a user other than SAP* in client
000. This is due to an inconsistency in the license, which is dependent on the hardware key. And since
there is a difference in the hardware key of the source and the target, a license key needs to be
applied.



License keys are found in transaction SLICENSE. Since the existing is of different Hardware Key,
delete it first as shown below.



Click on Install button as shown below.

BPD Restore Procedures from Disk BackupPage 19 of 37


Prepared By: Fatima Cabanes

Locate the license on the server and click Open. Please note that license.txt is located in the following
path C:\Documents and Settings\bpdadm\Desktop\ora-1017\license_bpd.txt



A successful application of a license key is confirmed by a message similar to below.



Check System -> Status if the license has been successfully installed. The license expiration date
should be 31.12.9999 as shown below.

BPD Restore Procedures from Disk BackupPage 20 of 37


Prepared By: Fatima Cabanes
Execute consistency check by going to transaction SICK.



Perform post installation actions by going to transaction SE06 -> Perform Post-Installation Actions



Confirm below message by clicking on Yes. Note that this would entail reinstalling the CTS in
transaction STMS.



Enter the source of the database copy, in this case the source is BPP (bpoierpprod) and click on
Continue.

BPD Restore Procedures from Disk BackupPage 21 of 37


Prepared By: Fatima Cabanes
Confirm the change from BPP to BPD by clicking on Yes.



Open a command prompt and connect to sqlplus by executing sqlplus /as sysdba. Execute alter
database rename global_name to BPD; This is for system copy/restore with different SID (source and
target system).



Delete entries from the following tables (ALCONSEG, ALSYSTEMS, DBSNP, MONI, OSMON, PAHI,
SDBAD, SDBAH, SDBAP, SDBAR, DDLOG, TPFET, TPFHT, TLOCK) by going to transaction SE14. Enter
the name of the table and click on Edit.


BPD Restore Procedures from Disk BackupPage 22 of 37


Prepared By: Fatima Cabanes
Select Delete data and click Activate and adjust database, as shown below.



Confirm the adjustment by clicking on Yes.



A similar message below confirms a successful activation and adjustment.



Repeat steps for the rest of the tables mentioned above.
BPD Restore Procedures from Disk BackupPage 23 of 37


Prepared By: Fatima Cabanes
Import profiles by going to transaction RZ10 -> Utilities -> Import Profiles -> Of active servers, as
shown below.






Check the consistency of Temporary Sequential Data by going to transaction SP12 -> TemSe Data
Storage -> Consistency Check, as shown below.


BPD Restore Procedures from Disk BackupPage 24 of 37


Prepared By: Fatima Cabanes
Delete inconsistencies by clicking on Delete All.



After deleting the inconsistencies, you should see a clear list for both TST01 and TST03 tables.






BPD Restore Procedures from Disk BackupPage 25 of 37


Prepared By: Fatima Cabanes
Go to transaction SE38 to delete all canceled and finished jobs. Key in RSBTCDEL and click on
Execute.



Mark field Delete with forced mode as shown below and hit Execute.



A successful deletion of jobs is confirmed by a similar message below.

BPD Restore Procedures from Disk BackupPage 26 of 37


Prepared By: Fatima Cabanes
Check important RFC connections by going to transaction SM59. Important RFC connections are as
follows: SAPOSS, SAPNET_RFC, SAPNET_RTCC and SDCC_OSS. Double-click on the RFC you wish to
check and click on Connection Test.


A successful connection test shows similar result as below.



BPD Restore Procedures from Disk BackupPage 27 of 37


Prepared By: Fatima Cabanes
Another important check is the authorization check. To do this, click on Utilities -> Authorization Test.



A successful authorization test shows similar results as below.



Check on the output devices by going to transaction SPAD -> Output Devices -> Display, as shown
below.



BPD Restore Procedures from Disk BackupPage 28 of 37


Prepared By: Fatima Cabanes
Notice that entries are highlighted in red similar to below, which indicates inconsistencies in the
entries. To correct this, double-click on the output device.



Notice that the Spool Server defined is incorrect (eg. bpoierpprod_BPP_00 when the correct server is
bpoifs_BPD_02). Change the Spool Server by hitting F4 or clicking the eye button beside the spool
server input box and click on Save.


Do the above steps for the other output devices with inconsistencies.

BPD Restore Procedures from Disk BackupPage 29 of 37


Prepared By: Fatima Cabanes
Synchronize all the buffers as described in SAP Note 36283 and adapt the client information for the
logical system by going to transaction SE38. Enter RSDBBUFF in the program field and hit Execute.






BPD Restore Procedures from Disk BackupPage 30 of 37


Prepared By: Fatima Cabanes
Check the Secure storage by going to transaction SECSTORE and click Execute.



For those entries with red status, it only means that the RFC connection is inconsistent. To correct
this, go to transaction SM59 and execute Connection and Authorization test. If Connection test fails,
check and correct the Target Address. On the other hand, if Authorization test fails, username and
password might be incorrect.




VII. Java instance reconfiguration

Since restore from backup covers only the ABAP instance, for JAVA instance to come alive, there are
configurations that needs to be done in which includes manual editing of the hostnames, SID, port
number and the like.


BPD Restore Procedures from Disk BackupPage 31 of 37


Prepared By: Fatima Cabanes
First is to go to E:\usr\sap\BPD\DVEBMGS02\j2ee and edit instance.properties. But before editing the
file, be sure to have it backed up first by saving a copy with a different filename. Edit out the following
and save the file.
port numbers (MS PORT should be 3903 and EN PORT should be 3203)
hostnames (bpoierpprod to bpoifs)
instance (DVEBMGS00 to DVEBMGS02)



Delete or rename also the instance.properties.vmprop from the same directory. Note that upon
startup, this file will be re-generated as well.

BPD Restore Procedures from Disk BackupPage 32 of 37


Prepared By: Fatima Cabanes
Run the CONFIGTOOL by double-clicking on configtool.bat located inside the directory
E:\usr\sap\BPD\DVEBMGS02\j2ee\configtool



Click on Yes to continue.



Click on Properties Search to start correcting the hostname.



Search for the hostname of the source system (which is bpoierpprod in this case). Correct the
parameters by selecting one -> Go -> enter the correct hostname (bpoifs) -> Set. Repeat the steps
until all parameters are changed correctly.


BPD Restore Procedures from Disk BackupPage 33 of 37


Prepared By: Fatima Cabanes
Click on Configuration Editor to start editing the cluster data.



Drill down on cluster_data -> Propertysheet instance.properties.ID28458 -> Switch to Edit Mode, as
shown below.



Click on Yes to proceed.

BPD Restore Procedures from Disk BackupPage 34 of 37


Prepared By: Fatima Cabanes
Click on an entry/parameter to be corrected and enter the correct value in the custom field. Click on
Apply Custom to save and continue. Note that the instance, SID and the hostname need to be
changed and corrected in this particular case.



After correcting the parameters, click on Switch to Display Mode, as shown below.

BPD Restore Procedures from Disk BackupPage 35 of 37


Prepared By: Fatima Cabanes
Click on Configuration Editor to go back to the main page.



Click on Save to save all the changes made.



A summary of all the changes us shown, click OK to confirm.



For changes to take effect, it is a must to restart the cluster. Click OK to continue.


BPD Restore Procedures from Disk BackupPage 36 of 37


Prepared By: Fatima Cabanes
Go to File -> Exit to leave the ConfigTool.



Stop SAP instance first in SAP MMC.



Then have it started again.


BPD Restore Procedures from Disk BackupPage 37 of 37


Prepared By: Fatima Cabanes

J2EE services should all be green as shown below. In case a service is in grey status, check the logs
for to see the cause of error. Logs can be accessed by right-clicking on the service in MMC ->
Developer Trace or by going to E:\usr\sap\BPD\DVEBMGS02\work.




VIII. System BPD ready for hand-off

Potrebbero piacerti anche