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









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)))