cancel
Showing results for 
Search instead for 
Did you mean: 

sapinst error backup/restore phase create controlfile

Former Member
0 Kudos

Hello experts

I am doing a homogeneous system copy using database specific tools backup/restore.Oracle 10.2.0.5, HP-UX, ECC 6.0

Source = ZD1 and Target = ZD1 (Yes they are both same) Source was a fresh install with brand new Export data (SID = ZD1) and now we are replacing the database with a copy of our existing Dev system (also SID = ZD1)

Restored the backup over target using OFFLINE backup. Have not run any "recover database ...." or "alter database open resetlogs" yet because sapinst is suppose to do this.

My control script looks like this: filename = CONTROL.SQL

STARTUP NOMOUNT

CREATE CONTROLFILE REUSE SET DATABASE "ZD1" RESETLOGS ARCHIVELOG

MAXLOGFILES 255

MAXLOGMEMBERS 3

MAXDATAFILES 254

MAXINSTANCES 50

MAXLOGHISTORY 23371

LOGFILE

GROUP 1 (

'/oracle/ZD1/origlogA/log_g11m1.dbf',

then all the data file paths (which I verified to be correct)

ends with:

'/oracle/ZD1/sapdata4/sr3_61/sr3.data61',

'/oracle/ZD1/sapdata4/sr3_62/sr3.data62'

CHARACTER SET UTF8

;

Now here is the issue:

1) When I manually run the CONTROL.SQL and then just do a alter database open resetlogs everything is fine. Database mounts and opens fine. However when I run the sapinst it tries to run the CONTROL.SQL again and messes up everything. I would like to skip this phase in sapinst and change ERROR to OK in keydb.xml file. Question is when should I do this ? Before starting sapinst so that it skips this or during the phase it stops and asks for backup/restore ?

2) Instead creating files manually I also let sapinst do this. But it throws an error during control file creation. When I used the above CONTROL.SQL it says must use resetlogs to open database. Then I restored all over again and added the line alter database open resetlogs at the end of CONTROL.SQL

'/oracle/ZD1/sapdata4/sr3_61/sr3.data61',

'/oracle/ZD1/sapdata4/sr3_62/sr3.data62'

CHARACTER SET UTF8

;

ALTER DATABASE OPEN RESTLOGS;

And then ran sapinst again from scratch and now it throws error file 1 needs media recovery.

This is weird and I don't know why sapinst acting smart here and wont let me do it and when it does it by himself it messes up.

Is my CONTROL.SQL scripts correct ? Whats the best approach here.

Thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

As per my understanding, Since SAPinst will ask for control.sql after the 'backup/restore' halt step. So you can comment keydb.xml when SAPinst stops asking backup/restore.

Thanks

nicholas_chang
Active Contributor
0 Kudos

Hi Basab Biswas

You need to replace the control.sql in /sapinst/../.../ORA/DB/ with your control.sql, otherwise, sapinst will run the default control.sql again.

Since you've manually open the database, you can also modify the control.sql in /sapinst/../.../ORA/DB/ to bypass the stage, simply with CONNECT and OPEN DATABASE.

Cheers,

Thanks,

Nicholas Chang

Former Member
0 Kudos

Hello Nicholas

Thank you. I have replaced the CONTROL>SQL in the installation directory itself. Its in /tmp/sapinst_instdir/ERP/LM/COPY/ORA/SYSTEM/CENTRAL/AS And yes it IS picking up the control.sql that I provided and not the default.

DatabaseSAP

Thank you. I have never commented anything in keydb.xml before. But sounds like a good idea because if I can restore it myself I really want to skip this step. Should I just do it before start of sapinst and what exact lines to comment ? Which keydb should I edit ? I found several but looks like ./ERP/LM/COPY/ORA/SYSTEM/CENTRAL/AS/keydb.xml is the right one.

root@zepsapa1 # find . -name keydb.xml

./NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/DB/keydb.xml

./NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/DB/log_20_Apr_2011_05_48_52/keydb.xml

./NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/DB_backup/keydb.xml

./NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/SCS/keydb.xml

./NW04S/LM/PRC/keydb.xml

./NW04S/LM/UNINSTALL/AS/keydb.xml

./NW04S/LM/UNINSTALL/AS/log_05_Dec_2011_07_39_50/keydb.xml

./ERP/LM/USR/keydb.xml

./ERP/LM/USR/log_15_Dec_2011_15_43_02/keydb.xml

./ERP/LM/USR/log_14_Dec_2011_16_15_35/keydb.xml

./ERP/LM/PRC/keydb.xml

./ERP/LM/COPY/ORA/SYSTEM/CENTRAL/AS/keydb.xml

./ERP/LM/COPY/ORA/SYSTEM/CENTRAL/AS/log_19_Dec_2011_08_48_00/keydb.xml

./ERP/SYSTEM/ORA/CENTRAL/AS/keydb.xml

./ERP/SYSTEM/ORA/CENTRAL/AS/log_16_Dec_2011_12_41_11/keydb.xml

./ERP/SYSTEM/ORA/CENTRAL/AS/log_16_Dec_2011_13_03_45/keydb.xml

./ERP/SYSTEM/ORA/CENTRAL/AS/log_18_Dec_2011_08_05_17/keydb.xml

Also what exactly am I commenting here ? I see step RunControlScript is the one causing problems and I dont want it to create any control files. Please advise what exactly I need to comment and when. And what about changing the ERROR to OK ?

<strval><![CDATA[]]>

</strval>

</fld>

</row>

<row>

<fld name="STEPKEY">

<strval><![CDATA[|NW_Doublestack_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|2|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_CreateDB|ind|ind|ind|ind|0|0|NW_OraDBCheck|ind|ind|ind|ind|0|0|NW_OraDBMain|ind|ind|ind|ind|0|0|NW_OraDBOBR|ind|ind|ind|ind|1|0|NW_OraOBR|ind|ind|ind|ind|4|0|RunControlScript]]>

</strval>

</fld>

<fld name="STATUS">

<strval><![CDATA[ERROR]]>

</strval>

</fld>

<fld name="STOP_BEFORE">

<strval><![CDATA[]]>

</strval>

</fld>

<fld name="STOP_AFTER">

<strval><![CDATA[]]>

</strval>

Thank you

nicholas_chang
Active Contributor
0 Kudos

Hi,

If you've manually open the database, instead of modify your control.sql, change it simply with option "CONNECT" and "OPEN DATABASE". It'll bypass the phase.

Thanks,

Nicholas Chang

former_member188883
Active Contributor
0 Kudos

Hi,

Incase you have opened your database manually, simply add the following line in your control.sql

EXIT;

This will run control.sql without affecting the installation.

Hope this is useful.

Regards,

Deepak Kori

Former Member
0 Kudos

Thank You Nicholas and Deepakori

The issue is resolved by doing the following two:

1) Create controlfile manually and provide sapinst with an empty controlfile with just connect / as sysdba. You can put anything pretty much. Thanks for the suggestions

2) Change ERROR to OK in keydb.xml file for the runcontrolscripts phase.