#
# $Header: rdbms.ins.pp 1.7 95/07/13 08:33:53 wyim Osd<unix> $ Copyr (c) 1992 Oracle
#

/* Copyright (c) Oracle Corporation 1992.  All Rights Reserved */

/***************************************************************************
NAME
    rdbms.ins.pp

FUNCTION
    Install the product RDBMS.

NOTES

CREATED
    PKu         05/19/92

MODIFIED  
    Tjose       07/11/95  Added code to upgrade to 7.2.3
    Wyim        19/01/95  Fix bug: 166497: if init<sid>.ora exists or 
			  init<sid>_0.ora exists, move it to 
			  init<sid>.ora.OLD or init<sid>_0.ora.OLD.
    Wyim        16/01/95  Added code for Symmetrci Replication (sro).
    Wyim        29/12/94  Added code to 7.1.6 uprgrade.
    CPatel      23/05/94  Added code to 7.1.3 upgrade.
    JFischer    11/09/93  Added code to 7.0.16 upgrade.  Shouldn't break 7.1.
    ERuben      08/24/93  7.1: Add code for 7.1 upgrade, surround with
                            SS_71RDBMS.  Also, remove references to 7.0.14,
                            since it was never released.
    ERuben      05/11/93  Added fix for upgrading an OFA_Compliant database.

***************************************************************************/

{mark{
/* Define USE_ULIMIT for ports which have file size restrictions imposed  */
/* by ulimit.  These are usually System V ports. */
/* Define NO_DEVSYS for ports which don't require Software Development System */
/* for installing Oracle */
/* Define OFF_SERVER_ONLY for Office Server only systems. */
/* Define GEN_AS to generate assembly code instead of c code in gen scripts */
/*  The SYSTEM_CHECK macro causes install/system.check, the pre-installation */
/*  configuration test, to be included in INSTALL.DIST.  The intent is that */
/*  this macro will be defined for all platforms (eventually). */
/*  The INCLUDE_CORE macro causes install/CORE.DIST to be included in  */
/*  install/INSTALL.DIST.  CORE.DIST contains a list of files which are  */
/*  required by all products.  They are especially important in the case */
/*  of sites which do not have an RDBMS license but link and use network */
/*  user tools (like SQL*Forms) from a "client" platform.  At some point */
/*  base development will "define" a CORE product and it can replace this */
/*  psydo-product.  */
/*  In 6.0.27.6, USE_BIGORALIB and USE_LIBKNL have been obsoleted.   */
/*  Both libora.a and libknl.a are now used for all ports.  This is  */
/*  done to clean up the suffix makefiles and to separate user and   */
/*  kernel libraries. */
/*  USE_BIGFRMLIB causes the the big forms library libforms.a to be made, */
/*  which is composed of libtm.a, libomm.a and libram.a */
/* Define USE_ROFIX if you want to rofix certain modules for your port.  */
/* Modules to be rofixed are designated in the make suffix files in the  */
/* source directories.  Rofixing (read-only fix) a module means compiling */
/* it in such a way as to move all data in the module from data space into */
/* text space.  Modules to be rofixed should be chosen with care since */
/* rofixing read/write data causes segmentation violations at run time. */
/*  Define LIBMEM if the make command on your port understands library    */
/*  dependency on object files, i.e. the rule: lib.a(obj1.o obj2.o).      */
/*  Define LIBSEP as well if each object file has to be listed separately,*/
/*  i.e. the rule: lib.a(obj1.o) lib.a(obj2.o).  For LIBSEP to be         */
/*  effective, LIBMEM has to be defined first.                            */
/* Define USE_RANLIB if "ranlib" is required after re-archiving the   */
/* library.  This affects the makefiles we ship out to the customers, */
/* not the makefiles in the development system.                       */
/* If you are using GNU make. */
/* Pro*Cobol Macros : Define the appropriate BUILD_* macros for your port. */
/* The code for the macro included below may require some port specific    */
/* modification.                                                           */
/* IDC */
/*
 * $Header: macros.vrf.pp 3090000.1 95/09/05 15:17:19 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */

/*
 * $Header: misc.ins.pp 3090000.1 95/09/05 15:17:24 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */








problem_error_info=nls( "problem_error_info","A problem occured trying to process the last error." );
problem_error_info_help=nls( "problem_error_info_help","?html problem_error_info_help" );
problem_error_info_content=nls( "problem_error_info_content","Error Processing Problem" );

problem_dlg_help=nls( "problem_dlg_help","?html problem_dlg_help" );

problem_header_dflt=nls( "problem_header_dflt", "
Platform:	%%operating_system%%
Release:	%%rel_version%%
Product: 	%%pname%%
Version:	%%current_version%%

Area:		(Installation)	

Install information:

	Installer Version:  %%installer_version%%
	Installer Script:   %%_line%% 
	Install Action:     %%Inst_Action%%

	Stage Home	    %%Stage_Home%%
	Oracle_Base	    %%Oracle_Base%%	(%%OFA_Compliant%%)
	Oracle Home	    %%Oracle_Home%%
	Owner		    %%Owner%%
	Log		    %%Install_Log%%

	During installation of the above product the error below is
	encountered:
");




Sys_Macro_Holdfile="%%Oracle_Home%%/orainst/holdfile.log";
Sys_Macro_Help=nls("Sys_Macro_Help", "?html Sys_Macro_Help" );
Sys_Macro_Content=nls( "Sys_Macro_Content", "O/S Error" );
Sys_Macro_Prompt=nls("Sys_Macro_Prompt", "
Error during action '%%_com%%'.

Command:  %%_cmd%%

");
Sys_Macro_Cancel_Prompt=nls("Sys_Macro_Cancel_Prompt", "Installation terminated at user request." );








/* Galina  
	{ 
	  if (exists(User_Dflt_File)) 
	  { 
	    { _tmp_var=translate(dflt_idx, User_Dflt_File, "="); 
	      _dflt_str="%_tmp_var%"; 
	    } 
	    [ 'UNBOUND_ENVIRONMENT_VARIABLE: _dflt_str=list_dflt; ] 
	  } 
	  else 
	    _dflt_str=list_dflt; 
	  if (Default_Install) 
	    output = _dflt_str; 
   else \ 

	    output=MULTIPLE_TEXT_DIALOG(prompt, _dflt_str, content, help); 
   if (exists(User_Dflt_File)) modify(dflt_idx, output, User_Dflt_File, "=");\ 
	  LOG_HDR("MULTIPLE_TEXT") 
	  _prompt=prompt; _answer=output; 
	  first_log=first(_answer); _answer1=rest(_answer); 
	  second_log=first(answer1); _answer=rest(answer1); 
	  third_log=first(answer); answer1=rest(answer); forth_log=first(answer1); 
	  _dummy="       Q> %_prompt%"; modify("", _dummy, Install_Log); 
	  _dummy="       A> %first_log%"; modify("", _dummy, Install_Log); 
	  _dummy="       A> %second_log%"; modify("", _dummy, Install_Log); 
	  _dummy="       A> %third_log%"; modify("", _dummy, Install_Log); 
	  _dummy="       A> %forth_log%"; modify("", _dummy, Install_Log); 
	}
  Galina */















/*
 * $Header: macros.ins.pp 3090000.1 95/09/05 15:17:16 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */


/*
 * $Header: misc.ins.pp 3090000.1 95/09/05 15:17:24 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */









     
	{ /*_LOG_MSG ( "Entering rdbms.ins" , "" ) */ 
	  _msg = "Entering rdbms.ins" ; 
	  _logfile = "" ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}

    /* 
     * Initialize values
     */
    rdbms_log_dir="%Oracle_Home%/rdbms/log";
    sgadef_file="%dbs_dir%/sgadef%Oracle_Sid%.dbf";
    svrmgrl = "%Oracle_Home%/bin/svrmgrl";

    /*
     * Initialize messages 
    */
    ld_files_echo =nls("ld_files_echo","Loading files");
    ld_files_done_echo =nls("ld_files_done_echo","Finished Loading Files");
    leave_do_load_echo =nls("leave_do_load_echo","Leaving loading files section");

    shutdown_error =nls("shutdown_error", "Error while attempting to shutdown the %%Oracle_Sid%% database.  You must shutdown the %%Oracle_Sid%% database and then try to install ORACLE again.");


    startup_error =nls("startup_error", "Error while attempting to startup the %Oracle_Sid% database.  Please check your system and attempt to startup the database manually.");
    initsid_move_mesg=nls("initsid_move_mesg","init%Oracle_Sid%.ora already exists and is moved to init%Oracle_Sid%.ora.OLD");
    initsid0_move_mesg=nls("initsid0_move_mesg","init%Oracle_Sid%_0.ora already exists and is moved to init%Oracle_Sid%_0.ora.OLD");
    ipc_lsnr_file_msg =nls("ipc_lsnr_file_msg", "Creating (or appended) listener.ora file with IPC address");
    ipc_listen_err =nls("ipc_listen_err", "Possible error during startup of tnslsnr on IPC address. Check your lsnrctl.log file under %Oracle_Home%/network/admin.  Ignore this message if the log file indicates that the command completed successfully.  Otherwise, check your listener.log file under %Oracle_Home%/network/log.");
    chmod_dbs_msg =nls("chmod_dbs_msg", "Protecting the dbs directory");
    dbshut_msg =nls("dbshut_msg", "Shutting down the %Oracle_Sid% database");
    dbstart_msg =nls("dbstart_msg", "Starting up the %Oracle_Sid% database");
    lsnrstart_msg =nls("lsnrstart_msg", "Starting up the TNS listener");
    create_log_dir_echo =nls("create_log_dir_echo","Creating %rdbms_log_dir% directory");
    relinking_error =nls("relinking_error", "Relinking Error.  The executables for %%product_label%% were not made successfully.  Please check the log file (%Install_Log%) and repeat the installation procedure for %%product_label%%.");
    creating_config_prompt =nls("creating_config_prompt","Creating the config.c file");
    ansi_c_prompt =nls("ansi_c_prompt","Installing the ANSI-C compatiblility modules");
    writable_libraries_prompt =nls("writable_libraries_prompt", "Make libraries writable");
    initialize_prod_libs_prompt =nls("initialize_prod_libs_prompt", "Initializing %%product_label%% libraries (ranlib)");
    link_prod_executables_prompt =nls("link_prod_executables_prompt","Linking and installing %%product_label%% executables");


    /*
     * Initialize Migration prompts
     */
    Convert_Log="%Oracle_Home%/rdbms/log/convert%Oracle_Sid%.log";
    reset_log="%Oracle_Home%/rdbms/log/reset%Oracle_Sid%.log";
    dropmig_prompt =nls("dropmig_prompt","Dropping the temporary user Migrate");

    alter_db_echo =nls("alter_db_echo","Running alter database convert command against %Oracle_Sid%");
    reset_log_echo =nls("reset_log_echo","Resetting redo log files");

    convert_succeed_prompt =nls("convert_succeed_prompt", "Did the alter database convert command succeed?  Check %Convert_Log% for errors.");
    convert_succeed_content =nls("convert_succeed_content", "Database OK");
    convert_succeed_help =nls("convert_succeed_help", "*You should examine the log file (%Convert_Log%) to see if the alter database convert command succeeded.  If there are no errors in the log, then select (YES).  Otherwise, select (NO).");
    convert_not_succeed_info =nls("convert_not_succeed_info", "Stopping the migration process because the alter database convert command experienced difficulties.");

    reset_logs_succeed_prompt =nls("reset_logs_succeed_prompt", "Did the alter database open resetlogs command succeed?  Please check the %reset_log% file.");
    reset_logs_succeed_content =nls("reset_logs_succeed_content", "Resetlogs");
    reset_logs_succeed_help =nls("reset_logs_succeed_help", "*You should examine the log file (%reset_log%) to see if the alter database open resetlogs command succeeded.  If there are no errors in the log, then select (YES).  Otherwise, select (NO).");
    reset_logs_failed_info =nls("reset_logs_failed_info", "Stopping the migration process because the alter database open resetlogs command experienced difficulties.");

    migrate_done_msg =nls("migrate_done_msg", "The migration of the %Oracle_Sid% database has succeeded.");
    migrate_err_msg =nls("migrate_err_msg", "The migration of the %Oracle_Sid% database appears to have failed.  Check installation log (%Install_Log%) for diagnostics.  You may have to repeat previous migration steps.");
    /* 
     * String initialization -- DB creation.
     */
    crinit_prompt =nls("crinit_prompt", "Creating init%Oracle_Sid%.ora file");
    crcrdb_sql =nls("crcrdb_sql", "Creating crdb%Oracle_Sid%.sql database creation script");
    crdb_prompt =nls("crdb_prompt", "Creating database %Oracle_Sid% (this will take a while)");

    /* Bug 148646: Need the following three messages. */
    check_db_create_info = nls("check_db_create_info", "Using egrep to search for 'ORA-' errors in the file:
%%create_db_spool_file%% in order to determine if the 
'CREATE DATABASE' statement succeeded for the %%dbname%% database.");
    create_db_succ = nls("create_db_succ", "SUCCESS: The 'CREATE DATABASE' statement for the %%dbname%% database succeeded.
no 'ORA-' errors appear in the file:
%%create_db_spool_file%%.");
    create_db_fail = nls("create_db_fail", "ERROR: The 'CREATE DATABASE' statement for the %%dbname%% database failed.
egrep failed to find 'ORA-' error in the file:
%%create_db_spool_file%%");
    /* Bug 148646: End Messages */

    crcrdb2_sql =nls("crcrdb_sql", "Creating crdb2%Oracle_Sid%.sql database catalog and file creation script");
    crdb2_prompt =nls("crdb_prompt", "Creating database %Oracle_Sid%'s catalogs and files (this will take a while)");
    chgpw_prompt =nls("chgpw_prompt", "Changing SYSTEM and SYS passwords.");
    crdb_fail_prompt =nls("crdb_fail_prompt", "Database creation failed. Please check log file.");
    done_crdb_prompt =nls("done_crdb_prompt", "Database creation completed. For more information, please check log file.");
    db_created_msg =nls("db_created_msg", "Database %Oracle_Sid% created");

    /*
     * OPS installation strings - log file creation and db startup.
     */
    crlogs_prompt =nls("crlogs_prompt","Creating log files for %Current_Node% threads");
    start_db_prompt =nls("start_db_prompt", "Starting up the database (SID=%Oracle_Sid%) %start_mode%.  See %Install_Log% for status.");
    db_fail_prompt =nls("db_fail_prompt", "Failed to start database (SID=%Oracle_Sid%).  See %Install_Log% for details.  Abort installation.");
    shut_fail_prompt =nls("shut_fail_prompt", "Failed to shut database (SID=%Oracle_Sid%).  See %Install_Log% for details.  Abort installation.");
    db_started_msg =nls("db_started_msg", "Database (SID=%Oracle_Sid%) started");

    /* ------------------------- Processing begins --------------------- */
     
	{ /*_INSTALL_PRODUCT ( ocommon ) */ 
	  { 
	    _prod_bound = TRUE ; 
	    _tmp_var = product_interface_label ( ocommon ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : { _prod_bound = FALSE ; } ] 
	  { 
	    if ( _prod_bound ) 
	      install ( ocommon ) ; 
	  } 
	}
     
	{ /*_INSTALL_PRODUCT ( network ) */ 
	  { 
	    _prod_bound = TRUE ; 
	    _tmp_var = product_interface_label ( network ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : { _prod_bound = FALSE ; } ] 
	  { 
	    if ( _prod_bound ) 
	      install ( network ) ; 
	  } 
	}
if(ORCA_Debug)
    {
     
	{ /*_LOG_MSG ( "DEBUG: Reached point 1." , Debug_Log ) */ 
	  _msg = "DEBUG: Reached point 1." ; 
	  _logfile = Debug_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
     
	{ /*_LOG_MSG ( "DEBUG: Reached point 2." , Debug_Log ) */ 
	  _msg = "DEBUG: Reached point 2." ; 
	  _logfile = Debug_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
    }
     
	{ /*_INSTALL_PRODUCT ( svrmgr ) */ 
	  { 
	    _prod_bound = TRUE ; 
	    _tmp_var = product_interface_label ( svrmgr ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : { _prod_bound = FALSE ; } ] 
	  { 
	    if ( _prod_bound ) 
	      install ( svrmgr ) ; 
	  } 
	}
     
	{ /*_INSTALL_PRODUCT ( plsql ) */ 
	  { 
	    _prod_bound = TRUE ; 
	    _tmp_var = product_interface_label ( plsql ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : { _prod_bound = FALSE ; } ] 
	  { 
	    if ( _prod_bound ) 
	      install ( plsql ) ; 
	  } 
	}

    remove_file("%Oracle_Home%/lib/libexp.a");
    remove_file("%Oracle_Home%/lib/libimp.a");
    remove_file("%Oracle_Home%/rdbms/install/partial.prd");

    while (not(empty(pa_inst_list)))
    {
         
	{ /*_INSTALL_PRODUCT ( first ( pa_inst_list ) ) */ 
	  { 
	    _prod_bound = TRUE ; 
	    _tmp_var = product_interface_label ( first ( pa_inst_list ) ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : { _prod_bound = FALSE ; } ] 
	  { 
	    if ( _prod_bound ) 
	      install ( first ( pa_inst_list ) ) ; 
	  } 
	}
        pa_inst_list = rest(pa_inst_list);
    }

/*
 * $Header: pinit.ins.pp 3090000.1 95/09/05 15:17:25 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */
/***************************************************************************
NAME
    pinit.ins

FUNCTION
    Contains common initialization code for *.ins scripts.

NOTES

CREATED
    PKu		07/26/92

MODIFIED 
***************************************************************************/
   { /* pinit.ins */
/*
 * $Header: macros.ins.pp 3090000.1 95/09/05 15:17:16 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */

    ui_product(product_label);
    ui_action("");

    if (Install_Doc_Only) {
      install_cd_doc=true;
       
	{ /*_INST_CD_DOC*/ 
	   if ( OraDoc ) { 
	     _pname = product_name ( product ) ; 
	     _pversion = product_version ( product ) ; 
	     if ( install_cd_doc ) 
	       _dummy = "%_pname% %_pversion%" ; 
	     else 
	       _dummy = "" ; 
	     modify ( "%_pname%_%_pversion%" , _dummy , CD_Doc_Inst_File , "=" ) ; 
	   } 
	}
	    }
	  } /*end of pinit.ins*/

    /*
     * Deinstall patch...
     */
    if (do_dei_patch)
    {
       
	{ /*_RESTORE_GROUP ( patcho , success ) */ 
	  { 
	    
	{ /*_ACTION ( instantiate ( rg_action1 ) ) */ 
	  _com = instantiate ( rg_action1 ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	    _rg_file_lst = group_files ( patcho ) ; 
	    success = TRUE ; 
	    while ( not ( empty ( _rg_file_lst ) ) ) 
	    { 
	      _rg_tmp_file = first ( _rg_file_lst ) ; 
	      _rg_file_lst = rest ( _rg_file_lst ) ; 
	      if ( ( not ( exists ( "%_rg_tmp_file%O" ) ) ) && success ) 
	      { 
	        success = FALSE ; 
	        
	{ /*_SYS_ERR ( instantiate ( rg_err_msg1 ) ) */ 
	      _com = instantiate ( rg_err_msg1 ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	} 
	        information_dialog ( instantiate ( rg_err_msg1 ) ) ; 
	      } 
	    } 
	    if ( success ) 
	    { 
	      
	{ /*_ACTION ( instantiate ( rg_action2 ) ) */ 
	  _com = instantiate ( rg_action2 ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	      _rg_file_lst = group_files ( patcho ) ; 
	      while ( not ( empty ( _rg_file_lst ) ) ) 
	      { 
	        _rg_tmp_file = first ( _rg_file_lst ) ; 
	        _rg_file_lst = rest ( _rg_file_lst ) ; 
	        { 
	          remove_file ( _rg_tmp_file ) ; 
	        } 
	        [ 
	         'PERMISSION_DENIED : 
	         { 
	           
	{ /*_SYS_ERR ( instantiate ( rg_err_msg2 ) ) */ 
	      _com = instantiate ( rg_err_msg2 ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	} 
	           information_dialog ( instantiate ( rg_err_msg2 ) ) ; 
	           while ( exists ( _rg_tmp_file ) ) 
	             information_dialog ( instantiate ( rg_err_msg3 ) ) ; 
	         } 
	        ] 
	      } 
	      
	{ /*_PATCH_RESTORE_GROUP ( patcho , TRUE , success ) */ 
	  { 
	     
	{ /*_ACTION ( instantiate ( prg_action ) ) */ 
	  _com = instantiate ( prg_action ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	     _prg_file_lst = group_files ( patcho ) ; 
	     
	{ /*_ABORT_BACKUP ( _prg_file_lst , "" , false , TRUE , success ) */ 
	  { 
	    
	{ /*_ACTION ( instantiate ( ab_action ) ) */ 
	  _com = instantiate ( ab_action ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	    
	{ /*_SYS_ERR ( "" ) */ 
	      _com = "" ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	} 
	    success = TRUE ; 
	    if ( false ) 
	      information_dialog ( "" ) ; 
	    _ab_file_lst = _prg_file_lst ; 
	    while ( not ( empty ( _ab_file_lst ) ) ) 
	    { 
	      _tmp_file = first ( _ab_file_lst ) ; 
	      { 
	        { remove_file ( _tmp_file ) ; } 
	        [ 'PERMISSION_DENIED : { } 
	          'READ_ERROR : { } 
	          'WRITE_ERROR : { } 
	        ] 
	        if ( TRUE ) 
	          copy_file ( "%_tmp_file%O" , _tmp_file ) ; 
	        else 
	          move_file ( "%_tmp_file%O" , _tmp_file ) ; 
	        _ab_file_lst = rest ( _ab_file_lst ) ; 
	      } 
	      [ 'FILE_NOT_FOUND : { information_dialog ( instantiate ( ab_err_fnf ) ) ; success = FALSE ; } 
	        'READ_ERROR : { information_dialog ( instantiate ( ab_err_re ) ) ; success = FALSE ; } 
	        'WRITE_ERROR : { information_dialog ( instantiate ( ab_err_we ) ) ; success = FALSE ; } 
	      ] 
	    } 
	  } 
	} 
	  } 
	} 
	    } 
	  } 
	}
      if (not(success))
      {
        do_relink=FALSE;
        information_dialog(instantiate(dei_patch_restore_error));
      } /* success */
    } /* do_dei_patch */

    /*
     * Loading files....
     */
    if (do_load) 
    {
         
	{ /*_BEGIN_SW_INST*/ 
	  _ploc = product_location ( product ) ; 
	  _pfname = product_file_name ( product ) ; 
	  _pSW = "%Stage_Home%/%_ploc%/%_pfname%.SW" ; 
	  if ( not ( Keep_Stage ) && ( exists ( _pSW ) ) ) remove_file ( _pSW ) ; 
	  _bsi_prdname = "%Oracle_Home%/%_ploc%/partial.prdO" ; 
	  if ( not ( Patch_Install ) ) 
	      if ( exists ( _bsi_prdname ) ) remove_file ( _bsi_prdname ) ; 
	}

        /* Remove backup group from past patches */
         
	{ /*_REMOVE_BACKUP_GROUP ( patcho ) */ 
	  
	{ /*_ACTION ( instantiate ( rbg_action ) ) */ 
	  _com = instantiate ( rbg_action ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  _rbg_file_lst = group_files ( patcho ) ; 
	  while ( not ( empty ( _rbg_file_lst ) ) ) 
	  { 
	    _rbg_tmp_file = first ( _rbg_file_lst ) ; 
	    _rbg_file_lst = rest ( _rbg_file_lst ) ; 
	    { 
	      remove_file ( "%_rbg_tmp_file%O" ) ; 
	    } 
	    [ 'PERMISSION_DENIED : { } 
	    ] 
	  } 
	}

        /* Remove generated group  */
        ui_action(instantiate(Rm_Gen));
        remove(gen);

         
	{ /*_LOG_MSG ( ld_files_echo , Install_Log ) */ 
	  _msg = ld_files_echo ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        copy(base);

         
	{ /*_TRANSF ( Load_Bin , bin ) */ 
	  
	{ /*_ACTION ( instantiate ( Load_Bin ) ) */ 
	  _com = instantiate ( Load_Bin ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  transfer ( bin , Keep_Stage ) ; 
	}
         
	{ /*_TRANSF2 ( Load_Admin , dbs , instal ) */ 
	  
	{ /*_ACTION ( instantiate ( Load_Admin ) ) */ 
	  _com = instantiate ( Load_Admin ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  transfer ( dbs , Keep_Stage ) ; 
	  transfer ( instal , Keep_Stage ) ; 
	}
         
	{ /*_TRANSF ( Load_Lib , lib ) */ 
	  
	{ /*_ACTION ( instantiate ( Load_Lib ) ) */ 
	  _com = instantiate ( Load_Lib ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  transfer ( lib , Keep_Stage ) ; 
	}
         
	{ /*_TRANSF ( Load_Demo , demo ) */ 
	  
	{ /*_ACTION ( instantiate ( Load_Demo ) ) */ 
	  _com = instantiate ( Load_Demo ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  transfer ( demo , Keep_Stage ) ; 
	}
         
	{ /*_TRANSF ( Load_Admin , admin ) */ 
	  
	{ /*_ACTION ( instantiate ( Load_Admin ) ) */ 
	  _com = instantiate ( Load_Admin ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  transfer ( admin , Keep_Stage ) ; 
	}
         
	{ /*_TRANSF ( Load_Mesg , mesg_dflt ) */ 
	  
	{ /*_ACTION ( instantiate ( Load_Mesg ) ) */ 
	  _com = instantiate ( Load_Mesg ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  transfer ( mesg_dflt , Keep_Stage ) ; 
	}
         
	{ /*_TRANSF_NLS ( mesg ) */ 
	  if ( All_Languages ) 
	  { 
	    
	{ /*_ACTION ( instantiate ( Load_Mesg ) ) */ 
	  _com = instantiate ( Load_Mesg ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	    transfer ( mesg , Keep_Stage ) ; 
	  } 
	  else 
	  { 
	    
	{ /*_ACTION ( instantiate ( Load_Mesg_NLS ) ) */ 
	  _com = instantiate ( Load_Mesg_NLS ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	    transfer ( mesg , Keep_Stage , NLS_Subgroup ) ; 
	  } 
	}
         
	{ /*_TRANSF ( Load_Doc , doc ) */ 
	  
	{ /*_ACTION ( instantiate ( Load_Doc ) ) */ 
	  _com = instantiate ( Load_Doc ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  transfer ( doc , Keep_Stage ) ; 
	}

/* Kludge - Installer copies modification times when it copies files.
            If user is upgrading, the old KSMS file may be more recent
            than the last modification of the shipped genksms file,
            in which case KSMS will not be regenerated (see oracle.mk
            and rdbms.map). */
        genksms_file = "%Oracle_Home%/bin/genksms";
        cmd = "touch %genksms_file%";
         
	{ /*_SYS ( cmd , "Update modification time of bin/genksms." ) */ 
	  _cmd = cmd ; _exe = cmd ; _com = "Update modification time of bin/genksms." ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/



         
	{ /*_SYS ( "rm -f %OH%/bin/sqlload" , "Remove sqlload (if exists)" ) */ 
	  _cmd = "rm -f %OH%/bin/sqlload" ; _exe = "rm -f %OH%/bin/sqlload" ; _com = "Remove sqlload (if exists)" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
         
	{ /*_SYS ( "ln %OH%/bin/sqlldr %OH%/bin/sqlload" , "Making sqlload a synonym of sqlldr" ) */ 
	  _cmd = "ln %OH%/bin/sqlldr %OH%/bin/sqlload" ; _exe = "ln %OH%/bin/sqlldr %OH%/bin/sqlload" ; _com = "Making sqlload a synonym of sqlldr" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
         
	{ /*_SYS ( "touch %OH%/rdbms/admin/svrmgrl.sql" , "Creating svrmgrl.sql for initialization of svrmgrl." ) */ 
	  _cmd = "touch %OH%/rdbms/admin/svrmgrl.sql" ; _exe = "touch %OH%/rdbms/admin/svrmgrl.sql" ; _com = "Creating svrmgrl.sql for initialization of svrmgrl." ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
         
	{ /*_SYS ( "chmod 6751 %OH%/bin/oracle" , "Setting permissions for oracle executable" ) */ 
	  _cmd = "chmod 6751 %OH%/bin/oracle" ; _exe = "chmod 6751 %OH%/bin/oracle" ; _com = "Setting permissions for oracle executable" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

         
	{ /*_LOG_MSG ( ld_files_done_echo , Install_Log ) */ 
	  _msg = ld_files_done_echo ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}


        /*
         * Create the rdbms log directory if it doesn't already exist.
         */
        if (not(exists(rdbms_log_dir)))
        {
             
	{ /*_LOG_MSG ( create_log_dir_echo , Install_Log ) */ 
	  _msg = create_log_dir_echo ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            make_directory(rdbms_log_dir);
        }

         
	{ /*_REG_PROD*/ 
	  
	{ /*_ACTION ( instantiate ( Register_Prompt ) ) */ 
	  _com = instantiate ( Register_Prompt ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  register ( product , File_Loaded_Msg ) ; 
	}

	 
	{ /*_INST_CD_DOC*/ 
	   if ( OraDoc ) { 
	     _pname = product_name ( product ) ; 
	     _pversion = product_version ( product ) ; 
	     if ( install_cd_doc ) 
	       _dummy = "%_pname% %_pversion%" ; 
	     else 
	       _dummy = "" ; 
	     modify ( "%_pname%_%_pversion%" , _dummy , CD_Doc_Inst_File , "=" ) ; 
	   } 
	}

         
	{ /*_LOG_MSG ( leave_do_load_echo , Install_Log ) */ 
	  _msg = leave_do_load_echo ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
    } /* if do_load */


    if (OFA_Compliant && load_or_relink_only && database_exists)
    {
        /* Bug 151823: If the database has been created with the OFA
         * structure, create soft link between the init<SID>.ora file and
         * and ?/dbs/init<SID>.ora.
         */
        if (not(exists(dbs_pfile)))
        {
             
	{ /*_SYS ( "ln -s %pfile_spec% %dbs_pfile%" , "Creating soft link from %dbs_pfile% to %pfile_spec%" ) */ 
	  _cmd = "ln -s %pfile_spec% %dbs_pfile%" ; _exe = "ln -s %pfile_spec% %dbs_pfile%" ; _com = "Creating soft link from %dbs_pfile% to %pfile_spec%" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
            if (exists(dbs_pfile))
            {
                 
	{ /*_LOG_MSG ( "Soft link for ?/dbs/init%Oracle_Sid%.ora created." , Install_Log ) */ 
	  _msg = "Soft link for ?/dbs/init%Oracle_Sid%.ora created." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            } else {
                 
	{ /*_LOG_MSG ( "Error: Soft link for ?/dbs/init%Oracle_Sid%.ora" , Install_Log ) */ 
	  _msg = "Error: Soft link for ?/dbs/init%Oracle_Sid%.ora" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
                 
	{ /*_LOG_MSG ( "       not created." , Install_Log ) */ 
	  _msg = "       not created." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            } /* if exists(dbs_pfile) */
        } /* if (dbs_pfile doesn't exist) */
    } /* if (OFA_Compliant && do_upgrade) */

    options_chosen = (
	(registered("sro") && registered("plsql") && member(RDBMS_Opts_List,"RDBMS_SR_OPT")) ||
        (registered("plsql") && member(RDBMS_Opts_List,"RDBMS_PROC_OPT")) ||
        (registered("ddbo")  && member(RDBMS_Opts_List,"RDBMS_DDB_OPT")) 
     || (registered("pqo")  && member(RDBMS_Opts_List, "RDBMS_PQ_OPT"))
        );

    if (do_load || do_relink || options_chosen)
    {
	    remove_file("%Oracle_Home%/lib/config.o");
             
	{ /*_ACTION ( creating_config_prompt ) */ 
	  _com = creating_config_prompt ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}
            instantiate_file("%rdbms_dir%/install/rdbms/config.orc",
                "%rdbms_dir%/lib/config.c");
    }

    if (not(No_Make))
    {
         
	{ /*_LOG_MSG ( "Entering Make Dependent section." , Install_Log ) */ 
	  _msg = "Entering Make Dependent section." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        if (do_relink || options_chosen)
        {
             
	{ /*_LOG_MSG ( "Entering do_relink==true or not(empty(RDBMS_Opts_List)) section." , Install_Log ) */ 
	  _msg = "Entering do_relink==true or not(empty(RDBMS_Opts_List)) section." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
    /*
            if (registered("plsql"))
            {
   */
                change_directory("%Oracle_Home%/rdbms/lib");
                 
	{ /*_SYS ( "%MAKE% -f ins_rdbms.mk procopt" , "Adding the procedural object file to libknlopt.a" ) */ 
	  _cmd = "%MAKE% -f ins_rdbms.mk procopt" ; _exe = "%MAKE% -f ins_rdbms.mk procopt" ; _com = "Adding the procedural object file to libknlopt.a" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
   /*
            }
    */



            ui_action("Touching %Oracle_Home%/rdbms/lib/sysliblist");
             
	{ /*_SYS ( "touch %Oracle_Home%/rdbms/lib/sysliblist" , "Touch %Oracle_Home%/rdbms/lib/sysliblist" ) */ 
	  _cmd = "touch %Oracle_Home%/rdbms/lib/sysliblist" ; _exe = "touch %Oracle_Home%/rdbms/lib/sysliblist" ; _com = "Touch %Oracle_Home%/rdbms/lib/sysliblist" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

        } /* do_relink || registered("plsql") */

        if(do_relink)
        {
            /*
             * Link and install product executables.
             */
             
	{ /*_LOG_MSG ( "Entering do_relink==true section" , Install_Log ) */ 
	  _msg = "Entering do_relink==true section" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            ui_action(instantiate(link_prod_executables_prompt));

             
	{ /*_LOG_MSG ( instantiate ( link_prod_executables_prompt ) , INstall_Log ) */ 
	  _msg = instantiate ( link_prod_executables_prompt ) ; 
	  _logfile = INstall_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
             
	{ /*_LOG_MSG ( "" , Install_Log ) */ 
	  _msg = "" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            change_directory("%Oracle_Home%/rdbms/lib");
            install_type="install";
            install_phrase="install";
             
	{ /*_SYSTEM ( "%MAKE% -f ins_rdbms.mk ORACLE_HOME=%Oracle_Home% %install_type%" , "Installing %install_phrase%." , status ) */ 
	  _cmd = "%MAKE% -f ins_rdbms.mk ORACLE_HOME=%Oracle_Home% %install_type%" ; _com = "Installing %install_phrase%." ; 
	   
	{ /*_LOG_SEL ( _cmd ,  outfile ) */ 
	    outfile = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      outfile = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      outfile = Make_Log ; 
	} 
	  _out = outfile ; _err = outfile ; 
	  modify ( "" , log_divider ( ) , outfile ) ; 
	  modify ( "" , "Action:  %_com%" , _out ) ; 
	  modify ( "" , "Command: (%_cmd%), Out=%_out%, Err=%_err%" , _out ) ; 
	  modify ( "" , "{" , _out ) ; 
	  _stat = spawn ( _cmd , _out , _err ) ; 
	  modify ( "" , "}" , _out ) ; 
	  modify ( "" , "Status:  %_stat%" , _out ) ; 
	  if ( _stat != 0 ) { 
	  modify ( "" , "(( OIERR-SYSTEM: %_cmd% ))" , _out ) ; 
	  } 
	  status = _stat ; 
	  modify ( "" , log_divider ( ) , _out ) ; 
	} /*End SYSTEM*/ 
             if (status != 0)
             {
              if (not(do_dei_patch))
              {
                 
	{ /*_SYS_ERR ( instantiate ( relinking_error ) ) */ 
	      _com = instantiate ( relinking_error ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
                signal('CANCEL, instantiate(relinking_error));
              }
              else
                 
	{ /*_RELINK_FAIL ( instantiate ( relinking_error ) ) */ 
	  add ( Patch_Install_Failed , product ) ; 
	  add ( Patch_Install_Failed , instantiate ( relinking_error ) ) ; 
	  add ( local_relink_install_failed , instantiate ( relinking_error ) ) ; 
	}
            }

            /*
            ** Do some special registration for patch deinstallation
            ** which is considered registered after relinking is
            ** successful.
            */
            if (do_dei_patch){
               
	{ /*_DEI_PATCH_REG ( patcho ) */ 
	  if ( empty ( local_relink_install_failed ) ) 
	  { 
	    
	{ /*_REG_PROD*/ 
	  
	{ /*_ACTION ( instantiate ( Register_Prompt ) ) */ 
	  _com = instantiate ( Register_Prompt ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  register ( product , File_Loaded_Msg ) ; 
	} 
	    
	{ /*_REMOVE_BACKUP_GROUP ( patcho ) */ 
	  
	{ /*_ACTION ( instantiate ( rbg_action ) ) */ 
	  _com = instantiate ( rbg_action ) ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	} 
	  _rbg_file_lst = group_files ( patcho ) ; 
	  while ( not ( empty ( _rbg_file_lst ) ) ) 
	  { 
	    _rbg_tmp_file = first ( _rbg_file_lst ) ; 
	    _rbg_file_lst = rest ( _rbg_file_lst ) ; 
	    { 
	      remove_file ( "%_rbg_tmp_file%O" ) ; 
	    } 
	    [ 'PERMISSION_DENIED : { } 
	    ] 
	  } 
	} 
	  } 
	  else 
	    information_dialog ( instantiate ( dei_patch_relink_err ) ) ; 
	}
            }

             
	{ /*_LOG_MSG ( "Leaving do_relink==true section." , Install_Log ) */ 
	  _msg = "Leaving do_relink==true section." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        } /* do_relink */
        else
        {
             
	{ /*_LOG_MSG ( "Entering do_relink==false section." , Install_Log ) */ 
	  _msg = "Entering do_relink==false section." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            if (options_chosen)
            {
                change_directory("%Oracle_Home%/rdbms/lib");
                ui_action("Relinking the Oracle executable with PL/SQL.");
                 
	{ /*_SYSTEM ( "%MAKE% -f ins_rdbms.mk ORACLE_HOME=%Oracle_Home% ioracle" , "Linking oracle." , status ) */ 
	  _cmd = "%MAKE% -f ins_rdbms.mk ORACLE_HOME=%Oracle_Home% ioracle" ; _com = "Linking oracle." ; 
	   
	{ /*_LOG_SEL ( _cmd ,  outfile ) */ 
	    outfile = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      outfile = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      outfile = Make_Log ; 
	} 
	  _out = outfile ; _err = outfile ; 
	  modify ( "" , log_divider ( ) , outfile ) ; 
	  modify ( "" , "Action:  %_com%" , _out ) ; 
	  modify ( "" , "Command: (%_cmd%), Out=%_out%, Err=%_err%" , _out ) ; 
	  modify ( "" , "{" , _out ) ; 
	  _stat = spawn ( _cmd , _out , _err ) ; 
	  modify ( "" , "}" , _out ) ; 
	  modify ( "" , "Status:  %_stat%" , _out ) ; 
	  if ( _stat != 0 ) { 
	  modify ( "" , "(( OIERR-SYSTEM: %_cmd% ))" , _out ) ; 
	  } 
	  status = _stat ; 
	  modify ( "" , log_divider ( ) , _out ) ; 
	} /*End SYSTEM*/
                if (not(status == 0))
                {
                     
	{ /*_SYS_ERR ( instantiate ( relinking_error ) ) */ 
	      _com = instantiate ( relinking_error ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
                    signal('CANCEL, instantiate(relinking_error));
                }
                 
	{ /*_LOG_MSG ( "Leaving do_relink==false section." , Install_Log ) */ 
	  _msg = "Leaving do_relink==false section." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            } /* PL/SQL or DDBO installed in this session */
        } /* if do_relink */


         
	{ /*_LOG_MSG ( "Leaving Make dependent section." , Install_Log ) */ 
	  _msg = "Leaving Make dependent section." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
    } /* if not No_Make */

    if (do_migrate)
    {
        /* do_migrate processing begins */
         
	{ /*_ACTION ( alter_db_echo ) */ 
	  _com = alter_db_echo ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}
        cnvrt_sql="%Oracle_Home%/rdbms/install/rdbms/convert%Oracle_Sid%.sql";
        instantiate_file("%Oracle_Home%/rdbms/install/rdbms/convert.orc", cnvrt_sql);

	args="<<!
@%cnvrt_sql%
exit
!";
         
	{ /*_SYS ( "%svrmgrl% %args%" , "Running Alter Database Convert command" ) */ 
	  _cmd = "%svrmgrl% %args%" ; _exe = "%svrmgrl% %args%" ; _com = "Running Alter Database Convert command" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/ 


         
	{ /*_YESNO_DLG ( convert_succeed_prompt , false , convert_succeed_content , convert_succeed_help , "%pname%.convert_succeed_output" , convert_succeed_output ) */ 
	  if ( exists ( User_Dflt_File ) ) 
	  { 
	    { 
	      _tmp_var = translate ( "%pname%.convert_succeed_output" , User_Dflt_File , "=" ) ; 
	      _dflt_str = "%_tmp_var%" ; 
	      if ( _dflt_str == "TRUE" ) 
	        _dflt_bool = TRUE ; 
	      else 
	        _dflt_bool = FALSE ; 
	    } 
	    [ 'UNBOUND_ENVIRONMENT_VARIABLE : _dflt_bool = false ; ] 
	  } 
	  else 
	    _dflt_bool = false ; 
	  if ( Default_Install ) 
	    convert_succeed_output = _dflt_bool ; 
	  else 
	    convert_succeed_output = YESNO_DIALOG ( convert_succeed_prompt , _dflt_bool , convert_succeed_content , convert_succeed_help ) ; 
	  if ( convert_succeed_output ) 
	    _answer = "TRUE" ; 
	  else 
	    _answer = "FALSE" ; 
	  if ( exists ( User_Dflt_File ) ) modify ( "%pname%.convert_succeed_output" , _answer , User_Dflt_File , "=" ) ; 
	  
	{ /*_LOG_HDR ( "YESNO" ) */ 
	  _dlg_type = "YESNO" ; 
	  modify ( "" , "      " , Install_Log ) ; 
	  if ( _dlg_type == "YESNO" ) 
	    _dummy = "-[ YESNO ]--------------------------------------------------------------------" ; 
	  else if ( _dlg_type == "TEXT" ) 
	    _dummy = "-[ TEXT ]---------------------------------------------------------------------" ; 
	  else if ( _dlg_type == "SINGLE_SELECT" ) 
	    _dummy = "-[ SINGLE_SELECT ]------------------------------------------------------------" ; 
	  else if ( _dlg_type == "MULTI_SELECT" ) 
	    _dummy = "-[ MULTI_SELECT ]-------------------------------------------------------------" ; 
	  else if ( _dlg_type == "GET_FILE" ) 
	    _dummy = "-[ GET_FILE ]-----------------------------------------------------------------" ; 
	  else if ( _dlg_type == "PASSWD" ) 
	    _dummy = "-[ PASSWD ]-------------------------------------------------------------------" ; 
	  else if ( _dlg_type == "MULTI_TEXT" ) 
	  { 
	    divider = "############################################################" ; 
	    dummy  = "#                    INSTALL LOG FILE                      #" ; 
	    linespace = "                     " ; 
	    modify ( "" , divider , Install_Log ) ; 
	    modify ( "" , dummy , Install_Log ) ; 
	    modify ( "" , divider , Install_Log ) ; 
	    spawn ( "echo %Install_Log%" , Install_Log , Install_Log ) ; 
	    spawn ( "echo `date` - `id`" , Install_Log , Install_Log ) ; 
	    modify ( "" , linespace , Install_Log ) ; 
	    dummy  = "#                    SQL LOG FILE                          #" ; 
	    modify ( "" , divider , Sql_Log ) ; 
	    modify ( "" , dummy , Sql_Log ) ; 
	    modify ( "" , divider , Sql_Log ) ; 
	    spawn ( "echo %Sql_Log%" , Sql_Log , Sql_Log ) ; 
	    spawn ( "echo `date` - `id`" , Sql_Log , Sql_Log ) ; 
	    modify ( "" , linespace , Sql_Log ) ; 
	    dummy  = "#                    MAKE LOG FILE                         #" ; 
	    modify ( "" , divider , Make_Log ) ; 
	    modify ( "" , dummy , Make_Log ) ; 
	    modify ( "" , divider , Make_Log ) ; 
	    spawn ( "echo %Make_Log%" , Make_Log , Make_Log ) ; 
	    spawn ( "echo `date` - `id`" , Make_Log , Make_Log ) ; 
	    modify ( "" , linespace , Make_Log ) ; 
	    dummy  = "#                    OS LOG FILE                           #" ; 
	    modify ( "" , divider , OS_Log ) ; 
	    modify ( "" , dummy , OS_Log ) ; 
	    modify ( "" , divider , OS_Log ) ; 
	    spawn ( "echo %OS_Log%" , OS_Log , OS_Log ) ; 
	    spawn ( "echo `date` - `id`" , OS_Log , OS_Log ) ; 
	    modify ( "" , linespace , OS_Log ) ; 
	    _dummy = "-[ MULTI_TEXT ]-------------------------------------------------------------" ; 
	  } 
	  modify ( "" , _dummy , Install_Log ) ; 
	} 
	  _prompt = convert_succeed_prompt ; 
	  _dummy = "       Q> %_prompt%" ; 
	  modify ( "" , _dummy , Install_Log ) ; 
	  _dummy = "       A> %_answer%" ; 
	  modify ( "" , _dummy , Install_Log ) ; 
	}
        if (not(convert_succeed_output))
        {
             
	{ /*_SYS_ERR ( convert_not_succeed_info ) */ 
	      _com = convert_not_succeed_info ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
            signal('CANCEL, convert_not_succeed_info);
        }

         
	{ /*_ACTION ( reset_log_echo ) */ 
	  _com = reset_log_echo ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}
        reset_sql="%Oracle_Home%/rdbms/install/rdbms/reset%Oracle_Sid%.sql";
        instantiate_file("%Oracle_Home%/rdbms/install/rdbms/reset.orc", reset_sql);

	args="<<!
@%reset_sql%
exit
!";
         
	{ /*_SYS ( "%svrmgrl% %args%" , "Resetting your log files" ) */ 
	  _cmd = "%svrmgrl% %args%" ; _exe = "%svrmgrl% %args%" ; _com = "Resetting your log files" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/ 

         
	{ /*_YESNO_DLG ( reset_logs_succeed_prompt , false , reset_logs_succeed_content , reset_logs_succeed_help , "%pname%.reset_logs_succeed_output" , reset_logs_succeed_output ) */ 
	  if ( exists ( User_Dflt_File ) ) 
	  { 
	    { 
	      _tmp_var = translate ( "%pname%.reset_logs_succeed_output" , User_Dflt_File , "=" ) ; 
	      _dflt_str = "%_tmp_var%" ; 
	      if ( _dflt_str == "TRUE" ) 
	        _dflt_bool = TRUE ; 
	      else 
	        _dflt_bool = FALSE ; 
	    } 
	    [ 'UNBOUND_ENVIRONMENT_VARIABLE : _dflt_bool = false ; ] 
	  } 
	  else 
	    _dflt_bool = false ; 
	  if ( Default_Install ) 
	    reset_logs_succeed_output = _dflt_bool ; 
	  else 
	    reset_logs_succeed_output = YESNO_DIALOG ( reset_logs_succeed_prompt , _dflt_bool , reset_logs_succeed_content , reset_logs_succeed_help ) ; 
	  if ( reset_logs_succeed_output ) 
	    _answer = "TRUE" ; 
	  else 
	    _answer = "FALSE" ; 
	  if ( exists ( User_Dflt_File ) ) modify ( "%pname%.reset_logs_succeed_output" , _answer , User_Dflt_File , "=" ) ; 
	  
	{ /*_LOG_HDR ( "YESNO" ) */ 
	  _dlg_type = "YESNO" ; 
	  modify ( "" , "      " , Install_Log ) ; 
	  if ( _dlg_type == "YESNO" ) 
	    _dummy = "-[ YESNO ]--------------------------------------------------------------------" ; 
	  else if ( _dlg_type == "TEXT" ) 
	    _dummy = "-[ TEXT ]---------------------------------------------------------------------" ; 
	  else if ( _dlg_type == "SINGLE_SELECT" ) 
	    _dummy = "-[ SINGLE_SELECT ]------------------------------------------------------------" ; 
	  else if ( _dlg_type == "MULTI_SELECT" ) 
	    _dummy = "-[ MULTI_SELECT ]-------------------------------------------------------------" ; 
	  else if ( _dlg_type == "GET_FILE" ) 
	    _dummy = "-[ GET_FILE ]-----------------------------------------------------------------" ; 
	  else if ( _dlg_type == "PASSWD" ) 
	    _dummy = "-[ PASSWD ]-------------------------------------------------------------------" ; 
	  else if ( _dlg_type == "MULTI_TEXT" ) 
	  { 
	    divider = "############################################################" ; 
	    dummy  = "#                    INSTALL LOG FILE                      #" ; 
	    linespace = "                     " ; 
	    modify ( "" , divider , Install_Log ) ; 
	    modify ( "" , dummy , Install_Log ) ; 
	    modify ( "" , divider , Install_Log ) ; 
	    spawn ( "echo %Install_Log%" , Install_Log , Install_Log ) ; 
	    spawn ( "echo `date` - `id`" , Install_Log , Install_Log ) ; 
	    modify ( "" , linespace , Install_Log ) ; 
	    dummy  = "#                    SQL LOG FILE                          #" ; 
	    modify ( "" , divider , Sql_Log ) ; 
	    modify ( "" , dummy , Sql_Log ) ; 
	    modify ( "" , divider , Sql_Log ) ; 
	    spawn ( "echo %Sql_Log%" , Sql_Log , Sql_Log ) ; 
	    spawn ( "echo `date` - `id`" , Sql_Log , Sql_Log ) ; 
	    modify ( "" , linespace , Sql_Log ) ; 
	    dummy  = "#                    MAKE LOG FILE                         #" ; 
	    modify ( "" , divider , Make_Log ) ; 
	    modify ( "" , dummy , Make_Log ) ; 
	    modify ( "" , divider , Make_Log ) ; 
	    spawn ( "echo %Make_Log%" , Make_Log , Make_Log ) ; 
	    spawn ( "echo `date` - `id`" , Make_Log , Make_Log ) ; 
	    modify ( "" , linespace , Make_Log ) ; 
	    dummy  = "#                    OS LOG FILE                           #" ; 
	    modify ( "" , divider , OS_Log ) ; 
	    modify ( "" , dummy , OS_Log ) ; 
	    modify ( "" , divider , OS_Log ) ; 
	    spawn ( "echo %OS_Log%" , OS_Log , OS_Log ) ; 
	    spawn ( "echo `date` - `id`" , OS_Log , OS_Log ) ; 
	    modify ( "" , linespace , OS_Log ) ; 
	    _dummy = "-[ MULTI_TEXT ]-------------------------------------------------------------" ; 
	  } 
	  modify ( "" , _dummy , Install_Log ) ; 
	} 
	  _prompt = reset_logs_succeed_prompt ; 
	  _dummy = "       Q> %_prompt%" ; 
	  modify ( "" , _dummy , Install_Log ) ; 
	  _dummy = "       A> %_answer%" ; 
	  modify ( "" , _dummy , Install_Log ) ; 
	}
        if (not(reset_logs_succeed_output))
        {
              
	{ /*_SYS_ERR ( reset_logs_failed_info ) */ 
	      _com = reset_logs_failed_info ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
            signal('CANCEL, reset_logs_failed_info);
        }

         
	{ /*_ACTION ( dropmig_prompt ) */ 
	  _com = dropmig_prompt ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}
	args="<<!
@%rdbms_dir%/install/dropmig.sql
exit
!";
         
	{ /*_SYS ( "%svrmgrl% %args%" , dropmig_prompt ) */ 
	  _cmd = "%svrmgrl% %args%" ; _exe = "%svrmgrl% %args%" ; _com = dropmig_prompt ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/  

    } /* do_migrate */

    /* Set to false later if failed to (create if needed) and startup a DB */
    db_up_normal=true;  

    /* Create a new database */
    if (do_db_actions && (not(do_upgrade)))
    {
         
	{ /*_LOG_MSG ( "Entering database actions section." , Install_Log ) */ 
	  _msg = "Entering database actions section." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}

        /* For the IBM SP, these directories all exist in the map file,
           and the make_directory() command does not handle "?"
           appropriately */

        make_directory(admin_dir);
        make_directory(pfile_dir);
        make_directory(create_dir);
        make_directory(bdump_dir);
        make_directory(cdump_dir);
        make_directory(udump_dir);




        /* Creating the directories that contain the database and misc.
           files */
        file_list=list( control1_file, control2_file, control3_file,
                system_file, log1_file, log2_file, log3_file,
                rbs_file, temp_file, users_file, tools_file);
        orapwd_stat_mesg =nls("orapwd_stat_mesg","ORAPWD DONE!!!");
        if (orapwd_pw_get)
             
	{ /*_SYS ( "%OH%/bin/orapwd file=%OH%/dbs/orapw%Oracle_Sid% password=%orapwd_pw% entries=%orapwd_size%" , "creating orapwd file....." ) */ 
	  _cmd = "%OH%/bin/orapwd file=%OH%/dbs/orapw%Oracle_Sid% password=%orapwd_pw% entries=%orapwd_size%" ; _exe = "%OH%/bin/orapwd file=%OH%/dbs/orapw%Oracle_Sid% password=%orapwd_pw% entries=%orapwd_size%" ; _com = "creating orapwd file....." ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
        while (not(empty(file_list)))
        {
            cur_file=first(file_list);
            file_list=rest(file_list);

            make_directory(directory_name(cur_file));
        }


        /*
         * Creating RDBMS ...
         */
        /* Instantiate the init.ora file */
        ui_action(crinit_prompt);
         
	{ /*_LOG_MSG ( crinit_prompt , Install_Log ) */ 
	  _msg = crinit_prompt ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        rollback_segs="r01,r02,r03,r04";
        maxinstances=1;
        maxlogfiles=16; /* SSDFRFL */
	if (Start_Lsnr==TRUE) 	/* check if user wanted MTS */
        init_ora_comment="";
	else
        init_ora_comment="# ";

        config_ora_file="config%dbname%.ora";

	/* Bug 166497
	 * Check if init<sid>.ora exists already.  If so, move it to
	 * "init<sid>.ora.OLD", so that the new init<sid>.ora will not 
	 * overwrite the old one.
	 */
	if(exists(instantiate("%pfile_dir%/init%Oracle_Sid%.ora")))
	{ move_file(instantiate("%pfile_dir%/init%Oracle_Sid%.ora"),
	instantiate("%pfile_dir%/init%Oracle_Sid%.ora.OLD"));
	information_dialog(instantiate(initsid_move_mesg)); 
	}

	sro_comment = "# ";
	if (registered("sro") && registered("plsql") && registered("ddbo"))
	sro_comment = " ";
        instantiate_file ("%rdbms_dir%/install/rdbms/cnfg.orc",
              "%pfile_dir%/%config_ora_file%");

        instantiate_file ("%rdbms_dir%/install/rdbms/initx.orc",
              "%pfile_dir%/init%Oracle_Sid%.ora");
        /* Bug 148474:
         * Need to use the initx.orc settings for the initSID_0.ora file
         * since we need to set parameters like SHARED_POOL_SIZE so that
         * there will be less chance of error during creation of the 
         * PL/SQL tables.
         */
        tmp_rollback_segs=rollback_segs;
        rollback_segs="";

	/* Bug 166497
	 * Check if init<sid>.ora exists already.  If so, move it to
	 * "init<sid>_0.ora.OLD", so that the new init<sid>_0.ora will not 
	 * overwrite the old one.
	 */
	if(exists(instantiate("%pfile_dir%/init%Oracle_Sid%_0.ora")))
	{ move_file(instantiate("%pfile_dir%/init%Oracle_Sid%_0.ora"),
	instantiate("%pfile_dir%/init%Oracle_Sid%_0.ora.OLD"));
	information_dialog(instantiate(initsid0_move_mesg)); 
	}

        instantiate_file ("%rdbms_dir%/install/rdbms/initx.orc",
              "%pfile_dir%/init%Oracle_Sid%_0.ora");
        rollback_segs=tmp_rollback_segs;
        /* Create a soft link between the ora files in pfile_dir and the dbs
           directory, because by default ORACLE looks in the dbs directory
           for these files */

        if(OFA_Compliant)
        {
            spawn("ln -s %pfile_dir%/*.ora %Oracle_Home%/dbs");
        }

         
	{ /*_SYS ( "chmod 660 %pfile_dir%/%config_ora_file%" , "Changing permissions of %pfile_dir%/%config_ora_file% to 660." ) */ 
	  _cmd = "chmod 660 %pfile_dir%/%config_ora_file%" ; _exe = "chmod 660 %pfile_dir%/%config_ora_file%" ; _com = "Changing permissions of %pfile_dir%/%config_ora_file% to 660." ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

        if (not(exists("%rdbms_dir%/log"))) 
        {
             
	{ /*_LOG_MSG ( create_log_dir_echo , Install_Log ) */ 
	  _msg = create_log_dir_echo ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            make_directory("%rdbms_dir%/log");
            /*
            ** Make sure that it is writable to the dba group.
            ** Bug: 143380
            */
             
	{ /*_SYS ( "chmod g+rwx %rdbms_dir%/log" , "Making %rdbms_dir%/log writable to the dba group" ) */ 
	  _cmd = "chmod g+rwx %rdbms_dir%/log" ; _exe = "chmod g+rwx %rdbms_dir%/log" ; _com = "Making %rdbms_dir%/log writable to the dba group" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
        } /* if (not(exists("%rdbms_dir%/log"))) */

        /* Create listener.ora file and start up listener if appropriate */
	if (Start_Lsnr==TRUE) 
	{
        modify("TNS_ADMIN", "%Oracle_Home%/network/admin");

        dom_name="%quotation_mark%%dom_name%%quotation_mark%";
         
	{ /*_SYS ( "%Oracle_Home%/bin/ncuxpp -s %Oracle_Sid% -d %dom_name% -h %Oracle_Home% -p %lsnr_pw%" , ipc_lsnr_file_msg ) */ 
	  _cmd = "%Oracle_Home%/bin/ncuxpp -s %Oracle_Sid% -d %dom_name% -h %Oracle_Home% -p %lsnr_pw%" ; _exe = "%Oracle_Home%/bin/ncuxpp -s %Oracle_Sid% -d %dom_name% -h %Oracle_Home% -p %lsnr_pw%" ; _com = ipc_lsnr_file_msg ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
         
	{ /*_SYS ( "cd %Oracle_Home%; %Oracle_Home%/bin/lsnrctl start >> %Oracle_Home%/network/admin/lsnrctl.log" , lsnrstart_msg ) */ 
	  _cmd = "cd %Oracle_Home%; %Oracle_Home%/bin/lsnrctl start >> %Oracle_Home%/network/admin/lsnrctl.log" ; _exe = "cd %Oracle_Home%; %Oracle_Home%/bin/lsnrctl start >> %Oracle_Home%/network/admin/lsnrctl.log" ; _com = lsnrstart_msg ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

                if (not(_result == "Ok"))
                 
	{ /*_LOG_MSG ( instantiate ( ipc_listen_err ) , Install_Log ) */ 
	  _msg = instantiate ( ipc_listen_err ) ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
	}


        /* Running the database creation scripts and catalog.sql, etc */
        ui_action(crcrdb_sql);
         
	{ /*_LOG_MSG ( crcrdb_sql , Install_Log ) */ 
	  _msg = crcrdb_sql ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        crdb_sql="%create_dir%/crdb%Oracle_Sid%.sql";
        crdb2_sql="%create_dir%/crdb2%Oracle_Sid%.sql";
        instantiate_file ("%rdbms_dir%/install/rdbms/crdb.orc", crdb_sql);
        instantiate_file ("%rdbms_dir%/install/rdbms/crdb2.orc", crdb2_sql);


        /*
         * Bug 148646:  If a file by the name of create_db_spool_file already
         * exists, then move it for safe keeping.
         */
        if (exists(create_db_spool_file))
        {
            move_file(create_db_spool_file, "%create_db_spool_file%O");
        }

        ui_action(crdb_prompt);
	args="<<!
@%crdb_sql%
exit
!";
         
	{ /*_SYS ( "%svrmgrl% %args%" , "Running crdb%Oracle_Sid%.sql" ) */ 
	  _cmd = "%svrmgrl% %args%" ; _exe = "%svrmgrl% %args%" ; _com = "Running crdb%Oracle_Sid%.sql" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

        /* Bug 148646:  Need to check that the create_db_spool_file contains
         * the "Statement processed" line.  Of course this solution is 
         * dependent on only one SQL statement being issued in the crdbSID.sql
         * script.
         */
        check_db_create = "egrep '^ORA-' %create_db_spool_file%";
         
	{ /*_SYSTEM ( check_db_create , instantiate ( check_db_create_info ) , status ) */ 
	  _cmd = check_db_create ; _com = instantiate ( check_db_create_info ) ; 
	   
	{ /*_LOG_SEL ( _cmd ,  outfile ) */ 
	    outfile = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      outfile = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      outfile = Make_Log ; 
	} 
	  _out = outfile ; _err = outfile ; 
	  modify ( "" , log_divider ( ) , outfile ) ; 
	  modify ( "" , "Action:  %_com%" , _out ) ; 
	  modify ( "" , "Command: (%_cmd%), Out=%_out%, Err=%_err%" , _out ) ; 
	  modify ( "" , "{" , _out ) ; 
	  _stat = spawn ( _cmd , _out , _err ) ; 
	  modify ( "" , "}" , _out ) ; 
	  modify ( "" , "Status:  %_stat%" , _out ) ; 
	  if ( _stat != 0 ) { 
	  modify ( "" , "(( OIERR-SYSTEM: %_cmd% ))" , _out ) ; 
	  } 
	  status = _stat ; 
	  modify ( "" , log_divider ( ) , _out ) ; 
	} /*End SYSTEM*/
        if (status != 0)
        {
             
	{ /*_LOG_MSG ( instantiate ( create_db_succ ) , Install_Log ) */ 
	  _msg = instantiate ( create_db_succ ) ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        } else {
             
	{ /*_LOG_MSG ( instantiate ( create_db_fail ) , Install_Log ) */ 
	  _msg = instantiate ( create_db_fail ) ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            signal('failure, crdb_fail_prompt);
        } /* if (status != 0) */





        /* if failed to create and startup the DB, then set db_up_normal 
         * to false.
         */
        if (not(exists(sgadef_file))) db_up_normal =false;

        /* This section is used to run crdb2<sid>.sql.  These are all the 
         * commands that used to be done in crdb<sid>.sql after the database 
         * was created.
         */
        if (db_up_normal)
        {
             
	{ /*_ACTION ( crdb2_prompt ) */ 
	  _com = crdb2_prompt ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}
/*            SYS("%svrmgrl% @%crdb2_sql%", "Running crdb2%Oracle_Sid%.sql")  */
	cmd="%Oracle_Home%/bin/svrmgrl  <<!
connect internal
@ %crdb2_sql%
exit
!";
             
	{ /*_SYS ( cmd , "Running crdb2%Oracle_Sid%.sql" ) */ 
	  _cmd = cmd ; _exe = cmd ; _com = "Running crdb2%Oracle_Sid%.sql" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/



            /* Bug 151823: If the database has been created with the OFA
             * structure, create soft link between the init<SID>.ora file and
             * and ?/dbs/init<SID>.ora.
             */
            dbs_pfile="%Oracle_Home%/dbs/init%Oracle_Sid%.ora";
            if ((OFA_Compliant) && (not(exists(dbs_pfile))))
            {
                 
	{ /*_SYS ( "ln -s %pfile_spec% %dbs_pfile%" , "Creating soft link from %dbs_pfile% to %pfile_spec%" ) */ 
	  _cmd = "ln -s %pfile_spec% %dbs_pfile%" ; _exe = "ln -s %pfile_spec% %dbs_pfile%" ; _com = "Creating soft link from %dbs_pfile% to %pfile_spec%" ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
                if (exists(dbs_pfile))
                {
                     
	{ /*_LOG_MSG ( "Soft link for ?/dbs/init%Oracle_Sid%.ora created." , Install_Log ) */ 
	  _msg = "Soft link for ?/dbs/init%Oracle_Sid%.ora created." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
                } else {
                     
	{ /*_LOG_MSG ( "Error: Soft link for ?/dbs/init%Oracle_Sid%.ora" , Install_Log ) */ 
	  _msg = "Error: Soft link for ?/dbs/init%Oracle_Sid%.ora" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
                     
	{ /*_LOG_MSG ( "       not created." , Install_Log ) */ 
	  _msg = "       not created." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
                } /* if exists(dbs_pfile) */
            } /* if OFA_Compliant and (dbs_pfile doesn't exist) */
        }

        }
     /* if (do_db_actions && not(do_upgrade)) */

    /*
     * If we are creating a database (do_db_actions) then the 
     * database was already should already have been started.
     * If we are migrating the database (do_migrate) then the
     * database should have been started by the reset.sql script.
     * Otherwise, if we just loaded the files, relinked the executables,
     * or are doing an upgrade, then we need to startup the database
     * at this point.
     */
    /*
     * If we are upgrading, then we need to startup the database in
     * EXCLUSIVE and RESTRICTED mode first.  Then we'll run the upgrade
     * scripts, and finally, we'll shutdown the database again.
     */
    if (do_upgrade && (not(do_migrate)) && db_up_normal)
    {
        /* Let's make sure that the database is shutdown. */
        if (exists(sgadef_file))
        {

            shutting_down_db_msg = nls("shutting_down_db_msg",
                      "Shutting down the database before performing upgrade.");
            ui_action(shutting_down_db_msg);
             
	{ /*_SYS ( "sh %Oracle_Home%/rdbms/install/rdbms/shutdown.sh" , shutting_down_db_msg ) */ 
	  _cmd = "sh %Oracle_Home%/rdbms/install/rdbms/shutdown.sh" ; _exe = "sh %Oracle_Home%/rdbms/install/rdbms/shutdown.sh" ; _com = shutting_down_db_msg ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
            if (exists(sgadef_file))
            {
                 
	{ /*_SYS_ERR ( instantiate ( shutdown_error ) ) */ 
	      _com = instantiate ( shutdown_error ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
                signal('CANCEL, instantiate(shutdown_error));
            } else {
                 
	{ /*_LOG_MSG ( "Database successfully shutdown" , Install_Log ) */ 
	  _msg = "Database successfully shutdown" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            }
        } else {
             
	{ /*_LOG_MSG ( "Database already shutdown before performing upgrade steps." , Install_Log ) */ 
	  _msg = "Database already shutdown before performing upgrade steps." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        } /* if exists(sgadef_file) */

        if (not(exists(sgadef_file)))
        {
             
	{ /*_ACTION ( dbstart_msg ) */ 
	  _com = dbstart_msg ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}
            start_mode="exclusive restrict";

             
	{ /*_GET_PFILE ( Oracle_Sid , pfile_spec ) */ 
	  pfile_spec = "" ; 
	  _pfile_log = "%Oracle_Home%/orainst/pfile.spc" ; 
	  if ( exists ( _pfile_log ) ) 
	  { 
	    _ora_sid = Oracle_Sid ; 
	    _tmp_str = translate ( "PFILE_%_ora_sid%" , _pfile_log , "=" ) ; 
	    pfile_spec = "pfile=%_tmp_str%" ; 
	  } 
	  [   'UNBOUND_ENVIRONMENT_VARIABLE : pfile = "" ; 
	  ] 
	}
            startup_sql="%Oracle_Home%/rdbms/install/rdbms/startup%Oracle_Sid%.sql";
            instantiate_file ("%Oracle_Home%/rdbms/install/rdbms/startup.orc",
                startup_sql);
          /*  SYSTEM("%svrmgrl% @%startup_sql%",
                dbstart_msg, status)  */
	cmd="%Oracle_Home%/bin/svrmgrl  <<!
connect internal
@ %startup_sql%
exit
!";
             
	{ /*_SYSTEM ( cmd , dbstart_msg , status ) */ 
	  _cmd = cmd ; _com = dbstart_msg ; 
	   
	{ /*_LOG_SEL ( _cmd ,  outfile ) */ 
	    outfile = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      outfile = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      outfile = Make_Log ; 
	} 
	  _out = outfile ; _err = outfile ; 
	  modify ( "" , log_divider ( ) , outfile ) ; 
	  modify ( "" , "Action:  %_com%" , _out ) ; 
	  modify ( "" , "Command: (%_cmd%), Out=%_out%, Err=%_err%" , _out ) ; 
	  modify ( "" , "{" , _out ) ; 
	  _stat = spawn ( _cmd , _out , _err ) ; 
	  modify ( "" , "}" , _out ) ; 
	  modify ( "" , "Status:  %_stat%" , _out ) ; 
	  if ( _stat != 0 ) { 
	  modify ( "" , "(( OIERR-SYSTEM: %_cmd% ))" , _out ) ; 
	  } 
	  status = _stat ; 
	  modify ( "" , log_divider ( ) , _out ) ; 
	} /*End SYSTEM*/


            if ((not(status == 0)) || (not(exists(sgadef_file))))
            {
                 
	{ /*_SYS_ERR ( instantiate ( startup_error ) ) */ 
	      _com = instantiate ( startup_error ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
                signal('CANCEL, instantiate(startup_error));
            }
        }

        /* Perform ORACLE7 database (non-migrate) upgrade */
        /* if a sql script is not to be run, set line header  to 'rem # ' 
           to comment out the sql script */
        comment_symbol="Rem # ";

        rem_7011_7013=comment_symbol;
        rem_7012_7013=comment_symbol;
        rem_7013_7015=comment_symbol;
        rem_7015_7016=comment_symbol;
        rem_701356_7102=comment_symbol;
	rem_7102_7103=comment_symbol;
        rem_to_7103="";
	rem_7103_7104=comment_symbol;
	rem_7104_7105=comment_symbol;
	rem_7105_7106=comment_symbol;
	rem_7106_7202=comment_symbol;
        rem_7202_7203=comment_symbol;
        rem_7203_7301=comment_symbol;
        rem_7301_7302=comment_symbol;

        if (upg_7011_to_7013) rem_7011_7013="";
        if (upg_7012_to_7013) rem_7012_7013="";
        if (upg_7013_to_7015) rem_7013_7015="";
        if (upg_7015_to_7016) rem_7015_7016="";
        if (upg_7013_to_7102 || upg_7015_to_7102 || upg_7016_to_7102) 
        {
            rem_701356_7102="";
            rem_to_7103=comment_symbol;
        } /* if (upg_7013_to_7102 || upg_7015_to_7102 || upg_7016_to_7102) */

	if (upg_7102_to_7103) rem_7102_7103="";
	if (upg_7103_to_7104 || upg_7104_to_7105) rem_7103_7104="";
	if (upg_7105_to_7106) rem_7105_7106="";
	if (upg_7106_to_7202) rem_7106_7202="";
        if (upg_7202_to_7203) rem_7202_7203="";
        if (upg_7203_to_7301) rem_7203_7301="";
        if (upg_7301_to_7302) rem_7301_7302="";


        rem_pso=comment_symbol;
        rem_proc=comment_symbol;
	rem_sro=comment_symbol;
        if (registered("pso")) rem_pso="";
        if (registered("plsql")) rem_proc="";
	if (registered("plsql") && registered("ddbo") && registered("sro")) rem_sro="";

        upgrd_sql="%rdbms_dir%/install/rdbms/upgrd%Oracle_Sid%.sql";

        instantiate_file( "%rdbms_dir%/install/rdbms/upgrd.orc", upgrd_sql);
        running_upgrade_info=nls("running_upgrade_info",
                           "Running %server_name% database upgrade script(s)");
        ui_action(running_upgrade_info);
   /*     SYSTEM("%svrmgrl% @%upgrd_sql%", running_upgrade_info, status)  */

	cmd="%Oracle_Home%/bin/svrmgrl  <<!
connect internal
@ %upgrd_sql%
exit
!";
             
	{ /*_SYS ( cmd , running_upgrade_info ) */ 
	  _cmd = cmd ; _exe = cmd ; _com = running_upgrade_info ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/


        shut_down_after_upgrade_info=nls("shut_down_after_upgrade_info",
            "Shutting down the database after performing upgrade.");
        ui_action(shut_down_after_upgrade_info);
         
	{ /*_SYS ( "sh %Oracle_Home%/rdbms/install/rdbms/shutdown.sh" , shut_down_after_upgrade_info ) */ 
	  _cmd = "sh %Oracle_Home%/rdbms/install/rdbms/shutdown.sh" ; _exe = "sh %Oracle_Home%/rdbms/install/rdbms/shutdown.sh" ; _com = shut_down_after_upgrade_info ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/
        if (exists(sgadef_file))
        {
             
	{ /*_SYS_ERR ( instantiate ( shutdown_error ) ) */ 
	      _com = instantiate ( shutdown_error ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
            signal('CANCEL, instantiate(shutdown_error));
        } else {
             
	{ /*_LOG_MSG ( "Database successfully shutdown" , Install_Log ) */ 
	  _msg = "Database successfully shutdown" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        }
    }

    /*
     * Now startup the database normally for the following instances:
     * 1.  You've performed database upgrade operations.
     *     do_actions would be true and do_upgrade would be false.
     * 2.  You've loaded files and/or relinked executables, a database exists,
     *     and the user wants us to restart the database.
     *     load_or_relink_only is true, database_exists is true, and
     *     startup_after_load_relink is true. do_db_actions would be false.
     *     Since startup_after_load_relink can only be true if 
     *     load_or_relink_only and database_exists are both true, we don't
     *     need to put them in the conditional statement.
     * We don't want to startup the database under the following conditions:
     * 1.  You've created the database.  The database should have already been
     *     started up normally.  do_actions would be true, do_upgrade is false.
     *     load_or_relink_only would be false, as would 
     *     startup_after_load_relink.
     * 2.  You've migrated the database.  The database should have already been
     *     started up normally.  do_migrate would be true.  Put this in the
     *     conditional statement as a little extra insurance.
     */
     
	{ /*_LOG_MSG ( "db_up_normal: %db_up_normal%" , Install_Log ) */ 
	  _msg = "db_up_normal: %db_up_normal%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
    if (((do_db_actions && do_upgrade) || startup_after_load_relink)
        && not(do_migrate) && db_up_normal
       )
    {
        if (exists(sgadef_file))
        {
             
	{ /*_LOG_MSG ( "Error: The database should be shutdown at this point." , Install_Log ) */ 
	  _msg = "Error: The database should be shutdown at this point." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
        } else {
             
	{ /*_ACTION ( dbstart_msg ) */ 
	  _com = dbstart_msg ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}
            if (registered("pso"))
                start_mode="shared";
            else
                start_mode="exclusive";

             
	{ /*_GET_PFILE ( Oracle_Sid , pfile_spec ) */ 
	  pfile_spec = "" ; 
	  _pfile_log = "%Oracle_Home%/orainst/pfile.spc" ; 
	  if ( exists ( _pfile_log ) ) 
	  { 
	    _ora_sid = Oracle_Sid ; 
	    _tmp_str = translate ( "PFILE_%_ora_sid%" , _pfile_log , "=" ) ; 
	    pfile_spec = "pfile=%_tmp_str%" ; 
	  } 
	  [   'UNBOUND_ENVIRONMENT_VARIABLE : pfile = "" ; 
	  ] 
	}
            startup_sql2="%Oracle_Home%/rdbms/install/rdbms/startup%Oracle_Sid%2.sql";
            instantiate_file ("%Oracle_Home%/rdbms/install/rdbms/startup.orc",
                startup_sql2);
         /*   SYSTEM("%svrmgrl% @%startup_sql2%", dbstart_msg, status)  */

	cmd="%Oracle_Home%/bin/svrmgrl  <<!
connect internal
@ %startup_sql2%
exit
!";
             
	{ /*_SYSTEM ( cmd , dbstart_msg , status ) */ 
	  _cmd = cmd ; _com = dbstart_msg ; 
	   
	{ /*_LOG_SEL ( _cmd ,  outfile ) */ 
	    outfile = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      outfile = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      outfile = Make_Log ; 
	} 
	  _out = outfile ; _err = outfile ; 
	  modify ( "" , log_divider ( ) , outfile ) ; 
	  modify ( "" , "Action:  %_com%" , _out ) ; 
	  modify ( "" , "Command: (%_cmd%), Out=%_out%, Err=%_err%" , _out ) ; 
	  modify ( "" , "{" , _out ) ; 
	  _stat = spawn ( _cmd , _out , _err ) ; 
	  modify ( "" , "}" , _out ) ; 
	  modify ( "" , "Status:  %_stat%" , _out ) ; 
	  if ( _stat != 0 ) { 
	  modify ( "" , "(( OIERR-SYSTEM: %_cmd% ))" , _out ) ; 
	  } 
	  status = _stat ; 
	  modify ( "" , log_divider ( ) , _out ) ; 
	} /*End SYSTEM*/
            if ((not(status == 0)) || (not(exists(sgadef_file))))
            {
                 
	{ /*_SYS_ERR ( instantiate ( startup_error ) ) */ 
	      _com = instantiate ( startup_error ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
                signal('CANCEL, instantiate(startup_error));
            }
        } /* if (exists(sgadef_file)) */
    } /* if (((do_db_actions && do_upgrade) || startup_after_load_relink)
             && not(do_migrate) && db_up_normal
            ) */

    /* Run catalog.sql only if doing migrate.  
     * For db creation, crdbSID.sql has already run catalog.sql.
     * For db upgrade, if catexp.sql was supposed to have been run, then
     *     it was already done in the preceding section.
     */
    if (do_migrate && db_up_normal)
    { 
        /* 
         * Run V7 catalog.sql 
         */
        catexp_prompt =nls("catexp_prompt",
            "Creating V7 data dictionary, export and loader views.");
         
	{ /*_ACTION ( catexp_prompt ) */ 
	  _com = catexp_prompt ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}

        catexp_sql="%rdbms_dir%/install/rdbms/catexp%Oracle_Sid%.sql";
        instantiate_file ("%rdbms_dir%/install/rdbms/catexp.orc", catexp_sql);
      /*  SYSTEM("%svrmgrl% @%catexp_sql%", catexp_prompt, status) */

	cmd="%Oracle_Home%/bin/svrmgrl  <<!
connect internal
@ %catexp_sql%
exit
!";
             
	{ /*_SYS ( cmd , catexp_prompt ) */ 
	  _cmd = cmd ; _exe = cmd ; _com = catexp_prompt ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

    }

    if ((do_db_actions || do_upgrade || do_migrate) && db_up_normal)
    { 
        /* 
         * Install PL/SQL tables 
         */
        crplsql_sql =nls("crplsql_sql", 
            "Creating plsql.sql plsql table creation script");
        plsql_inst_prompt =nls("plsql_inst_prompt", 
            "Installing default PL/SQL package");
        if (registered("plsql")) 
        {
            ui_action(crplsql_sql);
             
	{ /*_LOG_MSG ( crplsql_sql , Install_Log ) */ 
	  _msg = crplsql_sql ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            plsql_sql="%rdbms_dir%/install/rdbms/plsql.sql";
            instantiate_file ("%rdbms_dir%/install/rdbms/plsql.orc", plsql_sql);
            ui_action(plsql_inst_prompt);
             
	{ /*_LOG_MSG ( plsql_inst_prompt , Install_Log ) */ 
	  _msg = plsql_inst_prompt ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
         /*   SYSTEM("%svrmgrl% @%plsql_sql%",
                   plsql_inst_prompt, status)   */

	cmd="%Oracle_Home%/bin/svrmgrl  <<!
connect internal
@ %plsql_sql%
exit
!";
             
	{ /*_SYS ( cmd , plsql_inst_prompt ) */ 
	  _cmd = cmd ; _exe = cmd ; _com = plsql_inst_prompt ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

        }

	crsro_sql =nls("crsro_sql",
	    "Creating sro.sql Symmetric Replication table creation script");
        sro_inst_prompt =nls("sro_inst_prompt",
		"Installing Symmetric Replication package"); 
        if (registered("sro") && registered("plsql") && registered("ddbo")) 
        {
            ui_action(crsro_sql);
             
	{ /*_LOG_MSG ( crsro_sql , Install_Log ) */ 
	  _msg = crsro_sql ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
            sro_sql="%rdbms_dir%/install/rdbms/sro.sql";
            instantiate_file ("%rdbms_dir%/install/rdbms/sro.orc", sro_sql);
            ui_action(sro_inst_prompt);
             
	{ /*_LOG_MSG ( sro_inst_prompt , Install_Log ) */ 
	  _msg = sro_inst_prompt ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
          /*  SYSTEM("%svrmgrl% @%sro_sql%",
                   sro_inst_prompt, status) */

	cmd="%Oracle_Home%/bin/svrmgrl  <<!
connect internal
@ %sro_sql%
exit
!";
             
	{ /*_SYS ( cmd , sro_inst_prompt ) */ 
	  _cmd = cmd ; _exe = cmd ; _com = sro_inst_prompt ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

        }
    }

    /* After creating a new database, change system passwds */
    if ((do_db_actions && (not(do_upgrade))) && db_up_normal )
    {
        /* Change SYSTEM and SYS passwords */
         
	{ /*_ACTION ( chgpw_prompt ) */ 
	  _com = chgpw_prompt ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}
         
	{ /*_SYS ( "%rdbms_dir%/install/rdbms/chgpw.sh" , chgpw_prompt ) */ 
	  _cmd = "%rdbms_dir%/install/rdbms/chgpw.sh" ; _exe = "%rdbms_dir%/install/rdbms/chgpw.sh" ; _com = chgpw_prompt ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

        /*
         * Create Free Space table so that we'll be able to make space
         * calculations for the products that create database objects 
         * during installation.
         */
        if (For_Development)
        {
            crfreetb_sql="%Oracle_Home%/ocommon/util/crfreetb.sql";
            /* SYSTEM("%svrmgrl% @%crfreetb_sql%",
                "Creating the free space table for documentation space calcs.",
                status) */

	cmd="%Oracle_Home%/bin/svrmgrl  <<!
connect internal
@ %crfreetb_sql%
exit
!";
             
	{ /*_SYS ( cmd , "Creating the free space table for documentation space calcs." ) */ 
	  _cmd = cmd ; _exe = cmd ; _com = "Creating the free space table for documentation space calcs." ; _help = Sys_Macro_Help ; 
	  
	{ /*_LOG_SEL ( _cmd ,  _log_file ) */ 
	    _log_file = OS_Log ; 
	   if ( contains ( _cmd , "bin/sqldba" ) || contains ( _cmd , "bin/sqlplus" ) || contains ( _cmd , "bin/svrmgrl" ) || contains ( _cmd , "dbs/migrate.bsq" ) ) 
	      _log_file = Sql_Log ; 
	   if ( contains ( _cmd , "make " ) ) 
	      _log_file = Make_Log ; 
	} 
	  
	  { { /*_SYS_RETRY*/ 
	    _result = "Retry" ; 
	    _log_file = _log_file ; 
	    problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	    while ( _result == "Retry" ) { 
	      problem_holdfile = instantiate ( Sys_Macro_Holdfile ) ; 
	      modify ( "" , log_divider ( ) , _log_file ) ; 
	      modify ( "" , "Action:  %_com%" , _log_file ) ; 
	      modify ( "" , "Command: (%_cmd%), Out,Err=%_log_file%" , _log_file ) ; 
	      remove_file ( problem_holdfile ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      _stat = spawn ( _exe , problem_holdfile , problem_holdfile ) ; 
	      modify ( "" , "Status:  %_stat%" , _log_file ) ; 
	      if ( _stat != 0 ) { 
	      modify ( "" , "(( OIERR-SYS: %_cmd% ))" , _log_file ) ; 
	      } 
	      _s = _stat ; _result = "Ok" ; 
	      while ( ( _s != 0 ) || ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) ) { 
	        _result = full_retry_dialog ( instantiate ( Sys_Macro_Prompt ) , 
	  	      problem_holdfile , true , Sys_Option_Ignore , true , 
	  	      instantiate ( Sys_Macro_Content ) , instantiate ( _help ) ) ; 
	        if ( Sys_Option_ProcessDflt && ( _result == "Process" ) ) 
	          
		  { /*_SYS_PROCESS_ERROR*/ 
		    { problem_header  = instantiate ( Problem_Header_Dflt ) ; 
	  	      problem_text    = instantiate ( Sys_Macro_Prompt ) ; 
	    	      problem_action  = _com ; 
		      execute ( "problem.ins" ) ; 
		    } 
		    [ 'DEFAULT : { information_dialog ( problem_error_info , problem_error_info_content , problem_error_info_help ) ; } ] 
		  } /*End SYS_PROCESS_ERROR*/ 
	        _s = 0 ; 
	      } 
	      
	    { modify ( "" , "{" , _log_file ) ; 
	      create_file ( problem_holdfile ) ; /*To stop sed raising error*/ 
	      _pfx = "OIERR-SYS" ; if ( _result == "Ok" ) _pfx = "Ok" ; 
	      spawn ( instantiate ( "sed -e 's/^/| %%_pfx%%: /' < %%problem_holdfile%% >>%%_log_file%%" ) ) ; 
	      modify ( "" , "}" , _log_file ) ; } 
	    [ 'DEFAULT : { } ]  
	      modify ( "" , instantiate ( "Result:  %%_result%%" ) , _log_file ) ; 
	    } 
	    modify ( "" , log_divider ( ) , _log_file ) ; 
	    Sys_Option_Ignore = true ; 
	    Sys_Option_ProcessDflt = true ; 
	   } 
	   [ 'CANCEL : { modify ( "" , "Result:  Cancel" , _log_file ) ; 
	      		signal ( 'CANCEL , Sys_Macro_Cancel_Prompt ) ; } ] 
	  } /*End _SYS_RETRY*/ 
	} /*End SYS*/

        }

        /* Make sure database is up and running */
        if (not(exists(sgadef_file))) 
        {
            signal('failure, crdb_fail_prompt);
        }
        else /* successful */
        {
             
	{ /*_ACTION ( done_crdb_prompt ) */ 
	  _com = done_crdb_prompt ; 
	  ui_action ( "%_com%" ) ; 
	  
	{ /*_LOG_MSG ( "%_com%" ,  Install_Log ) */ 
	  _msg = "%_com%" ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	} 
	}

            register(product, db_created_msg);

        }
         
	{ /*_LOG_MSG ( "Leaving database actions section." , Install_Log ) */ 
	  _msg = "Leaving database actions section." ; 
	  _logfile = Install_Log ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
    }

    if (do_migrate)
    {
        if (exists(sgadef_file))
            information_dialog(migrate_done_msg);
        else 
            information_dialog(migrate_err_msg);
    }

    /* If this installation is for loading s/w && db actions (e.g.,
     * Complete SW/DB Fresh Install), AND failed to create and/or startup db, 
     * then let the user to decide whether to proceed w/ the rest 
     * of installation with s/w install only or abort installation.
     */
    if (do_load && do_db_actions && not(db_up_normal))
    {
  cont_sw_inst_only_prompt=nls("cont_sw_inst_only_prompt","Database creation appears to have failed.  Select [Yes] if you would like to continue with the installation (software only) for the rest of the selected products.  Select [No] to abort instalation.");
  cont_sw_inst_only_content=nls("cont_sw_inst_only_content","DB Failure");
  cont_sw_inst_only_help=nls("cont_sw_inst_only_help","*Database creation appears to have failed.  See log file (%Install_Log%) for diagnostics. 

You can still proceed with the installation of the remaining products, but only their software will be installed.  The database and the selected products' database objects will have to be created at a later time.  Alternately, you can abort the entire installation and retry at a later time.");

        cont_sw_inst_only=yesno_dialog(cont_sw_inst_only_prompt, cont_sw_inst_only_content, cont_sw_inst_only_help);

        /* Set the global list to indicate that DB creation/startup has 
           failed.  From this point on, when a product is installed in 
           the SW/DB Fresh install mode, only the SW install part will
           be done. */
        if (cont_sw_inst_only)
            add(DB_Startup_Failed, true);
        else
        {
             
	{ /*_SYS_ERR ( "Database creation failed, installation aborted." ) */ 
	      _com = "Database creation failed, installation aborted." ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	      modify ( "" , "Action:  %_com%" , Install_Log ) ; 
	      _line = replace ( log_divider ( ) , "-" , "" ) ; 
	      modify ( "" , log_divider ( ) , Install_Log ) ; 
	}
            signal('cancel);
         }
    }



    /* Change back to the Stage Home directory (change to default
     * directory (i.e., orainst/) in case Stage_Home is a relative path).
     */
    change_directory();
    change_directory(Stage_Home);



/* OWS needs to be called at the end as it calls sqlplus */
    
	{ /*_INSTALL_PRODUCT ( ows ) */ 
	  { 
	    _prod_bound = TRUE ; 
	    _tmp_var = product_interface_label ( ows ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : { _prod_bound = FALSE ; } ] 
	  { 
	    if ( _prod_bound ) 
	      install ( ows ) ; 
	  } 
	}
    
	{ /*_INSTALL_PRODUCT ( otrace ) */ 
	  { 
	    _prod_bound = TRUE ; 
	    _tmp_var = product_interface_label ( otrace ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : { _prod_bound = FALSE ; } ] 
	  { 
	    if ( _prod_bound ) 
	      install ( otrace ) ; 
	  } 
	}
   if(do_load)
   {
         
	{ /*_REFERENCE_PRODUCT ( ocommon , "ocommon" , product ) */ 
	  { 
	     reference ( ocommon , product ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : 
	     { 
	       _tmp_registry = registration ( "ocommon" ) ; 
	       reference ( _tmp_registry , product ) ; 
	     } 
	  ] 
	}
         
	{ /*_REFERENCE_PRODUCT ( network , "network" , product ) */ 
	  { 
	     reference ( network , product ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : 
	     { 
	       _tmp_registry = registration ( "network" ) ; 
	       reference ( _tmp_registry , product ) ; 
	     } 
	  ] 
	}
         
	{ /*_REFERENCE_PRODUCT ( svrmgr , "svrmgr" , product ) */ 
	  { 
	     reference ( svrmgr , product ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : 
	     { 
	       _tmp_registry = registration ( "svrmgr" ) ; 
	       reference ( _tmp_registry , product ) ; 
	     } 
	  ] 
	}
         
	{ /*_REFERENCE_PRODUCT ( plsql , "plsql" , product ) */ 
	  { 
	     reference ( plsql , product ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : 
	     { 
	       _tmp_registry = registration ( "plsql" ) ; 
	       reference ( _tmp_registry , product ) ; 
	     } 
	  ] 
	}
         
	{ /*_REFERENCE_PRODUCT ( ows , "owso" , product ) */ 
	  { 
	     reference ( ows , product ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : 
	     { 
	       _tmp_registry = registration ( "ows" ) ; 
	       reference ( _tmp_registry , product ) ; 
	     } 
	  ] 
	}
         
	{ /*_REFERENCE_PRODUCT ( otrace , "otrace" , product ) */ 
	  { 
	     reference ( otrace , product ) ; 
	  } 
	  [ 'UNBOUND_VARIABLE : 
	     { 
	       _tmp_registry = registration ( "otrace" ) ; 
	       reference ( _tmp_registry , product ) ; 
	     } 
	  ] 
	}
        reference(product);
   }
    
	{ /*_LOG_MSG ( "Leaving rdbms.ins" , "" ) */ 
	  _msg = "Leaving rdbms.ins" ; 
	  _logfile = "" ; 
	  if ( _logfile == "" ) 
	  { 
	    modify ( "" , ">>> %_msg%" , Install_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Sql_Log ) ; 
	    modify ( "" , ">>> %_msg%" , Make_Log ) ; 
	    modify ( "" , ">>> %_msg%" , OS_Log ) ; 
	    if ( ORCA_Debug ) 
	      modify ( "" , ">>> %_msg%" , Debug_Log ) ; 
	  } 
	  else if ( _logfile == Install_Log ) 
	    modify ( "" , "     - %_msg%" , Install_Log ) ; 
	  else if ( _logfile == Sql_Log ) 
	    modify ( "" , "     - %_msg%" , Sql_Log ) ; 
	  else if ( _logfile == Make_Log ) 
	    modify ( "" , "     - %_msg%" , Make_Log ) ; 
	  else if ( _logfile == OS_Log ) 
	    modify ( "" , "     - %_msg%" , OS_Log ) ; 
	  else if ( _logfile == Debug_Log ) 
	    if ( ORCA_Debug ) 
	      modify ( "" , "     - %_msg%" , Debub_Log ) ; 
	  else 
	    information_dialog ( "Bad Log file name" ) ; 
	}
}}
 
