MERCADOS FINANCIEROS

lunes, 30 de noviembre de 2020

BACKUP DISKGROUP ASMCMD

Example

The first example shows the use of the backup command when run without the disk group option. This example backs up all the mounted disk groups and creates the backup image in the /scratch/backup/alldgs20100422 file. The second example creates a backup of the data disk group. The metadata backup that this example creates is saved in the /scratch/backup/data20100422 file.
Example 12-40 Using the ASMCMD md_backup command
 
ASMCMD [+] > md_backup /u01/data.bck
Disk group metadata to be backed up: DATA
Disk group metadata to be backed up: FRA
Current alias directory path: ORCL/ONLINELOG
Current alias directory path: ORCL/PARAMETERFILE
Current alias directory path: ORCL
Current alias directory path: ASM
Current alias directory path: ORCL/DATAFILE
Current alias directory path: ORCL/CONTROLFILE
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: ORCL/TEMPFILE
Current alias directory path: ORCL/ARCHIVELOG/2010_04_20
Current alias directory path: ORCL
Current alias directory path: ORCL/BACKUPSET/2010_04_21
Current alias directory path: ORCL/ARCHIVELOG/2010_04_19
Current alias directory path: ORCL/BACKUPSET/2010_04_22
Current alias directory path: ORCL/ONLINELOG
Current alias directory path: ORCL/BACKUPSET/2010_04_20
Current alias directory path: ORCL/ARCHIVELOG
Current alias directory path: ORCL/BACKUPSET
Current alias directory path: ORCL/ARCHIVELOG/2010_04_22
Current alias directory path: ORCL/DATAFILE
Current alias directory path: ORCL/CONTROLFILE
Current alias directory path: ORCL/ARCHIVELOG/2010_04_21

ASMCMD [+] > md_backup /u01/backup/ -G data
Disk group metadata to be backed up: DATA
Current alias directory path: ORCL/ONLINELOG
Current alias directory path: ASM
Current alias directory path: ORCL/CONTROLFILE
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: ORCL/PARAMETERFILE
Current alias directory path: ORCL
Current alias directory path: ORCL/DATAFILE
Current alias directory path: ORCL/TEMPFILE

md_restore

Purpose
The md_restore command restores disk groups from a metadata backup file.
Syntax and Description

md_restore backup_file [--silent]
     [--full|--nodg|--newdg -o 'old_diskgroup:new_diskgroup [,...]']
     [-S sql_script_file] [-G 'diskgroup [,diskgroup...]']
Table 12-39 describes the options for the md_restore command.
Table 12-39 Options for the md_restore command
OptionDescription
backup_fileReads the metadata information from backup_file.
--silentIgnore errors. Typically, if md_restore encounters an error, it stops. Specifying this flag ignores any errors.
--fullSpecifies to create a disk group and restore metadata.
--nodgSpecifies to restore metadata only.
--newdg -o old_diskgroup:new_diskgroup]Specifies to create a disk group with a different name when restoring metadata. The -o option is required with --newdg.
-S sql_script_fileWrite SQL commands to the specified SQL script file instead of executing the commands.
-G diskgroupSelect the disk groups to be restored. If no disk groups are defined, then all disk groups are restored.
Example

The first example restores the disk group data from the backup script and creates a copy. The second example takes an existing disk group data and restores its metadata. The third example restores disk group data completely but the new disk group that is created is named data2. The fourth example restores from the backup file after applying the overrides defined in the override.sql script file.
Example 12-41 Using the ASMCMD md_restore command
 
ASMCMD [+] > md_restore –-full –G data –-silent /scratch/backup/alldgs20100422

ASMCMD [+] > md_restore –-nodg –G data –-silent /scratch/backup/alldgs20100422

ASMCMD [+] > md_restore –-newdg -o 'data:data2' --silent /scratch/backup/data20100422

ASMCMD [+] > md_restore -S override.sql --silent /scratch/backup/data20100422

EJEMPLO BACKUP METADATA

ASMCMD> md_backup /u01/backup/backup_asm_data.bck -G DATA
Disk group metadata to be backed up: DATA
Current alias directory path: ASM
Current alias directory path: ACME
Current alias directory path: ACME/PARAMETERFILE
Current alias directory path: ACME/DATAFILE
Current alias directory path: ASM/PASSWORD
Current alias directory path: ACME/CONTROLFILE
Current alias directory path: ACME/TEMPFILE
Current alias directory path: ACME/ONLINELOG
Current alias directory path: ASM/ASMPARAMETERFILE
ASMCMD> md_backup /u01/backup/backup_asm_fra.bck -G FRA
Disk group metadata to be backed up: FRA
Current alias directory path: ACME/ARCHIVELOG/2021_05_04
Current alias directory path: ACME/ARCHIVELOG/2021_05_01
Current alias directory path: ACME/BACKUPSET
Current alias directory path: ACME/ARCHIVELOG/2021_05_03
Current alias directory path: ACME/ARCHIVELOG/2021_05_02
Current alias directory path: ACME/ARCHIVELOG
Current alias directory path: ACME/ONLINELOG
Current alias directory path: ACME/AUTOBACKUP/2021_05_07
Current alias directory path: ACME/BACKUPSET/2021_05_05
Current alias directory path: ACME/ARCHIVELOG/2021_05_06
Current alias directory path: ACME/DATAFILE
Current alias directory path: ACME/CONTROLFILE
Current alias directory path: ACME
Current alias directory path: ACME/ARCHIVELOG/2021_05_07
Current alias directory path: ACME/AUTOBACKUP
Current alias directory path: ACME/ARCHIVELOG/2021_05_05
Current alias directory path: ACME/AUTOBACKUP/2021_05_05
ASMCMD> 



RMAN CATALOG NOPROMPT

 RMAN> catalog start with 'd:\oracle\backup\DBTEST\';

searching for all files that match the pattern d:\oracle\backup\DBTEST\

List of Files Unknown to the Database
=====================================
File Name: D:\ORACLE\BACKUP\DBTEST\AUTOBACKUP\2017_11_24\O1_MF_S_960913571_F1HYPDOZ_.BKP
File Name: D:\ORACLE\BACKUP\DBTEST\AUTOBACKUP\2017_11_24\O1_MF_S_960916783_F1J1TTCV_.BKP
File Name: D:\ORACLE\BACKUP\DBTEST\AUTOBACKUP\2017_12_08\O1_MF_S_962220655_F2O6RSGH_.BKP
File Name: D:\ORACLE\BACKUP\DBTEST\BACKUPSET\2017_11_24\O1_MF_NNNDF_TAG20171124T162515_F1HYNNBX_.BKP

Do you really want to catalog the above files (enter YES or NO)?

Enter yes or use catalog start with 'd:\oracle\backup\DBTEST\

If you don’t want to get prompt for each file use noprompt

RMAN> catalog start with 'd:\oracle\backup\DBTEST\' noprompt;

using target database control file instead of recovery catalog
searching for all files that match the pattern d:\oracle\backup\DBTEST\

List of Files Unknown to the Database
=====================================
File Name: D:\ORACLE\BACKUP\DBTEST\AUTOBACKUP\2017_11_24\O1_MF_S_960913571_F1HYPDOZ_.BKP
File Name: D:\ORACLE\BACKUP\DBTEST\AUTOBACKUP\2017_11_24\O1_MF_S_960916783_F1J1TTCV_.BKP
File Name: D:\ORACLE\BACKUP\DBTEST\AUTOBACKUP\2017_12_08\O1_MF_S_962220655_F2O6RSGH_.BKP
File Name: D:\ORACLE\BACKUP\DBTEST\BACKUPSET\2017_11_24\O1_MF_NNNDF_TAG20171124T162515_F1HYNNBX_.BKP
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: D:\ORACLE\BACKUP\DBTEST\AUTOBACKUP\2017_11_24\O1_MF_S_960913571_F1HYPDOZ_.BKP
File Name: D:\ORACLE\BACKUP\DBTEST\AUTOBACKUP\2017_11_24\O1_MF_S_960916783_F1J1TTCV_.BK

RMAN change backupset until time

 RMAN> change backupset 77,78,79 keep until time 'sysdate + 40';


allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=74 device type=DISK

keep attributes for the backup are changed

backup will be obsolete on date 09-JAN-21

backup set key=77 RECID=77 STAMP=1057863668

keep attributes for the backup are changed

backup will be obsolete on date 09-JAN-21

backup set key=78 RECID=78 STAMP=1057863673

keep attributes for the backup are changed

backup will be obsolete on date 09-JAN-21

backup set key=79 RECID=79 STAMP=1057863674


RMAN> 


miércoles, 25 de noviembre de 2020

BACKUP CONTROLFILE FORMAT

RMAN>  backup current controlfile format '/u01/backup/control%U.rman';

RMAN> backup current controlfile;

SQL> alter database backup controlfile to trace as '/u01/backup/control.trc';

Database altered.


Database altered.


SQL> alter database backup controlfile to trace;

LUEGO DE EJECUTAR ESTO DEBEMOS IR A LAS VISTA V$DIAG_INFO Y CONSULTAR LA RUTA TRACE QUE ES DONDE GENERA LA COPIA

NOTA: BUSCAR X FECHA   SID_ORA_###.trc



RMAN> BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/u01/backup/controlfile.bck';

Starting backup at 21-JUL-20
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/backup/controlfile.bck tag=TAG20200721T204557 RECID=1 STAMP=1046378759
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 21-JUL-20

Starting Control File and SPFILE Autobackup at 21-JUL-20
piece handle=+FRA/ACME/AUTOBACKUP/2020_07_21/s_1046378761.298.1046378761 comment=NONE
Finished Control File and SPFILE Autobackup at 21-JUL-20




DBA_OUTSTANDING_ALERTS VER ERRORES BASE DE DATOS

select

  to_char(creation_time, 'dd-mm-yyyy hh24:mi') crt,

  instance_name,

  object_type,

  message_type,

  message_level,

  reason,

  suggested_action

from

  dba_outstanding_alerts

/


BACKUP FORMAT

 RMAN> run

2> {

3> allocate channel c1 device type disk format "/u01/backup/%U";

4> backup as backupset database;

5> }

released channel: ORA_DISK_1

allocated channel: c1

channel c1: SID=41 device type=DISK


Starting backup at 25-NOV-20

channel c1: starting full datafile backup set

channel c1: specifying datafile(s) in backup set

input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_9qwm8fym_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_9qwmbsr6_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_9qwmf6kp_.dbf

input datafile file number=00002 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_9qwmmkbr_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_htct3xg4_.dbf

input datafile file number=00006 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_9qwmf54t_.dbf

channel c1: starting piece 1 at 25-NOV-20

channel c1: finished piece 1 at 25-NOV-20

piece handle=/u01/backup/1evge66h_1_1 tag=TAG20201125T182833 comment=NONE

channel c1: backup set complete, elapsed time: 00:00:55

Finished backup at 25-NOV-20


Starting Control File and SPFILE Autobackup at 25-NOV-20

piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2020_11_25/o1_mf_s_1057429768_hvxt6s15_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 25-NOV-20

released channel: c1


RMAN> host;


[oracle@localhost ~]$ cd /u01

[oracle@localhost u01]$ cd backup/

[oracle@localhost backup]$ ls -ltr

total 2094328

-rw-r--r--. 1 oracle oinstall        879 Nov 13 21:05 hr.log

-rw-r--r--. 1 oracle oinstall      40960 Nov 13 21:05 hr.dmp

-rw-r--r--. 1 oracle oinstall          0 Nov 25 18:12 controlfile.bck

-rw-r-----. 1 oracle dba      2144542720 Nov 25 18:29 1evge66h_1_1

[oracle@localhost backup]$ date


lunes, 23 de noviembre de 2020

RMAN BACKUP NOARCHIVELOG

 SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 23 21:51:37 2020


Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to an idle instance.


SQL> startup mount;

ORACLE instance started.


Total System Global Area  835104768 bytes

Fixed Size     2293880 bytes

Variable Size   658509704 bytes

Database Buffers   171966464 bytes

Redo Buffers     2334720 bytes

Database mounted.

SQL> 

SQL> archive log list;

Database log mode        Archive Mode

Automatic archival        Enabled

Archive destination        USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     214

Next log sequence to archive   216

Current log sequence        216

SQL> 

SQL> alter database noarchivelog;


Database altered.


SQL> archive log list;

Database log mode        No Archive Mode

Automatic archival        Disabled

Archive destination        USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     214

Current log sequence        216

SQL> 

[oracle@localhost ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Mon Nov 23 21:53:14 2020

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

connected to target database: ORCL (DBID=1376021099, not open)

RMAN> backup database;

Starting backup at 23-NOV-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_9qwm8fym_.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_9qwmbsr6_.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_9qwmf6kp_.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_9qwmmkbr_.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_htct3xg4_.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_9qwmf54t_.dbf
channel ORA_DISK_1: starting piece 1 at 23-NOV-20
channel ORA_DISK_1: finished piece 1 at 23-NOV-20
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2020_11_23/o1_mf_nnndf_TAG20201123T215323_hvrxf43o_.bkp tag=TAG20201123T215323 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 23-NOV-20

Starting Control File and SPFILE Autobackup at 23-NOV-20
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2020_11_23/o1_mf_s_1057269068_hvrxgw6o_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 23-NOV-20

RMAN> 


viernes, 13 de noviembre de 2020

CONSULTA DATAFILE CON ERRORES

 SQL> startup

ORACLE instance started.


Total System Global Area  835104768 bytes

Fixed Size     2293880 bytes

Variable Size   658509704 bytes

Database Buffers   171966464 bytes

Redo Buffers     2334720 bytes

Database mounted.

ORA-01157: cannot identify/lock data file 1 - see DBWR trace file

ORA-01110: data file 1: '+DATA/ACME/DATAFILE/system.258.848598015'



SQL> select name, error from v$datafile join v$recover_file using(file#);


NAME

--------------------------------------------------------------------------------

ERROR

-----------------------------------------------------------------

+DATA/ACME/DATAFILE/system.258.848598015

FILE NOT FOUND


+DATA/ACME/DATAFILE/auditoria.269.1056056241

FILE NOT FOUND



SQL> 


miércoles, 11 de noviembre de 2020

LINUX MANEJO LVM

Agradecimientos Especiales al Ingeniero Nicolas Hernandez sin su colaboracion esta pagina no seria posible 

MANEJO LVM


a.Correr el siguiente comando:

 fdisk /dev/sdb

b. Para identificar el número de partición tecleamos p.
c. Tecleamos n para crear una nueva partición. Tecleamos p para que sea primaria.
d. Tecleamos el número de partición, dependiendo de lo que nos mostró en el paso b.
e. Tecleamos Enter dos veces.
f. Tecleamos t para cambiar el ID de la partición.
g. Tecleamos el numero para seleccionar la partición recién creada.
h. Tecleamos 8e para cambiar el Hex Code de la partición por Linux LVM
i. Con w escribimos los cambios a la table de particiones.

Luego vamos a crear el PV:

 pvcreate /dev/sdb1
pvdisplay

Ahora vamos a crear un VG asignadole ese PV creado

vgcreate vg_nombre /dev/sdb1
vgdisplay

Por ultimo vamos a crear el LV asignandole los PE libres del VG creado:

lvcreate -l+10239  -n lv_repositorio vg_nombre


Formateamos la particion:

mkfs.xfs /dev/vg_nombre/lv_repositorio

Ahora vamos a crear una partición y asignarle a esa partición el LV:

mkdir /opt/Ejemplo

Y probamos montarla:

mount -t xfs /dev/vg_nombre/lv_repositorio /opt/Ejemplo
# df -T

S.ficheros                             Tipo     bloques de 1K  Usados Disponibles Uso% Montado en

/dev/mapper/vg_nombre-lv_repositorio xfs           41918468   32928    41885540   1% /opt/Ejemplo
# df -T

S.ficheros                             Tipo     bloques de 1K  Usados Disponibles Uso% Montado en

/dev/mapper/vg_nombre-lv_repositorio xfs           41918468   32928    41885540   1% /opt/Ejemplo

Para que quede montado automáticamente  al reiniciar el servidor debemos agregar la linea correspondiente al fstab:

vi /etc/fstab
/dev/mapper/vg_nombre-lv_repositorio /opt/Ejemplo                       xfs     _netdev,noatime        1 2

Para no realizar fsck

/dev/mapper/vg_oracle-lv_oracle1_u01    /u01    xfs     defaults        0 0

Para que quede montado automáticamente  al reiniciar el servidor 

EJEMPLO

[root@localhost javier]#  pvcreate /dev/sdb1

  Physical volume "/dev/sdb1" successfully created.

[root@localhost javier]# 

[root@localhost javier]# pvdisplay

  --- Physical volume ---

  PV Name               /dev/sda2

  VG Name               ol

  PV Size               <49,00 GiB / not usable 3,00 MiB

  Allocatable           yes 

  PE Size               4,00 MiB

  Total PE              12543

  Free PE               1

  Allocated PE          12542

  PV UUID               f0aYH4-VTyS-9gy1-Y6Mo-L7gu-dDQ8-AnD1yl

   

  "/dev/sdb1" is a new physical volume of "<30,00 GiB"

  --- NEW Physical volume ---

  PV Name               /dev/sdb1

  VG Name               

  PV Size               <30,00 GiB

  Allocatable           NO

  PE Size               0   

  Total PE              0

  Free PE               0

  Allocated PE          0

  PV UUID               bsr5NQ-zX5Z-GKXt-op5A-NpIB-wqTA-zNk56h

   

[root@localhost javier]# 

[root@localhost javier]# pvs

  PV         VG Fmt  Attr PSize   PFree  

  /dev/sda2  ol lvm2 a--  <49,00g   4,00m

  /dev/sdb1     lvm2 ---  <30,00g <30,00g

[root@localhost javier]# 

[root@localhost javier]# vgcreate vg_oracle /dev/sdb1

  Volume group "vg_oracle" successfully created

[root@localhost javier]# 

[root@localhost javier]# lvcreate -l+7679 -n lv_oracle1 vg_oracle

  Logical volume "lv_oracle1" created.

[root@localhost javier]# 


[root@localhost javier]# lvremove lv_oracle1
  Volume group "lv_oracle1" not found
  Cannot process volume group lv_oracle1
[root@localhost javier]# lvs
  LV         VG        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root       ol        -wi-ao----  46,99g                                                    
  swap       ol        -wi-ao----   2,00g                                                    
  lv_oracle1 vg_oracle -wi-a----- <30,00g                                                    
[root@localhost javier]# lvremove lv_oracle1
  Volume group "lv_oracle1" not found
  Cannot process volume group lv_oracle1
[root@localhost javier]# lvremove lv_oracle1 vg_oracle
  Volume group "lv_oracle1" not found
  Cannot process volume group lv_oracle1
Do you really want to remove active logical volume vg_oracle/lv_oracle1? [y/n]: y
  Logical volume "lv_oracle1" successfully removed
[root@localhost javier]# 
[root@localhost javier]# lvcreate -l+7679 -n lv_oracle1_u01 vg_oracle
  Logical volume "lv_oracle1_u01" created.
[root@localhost javier]# 
[root@localhost javier]# 

[root@localhost javier]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg_oracle/lv_oracle1_u01
  LV Name                lv_oracle1_u01
  VG Name                vg_oracle
  LV UUID                5Q9uB6-a7Y2-mlLZ-bdlG-tZJf-NayM-S8dje8
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2020-11-11 15:45:11 -0500
  LV Status              available
  # open                 0
  LV Size                <30,00 GiB
  Current LE             7679
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:2


[root@localhost javier]# lvs
  LV             VG        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root           ol        -wi-ao----  46,99g                                                    
  swap           ol        -wi-ao----   2,00g                                                    
  lv_oracle1_u01 vg_oracle -wi-a----- <30,00g                                                    
[root@localhost javier]# 

[root@localhost javier]# mkfs.xfs /dev/vg_oracle/lv_oracle1_u01 
meta-data=/dev/vg_oracle/lv_oracle1_u01 isize=256    agcount=4, agsize=1965824 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0, sparse=0
data     =                       bsize=4096   blocks=7863296, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=3839, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@localhost javier]# 

[root@localhost /]# mkdir /u01
[root@localhost /]# df -h
S.ficheros          Tamaño Usados  Disp Uso% Montado en
devtmpfs              855M      0  855M   0% /dev
tmpfs                 871M      0  871M   0% /dev/shm
tmpfs                 871M   9,5M  862M   2% /run
tmpfs                 871M      0  871M   0% /sys/fs/cgroup
/dev/mapper/ol-root    47G    14G   34G  29% /
/dev/sda1            1014M   329M  686M  33% /boot
tmpfs                 175M    24K  175M   1% /run/user/1000
[root@localhost /]# cd /u01
[root@localhost u01]# pwd
/u01
[root@localhost u01]# cd ..
[root@localhost /]# 

[root@localhost /]# mount /dev/vg_oracle/lv_oracle1_u01 /u01

[root@localhost /]# df -hT
S.ficheros                           Tipo     Tamaño Usados  Disp Uso% Montado en
devtmpfs                             devtmpfs   855M      0  855M   0% /dev
tmpfs                                tmpfs      871M      0  871M   0% /dev/shm
tmpfs                                tmpfs      871M   9,5M  862M   2% /run
tmpfs                                tmpfs      871M      0  871M   0% /sys/fs/cgroup
/dev/mapper/ol-root                  xfs         47G    14G   34G  29% /
/dev/sda1                            xfs       1014M   329M  686M  33% /boot
tmpfs                                tmpfs      175M    24K  175M   1% /run/user/1000
/dev/mapper/vg_oracle-lv_oracle1_u01 xfs         30G    33M   30G   1% /u01


Ver el tipo de montaje

mount | grep /u01









martes, 10 de noviembre de 2020

ORACLE LINUX

SCP

scp hola.txt oracle@10.1.1.200:/u02/backup/.

scp -r Downloads/ oracle@10.1.1.200:/u02/backup/.


sudo yum install "kernel-devel-uname-r == $(uname -r)"

VERSION 7

yum list *release-el7

VERSION 8

dnf list *release-el8

ASM

https://www.oracle.com/linux/downloads/linux-asmlib-v8-downloads.html

EDITAR EL GRUP

/boot/grub2

ls -ltr grub.cfg




sábado, 7 de noviembre de 2020

VMWARE TOOLS

 Para instalar VMware Tools en un sistema operativo invitado Linux mediante el compilador:

  1. Asegúrese de que la máquina virtual Linux esté encendida.
     
  2. Si está ejecutando una interfaz gráfica de usuario, abra un shell de comandos.

    Nota: Inicie sesión como usuario raíz o utilice el comando sudo para completar cada uno de estos pasos.
     
  3.  Haga clic con el botón derecho en máquina virtual en el menú máquina virtual y, a continuación, haga clic en invitado > instalar/actualizar VMware Tools .
  4. Haga clic en OK (Aceptar).

    Nota: En algunos casos, compruebe que el dispositivo CDROM esté conectado desde la opción Editar configuración de la máquina virtual.
     
  5. Para crear un punto de montaje, ejecute:

    mkdir /mnt/cdrom
     
  6. Para montar el CDROM, ejecute:

    mount /dev/cdrom /mnt/cdrom
     
  7. Para copiar el compilador archivo tar tar en un directorio local temporal, ejecute:

    CP/mnt/cdrom/vmwaretools-n.n. versión . tar. gz/tmp/

    donde versión es la versión del paquete VMware Tools.
     
  8. Para determinar la versión de VMware Tools, ejecute:

    ls/mnt/cdrom

    se muestra una salida similar a la siguiente:

    # VMwareTools-5.0.0 -12124. tar. gz
     
  9. Para cambiar al directorio de tmp y extraer el contenido del archivo tar en un nuevo directorio denominado VMware-Tools-distrib , ejecute:

    CD/tmp
    tar-zxvf VMwareTools- versión . tar. gz

     
  10. Para cambiar el directorio a VMware-Tools-distrib y ejecutar el script vmware-install.pl PERL para instalar VMware Tools, ejecute:

    CD VMware-Tools-distrib
    ./vmware-install.pl


    notas :
    • Complete los mensajes de la pantalla para instalar el VMware Tools. Las opciones que aparecen entre corchetes son opciones predeterminadas y se pueden seleccionar pulsando Introducir .
    • Para compilar VMware Tools correctamente, necesita fuentes de kernel de gcc y de kernel de Linux proporcionadas por su distribución de Linux. Consulte la documentación de distribución de Linux para obtener más información sobre los métodos para instalar estos paquetes.
    • Es normal que la pantalla de la consola se abra en blanco durante un breve periodo de tiempo durante la instalación cuando se cambia el tamaño de la pantalla.
    • Algunas advertencias o errores son normales, como cuando no existe ningún archivo.
    • Según la distribución de Linux, es posible que el servicio de red se reinicie después de la instalación. VMware recomienda invocar este comando desde la consola de y no de forma remota.
       
  11. Si está ejecutando una interfaz gráfica de usuario, reinicie la sesión de X para que se apliquen los cambios del mouse o de los gráficos.
     
  12. Para iniciar VMware Tools en ejecución en segundo plano durante una sesión X, mediante la sesión de terminal, ejecute el comando

    /usr/bin/VMware-Toolbox &
     
  13. En función de su entorno, es posible que deba desmontar el CD-ROM. Para desmontar el CD-ROM, ejecute:

    comando umount/mnt/cdrom
     
  14. En función de su entorno, es posible que deba finalizar manualmente la instalación de la VMware Tools. Para finalizar la instalación de la VMware Tools, haga clic en máquina virtual en el menú máquina virtual y, a continuación, haga clic en invitado > end VMware Tools instalar .
     
  15. Para eliminar VMware Tools paquetes de instalación, ejecute:

    CD
    RM/tmp/VMwareTools- versión . tar. gz
    RM-RF/tmp/vmware-Tools-distrib

viernes, 6 de noviembre de 2020

DROP TABLESPACE

Examples

Dropping a Tablespace: Example The following statement drops the tbs_01 tablespace and drops all referential integrity constraints that refer to primary and unique keys inside tbs_01:

DROP TABLESPACE tbs_01 
    INCLUDING CONTENTS  

        CASCADE CONSTRAINTS;  


Deleting Operating System Files: Example 

The following example drops the tbs_02 tablespace and deletes all associated operating system data files:

DROP TABLESPACE tbs_02
   INCLUDING CONTENTS AND DATAFILES;

miércoles, 4 de noviembre de 2020

PRIVILEGIOS USUARIOS - VISTAS USUARIO


VALIDAT TODOS LOS PRIVILEGIOS DE SISTEMA.

SQL> select * from system_privilege_map 


Privilegios Otorgados

La información de los privilegios otorgados se almacena en el diccionario de datos. Estos datos son accesibles a través de las siguientes vistas del diccionario de datos:

VistaContenidos
DBA_ROLESNombres de los roles y su estado del password.
DBA_ROLES_PRIVSUsuarios a los que han sido otorgados roles.
DBA_SYS_PRIVSUsuarios a los que han sido otorgados privilegios del sistema.
DBA_TAB_PRIVSUsuarios a los que han sido otorgados privilegios sobre objetos.
DBA_COL_PRIVSUsuarios a los que han sido otorgados privilegios sobre columnas de tablas.
ROLE_ROLE_PRIVSRoles que han sido otorgados a otros roles.
ROLE_SYS_PRIVSPrivilegios de sistema que han sido otorgados a roles.
ROLE_TAB_PRIVSPrivilegios de tabla que han sido otorgados a roles.

Configuring Multi-Threaded Server

 

Setting the Initial Number of Dispatchers

The number of dispatchers started at instance startup is controlled by the DISPATCHERS attribute.


Note:

Unlike the shared servers, the number of dispatchers does not change dynamically. The number of dispatchers must be explicitly changed with the ALTER SYSTEM command. You can change the number of dispatchers in this manner up to a maximum limit specified by the MTS_MAX_DISPATCHERS parameter. See the Oracle8i Designing and Tuning for Performance for further information about this parameter. 


The appropriate number of dispatchers for each instance depends upon the performance you want from your database, the host operating system's limit on the number of connections per process, (which is operating system dependent), and the number of connections required per network protocol.

Calculating the Initial Number of Dispatchers

Once you know the number of possible connections per process for your operating system, calculate the initial number of dispatchers to create during instance startup, per network protocol, using the following formula.

number                 maximum number of concurrent sessions
of           = CEIL   (--------------------------------------------------------------------------)
dispatchers                connections per dispatcher

CEIL represents the number roundest to the next highest number.

As an example, assume that a system that has:

  • 4000 users concurrently connected via TCP/IP and supports 1,000 connections per process

  • 3000 users concurrently connected via SPX and supports 1,000 connections per process

In this case, the DISPATCHERS attribute for TCP/IP should be set to a minimum of four dispatchers and SPX should be set to a minimum of three dispatchers:

mts_dispatchers="(protocol=tcp)(dispatchers=4)(connections=1000)"
mts_dispatchers="(protocol=spx)(dispatchers=3)(connections=1000)"

Depending on performance, you may need to adjust the number of dispatchers.

Setting Dispatcher Addresses

Example 1

To force the IP address used for the dispatchers, set the following:

mts_dispatchers="(address=(protocol=tcp)(host=144.25.16.201))
(dispatchers=2)"

This starts two dispatchers that listen on HOST=144.25.16.201. Note that Net8 dynamically selects the TCP/IP port for the dispatcher.

Example 2

To force the exact location of the dispatchers, add the PORT as follows:

mts_dispatchers="(address=(protocol=tcp)
(host=144.25.16.201)(port=5000))(dispatchers=1)"
mts_dispatchers="(address=(protocol=tcp)
(host=144.25.16.201)(port=5001))(dispatchers=1)"

Note:

You can specify multiple MTS_DISPATCHERS in the initialization file, but they must be adjacent to each other.  


Enabling Connection Pooling

Connection pooling is a resource utilization feature that enables you to reduce the number of physical network connections to a dispatcher. This is achieved by sharing or pooling a set of connections among the client processes.

To configure connection pooling, set the MTS_DISPATCHERS parameter in the initialization parameter file with the POOL attribute and the following optional attributes:

Returning to the example in "Calculating the Initial Number of Dispatchers", connection pooling can be used to allow each dispatcher 1,000 connections and 4,000 sessions for TCP/IP and 3,000 sessions for SPX. This reduces the configuration to one dispatcher for each protocol, as shown in the following:

mts_dispatchers="(protocol=tcp)(dispatchers=1)(pool=on)(tick=1) (connections=1000)(sessions=4000)"

mts_dispatchers="(protocol=spx)(dispatchers=1)(pool=on)(tick=1) 
(connections=2000)"

Allocating Resources

An Oracle8i database can be represented by multiple service names. Because of this, a pool of MTS dispatchers can be allocated exclusively for clients requesting a particular service. This way, the mission critical requests may be given more resources and, thus, in effect increase their priority.

For example, the following initialization parameter file sample shows two dispatchers. The first dispatcher services requests for clients requesting sales.us.acme.com. The other dispatcher services requests for only clients requesting adminsales.us.acme.com.

service_names=sales.us.acme.com
instance_name=sales
mts_dispatchers="(protocol=tcp)" 
mts_dispatchers="(protocol=tcp)(service=adminsales.us.acme.com)" 

Using MTS on Clients

If MTS is configured and a client connection request comes when no dispatchers are registered, the requests can be handled by a dedicated server (configured in the listener.ora file). If you want a particular client to always use a dispatcher, configure (SERVER=SHARED) in the connect data portion of the connect descriptor. For example:

sales= 
(description= 
  (address=(protocol=tcp)(host=sales-server)(port= 1521))
  (connect_data=
     (service_name=sales.us.acme.com)
     (server=shared)))

martes, 27 de octubre de 2020

ORACLE LINUX REPOSITORIO

3.6 Installing Oracle Linux with Oracle Linux Yum Server Support Use the following procedure to install Oracle Linux and configure your Linux installation for security errata or bug fix updates using the Oracle Linux yum server: Obtain Oracle Linux DVDs from Oracle Store, or download Oracle Linux from the Oracle Software Delivery Cloud: Oracle Store: https://shop.oracle.com Oracle Software Delivery Cloud website: https://edelivery.oracle.com/linux Install Oracle Linux from the ISO or DVD image. Log in as root Download the yum repository file for your Linux distribution from http://yum.oracle.com/, using the instructions you can find on the Oracle Linux yum server website. For example: # cd /etc/yum.repos.d/ # wget http://yum.oracle.com/public-yum-ol6.repo Ensure that the olrelease_latest file (for example, ol6_latest for Oracle Linux 6) is enabled, as this is the repository that contains the Oracle Preinstallation RPM. (Optional) Edit the repo file to enable other repositories. For example, enable the repository ol6_UEK_latest by setting enabled=1 in the file with a text editor. Run the command yum repolist to verify the registered channels. Start a terminal session and enter the following command as root, depending on your platform. For example: Oracle Linux 6 and Oracle Linux 7: # yum install oracle-rdbms-server-12cR1-preinstall # yum install -y oracleasm # yum install -y oracleasm-support # yum install oracleasmlib /usr/sbin/oracleasm configure -i /usr/sbin/oracleasm init # yum install oracle-validated You should see output indicating that you have subscribed to the Oracle Linux channel, and that packages are being installed. For example: el5_u6_i386_base el5_u6_x86_64_patch Oracle Linux automatically creates a standard (not role-allocated) Oracle installation owner and groups, and sets up other kernel configuration settings as required for Oracle installations. After installation, run the command yum update as needed to obtain the most current security errata and bug fixes for your Oracle Linux installation.

lunes, 26 de octubre de 2020

VISTA ARCHIVOS DE TRACE V$DIAG_INFO

SQL> select name,value from v$diag_info; Diag Enabled TRUE ADR Base /u01/app/oracle ADR Home /u01/app/oracle/diag/rdbms/acme/acme Diag Trace /u01/app/oracle/diag/rdbms/acme/acme/trace Diag Alert /u01/app/oracle/diag/rdbms/acme/acme/alert Diag Incident /u01/app/oracle/diag/rdbms/acme/acme/incident Diag Cdump /u01/app/oracle/diag/rdbms/acme/acme/cdump Health Monitor /u01/app/oracle/diag/rdbms/acme/acme/hm Default Trace File /u01/app/oracle/diag/rdbms/acme/acme/trace/acme_ora_10592.trc Active Problem Count 0 Active Incident Count 0

VISTA PROCESOS V$BGPROCESS

VISTA PROCESOS V$BGPROCESS POR SISTEMA OPERATIVO CONSULTANDO LOS PROCESOS BACKGROUND [oracle@localhost ~]$ ps -fea | grep pmon oracle 3478 1 0 Oct19 ? 00:03:56 asm_pmon_+ASM oracle 3658 1 0 Oct19 ? 00:04:31 ora_pmon_acme oracle 8828 1 0 06:35 ? 00:00:00 ora_pmon_orcl oracle 9427 8795 1 07:01 pts/2 00:00:00 grep pmon [oracle@localhost ~]$ [oracle@localhost ~]$ [oracle@localhost ~]$ ps -fea | grep smon oracle 3502 1 0 Oct19 ? 00:00:40 asm_smon_+ASM oracle 3684 1 0 Oct19 ? 00:01:14 ora_smon_acme oracle 8854 1 0 06:35 ? 00:00:00 ora_smon_orcl oracle 9429 8795 0 07:01 pts/2 00:00:00 grep smon [oracle@localhost ~]$ [oracle@localhost ~]$ ps -fea | grep lgwr oracle 3498 1 0 Oct19 ? 00:00:51 asm_lgwr_+ASM oracle 3680 1 0 Oct19 ? 00:03:18 ora_lgwr_acme oracle 8850 1 0 06:35 ? 00:00:01 ora_lgwr_orcl oracle 9435 8795 0 07:01 pts/2 00:00:00 grep lgwr [oracle@localhost ~]$ [oracle@localhost ~]$ ps -fea | grep dbw0 oracle 3496 1 0 Oct19 ? 00:00:49 asm_dbw0_+ASM oracle 3678 1 0 Oct19 ? 00:02:35 ora_dbw0_acme oracle 8848 1 0 06:35 ? 00:00:00 ora_dbw0_orcl oracle 9444 8795 0 07:02 pts/2 00:00:00 grep dbw0 [oracle@localhost ~]$ ps -fea | grep reco root 3132 2931 0 Oct19 ? 00:00:00 /usr/sbin/restorecond -u oracle 3686 1 0 Oct19 ? 00:00:22 ora_reco_acme oracle 8856 1 0 06:35 ? 00:00:00 ora_reco_orcl oracle 9603 8795 0 07:10 pts/2 00:00:00 grep reco [oracle@localhost ~]$ ps -fea | grep lreg oracle 3504 1 0 Oct19 ? 00:00:53 asm_lreg_+ASM oracle 3689 1 0 Oct19 ? 00:00:55 ora_lreg_acme oracle 8858 1 0 06:35 ? 00:00:00 ora_lreg_orcl oracle 9637 8795 0 07:13 pts/2 00:00:00 grep lreg [oracle@localhost ~]$ [oracle@localhost ~]$ ps -fea | grep arc oracle 3734 1 0 Oct19 ? 00:00:32 ora_arc0_acme oracle 3736 1 0 Oct19 ? 00:00:32 ora_arc1_acme oracle 3738 1 0 Oct19 ? 00:01:20 ora_arc2_acme oracle 3740 1 0 Oct19 ? 00:00:32 ora_arc3_acme oracle 8880 1 0 06:36 ? 00:00:00 ora_arc0_orcl oracle 8882 1 0 06:36 ? 00:00:00 ora_arc1_orcl oracle 8884 1 0 06:36 ? 00:00:00 ora_arc2_orcl oracle 8888 1 0 06:36 ? 00:00:01 ora_arc3_orcl oracle 9775 8557 0 07:20 pts/1 00:00:00 grep arc [oracle@localhost ~]$

VISTAS ARCHIVOS ORACLE DBA_DATA_FILES - DBA_TEMP_FILES

SQL> desc v$controlfile; Name Null? Type ----------------------------------------- -------- ---------------------------- STATUS VARCHAR2(7) NAME VARCHAR2(513) IS_RECOVERY_DEST_FILE VARCHAR2(3) BLOCK_SIZE NUMBER FILE_SIZE_BLKS NUMBER CON_ID NUMBER SQL> desc v$log; Name Null? Type ----------------------------------------- -------- ---------------------------- GROUP# NUMBER THREAD# NUMBER SEQUENCE# NUMBER BYTES NUMBER BLOCKSIZE NUMBER MEMBERS NUMBER ARCHIVED VARCHAR2(3) STATUS VARCHAR2(16) FIRST_CHANGE# NUMBER FIRST_TIME DATE NEXT_CHANGE# NUMBER NEXT_TIME DATE CON_ID NUMBER SQL> desc v$logfile; Name Null? Type ----------------------------------------- -------- ---------------------------- GROUP# NUMBER STATUS VARCHAR2(7) TYPE VARCHAR2(7) MEMBER VARCHAR2(513) IS_RECOVERY_DEST_FILE VARCHAR2(3) CON_ID NUMBER SQL> SQL> desc dba_data_files; Name Null? Type ----------------------------------------- -------- ---------------------------- FILE_NAME VARCHAR2(513) FILE_ID NUMBER TABLESPACE_NAME VARCHAR2(30) BYTES NUMBER BLOCKS NUMBER STATUS VARCHAR2(9) RELATIVE_FNO NUMBER AUTOEXTENSIBLE VARCHAR2(3) MAXBYTES NUMBER MAXBLOCKS NUMBER INCREMENT_BY NUMBER USER_BYTES NUMBER USER_BLOCKS NUMBER ONLINE_STATUS VARCHAR2(7) SQL> desc dba_temp_files; Name Null? Type ----------------------------------------- -------- ---------------------------- FILE_NAME VARCHAR2(513) FILE_ID NUMBER TABLESPACE_NAME NOT NULL VARCHAR2(30) BYTES NUMBER BLOCKS NUMBER STATUS VARCHAR2(7) RELATIVE_FNO NUMBER AUTOEXTENSIBLE VARCHAR2(3) MAXBYTES NUMBER MAXBLOCKS NUMBER INCREMENT_BY NUMBER USER_BYTES NUMBER USER_BLOCKS NUMBER

viernes, 23 de octubre de 2020

SERVETOUTPUT ON - DBMS_OUTPUT

 SET SERVEROUTPUT ON

 
BEGIN
 Dbms_Output.Put_Line(Systimestamp);
END;
/

DB_FLASHBACK_RETENTION_TARGET

 Configuration Best Practices

  1. Set DB_FLASHBACK_RETENTION_TARGET correctly.  Set DB_FLASHBACK_RETENTION_TARGET initialization parameter to the largest value prescribed by any of the following conditions that apply:
    • To leverage flashback database to reinstate your failed primary database after Data Guard failover, for most cases set DB_FLASHBACK_RETENTION_TARGET to a minimum of 60 (minutes) to enable reinstatement of a failed primary. 
    • Consider cases where there are multiple outages (e.g. first a network outage, followed later by a primary database outage) that may result in a transport lag between primary and standby database at failover time.  For such cases set DB_FLASHBACK_RETENTION_TARGET to a value equal to the sum of 60 (mins) plus the maximum transport lag that you wish to accommodate.  This will insure that the failed primary database can be flashed back to an SCN that precedes the SCN at which the standby became primary - a requirement for primary reinstatement.
    • If using Flashback Database for fast point in time recovery from user error or logical corruptions, set DB_FLASHBACK_RETENTION_TARGET to a value equal to the farthest time in the past that you wish to be able to recover to.
    • Set Primary and Standby  DB_FLASHBACK_RETENTION_TARGET to be the same.
  2. Size Fast Recovery Area (FRA).  Ensure the fast recovery area has allocated sufficient space to accommodate flashback database flashback logs for the target retention size and for peak batch rates.  Sizing the fast recovery area is described in detail in the 10g Database Backup and Recovery Basics guide  and the 11g Database Backup and Recovery User's Guide /  12c Database Backup and Recovery User's Guide  but the general rule of thumb is the volume of flashback log generation is approximately the same order of magnitude as redo log generation.  Use the following conservative formula and approach

Target FRA = Current FRA + DB_FLASHBACK_RETENTION_TARGET x 60 x Peak Redo Rate (MB/sec)

      Example:

  • Current FRA or DB_RECOVERY_FILE_DEST_SIZE=1000G
  • Target DB_FLASHBACK_RETENTION_TARGET=360 (360 minutes)
  • From AWR:  1) Peak redo rate for OLTP workload is 3 MB/sec for database.  2)  Peak redo rate for batch workload is 30 MB/sec for database and longest duration is 4 hours.   3) worst-case redo generation size for 6 hour window is       ( 240 minutes x 30 MB/sec x 60 secs/min) +  (120 minutes x 3 MB/sec x 60 secs/min ) = 453,600 MB or approx 443 GB
  • Proposed FRA or DB_RECOVERY_FILE_DEST_SIZE= 443 GB +1000 GB = 1443 GB.

An additional method to determine fast recovery area sizing is to enable flashback database and allow the database applications to run for a short period (2-3 hours) and query V$FLASHBACK_DATABASE_STAT.ESTIMATED_FLASHBACK_SIZE.

Note that the DB_FLASHBACK_RETENTION_TARGET is a target and there is no guarantee that you can flashback the database that far.  In some cases if there is space pressure in the flash recovery area where the flashback logs are stored then the oldest flashback logs may be deleted.  For a detailed explanation of the flash recovery area deletion rules see the Database Backup and Recovery User's Guide, Maintaining the Fast Recovery Area section.  To guarantee a flashback point-in-time you must use guaranteed restore points (GRP).  With GRP, the required flashback logs will never be recycled or purged until GRP is dropped.     You can hang the database if you have a GRP and there’s insufficient space; so you need allocate more space in the FRA depending on the intended duration of the GRP.

  1. Configure sufficient I/O bandwidth for Fast Recovery Area.  Insufficient I/O bandwidth with flashback database on is usually indicated by a high occurrence of the "FLASHBACK BUF FREE BY RVWR" wait event in an Automatic Workload Repository (AWR) report for OLTP workloads and “FLASHBACK LOG FILE WRITE” latency > 30 ms for large insert operations.   In general, flashback IOs are 1 MB in size and the overall write throughput will be similar to the redo generation rate if database force logging was enabled or similar to your load rate for direct load operations.   For simplicity, configure one large shared storage GRID and configure DATA on the outer portion of the disks or LUNS and RECO (fast recovery area) on the inner portion of the disks or LUNS.
  2. Recommended LOG_BUFFER settings to give flashback database more buffer space in memory.

    Recommend to set the LOG_BUFFER to maximum value for the specific database release and platform.   
    The previous 8 MB recommendation does not work well in high throughput applications with flashback database enabled.   

    We now recommend  64 MB for 32-bit systems
                 and up to  256 MB for 64-bit systems

  3. Set _DB_FLASHBACK_LOG_MIN_SIZE = <redo log size> for any 11.2.0.2 release.   In previous releases, the initially flashback log allocations are hindered because the initial file sizes are too small which may impact primary load performance.  As of 11.2.0.3, the default min size is the redo log group size which is the prescribed best practice.    This enhancement is not available in Oracle 10g so customers may experience some additional performance overhead until DB_FLASHBACK_RETENTION_TARGET is met 

     Example:

     SQL> alter system set "_db_flashback_log_min_size"=4g;

  1. Set _DB_FLASHBACK_LOG_MIN_TOTAL_SPACE =< projected flashback size> temporarily if you want to pre-allocate flashback logs in the FRA but you must add more space to FRA beforehand.  This is normally unnecessary since Oracle will allocate flashback logs as you generate changes.   We do recommend enabling flashback database at a non-peak period especially avoiding periods immediately prior to or during your direct load operations.   You can then monitor by querying V$FLASHBACK_DATABASE_LOG.FLASHBACK_SIZE.   Setting this undocumented parameter may be useful if you want to create a guaranteed restore point or enable flashback database prior to a big load and you want to quickly pre-allocate the necessary flashback logs.    

        Example:

            SQL> alter system set "_db_flashback_log_min_size"=4g;

            SQL> alter system set "_db_flashback_log_min_total_space"=50g;

Wait 5 minutes and query “select flashback_size from V$flashback_database_log;”   Repeat until flashback target minimum size is met.  When completed unset _DB_FLASHBACK_LOG_MIN_TOTAL_SPACE.

Operational Best Practices

  1. Gather database statistics using Automatic Workload Repository (AWR), Enterprise Manager before and after enabling flashback database so you can measure the impact of enabling flashback database.
  2. Set the Enterprise Manager monitoring metric, "Recovery Area Free Space (%)" for proactive alerts of space issues with the fast recovery area.
  3. From 11.2 onward, you can enable flashback database while the database is open.  However this operation may fail and signal an error if it fails to get enough contiguous memory.  To guarantee success, you can enable flashback in mount mode.
  4. To monitor the progress of a flashback database operation you can query the V$SESSION_LONGOPS view.  An example query to monitor progress is:

     select * from v$session_longops where opname like 'Flashback%';

If more detail is required on the flashback database operation then set _FLASHBACK_VERBOSE_INFO=TRUE database parameter which will generate a detailed trace of the flashback database operation in the DIAGNOSTIC_DEST trace directory for the database

  1. When using flashback database to perform repeated tests on a test database, it is recommended to use Guaranteed Restore Points (GRP) only without explicitly turning on flashback database.  To minimize space usage and flashback performance overhead, follow this recommended approach:

Create Guaranteed Restore Point (GRP)
Execute test
loop

     Flashback database to GRP
     Open resetlogs
     Create new GRP
     Drop old GRP
     Execute test

End loop

  1. Follow the Data Guard redo apply best practices described in Best Practices for Data Guard and Active Data Guard Redo Apply Performance.
  2. Also review the 10g Database Backup and Recovery Basics guide or the 11g Release 2 Backup and Recovery User's Guide.

Performance tuning for specific application use cases