sábado, 14 de enero de 2023

Changes to Databases that use mTLS Authentication (MOS Doc ID 2911553.1)


 Description:

 DigiCert retired the Organizational Unit (OU) field for all public TLS/SSL certificates to comply with industry standards as of August 2022 per their announcement: https://knowledge.digicert.com/alerts/ou-removal.html. This means that the public TLS/SSL certificates issued by DigiCert will not have the OU field anymore.

To avoid any disruptions to existing client connections, Autonomous Database will support doing DN matching based on the host property of your connection string. If you are using mTLS authentication, you must use an Oracle client library version that supports this new approach and download your wallet zip file with the new mTLS connection strings on or after January 10th, 2023 and before March 6th, 2023.

For more information and detailed instructions, see MOS Doc ID 2911553.1: https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=315341958284675&id=2911553.1&_afrWindowMode=0&_adf.ctrl-state=4hfhij8id_4

Affected service: Autonomous Database on Shared Infrastructure

miércoles, 4 de enero de 2023

Training Days 2023 Live-Virtual-Hybrid conference Feb 15-17, 2023

Training Days 2023 is one of the best Oracle Education Events of the Year. The best speakers are always there with timely information to help you in your day-to-day job. I look forward to seeing all of you at Training Days 2023!" ---Rich

Training Days 2023 Live-Virtual-Hybrid conference ((rmoug.org/Training-Days-)

Imagen

All India Oracle Users Group (AIOUG): Webinar LIVE Harnessing The Power Of OCI-Distributed CLOUD



Want to discover how to unlock the benefits of the OCI?Want to know the various options for OCI-distributed cloud? Join the session by Sai Penumuru to know all about OCI. 
 
All India Oracle Users Group (AIOUG)

 

 

Oracle ACE Spotlight: Abi Giles-Haigh

By: Oana-Aurelia (Păduraru) Bonu
Community Manager at Oracle

We're starting the year by launching the Oracle ACE Spotlight blog section - and the first interview features !

Thank you for answering our questions, Abi!
Discover our conversation from the article below ➡

https://lnkd.in/dJaKgRim

No hay descripción alternativa para esta imagen

lunes, 14 de noviembre de 2022

Invitación comunidad de Hackers de Costa Rica: El DEFCON 11506 (DC11506) presenta PWNEDCR0x5


 ¡Hola comunidad!

¡Como todos los años es costumbre en diciembre cerrar el año con el evento de Hacking más grande del país, hecho por hackers para hackers!
Este año tendremos talleres y charlas para nuevos y adentrados, así como una feria de trabajo enfocada 100% en brindar espacios y confianza de empresas que están apostando por el talento nacional en el área de la Ciberseguridad.
El evento será el sábado 3 de diciembre del 2022 en la Sede San Pedro de la Universidad Latina de Costa Rica, de 8:00am a 5pm.
Agradecemos enormemente a patrocinadores (GBM, Equifax, White Jaguars Cyber Security, CYBERSEC Cluster), así como la Universidad Latina de Costa Rica por apoyar estos espacios de aprendizaje gratuito y al Ministerio de Ciencia, Innovación, Tecnología y Telecomunicaciones (Unidad de Cooperación Internacional (MICITT).
¡Cordialmente invitados!
PD: ¿Listos para el mejor CTF del país?

domingo, 13 de noviembre de 2022

Oracle Database Enterprise Edition 19c: Restauración de un PDB a un Restore Point- Ejemplo borrado de esquema-


Es posible que no te guste ver videos y que requieras ver la parte escrita. Aquí te muestro, como hacer una restauración de un PDB, previo a la creación de puntos de restauración.

Primero que todo nos vamos a conectar a nuestro contenedor de base de datos. Para efectos de referencia, estaremos utilizando una versión 19c, con PSU 17

SQL> connect / as sysdba
Connected.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBRMAN                        READ WRITE NO
         4 SECURITY                       READ WRITE NO
         6 RESTORE_POINT                  READ WRITE NO

SQL> exit

Como puedes ver tenemos 3 PDBs creadas en nuestro contenedor. Para este ejemplo, vamos a utlizar la instancia "RESTORE_POINT".

Veamos que tenemos dentro de nuestra PDB.

[oracle@instructor-laboratorio admin]$ sqlplus hr/hr@restore_point


SQL*Plus: Release 19.0.0.0.0 - Production on Sat Nov 5 18:40:43 2022
Version 19.17.0.0.0
Copyright (c) 1982, 2022, Oracle.  All rights reserved.

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0

SQL> select * from cat;
TABLE_NAME                               TABLE_TYPE
---------------------------------------- -----------
REGIONS                                  TABLE
COUNTRIES                                TABLE
LOCATIONS                                TABLE
LOCATIONS_SEQ                            SEQUENCE
DEPARTMENTS                              TABLE
DEPARTMENTS_SEQ                          SEQUENCE
JOBS                                     TABLE
EMPLOYEES                                TABLE
EMPLOYEES_SEQ                            SEQUENCE
JOB_HISTORY                              TABLE
EMP_DETAILS_VIEW                         VIEW
11 rows selected.

SQL> select count(*) from cat;
  COUNT(*)
----------
        11
SQL> select count(*) from employees;
  COUNT(*)
----------
       107

Como haz notado tenemos el esquema de ejemplos de HR. Este es el que vamos a tomar como referencia para el ejercicio.

Vamos a conectarnos con privilegios de SYSDBA a la instancia PDB.

SQL> connect sys/oracle@restore_point as sysdba
Connected.

Una vez conectados, vamos a crear nuestro punto de restauración para recuperación.

SQL> create restore point pdb1_restore_point_created guarantee flashback database;

create restore point pdb1_restore_point_created guarantee flashback database

*
ERROR at line 1:
ORA-38784: Cannot create restore point 'PDB1_RESTORE_POINT_CREATED'.
ORA-38785: Media recovery must be enabled for guaranteed restore point.

Como acaba de observar, es necesario para poder crear un punto de restauración, que el contenedor de base de datos este en modo archivelog.

SQL> connect / as sysdba
Connected.
SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /opt/app/product/19c/dbs/arch
Oldest online log sequence     160
Current log sequence           162
SQL> shutdown immediate
Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.
Total System Global Area 1610609888 bytes
Fixed Size                  9135328 bytes
Variable Size            1056964608 bytes
Database Buffers          536870912 bytes
Redo Buffers                7639040 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL>

Listo. Con la base de datos en modo archivelog, vamos a forzar que toda transacción que se haga a nivel de base de datos, quede registrada. 

SQL> ALTER DATABASE FORCE LOGGING;

Database altered.

SQL> select force_logging from v$database;
FORCE_LOGGING
---------------------------------------
YES

Aunque ya tengamos configurada nuestra base de datos para registro forzado de nivel transaccional, es necesario validar como se encuentran los tablespaces previamente creados.
 
SQL> select force_logging from dba_tablespaces;
FOR
---
YES
YES
NO
NO
NO


SQL> select tablespace_name, force_logging from dba_tablespaces;
TABLESPACE_NAME                FOR
------------------------------ ---
SYSTEM                         YES
SYSAUX                         YES
UNDOTBS1                       NO
TEMP                           NO
USERS                          NO

Como logras observar, no todos los tablespaces, están trabajando en modo forzado de registro transaccional. En el caso del tablespace de UNDO, el modo de facto de trabajo es FORCE LOGGING. En el caso de los tablespace temporales, no trabajan con esta característica.

Cambios el modo de trabajo del tablespace USES forzando el registro transaccional para todas las operaciones. 

SQL> alter tablespace users force logging;

Tablespace altered.

SQL>  select tablespace_name, force_logging from dba_tablespaces;
TABLESPACE_NAME                FOR
------------------------------ ---
SYSTEM                         YES
SYSAUX                         YES
UNDOTBS1                       NO
TEMP                           NO
USERS                          YES

Como reiniciamos nuestro contenedor de base de datos y no hemos configurador salvar el estado OPEN de la instancias, vamos a abrir la instancia de RESTORE_POINT.
SQL> show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBRMAN                        MOUNTED
         4 SECURITY                       READ WRITE NO
         6 RESTORE_POINT                  MOUNTED

SQL> alter pluggable database RESTORE_POINT open;

Pluggable database altered.

Con la siguiente instrucción, cada vez que reiniciemos el contenedor, la PDB RESTORE_POINT, pasara siempre a modo OPEN. 

SQL> alter pluggable database RESTORE_POINT save state;

Pluggable database altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBRMAN                        MOUNTED
         4 SECURITY                       READ WRITE NO
         6 RESTORE_POINT                  READ WRITE NO

Verifiquemos el estado de los tablespace de la PDB. 

SQL> alter session set container=RESTORE_POINT;

Session altered.

SQL> select tablespace_name, force_logging from dba_tablespaces;

TABLESPACE_NAME                FOR
------------------------------ ---
SYSTEM                         YES
SYSAUX                         YES
UNDOTBS1                       NO
TEMP                           NO
USERS                          NO
TBS_DATOS                      NO
TBS_DATOS_NOSEGUROS            NO
TBS_DATOS_SEGUROS              NO

8 rows selected.

Cambiamos el modo a registro transaccional forzado en todos los tablespaces.

SQL> alter tablespace users force logging;

Tablespace altered.

SQL> alter tablespace TBS_DATOS force logging;

Tablespace altered.

SQL> alter tablespace TBS_DATOS_NOSEGUROS  force logging;

Tablespace altered.

SQL> alter tablespace TBS_DATOS_SEGUROS  force logging;

Tablespace altered.

SQL> select tablespace_name, force_logging from dba_tablespaces;

TABLESPACE_NAME                FOR
------------------------------ ---
SYSTEM                         YES
SYSAUX                         YES
UNDOTBS1                       NO
TEMP                           NO
USERS                          YES
TBS_DATOS                      YES
TBS_DATOS_NOSEGUROS            YES
TBS_DATOS_SEGUROS              YES

8 rows selected.

Ahora si, vamos a crear nuestro punto de restauración. 

SQL> SQL> show con_id
CON_ID
------------------------------
6

SQL> create restore point restore_point_pdb_create_RESTORE_POINT_db guarantee flashback database;

create restore point restore_point_pdb_create_RESTORE_POINT_db guarantee flashback database

*
ERROR at line 1:
ORA-38784: Cannot create restore point
'RESTORE_POINT_PDB_CREATE_RESTORE_POINT_DB'.
ORA-38786: Recovery area is not enabled.

Otro pre-requisito que es necesario. El área de recuperación, debe estar habilitada. En este caso, esto se resuelve dando un tamaño al parámetro DB_RECOVERY_FILE_DEST_SIZE.

SQL> connect / as sysdba

Connected.

SQL> show parameter recovery
NAME                                 TYPE        VALUE
------------------------------------ ----------- --------------------
db_recovery_file_dest                string
db_recovery_file_dest_size           big integer 0
recovery_parallelism                 integer     0
remote_recovery_file_dest            string

SQL> alter system set db_recovery_file_dest_size=50G scope=both;

System altered.

SQL> host mkdir -p /opt/app/oracle/recovery_area

SQL> alter system set db_recovery_file_dest='/opt/app/oracle/recovery_area' scope=both;

System altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     161
Next log sequence to archive   163
Current log sequence           163

SQL> alter system checkpoint;

System altered.

SQL> show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBRMAN                        MOUNTED
         4 SECURITY                       READ WRITE NO
         6 RESTORE_POINT                  READ WRITE NO

Ya tenemos todos los prerequisitos necesarios para crear nuestro punto de restauración.

SQL> alter session set container=RESTORE_POINT;
Session altered.

Como  lo vimos en el video del canal de Youtube, podemos tener dos tipos de restauración: Normales y Garantizados.

En este caso, vamos a crear un punto de restauración garantizado, en el PDB.

SQL> create restore point restore_point_pdb_create_RESTORE_POINT_db guarantee flashback database;

Restore point created.

También podríamos crear un punto de restauración conectados en el CDB para la base de datos acoplada RESTORE_POINT

SQL> connect / as sysdba
Connected.

SQL> create restore point restore_point_cdb_create_RESTORE_POINT_db for pluggable database RESTORE_POINT guarantee flashback database;

Ahora consultamos los dos puntos de restauración creados. 

SQL> @ver_restore_point.sql
NAME                                          TIME                                       SCN PDB GUA     CON_ID NAME_PDB
--------------------------------------------- ----------------------------------- ---------- --- --- ---------- ---------------
RESTORE_POINT_PDB_CREATE_RESTORE_POINT_DB     05-NOV-22 06.52.43.000000000 PM        5218861 YES YES          6 RESTORE_POINT
RESTORE_POINT_CDB_CREATE_RESTORE_POINT_DB     05-NOV-22 06.53.27.000000000 PM        5218891 YES YES          6 RESTORE_POINT

SQL> show con_id

CON_ID
------------------------------
1

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBRMAN                        MOUNTED
         4 SECURITY                       READ WRITE NO
         6 RESTORE_POINT                  READ WRITE NO

Vamos a generar el error. Vamos a borrar en el PDB el esquema de HR 

SQL> alter session set container=RESTORE_POINT;
Session altered.

SQL> drop user hr cascade;
User dropped.

Al realizar la operación, nos damos cuenta que cometimos un error.
Vamos a realizar la restauración utilizando alguno de los dos puntos creados previamente.

Primero, vamos a conectarnos al contenedor de base de datos y vamos a cerrar el PDB.

SQL> connect / as sysdba
Connected.
SQL> alter pluggable database RESTORE_POINT close;

Pluggable database altered.

SQL> @ver_restore_point.sql

NAME                                          TIME                                       SCN PDB GUA     CON_ID NAME_PDB
--------------------------------------------- ----------------------------------- ---------- --- --- ---------- ---------------
RESTORE_POINT_PDB_CREATE_RESTORE_POINT_DB     05-NOV-22 06.52.43.000000000 PM        5218861 YES YES          6 RESTORE_POINT
RESTORE_POINT_CDB_CREATE_RESTORE_POINT_DB     05-NOV-22 06.53.27.000000000 PM        5218891 YES YES          6 RESTORE_POINT

Vamos a utilizar el punto de restauración creado en el PDB, para hacer un FLASHBACK de la instancia acoplada.

SQL> flashback pluggable database RESTORE_POINT to restore point RESTORE_POINT_PDB_CREATE_RESTORE_POINT_DB;

Flashback complete.

Completado el Flashback, vamos a abrir en modo sólo lectura la PDB para verificar que el punto de restauración es el deseado y que el esquema HR, si se encuentra en el punto de restauración realizado.

SQL> alter pluggable database RESTORE_POINT open read only;

Pluggable database altered.

SQL> connect hr/hr@RESTORE_POINT
Connected.

SQL> select * from cat;
TABLE_NAME                               TABLE_TYPE
---------------------------------------- -----------
REGIONS                                  TABLE
COUNTRIES                                TABLE
LOCATIONS                                TABLE
LOCATIONS_SEQ                            SEQUENCE
DEPARTMENTS                              TABLE
DEPARTMENTS_SEQ                          SEQUENCE
JOBS                                     TABLE
EMPLOYEES                                TABLE
EMPLOYEES_SEQ                            SEQUENCE
JOB_HISTORY                              TABLE
EMP_DETAILS_VIEW                         VIEW
11 rows selected.

SQL> connect / as sysdba
Connected.

Al confirmar que el punto de restauración es el adecuado, cerramos el PDB y lo abrimos en modo de lectura y escritura, haciendo un reinicio de los redologs.

SQL> alter pluggable database RESTORE_POINT close;

Pluggable database altered.

SQL> alter pluggable database RESTORE_POINT open resetlogs;

Pluggable database altered.

Nos conectamos nuevamente a nuestra base de datos y la información esta nuevamente en su lugar.

SQL> connect hr/hr@RESTORE_POINT

Connected.

SQL> select * from cat;
TABLE_NAME                               TABLE_TYPE
---------------------------------------- -----------
REGIONS                                  TABLE
COUNTRIES                                TABLE
LOCATIONS                                TABLE
LOCATIONS_SEQ                            SEQUENCE
DEPARTMENTS                              TABLE
DEPARTMENTS_SEQ                          SEQUENCE
JOBS                                     TABLE
EMPLOYEES                                TABLE
EMPLOYEES_SEQ                            SEQUENCE
JOB_HISTORY                              TABLE
EMP_DETAILS_VIEW                         VIEW
11 rows selected.

SQL> select count(*) from employees;
  COUNT(*)
----------
       107

SQL>

Si ya no necesitamos los puntos de restauración, nos conectamos al CDB y desde ahí vamos a borrar cada uno de los puntos de restauración creados. 

SQL> connect / as sysdba
Connected.

SQL> @ver_restore_point.sql

NAME                                          TIME                                       SCN PDB GUA     CON_ID NAME_PDB
--------------------------------------------- ----------------------------------- ---------- --- --- ---------- ---------------
RESTORE_POINT_PDB_CREATE_RESTORE_POINT_DB     05-NOV-22 06.52.43.000000000 PM        5218861 YES YES          6 RESTORE_POINT
RESTORE_POINT_CDB_CREATE_RESTORE_POINT_DB     05-NOV-22 06.53.27.000000000 PM        5218891 YES YES          6 RESTORE_POINT

SQL> drop restore point "RESTORE_POINT_PDB_CREATE_RESTORE_POINT_DB" for pluggable database RESTORE_POINT;

Restore point dropped.

SQL> drop restore point "RESTORE_POINT_CDB_CREATE_RESTORE_POINT_DB" for pluggable database RESTORE_POINT;

Restore point dropped.

Ahora confirmamos que no existen puntos de restauración disponibles.

SQL> @ver_restore_point.sql
no rows selected

SQL>

Los puntos de restauración van incrementando su tamaño, según la cantidad de horas, días y semanas que permanezcan y el nivel transaccional que experimente los ambientes referenciados.

Tenga cuidado de agotar el espacio del área de recuperación, por excesivo tiempo de retención de los puntos de restauración.

Los puntos de restauración, no son parte de una estrategia de respaldos. Son parte de una estrategia temporal de DR. No debemos confundir, para que fueron creados.
 

sábado, 12 de noviembre de 2022

Oracle Linux Firewall: WARNING: AllowZoneDrifting is enabled.

Algunas versiones  del software de firewalld tenían un comportamiento no documentado conocido como "zona a la deriva". 

Esto permite que los paquetes ingresen en múltiples zonas; lo cuál es una violación de los firewalls basados en zonas. 

Sin embargo, algunos usuarios confían en este comportamiento para tener una zona "catch-al- cajón del sastre", como zona determinada.

Para deshabilitar esto en la configuración de nuestro firewall en Oracle Linux 7.x deberemos hacer lo siguiente:

Primero que todo vamos a logearnos con el usuario root al sistema operativo y vamos a ir al directorio /etc/firewalld

[opc@laboratorio ~]$ sudo -s /bin/bash
[root@laboratorio opc]# cd /etc/firewalld
[root@laboratorio firewalld]# ls -la
total 32
drwxr-x---. 7 root root 4096 May 13 00:37 .
drwxr-xr-x. 95 root root 8192 Jun 10 17:22 ..
-rw-r--r--. 1 root root 5172 May 13 00:37 direct.xml
-rw-r--r--. 1 root root 2706 Apr 27 2021 firewalld.conf
drwxr-x---. 2 root root 6 Apr 27 2021 helpers
drwxr-x---. 2 root root 6 Apr 27 2021 icmptypes
drwxr-x---. 2 root root 6 Apr 27 2021 ipsets
-rw-r--r--. 1 root root 272 Apr 27 2021 lockdown-whitelist.xml
drwxr-x---. 2 root root 6 Apr 27 2021 services
drwxr-x---. 2 root root 46 May 13 00:29 zones
[root@laboratorio firewalld]# cd zones

En dicho directorio podrás ubicar el directorio "ZONES", pero esto no tiene nada que ver con el tema. No te confundas.


[root@laboratorio zones]# ls -la
total 12

drwxr-x---. 2 root root 46 May 13 00:29 .
drwxr-x---. 7 root root 4096 May 13 00:37 ..
-rw-r--r--. 1 root root 387 Jun 10 16:24 public.xml
-rw-r--r--. 1 root root 350 Jun 10 16:23 public.xml.old

[root@laboratorio zones]# more public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas.
You do not trust the other computers on networks to not harm your computer.
Only selected incoming connections are accepted.</de
scription>
<service name="ssh"/>
<service name="dhcpv6-client"/>
<port protocol="tcp" port="22"/>
<port protocol="tcp" port="1521"/>
</zone>

Con el comando SYSTEMCTL podrás validar si la zona "Drifting" esta activada.

[root@laboratorio zones]# systemctl status firewalld
? firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-06-10 16:23:33 GMT; 5h 39min ago
Docs: man:firewalld(1)
Main PID: 31241 (firewalld)
Memory: 27.1M
CGroup: /system.slice/firewalld.service
+-31241 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
Jun 10 16:23:33 laboratorio systemd[1]: Starting firewalld - dynamic firewall daemon...
Jun 10 16:23:33 laboratorio systemd[1]: Started firewalld - dynamic firewall daemon.
Jun 10 16:23:33 laboratorio firewalld[31241]: WARNING: AllowZoneDrifting is enabled.
This is considered an insecure configuration option. It will...g it now.
Jun 10 16:24:05 laboratorio firewalld[31241]: WARNING: AllowZoneDrifting is enabled.
This is considered an insecure configuration option. It will...g it now.
Jun 10 16:28:32 laboratorio firewalld[31241]: WARNING: AllowZoneDrifting is enabled.
This is considered an insecure configuration option. It will...g it now.

En el directorio indicado, vamos a editar el archivo FIREWALLD.CONF.

[root@laboratorio firewalld]# ls -la
total 32
drwxr-x---. 7 root root 4096 May 13 00:37 .
drwxr-xr-x. 95 root root 8192 Jun 10 17:22 ..
-rw-r--r--. 1 root root 5172 May 13 00:37 direct.xml
-rw-r--r--. 1 root root 2706 Apr 27 2021 firewalld.conf
drwxr-x---. 2 root root 6 Apr 27 2021 helpers
drwxr-x---. 2 root root 6 Apr 27 2021 icmptypes
drwxr-x---. 2 root root 6 Apr 27 2021 ipsets
-rw-r--r--. 1 root root 272 Apr 27 2021 lockdown-whitelist.xml
drwxr-x---. 2 root root 6 Apr 27 2021 services
drwxr-x---. 2 root root 46 May 13 00:29 zones
[root@laboratorio firewalld]# more firewalld.conf

# firewalld config file
# default zone
# The default zone used if an empty zone string is used.
# Default: public
DefaultZone=public
# Minimal mark
# Marks up to this minimum are free for use for example in the direct
# interface. If more free marks are needed, increase the minimum
...
...

# based zones to other interfaces based zones (including the default zone).
# Possible values; "yes", "no". Defaults to "yes".

Vas a ir hasta el final del archivo y encontrarás el siguiente parámetro de configuración.

Ahí debes cambiar el valor del parámetro a "NO". No lo documentes, ya que eso no resuelve el tema.


AllowZoneDrifting=No

[root@laboratorio firewalld]# ls -la

total 32
drwxr-x---. 7 root root 4096 Jun 10 22:05 .
drwxr-xr-x. 95 root root 8192 Jun 10 17:22 ..
-rw-r--r--. 1 root root 5172 May 13 00:37 direct.xml
-rw-r--r--. 1 root root 2708 Jun 10 22:05 firewalld.conf
drwxr-x---. 2 root root 6 Apr 27 2021 helpers
drwxr-x---. 2 root root 6 Apr 27 2021 icmptypes
drwxr-x---. 2 root root 6 Apr 27 2021 ipsets
-rw-r--r--. 1 root root 272 Apr 27 2021 lockdown-whitelist.xml
drwxr-x---. 2 root root 6 Apr 27 2021 services
drwxr-x---. 2 root root 46 May 13 00:29 zones

[root@laboratorio firewalld]# vi firewalld.conf

Carga nuevamente la configuración del firewalld y reinicia.


[root@laboratorio firewalld]# systemctl reload firewalld
[root@laboratorio firewalld]# systemctl restart firewalld

Ahora puedes validar que la zona ha sido deshabilitada.

[root@laboratorio firewalld]# systemctl -l status firewalld
? firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service;
enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-06-10 22:07:33 GMT; 10s ago
Docs: man:firewalld(1)
Process: 17907 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
Main PID: 18042 (firewalld)
Memory: 22.6M
CGroup: /system.slice/firewalld.service
+-18042 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
Jun 10 22:07:33 laboratorio systemd[1]: Starting firewalld - dynamic firewall daemon...
Jun 10 22:07:33 laboratorio systemd[1]: Started firewalld - dynamic firewall daemon.
[root@laboratorio firewalld]#


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


Todos los Sábados a las 8:00PM