restore procedures from disk backup

Upload: fcabanes01

Post on 02-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 Restore Procedures From Disk Backup

    1/37

    BPD Restore Procedures from Disk BackupPage 1 of 37

    Prepared By: Fatima Cabanes

    BPD Restore Procedures from BPP (bpoierpprod)Disk Backup

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

    I. Execute BackupBackups 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 -> Addto schedule a backup.

    BPP

  • 8/11/2019 Restore Procedures From Disk Backup

    2/37

    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 SAPinstance is up and running and Offline Backups requires downtime of the SAP instance. For Backup toTape, 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 tojustAdd 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 SAPinstance first then the SAP services as well. Otherwise, skip this step and proceed with callingBRTOOLS.

    initbpp.sap

    initbpp.sap

  • 8/11/2019 Restore Procedures From Disk Backup

    3/37

    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

  • 8/11/2019 Restore Procedures From Disk Backup

    4/37

    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 alter the value and hit enter. If the backup is to be saved on tape, alter the valueof 2 Backup device type . 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 savespace especially if backup is to be saved on disk, select 4 Verification mode and enter yes.

    However, please note that compression is not recommended for backup to disk. HardwareCompression 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.

  • 8/11/2019 Restore Procedures From Disk Backup

    5/37

    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 anadequate 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

  • 8/11/2019 Restore Procedures From Disk Backup

    6/37

    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\sapdata16) F:\oracle\BPD\saparch\*

    7) F:\oracle\BPD\sapbackup\*8) F:\oracle\BPD\saptrace\usertrace\*9) F:\oracle\BPD\saptrace\background10)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]

  • 8/11/2019 Restore Procedures From Disk Backup

    7/37

    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 inF:\oracle\BPD\sapbackup. Adapt the current location (target system) of the directories found in thisfile.

    Open a command prompt and go to the sapback directory. Execute brrestore m full b -cto start the restore. For some differences other than thatshown below, it should be edited on the logfile inside the sapbackup, then re-run the command. Toconfirm the values, key in C to continue.

  • 8/11/2019 Restore Procedures From Disk Backup

    8/37

    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 restorecommand.

    Enter C to continue

  • 8/11/2019 Restore Procedures From Disk Backup

    9/37

  • 8/11/2019 Restore Procedures From Disk Backup

    10/37

    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 andsave as an SQL file (eg. rename_.sql).

    Start Oracle services.

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

  • 8/11/2019 Restore Procedures From Disk Backup

    11/37

    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 databaseuntil cancel using backup controlfile;

    It will ask for the location of a particular archivelog file that comes with the DB backup. Specify thelocation 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

  • 8/11/2019 Restore Procedures From Disk Backup

    12/37

    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 datafileshould have SYSTEM status and the rest in ONLINE status.

    Shutdown the database by executing shutdown;

  • 8/11/2019 Restore Procedures From Disk Backup

    13/37

    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 xand R3trans d. Takenote of the directory where you ran the command. A logfile (trans.log) will be generated and can befound there, which contains the errors.

    The cause of the RC=0012 above is ORA-1017 as shown in below trans.log located inE:\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 aswell. These will be discussed on the next part.

  • 8/11/2019 Restore Procedures From Disk Backup

    14/37

    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 Note50088 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.sqlSAPSR3 NT bpoifs

    Enter the SID, in this case BPD

  • 8/11/2019 Restore Procedures From Disk Backup

    15/37

    BPD Restore Procedures from Disk BackupPage 15 of 37

    Prepared By: Fatima Cabanes

    User OPS$\ADMand OPS$\SAPSERVICEwill be created. In thisparticular case, users are OPS$BPOIFS\BPDADMand OPS$BPOIFS\SAPSERVICEBPD.

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

    To delete OPS$BPOIERPPROD\BPPADMfrom dba_tables, execute drop table

    OPS$BPOIERPPROD\BPPADM.SAPUSER;

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

  • 8/11/2019 Restore Procedures From Disk Backup

    16/37

    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 fromdba_synonyms where synonym_name=SAPUSER;Check for incorrect OWNERentries with a domaindifferent from the current one (eg. OPS$BPOIERPPROD\SAPSERVICEBPP), this needs to be deletedfrom 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 scriptwhich 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

    command in the CMD prompt.

  • 8/11/2019 Restore Procedures From Disk Backup

    17/37

    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)andensure that below Oracle services are started.

    Same goes with SAP services as shown below.

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

  • 8/11/2019 Restore Procedures From Disk Backup

    18/37

    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 client000. This is due to an inconsistency in the license, which is dependent on the hardware key. And sincethere is a difference in the hardware key of the source and the target, a license key needs to beapplied.

    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.

  • 8/11/2019 Restore Procedures From Disk Backup

    19/37

    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 followingpath 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 -> Statusif the license has been successfully installed. The license expiration dateshould be 31.12.9999as shown below.

  • 8/11/2019 Restore Procedures From Disk Backup

    20/37

    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 intransaction STMS.

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

  • 8/11/2019 Restore Procedures From Disk Backup

    21/37

    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 alterdatabase rename global_name to BPD; This is for system copy/restore with different SID (source andtarget 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. Enterthe name of the table and click on Edit.

  • 8/11/2019 Restore Procedures From Disk Backup

    22/37

    BPD Restore Procedures from Disk BackupPage 22 of 37

    Prepared By: Fatima Cabanes

    Select Delete dataand clickActivate 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.

  • 8/11/2019 Restore Procedures From Disk Backup

    23/37

    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, asshown below.

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

  • 8/11/2019 Restore Procedures From Disk Backup

    24/37

    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.

  • 8/11/2019 Restore Procedures From Disk Backup

    25/37

    BPD Restore Procedures from Disk BackupPage 25 of 37

    Prepared By: Fatima Cabanes

    Go to transaction SE38to delete all canceled and finished jobs. Key in RSBTCDEL and click onExecute.

    Mark field Delete with forced modeas shown below and hit Execute.

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

  • 8/11/2019 Restore Procedures From Disk Backup

    26/37

    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 asfollows: SAPOSS, SAPNET_RFC, SAPNET_RTCC and SDCC_OSS. Double-click on the RFC you wish tocheck and click on Connection Test.

    A successful connection test shows similar result as below.

  • 8/11/2019 Restore Procedures From Disk Backup

    27/37

    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 shownbelow.

  • 8/11/2019 Restore Procedures From Disk Backup

    28/37

    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 theentries. 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 isbpoifs_BPD_02). Change the Spool Server by hitting F4 or clicking the eye button beside the spoolserver input box and click on Save.

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

  • 8/11/2019 Restore Procedures From Disk Backup

    29/37

    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 thelogical system by going to transaction SE38. Enter RSDBBUFF in the program field and hit Execute.

  • 8/11/2019 Restore Procedures From Disk Backup

    30/37

    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 correctthis, go to transaction SM59and execute Connection andAuthorization test. If Connection test fails,check and correct the Target Address. On the other hand, ifAuthorization test fails, username andpasswordmight be incorrect.

    VII. Java instance reconfiguration

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

  • 8/11/2019 Restore Procedures From Disk Backup

    31/37

    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 thefile, be sure to have it backed up first by saving a copy with a different filename. Edit out the followingand 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.vmpropfrom the same directory. Note that uponstartup, this file will be re-generated as well.

  • 8/11/2019 Restore Procedures From Disk Backup

    32/37

    BPD Restore Procedures from Disk BackupPage 32 of 37

    Prepared By: Fatima Cabanes

    Run the CONFIGTOOL by double-clicking on configtool.bat locatedinside the directoryE:\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 bpoierpprodin this case). Correct theparameters by selecting one -> Go -> enter the correct hostname (bpoifs) -> Set. Repeat the stepsuntil all parameters are changed correctly.

  • 8/11/2019 Restore Procedures From Disk Backup

    33/37

    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.

  • 8/11/2019 Restore Procedures From Disk Backup

    34/37

    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 onApply Custom to save and continue. Note that the instance, SIDand the hostnameneed to bechanged and corrected in this particular case.

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

  • 8/11/2019 Restore Procedures From Disk Backup

    35/37

    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.

  • 8/11/2019 Restore Procedures From Disk Backup

    36/37

    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.

  • 8/11/2019 Restore Procedures From Disk Backup

    37/37

    BPD Restore Procedures from Disk BackupPage 37 of 37

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

    VIII. System BPD ready for hand-off