You are on page 1of 4

3/8/2015

SAP DUMP - Useful Basis Tutorials - SAP Specific Steps for Oracle Backup Restore method with different SID...

SAP Specific Steps for Oracle Backup Restore method with different SID...
Changes to Parameter file "initSAPSID.sap" as user "oraSAPSID":
1) Traverse to path /oracle/SOURCE_SID/102_64/dbs
2) Open initSAPSID.sap file
3) Make sure the following values are set
backup_mode = all
backup_type = offline_force
backup_dev_type = disk
backup_root_dir = /oracle/SOURCE_SID/sapbackup

(You can change this path keeping in view space

constraints adn also make sure proper permissions are given.)


4) The above mentioned parameters can changed at user discretion.

Backup Database to disk as "oraSAPSID" user using brtools:


1) execute brtools command
2) Select Option 4 for backup and database copy
3) Select Option 1 for database backup
4) Since already required options are changed in initSAPSID.sap file, enter option c in the next screen.
5) Enter option c in the next screen.
6) Enter option c in the next screen to proceed with backup.
7) This will create backup files and ".afd" file.
Backup Database using command level as oraSAPSID user:
brbackup -m all -t offline_force -d disk ----( where by default the database backup will be
in/oracle/SOURCE_SID/sapbackup directory unless the value backup_root_dir is changed
in initSAPSID.sap file)

Backup the control file of the source system using below steps:
The database sholud be in nomount/mount state.
As oraSAPSID user,execute the command:
sqlplus / as sysdba
>startup mount ( if database is down)
>alter database backup controlfile to trace;
>exit
This will create a copy of the control file as a trace file in: /oracle/SOURCE_SID/saptrace/usertrace
Rename this file as CONTROL.SQL for use in Target system.

data:text/html;charset=utf-8,%3Cdiv%20class%3D%22seaocore_gutter_view_title%20sitefaq_view_title%22%20style%3D%22padding%3A%200px%3B%2

1/4

3/8/2015

SAP DUMP - Useful Basis Tutorials - SAP Specific Steps for Oracle Backup Restore method with different SID...

Restore DB with Different SID:


Pre-requisites:
1. Copy the .afd file of the backup(source system) to /oracle/TARGET_SID/sapbackup and change the
permissions appropriately.
2. Copy the backupfile to /oracle/TARGET_SID/sapbackup or to any other location on the target
(this location entry must be made in .afd file for backup_root_dir value). Also change

system

the permissions on

these files accordingly.


3. Before restoring the database, make sure that the same file structure exists in the target database as that of
source database (except fo SID's).
4. Before restoring, change the Source SID value to Target SID value in .afd file related to the backup. Check
for case sensitivity.
5. Also change the value of SOURCE_SID to TARGET_SID as shown below:
BR0201I Compressing /oracle/SOURCE_SID/sapdata1/sr3_1/sr3.data1
BR0203I to /oracle/SOURCE_SID/sapbackup/bekbreeb/sr3.data1.Z ...

BR0201I Compressing /oracle/SOURCE_SID/sapdata1/sr3_1/sr3.data1


BR0203I to /oracle/TARGET_SID/loaction of the backupfile on target system/bekbreeb/sr3.data1.Z ...

Restoration on different SID:


Login as user oraSAPSID in target system: brrestore -m full -d disk -b .afd
1. Enter option c in the next screen.
2. Enter option c in the next screen. check the onscreen details regarding the restore of the database.
3. Enter option c in the next screen and continue with restoration process.
NOTE: Database should be in shutdown state at this point.
1. Steps After restoration:
1) Copy the CONTROL.SQL to the target system and assign appropraite permissions.
2) Open the CONTROL.SQL file.
3) Scroll until the following statements are encountered:
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "TARGET_SID" RESETLOGS ARCHIVELOG
4) Select everything above the mentioned statements and delete them.
5) Scroll until the following statements are encountered:
CHARACTER SET UTF8;
6) Select everything below the mentioned statements and delete them.
7) Now modify the above statements as below:
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE SET DATABASE "" RESETLOGS ARCHIVELOG
8) Replace /oracle/SOURCE_SID with /oracle/TARGET_SID in CONTROL.SQL file.
9) As user "oraTARGET_SID", execute the following command:
sqlplus / as sysdba
>@/location of CONTROL.SQL file/CONTROL.SQL
data:text/html;charset=utf-8,%3Cdiv%20class%3D%22seaocore_gutter_view_title%20sitefaq_view_title%22%20style%3D%22padding%3A%200px%3B%2

2/4

3/8/2015

SAP DUMP - Useful Basis Tutorials - SAP Specific Steps for Oracle Backup Restore method with different SID...

This will create the controlfile in the target system. Database will be in no mount State.
>alter database mount;
>alter database open resetlogs;
>exit
10) Download ORADBUSR sript to the target system and assign appropriate permissions.
11) As user "oraTARGET_SID", execute the following command:
sqlplus / as sysdba
>@/location of ORADBUSR.sql file/ORADBUSR.sql TARGET_SCHEMA UNIX TARGET_SID x
12) If any tablespace related error arises, create the prompted tablespace as user "oraTARGET_SID",
using brtools.
13) Again with user "oraTARGET_SID", execute the following command:
sqlplus / as sysdba
>@/location of ORADBUSR.sql file/ORADBUSR.sql TARGET_SCHEMA UNIX TARGET_SID x
14) After the script has been executed, we can check the users created executing the below query:
select username, account_status from dba_users;
15) To know which user is assigned to which tablespace, execute the below query:
select username, default_tablespacefrom dba_users;
16) To be able to start sap, the ops$TARGET_SIDadm.sapuser table needs to contain the entries
user-id and password of the source database schema owner. Execute the below command to know the
entry details in the table.
select * from ops$TARGET_SIDadm.sapuser;
If no entries are found, we need to pass the values to this table using brtools.
as user "oraTARGET_SID", execute brtools command as below:
Select option 8(Additional Functions)
Select option 4(Change password of database user)
Select option 3(Database ower to changePassword), pass the value of the source system schema
ower and press enter
Enter option c to continue
Enter option c to continue
Enter Password as prompted in the next screen and press enter
Re-enter Password as prompted in the next screen and press enter
Enter option c to continue
Enter option s to stop brtools
Enter option y to continue
Execute the below command to know the entry details in the table.

select * from ops$TARGET_SIDadm.sapuser;


Now the ops$TARGET_SIDadm.sapuser table will have entry of the source database schema owner.
data:text/html;charset=utf-8,%3Cdiv%20class%3D%22seaocore_gutter_view_title%20sitefaq_view_title%22%20style%3D%22padding%3A%200px%3B%2

3/4

3/8/2015

SAP DUMP - Useful Basis Tutorials - SAP Specific Steps for Oracle Backup Restore method with different SID...

17) To check the SAP connectivity with the database, login as TARGET_SIDadm user and execute
R3trans d command. If the return code is 0000, then the database connectivity successful after the
restoration.
18) Start SAP Application Server using command "startsap" with user SIDADM in target system

data:text/html;charset=utf-8,%3Cdiv%20class%3D%22seaocore_gutter_view_title%20sitefaq_view_title%22%20style%3D%22padding%3A%200px%3B%2

4/4