You are on page 1of 15

Como re-inicializar el conteo de los archivos de log ubicados en el directorio /oracle/VHP/oraarch de SAP Productivo.

1.- Primeramente realizar los siguientes pasos: srv1sap:oravhp 1> sqlplus /as sysdba SQL> shutdown immediate; SQL> startup mount; SQL> alter database backup Controlfile to trace as /oracle/VHP/re_ini.sql ; . Si no se coloca el nombre del archivo destino, este se graba en la ruta: /oracle/VHP/saptrace/usertrace. . Si se crea el archivo sin ruta, este se crea en $ORACLE_HOME/dbs SQL> alter database open; SQL> exit srv1sap:oravhp 2> cd /oracle/VHP srv1sap:oravhp 3> vi re_ini.sql 2.- Modificar el script recrea.sql tomando de acuerdo al anexo 1 3.- El anexo 2 es como debe de quedar el script re_ini.sql 4.- Luego ejecute el script re_ini.sql srv1sap:oravhp 3> sqlplus /as sysdba SQL> @re_ini.sql SQL> exit

ANEXO 1: re_ini.sql no-revisado:


Todo lo que este con color amarillo debe ser borrado: -- The following are current System-scope REDO Log Archival related -- parameters and can be included in the database initialization file. --- LOG_ARCHIVE_DEST='' -- LOG_ARCHIVE_DUPLEX_DEST='' --- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf --- DB_UNIQUE_NAME="VHP" --- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG' -- LOG_ARCHIVE_MAX_PROCESSES=2 -- STANDBY_FILE_MANAGEMENT=MANUAL -- STANDBY_ARCHIVE_DEST=?/dbs/arch -- FAL_CLIENT='' -- FAL_SERVER='' --- LOG_ARCHIVE_DEST_1='LOCATION=/oracle/VHP/oraarch/VHParch' -- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY' -- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC' -- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY' -- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME' -- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)' -- LOG_ARCHIVE_DEST_STATE_1=ENABLE

--

-- Below are two sets of SQL statements, each of which creates a new -- control file and uses it to open the database. The first set opens -- the database with the NORESETLOGS option and should be used only if -- the current versions of all online logs are available. The second -- set opens the database with the RESETLOGS option and should be used -- if online logs are unavailable. -- The appropriate set of statements can be copied from the trace into -- a script file, edited as necessary, and executed when there is a -- need to re-create the control file. ----- The following commands will create a new control file and use it -- to open the database. -- Data used by Recovery Manager will be lost. -- Additional logs may be required for media recovery of offline -- Use this only if the current versions of all online logs are -- available. Set #1. NORESETLOGS case

-- After mounting the created controlfile, the following SQL -- statement will place the database in the appropriate -- protection mode: -ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "VHP" NORESETLOGS MAXLOGFILES 255 MAXLOGMEMBERS 3 MAXDATAFILES 254 MAXINSTANCES 50 ARCHIVELOG

MAXLOGHISTORY 11685 LOGFILE GROUP 1 ( '/oracle/VHP/origlogA/log_g11m1.dbf', '/oracle/VHP/mirrlogA/log_g11m2.dbf' ) SIZE 50M, GROUP 2 ( '/oracle/VHP/origlogB/log_g12m1.dbf', '/oracle/VHP/mirrlogB/log_g12m2.dbf' ) SIZE 50M, GROUP 3 ( '/oracle/VHP/origlogA/log_g13m1.dbf', '/oracle/VHP/mirrlogA/log_g13m2.dbf' ) SIZE 50M, GROUP 4 ( '/oracle/VHP/origlogB/log_g14m1.dbf', '/oracle/VHP/mirrlogB/log_g14m2.dbf' ) SIZE 50M -- STANDBY LOGFILE

DATAFILE '/oracle/VHP/sapdata5/system_1/system.data1', '/oracle/VHP/sapdata3/undo_1/undo.data1', '/oracle/VHP/sapdata5/sysaux_1/sysaux.data1', '/oracle/VHP/sapdata1/sr3_1/sr3.data1', '/oracle/VHP/sapdata1/sr3_2/sr3.data2', '/oracle/VHP/sapdata1/sr3_3/sr3.data3', '/oracle/VHP/sapdata1/sr3_4/sr3.data4', '/oracle/VHP/sapdata1/sr3_5/sr3.data5', '/oracle/VHP/sapdata1/sr3_6/sr3.data6',

'/oracle/VHP/sapdata1/sr3_7/sr3.data7', '/oracle/VHP/sapdata1/sr3_8/sr3.data8', '/oracle/VHP/sapdata2/sr3_9/sr3.data9', '/oracle/VHP/sapdata2/sr3_10/sr3.data10', '/oracle/VHP/sapdata2/sr3_11/sr3.data11', '/oracle/VHP/sapdata2/sr3_12/sr3.data12', '/oracle/VHP/sapdata2/sr3_13/sr3.data13', '/oracle/VHP/sapdata2/sr3_14/sr3.data14', '/oracle/VHP/sapdata2/sr3_15/sr3.data15', '/oracle/VHP/sapdata2/sr3_16/sr3.data16', '/oracle/VHP/sapdata3/sr3_17/sr3.data17', '/oracle/VHP/sapdata3/sr3_18/sr3.data18', '/oracle/VHP/sapdata3/sr3_19/sr3.data19', '/oracle/VHP/sapdata3/sr3_20/sr3.data20', '/oracle/VHP/sapdata3/sr3_21/sr3.data21', '/oracle/VHP/sapdata3/sr3_22/sr3.data22', '/oracle/VHP/sapdata3/sr3_23/sr3.data23', '/oracle/VHP/sapdata3/sr3_24/sr3.data24', '/oracle/VHP/sapdata7/sr3_25/sr3.data25', '/oracle/VHP/sapdata7/sr3_26/sr3.data26', '/oracle/VHP/sapdata7/sr3_27/sr3.data27', '/oracle/VHP/sapdata7/sr3_28/sr3.data28', '/oracle/VHP/sapdata7/sr3_29/sr3.data29', '/oracle/VHP/sapdata7/sr3_30/sr3.data30', '/oracle/VHP/sapdata4/sr3700_2/sr3700.data2', '/oracle/VHP/sapdata4/sr3700_3/sr3700.data3', '/oracle/VHP/sapdata4/sr3700_4/sr3700.data4', '/oracle/VHP/sapdata4/sr3700_5/sr3700.data5', '/oracle/VHP/sapdata4/sr3700_6/sr3700.data6', '/oracle/VHP/sapdata4/sr3700_7/sr3700.data7',

'/oracle/VHP/sapdata4/sr3700_1/sr3700.data1', '/oracle/VHP/sapdata5/sr3700_9/sr3700.data9', '/oracle/VHP/sapdata5/sr3700_11/sr3700.data11', '/oracle/VHP/sapdata5/sr3700_12/sr3700.data12', '/oracle/VHP/sapdata5/sr3700_13/sr3700.data13', '/oracle/VHP/sapdata5/sr3700_14/sr3700.data14', '/oracle/VHP/sapdata5/sr3700_15/sr3700.data15', '/oracle/VHP/sapdata6/sr3700_16/sr3700.data16', '/oracle/VHP/sapdata6/sr3700_17/sr3700.data17', '/oracle/VHP/sapdata6/sr3700_18/sr3700.data18', '/oracle/VHP/sapdata6/sr3700_19/sr3700.data19', '/oracle/VHP/sapdata6/sr3700_20/sr3700.data20', '/oracle/VHP/sapdata6/sr3700_21/sr3700.data21', '/oracle/VHP/sapdata6/se3700_22/sr3700.data22', '/oracle/VHP/sapdata7/sr3700_23/sr3700.data23', '/oracle/VHP/sapdata4/sr3usr_1/sr3usr.data1', '/oracle/VHP/sapdata6/sr3usr_2/sr3usr.data2', '/oracle/VHP/sapdata4/undo_2/undo.data2', '/oracle/VHP/sapdata6/undo_3/undo.data3', '/oracle/VHP/sapdata4/sr3700_8/sr3700.data8', '/oracle/VHP/sapdata5/sr3700_10/sr3700.data10', '/oracle/VHP/sapdata7/sr3700_24/sr3700.data24' CHARACTER SET UTF8 ;

-- Commands to re-create incarnation table -- Below log names MUST be changed to existing filenames on -- disk. Any one log file from each branch can be used to -- re-create incarnation records. -- ALTER DATABASE REGISTER LOGFILE '/oracle/VHP/oraarch/VHParch1_1_670269724.dbf';

-- ALTER DATABASE REGISTER LOGFILE '/oracle/VHP/oraarch/VHParch1_1_670269994.dbf'; -- Recovery is required if any of the datafiles are restored backups, -- or if the last shutdown was not normal or immediate. RECOVER DATABASE

-- All logs need archiving and a log switch is needed. ALTER SYSTEM ARCHIVE LOG ALL;

-- Database can now be opened normally. ALTER DATABASE OPEN;

-- Commands to add tempfiles to temporary tablespaces. -- Online tempfiles have complete space information. -- Other tempfiles may require adjustment. ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata5/temp_1/temp.data1' SIZE 1048576000 REUSE AUTOEXTEND OFF;

ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata6/temp_2/temp.data2' SIZE 1048576000 REUSE AUTOEXTEND OFF;

ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata7/temp_3/temp.data3' SIZE 1048576000 REUSE AUTOEXTEND OFF;

-- End of tempfile additions. ----- The following commands will create a new control file and use it -- to open the database. -- Data used by Recovery Manager will be lost. -- The contents of online logs will be lost and all backups will Set #2. RESETLOGS case

-- be invalidated. Use this only if online logs are damaged.

-- After mounting the created controlfile, the following SQL -- statement will place the database in the appropriate -- protection mode: -ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "VHP" RESETLOGS MAXLOGFILES 255 MAXLOGMEMBERS 3 MAXDATAFILES 254 MAXINSTANCES 50 MAXLOGHISTORY 11685 LOGFILE GROUP 1 ( '/oracle/VHP/origlogA/log_g11m1.dbf', '/oracle/VHP/mirrlogA/log_g11m2.dbf' ) SIZE 50M, GROUP 2 ( '/oracle/VHP/origlogB/log_g12m1.dbf', '/oracle/VHP/mirrlogB/log_g12m2.dbf' ) SIZE 50M, GROUP 3 ( '/oracle/VHP/origlogA/log_g13m1.dbf', '/oracle/VHP/mirrlogA/log_g13m2.dbf' ) SIZE 50M, GROUP 4 ( '/oracle/VHP/origlogB/log_g14m1.dbf', '/oracle/VHP/mirrlogB/log_g14m2.dbf' ARCHIVELOG

) SIZE 50M -- STANDBY LOGFILE

DATAFILE '/oracle/VHP/sapdata5/system_1/system.data1', '/oracle/VHP/sapdata3/undo_1/undo.data1', '/oracle/VHP/sapdata5/sysaux_1/sysaux.data1', '/oracle/VHP/sapdata1/sr3_1/sr3.data1', '/oracle/VHP/sapdata1/sr3_2/sr3.data2', '/oracle/VHP/sapdata1/sr3_3/sr3.data3', '/oracle/VHP/sapdata1/sr3_4/sr3.data4', '/oracle/VHP/sapdata1/sr3_5/sr3.data5', '/oracle/VHP/sapdata1/sr3_6/sr3.data6', '/oracle/VHP/sapdata1/sr3_7/sr3.data7', '/oracle/VHP/sapdata1/sr3_8/sr3.data8', '/oracle/VHP/sapdata2/sr3_9/sr3.data9', '/oracle/VHP/sapdata2/sr3_10/sr3.data10', '/oracle/VHP/sapdata2/sr3_11/sr3.data11', '/oracle/VHP/sapdata2/sr3_12/sr3.data12', '/oracle/VHP/sapdata2/sr3_13/sr3.data13', '/oracle/VHP/sapdata2/sr3_14/sr3.data14', '/oracle/VHP/sapdata2/sr3_15/sr3.data15', '/oracle/VHP/sapdata2/sr3_16/sr3.data16', '/oracle/VHP/sapdata3/sr3_17/sr3.data17', '/oracle/VHP/sapdata3/sr3_18/sr3.data18', '/oracle/VHP/sapdata3/sr3_19/sr3.data19', '/oracle/VHP/sapdata3/sr3_20/sr3.data20', '/oracle/VHP/sapdata3/sr3_21/sr3.data21', '/oracle/VHP/sapdata3/sr3_22/sr3.data22', '/oracle/VHP/sapdata3/sr3_23/sr3.data23',

'/oracle/VHP/sapdata3/sr3_24/sr3.data24', '/oracle/VHP/sapdata7/sr3_25/sr3.data25', '/oracle/VHP/sapdata7/sr3_26/sr3.data26', '/oracle/VHP/sapdata7/sr3_27/sr3.data27', '/oracle/VHP/sapdata7/sr3_28/sr3.data28', '/oracle/VHP/sapdata7/sr3_29/sr3.data29', '/oracle/VHP/sapdata7/sr3_30/sr3.data30', '/oracle/VHP/sapdata4/sr3700_2/sr3700.data2', '/oracle/VHP/sapdata4/sr3700_3/sr3700.data3', '/oracle/VHP/sapdata4/sr3700_4/sr3700.data4', '/oracle/VHP/sapdata4/sr3700_5/sr3700.data5', '/oracle/VHP/sapdata4/sr3700_6/sr3700.data6', '/oracle/VHP/sapdata4/sr3700_7/sr3700.data7', '/oracle/VHP/sapdata4/sr3700_1/sr3700.data1', '/oracle/VHP/sapdata5/sr3700_9/sr3700.data9', '/oracle/VHP/sapdata5/sr3700_11/sr3700.data11', '/oracle/VHP/sapdata5/sr3700_12/sr3700.data12', '/oracle/VHP/sapdata5/sr3700_13/sr3700.data13', '/oracle/VHP/sapdata5/sr3700_14/sr3700.data14', '/oracle/VHP/sapdata5/sr3700_15/sr3700.data15', '/oracle/VHP/sapdata6/sr3700_16/sr3700.data16', '/oracle/VHP/sapdata6/sr3700_17/sr3700.data17', '/oracle/VHP/sapdata6/sr3700_18/sr3700.data18', '/oracle/VHP/sapdata6/sr3700_19/sr3700.data19', '/oracle/VHP/sapdata6/sr3700_20/sr3700.data20', '/oracle/VHP/sapdata6/sr3700_21/sr3700.data21', '/oracle/VHP/sapdata6/se3700_22/sr3700.data22', '/oracle/VHP/sapdata7/sr3700_23/sr3700.data23', '/oracle/VHP/sapdata4/sr3usr_1/sr3usr.data1', '/oracle/VHP/sapdata6/sr3usr_2/sr3usr.data2',

'/oracle/VHP/sapdata4/undo_2/undo.data2', '/oracle/VHP/sapdata6/undo_3/undo.data3', '/oracle/VHP/sapdata4/sr3700_8/sr3700.data8', '/oracle/VHP/sapdata5/sr3700_10/sr3700.data10', '/oracle/VHP/sapdata7/sr3700_24/sr3700.data24' CHARACTER SET UTF8 ;

-- Commands to re-create incarnation table -- Below log names MUST be changed to existing filenames on -- disk. Any one log file from each branch can be used to -- re-create incarnation records. -- ALTER DATABASE REGISTER LOGFILE '/oracle/VHP/oraarch/VHParch1_1_670269724.dbf'; -- ALTER DATABASE REGISTER LOGFILE '/oracle/VHP/oraarch/VHParch1_1_670269994.dbf'; -- Recovery is required if any of the datafiles are restored backups, -- or if the last shutdown was not normal or immediate. RECOVER DATABASE USING BACKUP CONTROLFILE -- Database can now be opened zeroing the online logs. ALTER DATABASE OPEN RESETLOGS; -- Commands to add tempfiles to temporary tablespaces. -- Online tempfiles have complete space information. -- Other tempfiles may require adjustment. ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata5/temp_1/temp.data1' SIZE 1048576000 REUSE AUTOEXTEND OFF;

ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata6/temp_2/temp.data2' SIZE 1048576000 REUSE AUTOEXTEND OFF;

ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata7/temp_3/temp.data3' SIZE 1048576000 REUSE AUTOEXTEND OFF;

-- End of tempfile additions.

ANEXO 2 re_ini.sql revisado:


STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "VHP" RESETLOGS MAXLOGFILES 255 MAXLOGMEMBERS 3 MAXDATAFILES 254 MAXINSTANCES 50 MAXLOGHISTORY 11680 LOGFILE GROUP 1 ( '/oracle/VHP/origlogA/log_g11m1.dbf', '/oracle/VHP/mirrlogA/log_g11m2.dbf' ) SIZE 50M, GROUP 2 ( '/oracle/VHP/origlogB/log_g12m1.dbf', '/oracle/VHP/mirrlogB/log_g12m2.dbf' ) SIZE 50M, GROUP 3 ( '/oracle/VHP/origlogA/log_g13m1.dbf', '/oracle/VHP/mirrlogA/log_g13m2.dbf' ) SIZE 50M, GROUP 4 ( '/oracle/VHP/origlogB/log_g14m1.dbf', '/oracle/VHP/mirrlogB/log_g14m2.dbf' ) SIZE 50M -- STANDBY LOGFILE ARCHIVELOG

DATAFILE '/oracle/VHP/sapdata5/system_1/system.data1', '/oracle/VHP/sapdata3/undo_1/undo.data1', '/oracle/VHP/sapdata5/sysaux_1/sysaux.data1', '/oracle/VHP/sapdata1/sr3_1/sr3.data1', '/oracle/VHP/sapdata1/sr3_2/sr3.data2', '/oracle/VHP/sapdata1/sr3_3/sr3.data3', '/oracle/VHP/sapdata1/sr3_4/sr3.data4', '/oracle/VHP/sapdata1/sr3_5/sr3.data5', '/oracle/VHP/sapdata1/sr3_6/sr3.data6', '/oracle/VHP/sapdata1/sr3_7/sr3.data7', '/oracle/VHP/sapdata1/sr3_8/sr3.data8', '/oracle/VHP/sapdata2/sr3_9/sr3.data9', '/oracle/VHP/sapdata2/sr3_10/sr3.data10', '/oracle/VHP/sapdata2/sr3_11/sr3.data11', '/oracle/VHP/sapdata2/sr3_12/sr3.data12', '/oracle/VHP/sapdata2/sr3_13/sr3.data13', '/oracle/VHP/sapdata2/sr3_14/sr3.data14', '/oracle/VHP/sapdata2/sr3_15/sr3.data15', '/oracle/VHP/sapdata2/sr3_16/sr3.data16', '/oracle/VHP/sapdata3/sr3_17/sr3.data17', '/oracle/VHP/sapdata3/sr3_18/sr3.data18', '/oracle/VHP/sapdata3/sr3_19/sr3.data19', '/oracle/VHP/sapdata3/sr3_20/sr3.data20', '/oracle/VHP/sapdata3/sr3_21/sr3.data21', '/oracle/VHP/sapdata3/sr3_22/sr3.data22', '/oracle/VHP/sapdata3/sr3_23/sr3.data23', '/oracle/VHP/sapdata3/sr3_24/sr3.data24', '/oracle/VHP/sapdata7/sr3_25/sr3.data25',

'/oracle/VHP/sapdata7/sr3_26/sr3.data26', '/oracle/VHP/sapdata7/sr3_27/sr3.data27', '/oracle/VHP/sapdata7/sr3_28/sr3.data28', '/oracle/VHP/sapdata7/sr3_29/sr3.data29', '/oracle/VHP/sapdata7/sr3_30/sr3.data30', '/oracle/VHP/sapdata4/sr3700_2/sr3700.data2', '/oracle/VHP/sapdata4/sr3700_3/sr3700.data3', '/oracle/VHP/sapdata4/sr3700_4/sr3700.data4', '/oracle/VHP/sapdata4/sr3700_5/sr3700.data5', '/oracle/VHP/sapdata4/sr3700_6/sr3700.data6', '/oracle/VHP/sapdata4/sr3700_7/sr3700.data7', '/oracle/VHP/sapdata4/sr3700_1/sr3700.data1', '/oracle/VHP/sapdata5/sr3700_9/sr3700.data9', '/oracle/VHP/sapdata5/sr3700_11/sr3700.data11', '/oracle/VHP/sapdata5/sr3700_12/sr3700.data12', '/oracle/VHP/sapdata5/sr3700_13/sr3700.data13', '/oracle/VHP/sapdata5/sr3700_14/sr3700.data14', '/oracle/VHP/sapdata5/sr3700_15/sr3700.data15', '/oracle/VHP/sapdata6/sr3700_16/sr3700.data16', '/oracle/VHP/sapdata6/sr3700_17/sr3700.data17', '/oracle/VHP/sapdata6/sr3700_18/sr3700.data18', '/oracle/VHP/sapdata6/sr3700_19/sr3700.data19', '/oracle/VHP/sapdata6/sr3700_20/sr3700.data20', '/oracle/VHP/sapdata6/sr3700_21/sr3700.data21', '/oracle/VHP/sapdata6/se3700_22/sr3700.data22', '/oracle/VHP/sapdata7/sr3700_23/sr3700.data23', '/oracle/VHP/sapdata4/sr3usr_1/sr3usr.data1', '/oracle/VHP/sapdata6/sr3usr_2/sr3usr.data2', '/oracle/VHP/sapdata4/undo_2/undo.data2',

'/oracle/VHP/sapdata6/undo_3/undo.data3', '/oracle/VHP/sapdata4/sr3700_8/sr3700.data8', '/oracle/VHP/sapdata5/sr3700_10/sr3700.data10', '/oracle/VHP/sapdata7/sr3700_24/sr3700.data24' CHARACTER SET UTF8 ; ALTER DATABASE OPEN RESETLOGS; ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata7/temp_3/temp.data3' REUSE; ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata6/temp_2/temp.data2' REUSE; ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/VHP/sapdata5/temp_1/temp.data1' REUSE;