miércoles, 5 de octubre de 2022

RMAN-01009: syntax error: found "integer": expecting one of: "double-quoted-string, identifier, single-quoted-string, "

Pin en Mis Pines guardados

RMAN es para mi una de las herramientas preferidadas, sin embargo, cuando de intentar parsear un error de ejecución en un script se trata, es realmente todo un arte, saber lo que pasa.

Uno se pregunta, porque lo hicieron tan complicado.? 

 Podría ser más simple.

Hagan cuenta del siguiente script:

# Respaldo de nivel 1 Incremental Acumulativo con Utilitario RMAN
# Contiene los bloques que han cambiado desde el mas reciente respaldo de nivel 0 incremental
        sql 'alter system archive log current';
        sql "alter session set nls_date_format=''dd.mm.yyyy hh24:mi:ss''";
        RUN
        {
        configure controlfile autobackup on;
        set command id to '100011_BKAcum_Inc_level_0';
        ALLOCATE CHANNEL c1 DEVICE TYPE disk;
        ALLOCATE CHANNEL c2 DEVICE TYPE disk;
        ALLOCATE CHANNEL c3 DEVICE TYPE disk;
        ALLOCATE CHANNEL c4 DEVICE TYPE disk;
        backup incremental level 0 cumulative database tag='LEVEL NIVEL 0 100011' format '/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_%d_%T_%s_%p';
        sql 'alter system archive log current';
        backup tag 100011_ARC format '/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ARCH_%d_%T_%s_%p' archivelog all;
        backup tag 100011_CTRL current controlfile format '/DR_BCKS/rman/10.0.0.11/backup_rman/CNTRLFILE_100011_%d_%T_%s_%p_CTL';
        release channel c4;
        release channel c3;
        release channel c2;
        release channel c1;
        }
exit;

Posiblemente si lo revisan de pies a cabeza, a simple vista no encontraran nada malo.

Pero a la hora de ejecutarse, genera este error.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "integer": expecting one of: "double-quoted-string, identifier, single-quoted-string, "
RMAN-01007: at line 7 column 12 file: standard input

Ahora, estoy buscando donde tengo un "entero" y que espera una "doble comilla".

Bastante confuso en verdad el mensaje de error.

Pues es el tema te puede llevar varias minutos buscándolo y es muy posible que no lo encuentres.

En realidad lo que sucede es que en la línea del tag para el backup de los archivelogs y el controlfile, hemos iniciado el nombre del TAG con un número.

        backup tag 100011_ARC format '/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ARCH_%d_%T_%s_%p' archivelog all;
        backup tag 100011_CTRL current controlfile format '/DR_BCKS/rman/10.0.0.11/backup_rman/CNTRLFILE_100011_%d_%T_%s_%p_CTL';

Eso es lo que provoca el error. El nombre del TAG no puede iniciar con un número, tiene que ser con una letra.

# Respaldo de nivel 1 Incremental Acumulativo con Utilitario RMAN
# Contiene los bloques que han cambiado desde el mas reciente respaldo de nivel 0 incremental
        sql 'alter system archive log current';
        sql "alter session set nls_date_format=''dd.mm.yyyy hh24:mi:ss''";
        RUN
        {
        configure controlfile autobackup on;
        set command id to '100011_BKAcum_Inc_level_0';
        ALLOCATE CHANNEL c1 DEVICE TYPE disk;
        ALLOCATE CHANNEL c2 DEVICE TYPE disk;
        ALLOCATE CHANNEL c3 DEVICE TYPE disk;
        ALLOCATE CHANNEL c4 DEVICE TYPE disk;
        backup incremental level 0 cumulative database tag='LEVEL NIVEL 0 100011' format '/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_%d_%T_%s_%p';
        sql 'alter system archive log current';
        backup tag BK100011_ARC format '/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ARCH_%d_%T_%s_%p' archivelog all;
        backup tag BK100011_CTRL current controlfile format '/DR_BCKS/rman/10.0.0.11/backup_rman/CNTRLFILE_100011_%d_%T_%s_%p_CTL';
        release channel c4;
        release channel c3;
        release channel c2;
        release channel c1;
        }
exit;

Cambiamos el nombre del TAG para que inicie con letras y volvemos a correr el script y VOILA.


[oracle@migra-db scripts]$ rman target / < backup_rman_level0.rman

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Oct 5 10:41:35 2022
Version 19.6.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.

connected to target database: ORCL (DBID=40859130)

RMAN> 2> 3>
using target database control file instead of recovery catalog
sql statement: alter system archive log current

RMAN>
sql statement: alter session set nls_date_format=''dd.mm.yyyy hh24:mi:ss''

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17>
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

executing command: SET COMMAND ID

allocated channel: c1
channel c1: SID=1221 device type=DISK

allocated channel: c2
channel c2: SID=40 device type=DISK

allocated channel: c3
channel c3: SID=1193 device type=DISK

allocated channel: c4
channel c4: SID=1211 device type=DISK

Starting backup at 05-OCT-22
channel c1: starting incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00013 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/fcubsgold.280.1064825319
channel c1: starting piece 1 at 05-OCT-22
channel c2: starting incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00015 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/undotbs1.279.1065732281
channel c2: starting piece 1 at 05-OCT-22
channel c3: starting incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00010 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/undotbs1.272.1063639379
channel c3: starting piece 1 at 05-OCT-22
channel c4: starting incremental level 0 datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00017 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/fcubsgld.287.1065733587
channel c4: starting piece 1 at 05-OCT-22
channel c4: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71055_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c4: backup set complete, elapsed time: 00:04:45
channel c4: starting incremental level 0 datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00008 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/system.276.1063639361
channel c4: starting piece 1 at 05-OCT-22
channel c3: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71054_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c3: backup set complete, elapsed time: 00:07:50
channel c3: starting incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00034 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/fcubsuat_00.dbf
channel c3: starting piece 1 at 05-OCT-22
channel c4: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71056_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c4: backup set complete, elapsed time: 00:03:31
channel c4: starting incremental level 0 datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00012 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/users.275.1063639345
input datafile file number=00023 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/obdx_ias_opss.283.1069033695
input datafile file number=00030 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/obdx_iau.295.1069034919
input datafile file number=00031 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/obdx_stb.297.1069034919
input datafile file number=00032 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/obdx_wls.294.1069034921
channel c4: starting piece 1 at 05-OCT-22
channel c3: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71057_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:40
channel c3: starting incremental level 0 datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00037 name=/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/tbsIntegracionDataTestParam.dbf
input datafile file number=00009 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/sysaux.271.1063639371
input datafile file number=00014 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/fcubsmig.284.1064825423
input datafile file number=00020 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/tbs_obdx_mig_ehms.dbf
input datafile file number=00021 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/obdx_mig.dbf
channel c3: starting piece 1 at 05-OCT-22
channel c1: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71052_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c1: backup set complete, elapsed time: 00:08:36
channel c1: starting incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00022 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/obdx_audit_mig.dbf
input datafile file number=00033 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/tbs_obdx_sit_ehms.dbf
input datafile file number=00035 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/tbs_data_etl.289.1108569251
input datafile file number=00036 name=+DATA/ORCL_IAD2H4/BA8A363B8C1C7E0DE0530204000BA38F/DATAFILE/fcubsgold.300.1113398881
channel c1: starting piece 1 at 05-OCT-22
channel c1: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71060_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:25
channel c1: starting incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/ORCL_IAD2H4/DATAFILE/sysaux.262.1063638273
channel c1: starting piece 1 at 05-OCT-22
channel c2: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71053_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c2: backup set complete, elapsed time: 00:09:02
channel c2: starting incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/ORCL_IAD2H4/DATAFILE/system.261.1063638237
input datafile file number=00004 name=+DATA/ORCL_IAD2H4/DATAFILE/undotbs1.263.1063638289
channel c2: starting piece 1 at 05-OCT-22
channel c2: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71062_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:25
channel c2: starting incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00016 name=+DATA/ORCL_IAD2H4/DATAFILE/undotbs1.286.1065732343
input datafile file number=00011 name=+DATA/ORCL_IAD2H4/DATAFILE/users.274.1063639345
channel c2: starting piece 1 at 05-OCT-22
channel c2: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71063_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:03
channel c2: starting incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00006 name=+DATA/ORCL_IAD2H4/9BB009ACC6A03ABEE053B407F40A09A3/DATAFILE/sysaux.266.1063638403
channel c2: starting piece 1 at 05-OCT-22
channel c4: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71058_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c4: backup set complete, elapsed time: 00:01:16
channel c4: starting incremental level 0 datafile backup set
channel c4: specifying datafile(s) in backup set
input datafile file number=00005 name=+DATA/ORCL_IAD2H4/9BB009ACC6A03ABEE053B407F40A09A3/DATAFILE/system.265.1063638403
channel c4: starting piece 1 at 05-OCT-22
channel c1: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71061_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:46
channel c1: starting incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00007 name=+DATA/ORCL_IAD2H4/9BB009ACC6A03ABEE053B407F40A09A3/DATAFILE/undotbs1.267.1063638403
channel c1: starting piece 1 at 05-OCT-22
channel c2: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71064_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:15
channel c3: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71059_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c3: backup set complete, elapsed time: 00:01:15
channel c4: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71065_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:15
channel c1: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ACUM_LEVEL0_ORCL_20221005_71066_1 tag=LEVEL NIVEL 0 100011 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 05-OCT-22

Starting Control File and SPFILE Autobackup at 05-OCT-22
piece handle=+RECO/ORCL_IAD2H4/AUTOBACKUP/2022_10_05/s_1117277504.359.1117277505 comment=NONE
Finished Control File and SPFILE Autobackup at 05-OCT-22

sql statement: alter system archive log current

Starting backup at 05-OCT-22
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=16005 RECID=16005 STAMP=1116738170
...
input archived log thread=1 sequence=16004 RECID=16004 STAMP=1116734552
channel c4: starting piece 1 at 05-OCT-22
channel c1: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ARCH_ORCL_20221005_71068_1 tag=BK100011_ARC comment=NONE
channel c1: backup set complete, elapsed time: 00:24:42
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=16059 RECID=16059 STAMP=1116939258
...
input archived log thread=1 sequence=16112 RECID=16112 STAMP=1117047755
channel c1: starting piece 1 at 05-OCT-22
channel c2: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ARCH_ORCL_20221005_71069_1 tag=BK100011_ARC comment=NONE
channel c2: backup set complete, elapsed time: 00:24:43
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=16168 RECID=16168 STAMP=1117166572
input archived log thread=1 sequence=16169 RECID=16169 STAMP=1117170179
...
input archived log thread=1 sequence=16230 RECID=16230 STAMP=1117277513
input archived log thread=1 sequence=16231 RECID=16231 STAMP=1117277513
channel c2: starting piece 1 at 05-OCT-22
channel c3: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ARCH_ORCL_20221005_71070_1 tag=BK100011_ARC comment=NONE
channel c3: backup set complete, elapsed time: 00:24:43
channel c4: finished piece 1 at 05-OCT-22
piece handle=/DR_BCKS/rman/10.0.0.11/backup_rman/RMAN_100011_ARCH_ORCL_20221005_71071_1 tag=BK100011_ARC comment=NONE
channel c4: backup set complete, elapsed time: 00:24:42


No hay comentarios:

Publicar un comentario

Te agradezco tus comentarios. Te esperamos de vuelta.

Todos los Sábados a las 8:00PM

Optimismo para una vida Mejor

Optimismo para una vida Mejor
Noticias buenas que comentar