cancel
Showing results for 
Search instead for 
Did you mean: 

Recover database

Former Member
0 Kudos

Hi Experts,

I am doing a homogeneous system copy using Oracle backup/restore method. Flavors involved are Oracle 9i, SAP R/3 4.7 and Windows 2003.

SAPinst has halted at the place where it asks to restore the backup and place the control.sql script in the current SAPinst working directory generated from the source DB. I have restored online backup and related offline redo log files. Now while preparing the control.sql script I have a confusion whether to use -

RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE or

RECOVER DATABASE USING BACKUP CONTROLFILE

My confusion is this if I use UNTIL CANCEL how will the SAPinst recognize CANCEL command as it will create control file and recover in background?

And if I use the second option, will it work without using UNTIL CANCEL?

Help needed at the earliest.

Regards,

Sourabh Majumdar

Accepted Solutions (0)

Answers (2)

Answers (2)

Reagan
Advisor
Advisor
0 Kudos

You need to restore the database and apply the offline redologs and recover the database.

The control.sql file is not used for recovering the database. Instead it is used for creating the control files for the database after the recovery.

You will need to restore the database first and then recover the database with the available offline redologs manually.

Regards

RB

Former Member
0 Kudos

Hi,

I think that you need to read the chapter in the system copy guide.

In chapter "Generating the Control File Structure" of the system copy guide for the database specific system copy procedure.

Backup (R3COPY): Check CONTROL.SQL

The script CONTROL.SQL is created by R3COPY. It is later used to create the target database structure. In order to get a target database that is most suitable for your source database contents, verify the parameters in CONTROL.SQL as follows:

1. Create CONTROL.SQL with R3COPY. This is described in the section "Generating the Script CONTROL.SQL" (manual R/3 Homogeneous System Copy).

2. Create a trace file. This is described in the section "Backup of Control Files to a Trace File".

3. Replace the CREATE CONTROLFILE command in CONTROL.SQL with the command from the trace file. The command contains a number of lines and ends with a semicolon (;). The point is to get the correct data about the DATAFILEs, the LOGFILEs, and the MAX* parameters from the trace file. However, do not change the beginning of the command in CONTROL.SQL(CREATE CONTROLFILE SET DATABASE...).

Thanks

Rishi Abrol

Former Member
0 Kudos

Hello,

I usually prefer to do the recovery manually and open the database and I keep only command "startup" in CONTROL.SQL, that actually reduces the confusion what commands to we use and what command sapinst is executing.

Regards,

Nitesh Jain

Former Member
0 Kudos

Hi,

In one of my project DBA use to restore the database and bring the listener and database online . After that they use to stop the DB and then ask the application team to run the sapinist for the import process. So you can try that but not 100% sure...

The later sapinst use to ask us to drop the schema of the source system. But that was done for NW 7.00 system .

You can also check the below note.

549828 - Databasecopy with Onlinebackup

Thanks

RishI Abrol

Below are the contents from the guide...

++++++++++++++++++++++++++++++++++++++

5.1.1Generating the Control File Structure

The OraBRCopy Java tool writes a file CONTROL.SQL to the current working directory, which can be used without further adaptations on the target system.

For more information about the OraBRCopy tool, see the documentation ORABRCopy.pdf, which is part of the OraBRCOPY.SAR archive.

Prerequisites

RECOMMENDATION

We recommend that you shut down the SAP system before you perform the following steps. The database must still be running.

Procedure

1.

Create an installation directory <INSTDIR> on the source system.

2.

Copy the ORABRCOPY.SAR archive from the installation medium to the installation directory and extract it using SAPCAR.

You can find the archive in the following directory on the installation medium:<IM_OS>\COMMON\INSTALL\ORA\ORABRCOPY.SAR

3.

Make sure that all redo log groups are archived

4.

Start the OraBRCopy tool as an OS user with Oracle DBA privileges:

user ora<dbsid>

user <sapsid>admù/ł« n

If you perform an offline manual copy, enter the following commands:ora_br_copy.bat –generateFiles –forceLogSwitches —targetSid <TARGET_DBSID> —password <system's password> —listenerPort <listener port>

The tool creates the files CONTROL.SQL, CONTROL.TRC and init<targetSID>.ora in your installation directory, shuts down and restarts the database and performs the required log switches.ù/ł« n

If you perform an offline or online backup using BR*Tools, enter the following commands:ora_br_copy.bat –generateFiles —targetSid <TARGET_DBSID> —password <system's password> —listenerPort <listener port>

NOTE

During the online backup, the database must be up and running. To ensure this, this command must not contain the parameter —forceLogSwitches.

5 Database-Specific System Copy

5.1 Oracle-Specific Procedure

2013-11-22 CUSTOMER 47/104

The tool creates the files CONTROL.SQL, CONTROL.TRC and init<targetSID>.ora in your installation directory, and performs the required log switches.

NOTE

If an error occurs, check the log file:<INSTDIR>/ora.brcopy.log

5.

Verify and, if necessary, update the CONTROL.SQL control file using the CONTROL.TRC trace file as follows.

Example for Windows

In the following example for Windows, entries of CONTROL.SQL written in bold should be compared and changed according to the trace file:REM ==================================================================== REM CONTROL.SQL REM REM SAP AG Walldorf REM Systeme, Anwendungen und Produkte in der Datenverarbeitung REM REM (C) Copyright SAP AG 2004 REM ==================================================================== REM Generated at: REM Fri Sep 17 08:33:25 CEST 2005 REM for target system NEW REM on REM Windows 2000 5.0 x86 CONNECT / AS SYSDBA STARTUP NOMOUNT CREATE CONTROLFILE REUSE SET DATABASE "NEW" RESETLOGS ARCHIVELOG MAXLOGFILES 255MAXLOGMEMBERS 3MAXDATAFILES 1022MAXINSTANCES 50MAXLOGHISTORY 1134LOGFILE

5 Database-Specific System Copy

5.1 Oracle-Specific Procedure

48/104 CUSTOMER 2013-11-22

GROUP 1 ( 'D:\ORACLE\NEW\ORIGLOGA\LOG_G11M1.DBF', 'D:\ORACLE\NEW\MIRRLOGA\LOG_G11M2.DBF' ) SIZE 50M,GROUP 2 ( 'D:\ORACLE\NEW\ORIGLOGB\LOG_G12M1.DBF', 'D:\ORACLE\NEW\MIRRLOGB\LOG_G12M2.DBF' ) SIZE 50M, GROUP 3 ( 'D:\ORACLE\NEW\ORIGLOGA\LOG_G13M1.DBF', 'D:\ORACLE\NEW\MIRRLOGA\LOG_G13M2.DBF' ) SIZE 50M, GROUP 4 ( 'D:\ORACLE\NEW\ORIGLOGB\LOG_G14M1.DBF', 'D:\ORACLE\NEW\MIRRLOGB\LOG_G14M2.DBF' ) SIZE 50M DATAFILE 'D:\ORACLE\NEW\SAPDATA1\SYSTEM_1\SYSTEM.DATA1', 'D:\ORACLE\NEW\SAPDATA3\IMS_1\IMS.DATA1','D:\ORACLE\NEW\SAPDATA3\IMS_2\IMS.DATA2','D:\ORACLE\NEW\SAPDATA3\IMS_3\IMS.DATA3','D:\ORACLE\NEW\SAPDATA3\IMS_4\IMS.DATA4','D:\ORACLE\NEW\SAPDATA4\IMS_5\IMS.DATA5','D:\ORACLE\NEW\SAPDATA4\IMS_6\IMS.DATA6','D:\ORACLE\NEW\SAPDATA4\IMS_7\IMS.DATA7','D:\ORACLE\NEW\SAPDATA4\IMS_8\IMS.DATA8','D:\ORACLE\NEW\SAPDATA4\IMS_9\IMS.DATA9','D:\ORACLE\NEW\SAPDATA1\IMS700_1\IMS700.DATA1','D:\ORACLE\NEW\SAPDATA1\IMS700_2\IMS700.DATA2','D:\ORACLE\NEW\SAPDATA1\IMS700_3\IMS700.DATA3','D:\ORACLE\NEW\SAPDATA1\IMS700_4\IMS700.DATA4','D:\ORACLE\NEW\SAPDATA2\IMS700_5\IMS700.DATA5','D:\ORACLE\NEW\SAPDATA2\IMS700_6\IMS700.DATA6','D:\ORACLE\NEW\SAPDATA2\IMS700_7\IMS700.DATA7','D:\ORACLE\NEW\SAPDATA2\IMS700_8\IMS700.DATA8','D:\ORACLE\NEW\SAPDATA2\IMS700_9\IMS700.DATA9','D:\ORACLE\NEW\SAPDATA3\IMS700_10\IMS700.DATA10','D:\ORACLE\NEW\SAPDATA4\IMS700_11\IMS700.DATA11',

5 Database-Specific System Copy

5.1 Oracle-Specific Procedure

2013-11-22 CUSTOMER 49/104

'D:\ORACLE\NEW\SAPDATA1\IMSUSR_1\IMSUSR.DATA1', 'D:\ORACLE\NEW\SAPDATA2\ROLL_1\ROLL.DATA1' ; ALTER DATABASE OPEN RESETLOGS; ALTER TABLESPACE PSAPTEMP ADD TEMPFILE 'D:\ORACLE\NEW\SAPDATA3\TEMP_1\TEMP.DATA1' SIZE 350M REUSE AUTOEXTEND OFF;

NOTE

In the above example for Windows, entries and values of CONTROL.SQL written in bold should be compared to the trace file. The changes to be made are valid for UNIX, too.

Changes to be made

1.

If you want to migrate your database from 32-bit to 64-bit or vice versa, add the following lines at the bottom of the CONTROL.SQL file:shutdown immediatestartup upgradespool utlirp.log@?/rdbms/admin/utlirp.sqlspool offshutdown immediatestartupspool utlrp.log@?/rdbms/admin/utlrp.sqlspool offexit

2.MAXLOGFILES 255

...

The numbers must be greater than or equal to the corresponding numbers in the trace file.

3.GROUP 1 ( 'D:\ORACLE\NEW\ORIGLOGA\LOG_G11M1.DBF', 'D:\ORACLE\NEW\MIRRLOGA\LOG_G11M2.DBF' ) SIZE 50M,Group 2 (

The sizes of the respective groups must be equal to the sizes of the corresponding groups in the trace file.

4.'D:\ORACLE\NEW\SAPDATA1\SYSTEM_1\SYSTEM.DATA1', 'D:\ORACLE\NEW\SAPDATA3\IMS_1\IMS.DATA1',

5 Database-Specific System Copy

5.1 Oracle-Specific Procedure

50/104 CUSTOMER 2013-11-22

…'D:\ORACLE\NEW\SAPDATA1\IMS700_1\IMS700.DATA1'

The count of the data files must be equal to the count of the corresponding data files in the trace file.

5.ALTER TABLESPACE PSAPTEMP ADD TEMPFILE'D:\ORACLE\NEW\SAPDATA3\TEMP_1\TEMP.DATA1' SIZE 350M REUSE AUTOEXTEND OFF;

The size must be equal to the corresponding size in the trace file.

6.

The number of rows with ALTER TABLESPACE must be equal to the number of corresponding rows in the trace file.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++