Cuando se instala la infraestructura del GRID para un servidor independiente , la Red de Oracle Listener es iniciada desde su directorio de instalación de software, conocido como < Grid_home > . Se requiere un Listener que se ejecute a partir de esta instalación de software para proporcionar capacidades de conexión a la instancia ASM . Esto también se utiliza por defecto para escuchar en todas las instancias de base de datos que están instalados en el mismo servidor.
cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = dbtest) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/grid) (SID_NAME = dbtest) ) (SID_DESC = (GLOBAL_DBNAME = orcl) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/grid) (SID_NAME = orcl) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) ) ADR_BASE_LISTENER = /u01/app/oracle ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON
cat sqlnet.ora # sqlnet.ora
Network Configuration File: /u01/app/oracle/product/11.2.0/grid/network/admin/sqlnet.ora # Generated by Oracle configuration tools. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) ADR_BASE = /u01/app/oracle
$ORACLE_HOME/u01/app/oracle/product/11.2.0/dbhome_1/network/admin
cat listener.ora # listener3342170619141601331.ora Network Configuration File: /tmp/listener3342170619141601331.ora # Generated by Oracle configuration tools. LISTENER_DBTEST = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522)) ) ) ) #LISTENER.ORA Network Configuration File #Created by Oracle Enterprise Manager Clone Database tool SID_LIST_LISTENER_DBTEST = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = dbtest) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1) (SID_NAME = dbtest) ) )
cat sqlnet.ora #SQLNET.ORA Network Configuration File #Created by Oracle Enterprise Manager Clone Database tool
martes, 25 de noviembre de 2014
domingo, 23 de noviembre de 2014
Creando una base de datos manualmente
Creando una base de datos manualmente en linux
export ORACLE_SID=dbtest
en linux/unix se crea en la carpeta
$ORACLE_HOME/dbs
cat initdbtest.ora
##############################################################################
# Example INIT$ORACLE_SID.ORA file
#
# This file is provided by Oracle Corporation to help you start by providing
# a starting point to customize your RDBMS installation for your site.
#
# NOTE: The values that are used in this file are only intended to be used
# as a starting point. You may want to adjust/tune those values to your
# specific hardware and needs. You may also consider using Database
# Configuration Assistant tool (DBCA) to create INIT file and to size your
# initial set of tablespaces based on the user input.
###############################################################################
# Change '<ORACLE_BASE>' to point to the oracle base (the one you specify at
# install time)
db_name='dbtest'
memory_target=1G
processes = 150
audit_file_dest='/u01/app/oracle/admin/dbtest/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_create_file_dest=+DATA
db_recovery_file_dest=+FRA
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app/oracle'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files='+DATA','+FRA'
mkdir /u01/app/oracle/admin/dbtest/adump
En caso de que se utilice Oracle Managed Files se debe definir el parametro
db_create_file_dest=+DATA en el archivo de parametros de inicialización para poder simplificar el trabajo de la siguiente manera.
SQL> CREATE DATABASE dbtest
USER SYS IDENTIFIED BY oracle_4U
USER SYSTEM IDENTIFIED BY oracle_4U
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp
UNDO TABLESPACE undotbs1
DEFAULT TABLESPACE users;
Database created.
https://docs.oracle.com/cd/B28359_01/server.111/b28310/create003.htm#ADMIN11073
- Establecer el ORACLE_SID
export ORACLE_SID=dbtest
- Crear el archivo de parametros de inicialización
en linux/unix se crea en la carpeta
$ORACLE_HOME/dbs
cat initdbtest.ora
##############################################################################
# Example INIT$ORACLE_SID.ORA file
#
# This file is provided by Oracle Corporation to help you start by providing
# a starting point to customize your RDBMS installation for your site.
#
# NOTE: The values that are used in this file are only intended to be used
# as a starting point. You may want to adjust/tune those values to your
# specific hardware and needs. You may also consider using Database
# Configuration Assistant tool (DBCA) to create INIT file and to size your
# initial set of tablespaces based on the user input.
###############################################################################
# Change '<ORACLE_BASE>' to point to the oracle base (the one you specify at
# install time)
db_name='dbtest'
memory_target=1G
processes = 150
audit_file_dest='/u01/app/oracle/admin/dbtest/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_create_file_dest=+DATA
db_recovery_file_dest=+FRA
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app/oracle'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files='+DATA','+FRA'
- Crear el directorio audit_file_dest
mkdir /u01/app/oracle/admin/dbtest/adump
- Iniciar la instancia
En caso de que se utilice Oracle Managed Files se debe definir el parametro
db_create_file_dest=+DATA en el archivo de parametros de inicialización para poder simplificar el trabajo de la siguiente manera.
SQL> CREATE DATABASE dbtest
USER SYS IDENTIFIED BY oracle_4U
USER SYSTEM IDENTIFIED BY oracle_4U
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp
UNDO TABLESPACE undotbs1
DEFAULT TABLESPACE users;
Database created.
https://docs.oracle.com/cd/B28359_01/server.111/b28310/create003.htm#ADMIN11073
viernes, 21 de noviembre de 2014
ASM
connect sys as sysasm;
CREATE DISKGROUP FRA
EXTERNAL REDUNDANCY
DISK '/dev/oracleasm/disks/ASM5'
NAME ASM5;
ALTER DISKGROUP FRA
ADD DISK '/dev/oracleasm/disks/ASM6' NAME ASM6;
select group_number,disk_number,mode_status,name
from v$asm_disk;
SELECT *
FROM V$ASM_OPERATION;
create diskgroup fra external redundancy
disk '/dev/oracleasm/disks/ASM5' NAME FRA001
disk '/dev/oracleasm/disks/ASM6' NAME FRA002
disk '/dev/oracleasm/disks/ASM7' NAME FRA003
disk '/dev/oracleasm/disks/ASM8' NAME FRA004
ATTRIBUTE 'au_size'='4M',
'compatible.asm'='11.2',
'compatible.rdbms'='11.2';
http://www.dbajunior.com/create-asm-disk-groups/
CREATE DISKGROUP FRA
EXTERNAL REDUNDANCY
DISK '/dev/oracleasm/disks/ASM5'
NAME ASM5;
ALTER DISKGROUP FRA
ADD DISK '/dev/oracleasm/disks/ASM6' NAME ASM6;
select group_number,disk_number,mode_status,name
from v$asm_disk;
SELECT *
FROM V$ASM_OPERATION;
create diskgroup fra external redundancy
disk '/dev/oracleasm/disks/ASM5' NAME FRA001
disk '/dev/oracleasm/disks/ASM6' NAME FRA002
disk '/dev/oracleasm/disks/ASM7' NAME FRA003
disk '/dev/oracleasm/disks/ASM8' NAME FRA004
ATTRIBUTE 'au_size'='4M',
'compatible.asm'='11.2',
'compatible.rdbms'='11.2';
http://www.dbajunior.com/create-asm-disk-groups/
Oracle Label Security
Oracle Label Security ofrece la solución más avanzada y flexible de clasificación de datos en la industria, permitiendo a la base de datos de Oracle saber inherentemente la sensibilidad de los datos consolidados de múltiples bases de datos. Oracle Label Security proporciona la capacidad de definir las etiquetas de datos, asignar etiquetas de usuarios y proteger información confidencial de aplicaciones dentro de la base de datos Oracle.
Las políticas de seguridad de Oracle label proporcionan la capacidad de definir las etiquetas de datos personalizados para casi cualquier industria que van de la asistencia sanitaria a la aplicación de la ley. Opciones de aplicación flexibles permiten al control de acceso que sea finamente sintonizado.
Gestión de políticas de seguridad de etiqueta de Oracle se puede realizar utilizando Oracle
Encargado de la empresa y la integración con Oracle Identity Management proporciona una gestión centralizado de la empresa.
Las políticas de seguridad de Oracle label proporcionan la capacidad de definir las etiquetas de datos personalizados para casi cualquier industria que van de la asistencia sanitaria a la aplicación de la ley. Opciones de aplicación flexibles permiten al control de acceso que sea finamente sintonizado.
Gestión de políticas de seguridad de etiqueta de Oracle se puede realizar utilizando Oracle
Encargado de la empresa y la integración con Oracle Identity Management proporciona una gestión centralizado de la empresa.
martes, 11 de noviembre de 2014
Mantenimiento de la base de datos
Objetivos
Después de completar esta lección , usted debería ser capaz de :
• Manejar las estadísticas del optimizador
• Manejo del repositorio del repositorio automático de la carga de trabajo ( AWR )
lunes, 10 de noviembre de 2014
Automatic Tuning Optimizer
Cuando las sentencias SQL son ejecutadas por la base de datos Oracle, el optimizador de consultas es utilizado para generar los planes de ejecución
en dos modos: un modo normal y un modo de afinación.
En modo normal, el optimizador compila el codigo SQL y genera un plan de ejecución. El modo normal del optimizador genera un plan razonable de ejecución para la mayoría de sentencias SQL. Bajo modo normal, el optimizador opera con restricciones muy estrictas, generalmente una fracción de segundo, durante la cual debe encontrar un buen plan de ejecución.
En modo de afinación, el optimizador realiza un analisis adicional para revisar sí el plan de ejecución producido bajo modo normal puede ser mejorado aún más. La salida del optimizador de consultas no es un plan de ejecución, sino una serie de acciones, junto con sus beneficio racionales y esperados para producir un plan significativamente superior. Cuando se ejecuta en modo de afinación, el optimizador es referido como Automatic Tuning Optimizer.
Bajo modo de afinación, el optimizador puede tomar varios minutos para afinar un sentencia unica. Consume una gran cantidad de recursos y tiempo invocar el Automatic Tuning Optimizer cada vez que una sentencia tiene que ser analizada. El Automatic Tuning Optimizer esta destinado a ser utilizado con sentencias SQL de alta carga de trabajo que no tienen un impacto trivial en el sistema entero. El Automatic Database Diagnostic Monitor (ADDM) identifica proactivamente las sentencias SQL con alta carga de trabajo las cuales son buenas candidatas para el afinador de SQL. Cuando las sentencias SQL son ejecutadas por la base de datos Oracle, el optimizador de consultas es utilizado para generar los planes de ejecución
en dos modos: un modo normal y un modo de afinación.
En modo normal, el optimizador compila el codigo SQL y genera un plan de ejecución. El modo normal del optimizador genera un plan razonable de ejecución para la mayoría de sentencias SQL. Bajo modo normal, el optimizador opera con restricciones muy estrictas, generalmente una fracción de segundo, durante la cual debe encontrar un buen plan de ejecución.
En modo de afinación, el optimizador realiza un analisis adicional para revisar sí el plan de ejecución producido bajo modo normal puede ser mejorado aún más. La salida del optimizador de consultas no es un plan de ejecución, sino una serie de acciones, junto con sus beneficio racionales y esperados para producir un plan significativamente superior. Cuando se ejecuta en modo de afinación, el optimizador es referido como Automatic Tuning Optimizer.
Bajo modo de afinación, el optimizador puede tomar varios minutos para afinar un sentencia unica. Consume una gran cantidad de recursos y tiempo invocar el Automatic Tuning Optimizer cada vez que una sentencia tiene que ser analizada. El Automatic Tuning Optimizer esta destinado a ser utilizado con sentencias SQL de alta carga de trabajo que no tienen un impacto trivial en el sistema entero. El Automatic Database Diagnostic Monitor (ADDM) identifica proactivamente las sentencias SQL con alta carga de trabajo las cuales son buenas candidatas para el afinador de SQL.
https://docs.oracle.com/cd/B28359_01/server.111/b28274/sql_tune.htm#PFGRF02604
en dos modos: un modo normal y un modo de afinación.
En modo normal, el optimizador compila el codigo SQL y genera un plan de ejecución. El modo normal del optimizador genera un plan razonable de ejecución para la mayoría de sentencias SQL. Bajo modo normal, el optimizador opera con restricciones muy estrictas, generalmente una fracción de segundo, durante la cual debe encontrar un buen plan de ejecución.
En modo de afinación, el optimizador realiza un analisis adicional para revisar sí el plan de ejecución producido bajo modo normal puede ser mejorado aún más. La salida del optimizador de consultas no es un plan de ejecución, sino una serie de acciones, junto con sus beneficio racionales y esperados para producir un plan significativamente superior. Cuando se ejecuta en modo de afinación, el optimizador es referido como Automatic Tuning Optimizer.
Bajo modo de afinación, el optimizador puede tomar varios minutos para afinar un sentencia unica. Consume una gran cantidad de recursos y tiempo invocar el Automatic Tuning Optimizer cada vez que una sentencia tiene que ser analizada. El Automatic Tuning Optimizer esta destinado a ser utilizado con sentencias SQL de alta carga de trabajo que no tienen un impacto trivial en el sistema entero. El Automatic Database Diagnostic Monitor (ADDM) identifica proactivamente las sentencias SQL con alta carga de trabajo las cuales son buenas candidatas para el afinador de SQL. Cuando las sentencias SQL son ejecutadas por la base de datos Oracle, el optimizador de consultas es utilizado para generar los planes de ejecución
en dos modos: un modo normal y un modo de afinación.
En modo normal, el optimizador compila el codigo SQL y genera un plan de ejecución. El modo normal del optimizador genera un plan razonable de ejecución para la mayoría de sentencias SQL. Bajo modo normal, el optimizador opera con restricciones muy estrictas, generalmente una fracción de segundo, durante la cual debe encontrar un buen plan de ejecución.
En modo de afinación, el optimizador realiza un analisis adicional para revisar sí el plan de ejecución producido bajo modo normal puede ser mejorado aún más. La salida del optimizador de consultas no es un plan de ejecución, sino una serie de acciones, junto con sus beneficio racionales y esperados para producir un plan significativamente superior. Cuando se ejecuta en modo de afinación, el optimizador es referido como Automatic Tuning Optimizer.
Bajo modo de afinación, el optimizador puede tomar varios minutos para afinar un sentencia unica. Consume una gran cantidad de recursos y tiempo invocar el Automatic Tuning Optimizer cada vez que una sentencia tiene que ser analizada. El Automatic Tuning Optimizer esta destinado a ser utilizado con sentencias SQL de alta carga de trabajo que no tienen un impacto trivial en el sistema entero. El Automatic Database Diagnostic Monitor (ADDM) identifica proactivamente las sentencias SQL con alta carga de trabajo las cuales son buenas candidatas para el afinador de SQL.
https://docs.oracle.com/cd/B28359_01/server.111/b28274/sql_tune.htm#PFGRF02604
sábado, 8 de noviembre de 2014
Automatic Workload Repository
Automatic Workload Repository
Repositorio Automatico de carga de trabajo
El repositorio automatico de carga de trabajo es una colección de estadisticas persistentes del rendimiento del sistema que le pertenecen al usuario SYS. El repositorio automatico de carga de trabajo reside en el espacio de tablas SYSAUX.
Un SNAPSHOT(imagen instantanea) es un conjunto de estadisticas de rendimiento capturadas en cierto tiempoo y guardadas en el repositorio automatico de carga de trabajo. Cada snapshot es identificado por un número de secuencia (snap_id) que es único en el AWR. Por defecto, los snapshots son generados cada 60 minutos. Puedes ajustar esta frecuencia cambiando el parametro de intervalo de snapshot. Porque los asesores de base de datos dependen de los snapshots, debes estar consiente que el ajuste del nivel puede afectar la precisión de diagnostico.
Repositorio Automatico de carga de trabajo
El repositorio automatico de carga de trabajo es una colección de estadisticas persistentes del rendimiento del sistema que le pertenecen al usuario SYS. El repositorio automatico de carga de trabajo reside en el espacio de tablas SYSAUX.
Un SNAPSHOT(imagen instantanea) es un conjunto de estadisticas de rendimiento capturadas en cierto tiempoo y guardadas en el repositorio automatico de carga de trabajo. Cada snapshot es identificado por un número de secuencia (snap_id) que es único en el AWR. Por defecto, los snapshots son generados cada 60 minutos. Puedes ajustar esta frecuencia cambiando el parametro de intervalo de snapshot. Porque los asesores de base de datos dependen de los snapshots, debes estar consiente que el ajuste del nivel puede afectar la precisión de diagnostico.
viernes, 7 de noviembre de 2014
Asesores de Oracle
Utilizando los asesores de Oracle
Obten consejos sobre retos clave de administración y mejora el rendimiento en Oracle Database 11g.
Los asesores son herramientas potentes que proveen un consejo especifico sobre como enfrentar retos clave
de administración, cubriendo una amplia variedad de areas, incluyendo espacio de almacenamiento, rendimiento,
y administración de undo. Los advisors estan construidos sobre dos componentes de la infraestructura.
El repositorio automatico de carga de trabajo (AWR). Este repositorio provee servicios para la recolección, mantenimiento, y utilización de estadisticas con el proposito de la detección de problemas y auto afinación.
La información estadistica es guardada en el repositorio AWR en forma de instantaneas(snapshots).
Automatic database diagnostic monitor (ADDM). Este monitor realiza analisis, detecta cuellos de botella, y recomienda soluciones. Las recomendaciones pueden incluir el tipo de asesores que pueden ser utilizados para
resolver le problema.
Este texto se centra en algunos de los asesores que son invocados por el ADDM para ayudar a mejorar el rendimiento de la base de datos. Presenta preguntas de muestra del tipo que podrias encontrar cuando presentas el examen Oracle Database 11g Administration Workshop I, el cual te permite ganar el nivel de certificación Oracle Certified Associate.
SQL tuning Advisor
El asesor de afinación SQL analiza problemas con sentencias SQL individuales, tales como un plan optimizador de mal desempeño o el uso equivocado de ciertas estructuras SQL, y hace recomendaciones para mejorar su desempeño.
Puede ejecutar el asesor de ajuste SQL contra las sentencias SQL que requieren muchos recursos.
Un conjunto de sentencias SQL durante un período de tiempo, o de una carga de trabajo SQL. Normalmente , se ejecuta este consejero en respuesta a un hallazgo rendimiento ADDM que recomienda su uso.
Oracle Database 11g introduce el asesor de afinación SQL automático , que puede ser configurado para ejecutarse de forma automática durante las ventanas de mantenimiento del sistema como una tarea de mantenimiento . Durante cada ejecución automática, el asesor selecciona consultas SQL de gran carga en el sistema y genera recomendaciones sobre cómo ajustarlas.
Juan empieza a crear una nueva tabla basada en los datos de la tabla de clientes . Los siguientes criterios deben aplicarse en los datos:
Todas las columnas de la tabla de clientes deben estar disponibles en la nueva tabla .
La nueva tabla debe tener datos sólo para aquellos clientes cuyo pedido promedio es de US $ 1 millón o más por trimestre , que no han efectuado pagos correspondientes a los dos últimos pedidos , y cuyo plazo de pago ha superado el período de crédito.
Obten consejos sobre retos clave de administración y mejora el rendimiento en Oracle Database 11g.
Los asesores son herramientas potentes que proveen un consejo especifico sobre como enfrentar retos clave
de administración, cubriendo una amplia variedad de areas, incluyendo espacio de almacenamiento, rendimiento,
y administración de undo. Los advisors estan construidos sobre dos componentes de la infraestructura.
El repositorio automatico de carga de trabajo (AWR). Este repositorio provee servicios para la recolección, mantenimiento, y utilización de estadisticas con el proposito de la detección de problemas y auto afinación.
La información estadistica es guardada en el repositorio AWR en forma de instantaneas(snapshots).
Automatic database diagnostic monitor (ADDM). Este monitor realiza analisis, detecta cuellos de botella, y recomienda soluciones. Las recomendaciones pueden incluir el tipo de asesores que pueden ser utilizados para
resolver le problema.
Este texto se centra en algunos de los asesores que son invocados por el ADDM para ayudar a mejorar el rendimiento de la base de datos. Presenta preguntas de muestra del tipo que podrias encontrar cuando presentas el examen Oracle Database 11g Administration Workshop I, el cual te permite ganar el nivel de certificación Oracle Certified Associate.
SQL tuning Advisor
El asesor de afinación SQL analiza problemas con sentencias SQL individuales, tales como un plan optimizador de mal desempeño o el uso equivocado de ciertas estructuras SQL, y hace recomendaciones para mejorar su desempeño.
Puede ejecutar el asesor de ajuste SQL contra las sentencias SQL que requieren muchos recursos.
Un conjunto de sentencias SQL durante un período de tiempo, o de una carga de trabajo SQL. Normalmente , se ejecuta este consejero en respuesta a un hallazgo rendimiento ADDM que recomienda su uso.
Oracle Database 11g introduce el asesor de afinación SQL automático , que puede ser configurado para ejecutarse de forma automática durante las ventanas de mantenimiento del sistema como una tarea de mantenimiento . Durante cada ejecución automática, el asesor selecciona consultas SQL de gran carga en el sistema y genera recomendaciones sobre cómo ajustarlas.
Juan empieza a crear una nueva tabla basada en los datos de la tabla de clientes . Los siguientes criterios deben aplicarse en los datos:
Todas las columnas de la tabla de clientes deben estar disponibles en la nueva tabla .
La nueva tabla debe tener datos sólo para aquellos clientes cuyo pedido promedio es de US $ 1 millón o más por trimestre , que no han efectuado pagos correspondientes a los dos últimos pedidos , y cuyo plazo de pago ha superado el período de crédito.
sábado, 25 de octubre de 2014
Restore spfile from a backupset without dbid
restore spfile from '+fra/rcat/autobackup/2014_10_22/s_861663111.258.861663531';
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "RCAT" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '+DATA/rcat/redo01.log' SIZE 50M BLOCKSIZE 512,
GROUP 2 '+DATA/rcat/redo02.log' SIZE 50M BLOCKSIZE 512,
GROUP 3 '+DATA/rcat/redo03.log' SIZE 50M BLOCKSIZE 512
DATAFILE
'+DATA/rcat/system01.dbf',
'+DATA/rcat/sysaux01.dbf',
'+DATA/rcat/undotbs01.dbf',
'+DATA/rcat/users01.dbf',
'+DATA/rcat01.dbf'
CHARACTER SET AL32UTF8
;
restore spfile from '+fra/rcat/autobackup/2014_10_22/s_861663111.258.861663531';
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "RCAT" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '+DATA/rcat/redo01.log' SIZE 50M BLOCKSIZE 512,
GROUP 2 '+DATA/rcat/redo02.log' SIZE 50M BLOCKSIZE 512,
GROUP 3 '+DATA/rcat/redo03.log' SIZE 50M BLOCKSIZE 512
DATAFILE
'+DATA/rcat/system01.dbf',
'+DATA/rcat/sysaux01.dbf',
'+DATA/rcat/undotbs01.dbf',
'+DATA/rcat/users01.dbf',
'+DATA/rcat01.dbf'
CHARACTER SET AL32UTF8
;
domingo, 19 de octubre de 2014
Cambiar el tamaño de la Fast recovery area
Size in bytes
1 kb= 1024 bytes
1 mb= 1024^2 bytes
1 gb= 1024^3 bytes
SQL> select * from v$recovery_file_dest;
NAME
--------------------------------------------------------------------------------
SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
----------- ---------- ----------------- ---------------
+FRA
4259315712 268435456 0 9
SQL> show parameter recovery_file_dest_size;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest_size big integer 4062M
ALTER SYSTEM SET db_recovery_file_dest_size = 6442450944 SCOPE=BOTH;
1 kb= 1024 bytes
1 mb= 1024^2 bytes
1 gb= 1024^3 bytes
SQL> select * from v$recovery_file_dest;
NAME
--------------------------------------------------------------------------------
SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
----------- ---------- ----------------- ---------------
+FRA
4259315712 268435456 0 9
SQL> show parameter recovery_file_dest_size;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest_size big integer 4062M
ALTER SYSTEM SET db_recovery_file_dest_size = 6442450944 SCOPE=BOTH;
viernes, 3 de octubre de 2014
Database Advisors
Using Database Advisors
Get advice on key management challenges and improve performance in Oracle Database 11g.
Advisors are powerful tools that provide specific advice on how to address key database management challenges, covering a wide range of areas, including space, performance, and undo management. Advisors are built around two infrastructure components:
Automatic workload repository (AWR). This repository provides services for collecting, maintaining, and utilizing statistics for problem detection and self-tuning purposes. The statistical information is stored in the AWR in the form of snapshots.
Automatic database diagnostic monitor (ADDM). This monitor performs analysis, detects bottlenecks, and recommends solutions. Recommendations can include the type of advisor that needs to be used to resolve the problem.
This column focuses on some of the database advisors that are invoked by ADDM to help you improve database performance. It presents sample questions of the type you may encounter when taking the Oracle Database 11g Administration Workshop I exam, which enables you to earn the Oracle Certified Associate level of certification.
SQL Tuning Advisor
The SQL tuning advisor analyzes problems with individual SQL statements, such as a poorly performing optimizer plan or the mistaken use of certain SQL structures, and makes recommendations for improving their performance. You can run the SQL tuning advisor against resource-intensive SQL statements, a set of SQL statements over a period of time, or from a SQL workload. Typically, you run this advisor in response to an ADDM performance finding that recommends its use.
Oracle Database 11g introduces the automatic SQL tuning advisor, which can be configured to automatically run during system maintenance windows as a maintenance task. During each automatic run, the advisor selects high-load SQL queries in the system and generates recommendations on how to tune them.
John starts to create a new table based on data in the customer table. The following criteria must be applied on the data:
All columns of the customer table must be available in the new table.
The new table must have data for only those customers whose average order is US$1 million or more per quarter, who have not made payments for the last two orders, and whose payment period has exceeded the credit period.
John notices that the table-creation process is taking very long to complete. The DBA has enabled the automatic SQL tuning advisor with automatic implementation, but when he runs the SQL tuning advisor, he notes that this SQL statement was poorly formed and not automatically tuned. Why did the server not automatically tune this statement?
A. The automatic SQL tuning advisor ignores CREATE TABLE AS SELECT statements.
B. The automatic SQL tuning advisor ignores CREATE TABLE statements.
C. The automatic SQL tuning advisor tunes only SQL queries.
D. The automatic SQL tuning advisor does not tune DML statements.
The correct answer is A. Even though the automatic SQL tuning advisor is enabled, it does not resolve every SQL performance issue. It does not automatically resolve issues with the following types of SQL statements: CREATE TABLE AS SELECT and INSERT SELECT, ad hoc or rarely repeated SQL, parallel queries, and recursive SQL.
You have received complaints about the degradation of SQL query performance and have identified the most-resource-intensive SQL queries. What is your next step to get recommendations about restructuring the SQL statements to improve query performance?
A. Run the segment advisor
B. Run the SQL tuning advisor on the most-resource-intensive SQL statements
C. Run the AWR report
D. Run ADDM on the most-resource-intensive SQL statements
The correct answer is B. After you have identified the SQL statements that are the most resource intensive, you use the SQL tuning advisor to get recommendations on how to tune them. Answer A is incorrect because the segment advisor reports on the growth trend of segments and provides recommendations on whether a segment needs to be shrunk. Answer C is incorrect because AWR is a repository that stores performance-related information in the form of snapshots. Answer D is incorrect because ADDM uses these statistics to perform analysis and detect bottlenecks and then recommends solutions.
SQL Access Advisor
The SQL access advisor provides recommendations for improving the performance of a workload. In addition to analyzing indexes and materialized views as in Oracle Database 10g, the SQL access advisor in Oracle Database 11g analyzes tables and queries and provides recommendations on optimizing storage structures.
The SQL access advisor tunes a schema to a particular workload. Typically, when you use the SQL access advisor for performance tuning, you perform the following steps: create a task, define the workload, generate recommendations, and implement recommendations.
You can use the SQL access advisor to receive recommendations on which of the following:
A. Schema modifications
B. Tuning resource-intensive SQL statements
C. Improving the execution plan of SQL statements
D. SQL workload
The correct answers are A and D. The SQL access advisor analyzes an entire workload and recommends changes to indexes, materialized views, and tables to improve performance. Answers B and C are incorrect because the SQL tuning advisor makes recommendations on tuning resource-intensive SQL statements and improving the execution plan of SQL statements.
Memory Advisor
The memory advisor is a collection of several advisory functions that help determine the best settings for the total memory used by the database instance. They provide graphical analyses of total memory target settings (as shown in Figure 1), SGA and PGA target settings, or SGA component size settings. You use these analyses to tune database performance and for what-if planning. Several memory advisors are available for memory tuning (note that the availability of these advisors depends on whether the automatic memory management [AMM] and the automatic shared memory management [ASMM] features are enabled or disabled): The SGA advisor provides information about percentage improvement in DB (database) time for various sizes of SGA, the shared pool advisor provides information about the estimated parse time in the shared pool for different pool sizes, the buffer cache advisor provides information about physical reads and time for the cache size, and the PGA advisor provides information about cache hit percentage against PGA target memory size.
You have enabled AMM and ASMM features in your database, and you use Oracle Enterprise Manager to manage your database. Which memory advisorsmemory size advisor, shared pool advisor, buffer cache advisor, or Java pool advisorwill you be able to use?
A. Only memory size advisor
B. Only shared pool advisor
C. All four of the memory advisors
D. Shared pool advisor, buffer cache advisor, and Java pool advisor
The correct answer is A. When AMM and ASMM are enabled, the system adapts to workload changes by automatically sizing SGA and PGA components. Because you will not receive advice on these individual components of SGA, the corresponding advisors will be disabled.
Undo Advisor
The undo advisor helps you determine the size of the undo tablespace. You can compute the minimum size of the undo tablespace, based on either the statistics gathered over a designated time period or an undo retention period. Using the runtime statistics collected in the AWR, you can use the undo advisor to extrapolate how future requirements might affect the size of the undo tablespace. You then use the Undo Management page in Oracle Enterprise Manager to make the changes recommended by the undo advisor.
You are a DBA of an online transaction processing (OLTP) system that supports thousands of users and millions of transactions every day. As part of the periodic tuning activity, you plan to use the undo advisor to ensure that the size of the undo tablespace meets the requirements of the longest-running transaction of the instance. What information will the advisor use to determine the size of the undo tablespace?
A. The analysis time period
B. The undo retention period
C. The undo generation rate
D. The number of undo tablespaces in the database
figure 1
Figure 1: Total memory target settings
The correct answers are A, B, and C. The undo advisor uses the analysis time period, the undo retention period, and the rate of undo generation to recommend the minimum size of the undo tablespace that can meet the requirements of the longest-running transaction. Answer D is incorrect because only one undo tablespace is active at any particular time, so it does not matter how many undo tablespaces a database has.
Conclusion
This column has focused on some advisors that help you manage and tune your database:
SQL tuning advisor provides recommendations on actions such as rewriting the statement, changing the instance configuration, and adding indexes.
SQL access advisor takes a SQL workload as an input and recommends which indexes, materialized views, and logs to create, drop, or retain for faster performance.
Memory advisor provides graphical analyses of total memory target settings, SGA and PGA target settings, or SGA component size settings.
Undo advisor determines the undo tablespace size that is required to support a given retention period.
Get advice on key management challenges and improve performance in Oracle Database 11g.
Advisors are powerful tools that provide specific advice on how to address key database management challenges, covering a wide range of areas, including space, performance, and undo management. Advisors are built around two infrastructure components:
Automatic workload repository (AWR). This repository provides services for collecting, maintaining, and utilizing statistics for problem detection and self-tuning purposes. The statistical information is stored in the AWR in the form of snapshots.
Automatic database diagnostic monitor (ADDM). This monitor performs analysis, detects bottlenecks, and recommends solutions. Recommendations can include the type of advisor that needs to be used to resolve the problem.
This column focuses on some of the database advisors that are invoked by ADDM to help you improve database performance. It presents sample questions of the type you may encounter when taking the Oracle Database 11g Administration Workshop I exam, which enables you to earn the Oracle Certified Associate level of certification.
SQL Tuning Advisor
The SQL tuning advisor analyzes problems with individual SQL statements, such as a poorly performing optimizer plan or the mistaken use of certain SQL structures, and makes recommendations for improving their performance. You can run the SQL tuning advisor against resource-intensive SQL statements, a set of SQL statements over a period of time, or from a SQL workload. Typically, you run this advisor in response to an ADDM performance finding that recommends its use.
Oracle Database 11g introduces the automatic SQL tuning advisor, which can be configured to automatically run during system maintenance windows as a maintenance task. During each automatic run, the advisor selects high-load SQL queries in the system and generates recommendations on how to tune them.
John starts to create a new table based on data in the customer table. The following criteria must be applied on the data:
All columns of the customer table must be available in the new table.
The new table must have data for only those customers whose average order is US$1 million or more per quarter, who have not made payments for the last two orders, and whose payment period has exceeded the credit period.
John notices that the table-creation process is taking very long to complete. The DBA has enabled the automatic SQL tuning advisor with automatic implementation, but when he runs the SQL tuning advisor, he notes that this SQL statement was poorly formed and not automatically tuned. Why did the server not automatically tune this statement?
A. The automatic SQL tuning advisor ignores CREATE TABLE AS SELECT statements.
B. The automatic SQL tuning advisor ignores CREATE TABLE statements.
C. The automatic SQL tuning advisor tunes only SQL queries.
D. The automatic SQL tuning advisor does not tune DML statements.
The correct answer is A. Even though the automatic SQL tuning advisor is enabled, it does not resolve every SQL performance issue. It does not automatically resolve issues with the following types of SQL statements: CREATE TABLE AS SELECT and INSERT SELECT, ad hoc or rarely repeated SQL, parallel queries, and recursive SQL.
You have received complaints about the degradation of SQL query performance and have identified the most-resource-intensive SQL queries. What is your next step to get recommendations about restructuring the SQL statements to improve query performance?
A. Run the segment advisor
B. Run the SQL tuning advisor on the most-resource-intensive SQL statements
C. Run the AWR report
D. Run ADDM on the most-resource-intensive SQL statements
The correct answer is B. After you have identified the SQL statements that are the most resource intensive, you use the SQL tuning advisor to get recommendations on how to tune them. Answer A is incorrect because the segment advisor reports on the growth trend of segments and provides recommendations on whether a segment needs to be shrunk. Answer C is incorrect because AWR is a repository that stores performance-related information in the form of snapshots. Answer D is incorrect because ADDM uses these statistics to perform analysis and detect bottlenecks and then recommends solutions.
SQL Access Advisor
The SQL access advisor provides recommendations for improving the performance of a workload. In addition to analyzing indexes and materialized views as in Oracle Database 10g, the SQL access advisor in Oracle Database 11g analyzes tables and queries and provides recommendations on optimizing storage structures.
The SQL access advisor tunes a schema to a particular workload. Typically, when you use the SQL access advisor for performance tuning, you perform the following steps: create a task, define the workload, generate recommendations, and implement recommendations.
You can use the SQL access advisor to receive recommendations on which of the following:
A. Schema modifications
B. Tuning resource-intensive SQL statements
C. Improving the execution plan of SQL statements
D. SQL workload
The correct answers are A and D. The SQL access advisor analyzes an entire workload and recommends changes to indexes, materialized views, and tables to improve performance. Answers B and C are incorrect because the SQL tuning advisor makes recommendations on tuning resource-intensive SQL statements and improving the execution plan of SQL statements.
Memory Advisor
The memory advisor is a collection of several advisory functions that help determine the best settings for the total memory used by the database instance. They provide graphical analyses of total memory target settings (as shown in Figure 1), SGA and PGA target settings, or SGA component size settings. You use these analyses to tune database performance and for what-if planning. Several memory advisors are available for memory tuning (note that the availability of these advisors depends on whether the automatic memory management [AMM] and the automatic shared memory management [ASMM] features are enabled or disabled): The SGA advisor provides information about percentage improvement in DB (database) time for various sizes of SGA, the shared pool advisor provides information about the estimated parse time in the shared pool for different pool sizes, the buffer cache advisor provides information about physical reads and time for the cache size, and the PGA advisor provides information about cache hit percentage against PGA target memory size.
You have enabled AMM and ASMM features in your database, and you use Oracle Enterprise Manager to manage your database. Which memory advisorsmemory size advisor, shared pool advisor, buffer cache advisor, or Java pool advisorwill you be able to use?
A. Only memory size advisor
B. Only shared pool advisor
C. All four of the memory advisors
D. Shared pool advisor, buffer cache advisor, and Java pool advisor
The correct answer is A. When AMM and ASMM are enabled, the system adapts to workload changes by automatically sizing SGA and PGA components. Because you will not receive advice on these individual components of SGA, the corresponding advisors will be disabled.
Undo Advisor
The undo advisor helps you determine the size of the undo tablespace. You can compute the minimum size of the undo tablespace, based on either the statistics gathered over a designated time period or an undo retention period. Using the runtime statistics collected in the AWR, you can use the undo advisor to extrapolate how future requirements might affect the size of the undo tablespace. You then use the Undo Management page in Oracle Enterprise Manager to make the changes recommended by the undo advisor.
You are a DBA of an online transaction processing (OLTP) system that supports thousands of users and millions of transactions every day. As part of the periodic tuning activity, you plan to use the undo advisor to ensure that the size of the undo tablespace meets the requirements of the longest-running transaction of the instance. What information will the advisor use to determine the size of the undo tablespace?
A. The analysis time period
B. The undo retention period
C. The undo generation rate
D. The number of undo tablespaces in the database
figure 1
Figure 1: Total memory target settings
The correct answers are A, B, and C. The undo advisor uses the analysis time period, the undo retention period, and the rate of undo generation to recommend the minimum size of the undo tablespace that can meet the requirements of the longest-running transaction. Answer D is incorrect because only one undo tablespace is active at any particular time, so it does not matter how many undo tablespaces a database has.
Conclusion
This column has focused on some advisors that help you manage and tune your database:
SQL tuning advisor provides recommendations on actions such as rewriting the statement, changing the instance configuration, and adding indexes.
SQL access advisor takes a SQL workload as an input and recommends which indexes, materialized views, and logs to create, drop, or retain for faster performance.
Memory advisor provides graphical analyses of total memory target settings, SGA and PGA target settings, or SGA component size settings.
Undo advisor determines the undo tablespace size that is required to support a given retention period.
martes, 23 de septiembre de 2014
Funciones oracle
Trigger: es un bloque de código que se ejecuta automáticamente cuando ocurre algún evento (como inserción, actualización o borrado) sobre una determinada tabla (o vista).
Se crean para conservar la integridad y la coherencia de los datos.
Se crean para conservar la integridad y la coherencia de los datos.
CREATE OR REPLACE TRIGGER Print_salary_changes
BEFORE DELETE OR INSERT OR UPDATE ON Emp_tab
FOR EACH ROW
WHEN (new.Empno > 0)
DECLARE
sal_diff number;
BEGIN
sal_diff := :new.sal - :old.sal;
dbms_output.put('Old salary: ' || :old.sal);
dbms_output.put(' New salary: ' || :new.sal);
dbms_output.put_line(' Difference ' || sal_diff);
END;
/
create or replace trigger NOMBREDISPARADOR
MOMENTO-- before, after o instead of
EVENTO-- insert, update o delete
of CAMPOS-- solo para update
on NOMBRETABLA
NIVEL--puede ser a nivel de sentencia (statement) o de fila (for each row)
when CONDICION--opcional
begin
CUERPO DEL DISPARADOR--sentencias
end NOMBREDISPARADOR;
jueves, 21 de agosto de 2014
ASM parameters
INSTANCE_TYPE
should be set to ASM for ASM instances. This is the only parameter
that must be defined. For database instances, this is set to the value RDBMS.
ASM_POWER_LIMIT controls the speed for a rebalance operation. Values range from 1 through 11, with 11 being the fastest. If omitted, this value defaults to 1.
ASM_DISKSTRING is an operating system–dependent value used by ASM to limit the set of disks considered for discovery. The default value is the null string, and this will be sufficient in most cases. A more restrictive value as shown above may reduce the time
required for ASM to perform discovery, and thus improve disk group mount times.
ASM_PREFERRED_READ_FAILURE_GROUPS specifies the failure groups that contain preferred read disk. This is useful in extended or stretched cluster databases that have
mirrored copies of data with one of the copies in close proximity to the server.
DIAGNOSTIC_DEST specifies the location of the Automatic Diagnostic Repository (ADR) home. Trace files, alert logs, core files, and incident files can be found under this
directory. The default value of this parameter is derived from the value of ORACLE_BASE.
ASM_DISKGROUPS is the list of names of disk groups to be mounted by an ASM instance at startup, or when the ALTER DISKGROUP ALL MOUNT command is used. Oracle Restart can mount disk groups if they are listed as dependencies even if they are not listed with the ASM_DISKGROUPS parameter. This parameter has no default value.
LARGE_POOL_SIZE specifies (in bytes) the size of the large pool allocation heap. The large pool allocation heap is used in shared server systems for session memory, by parallel execution for message buffers, and by backup processes for disk I/O buffers. The ASM instance makes use of automatic memory management, so this parameter serves as a minimum size that the large pool can be lowered to.
REMOTE_LOGIN_PASSWORDFILE specifies whether the Oracle software checks for a password file. The default value is EXCLUSIVE.
Automatic memory management is enabled by default on ASM instances,
event when the that MEMORY_TARGET parameter is not explicitly set. This is the only parameter you need to set for complete ASM memory management. Oracle Corporation strongly lrecommends that you use automatic memory management for ASM
INSTANCE_TYPE
should be set to ASM for ASM instances. This is the only parameter
that must be defined. For database instances, this is set to the value RDBMS.
ASM_POWER_LIMIT controls the speed for a rebalance operation. Values range from 1 through 11, with 11 being the fastest. If omitted, this value defaults to 1.
ASM_DISKSTRING is an operating system–dependent value used by ASM to limit the set of disks considered for discovery. The default value is the null string, and this will be sufficient in most cases. A more restrictive value as shown above may reduce the time
required for ASM to perform discovery, and thus improve disk group mount times.
ASM_PREFERRED_READ_FAILURE_GROUPS specifies the failure groups that contain preferred read disk. This is useful in extended or stretched cluster databases that have
mirrored copies of data with one of the copies in close proximity to the server.
DIAGNOSTIC_DEST specifies the location of the Automatic Diagnostic Repository (ADR) home. Trace files, alert logs, core files, and incident files can be found under this
directory. The default value of this parameter is derived from the value of ORACLE_BASE.
ASM_DISKGROUPS is the list of names of disk groups to be mounted by an ASM instance at startup, or when the ALTER DISKGROUP ALL MOUNT command is used. Oracle Restart can mount disk groups if they are listed as dependencies even if they are not listed with the ASM_DISKGROUPS parameter. This parameter has no default value.
LARGE_POOL_SIZE specifies (in bytes) the size of the large pool allocation heap. The large pool allocation heap is used in shared server systems for session memory, by parallel execution for message buffers, and by backup processes for disk I/O buffers. The ASM instance makes use of automatic memory management, so this parameter serves as a minimum size that the large pool can be lowered to.
REMOTE_LOGIN_PASSWORDFILE specifies whether the Oracle software checks for a password file. The default value is EXCLUSIVE.
Automatic memory management is enabled by default on ASM instances,
event when the that MEMORY_TARGET parameter is not explicitly set. This is the only parameter you need to set for complete ASM memory management. Oracle Corporation strongly lrecommends that you use automatic memory management for ASM
martes, 19 de agosto de 2014
ASM_DISKSTRING
ASM_DISKSTRING
El parametro ASM_DISKSTRING especifica los discos que la instancia ASM debe descubrir y usar para guardar los archivos
El parametro ASM_DISKSTRING especifica los discos que la instancia ASM debe descubrir y usar para guardar los archivos
Archivelog mode
ARCHIVELOG mode
The mode of the database in which log transport services archives filled online redo logs to disk. Specify the mode at database creation or by using the SQL
ALTER DATABASE ARCHIVELOG
statement. You can enable automatic archiving either dynamically using the SQL ALTER SYSTEM ARCHIVE LOG START
statement or by setting the initialization parameter LOG_ARCHIVE_START
to true
. Running your database in ARCHIVELOG mode has several advantages over NOARCHIVELOG mode. You can:
- Back up your database while it is open and being accessed by users
- Recover your database to any desired point in time
To protect your database that is in ARCHIVELOG mode in case of failure, back up your archived logs.
archiver process (ARCn)
On the primary database site, the process (or a SQL session performing an archival operation) that creates a copy of the online redo logs, either locally or remotely, for standby databases. On the standby database site, the ARCn process archives the standby redo logs to be applied by the managed recovery process (MRP).
ARCH
Setting this attribute on the
LOG_ARCHIVE_DEST_
n
initialization parameter indicates that the archiver process (ARCn) will create archived redo logs on the primary database and also transmit redo logs for archival at specified destinations. To see process
lunes, 18 de agosto de 2014
Servicios Oracle
Servicios de bases de datos (servicios) son abstracciones lógicas para la gestión de cargas de trabajo de base de datos Oracle. Los servicios dividen las cargas de trabajo en grupos mutuamente disjuntos. Cada servicio representa una carga de trabajo con atributos comunes, los umbrales de nivel de servicio, y las prioridades. La agrupación se basa en los atributos de trabajo que podrían incluir la función de aplicación que se utilizará, la prioridad de la ejecución de la función de aplicación, la clase de trabajo que se logró, o el rango de datos utilizados en la función de aplicación o tipo de trabajo. Por ejemplo, la suite Oracle E-Business define un servicio para cada responsabilidad, tales como contabilidad general, cuentas por cobrar, la entrada de pedidos, y así sucesivamente. Cada servicio de base de datos tiene un nombre único.
jueves, 14 de agosto de 2014
PGA , SGA y Automatic Memory Management
The Program Global Area (PGA) is a memory buffer that contains data and control information for a server process. A PGA is created by Oracle when a server process is started.
When Automatic Memory Management is enabled, the database will automatically set the optimal distribution of memory. The distribution of memory will change from time to time to accomodate changes in the workload.
The System Global Area (SGA) is a group of shared memory structures that contains data and control information for one Oracle database. The SGA is allocated in memory when an Oracle database instance is starte
emca -config dbcontrol db
miércoles, 13 de agosto de 2014
Respaldos continuación
¿Cuál de los siguientes tipos de espacios de tabla guarda información sobre los extents usados y libres de una base de datos?
Dictionary managed tablespace.
¿Como es conocido el catalogo central de recuperación?
Base recovery catalog.
Dictionary managed tablespace.
¿Como es conocido el catalogo central de recuperación?
Base recovery catalog.
Enable flashback database
SHUTDOWN immediate
STARTUP mount
ALTER DATABASE FLASHBACK ON
ALTER DATABASE OPEN READ WRITE
The startup command will use a temporary file as pfile with the following init.ora parameters:
spfile='+DATA/orcl/spfileorcl.ora'
STARTUP mount
ALTER DATABASE FLASHBACK ON
ALTER DATABASE OPEN READ WRITE
The startup command will use a temporary file as pfile with the following init.ora parameters:
spfile='+DATA/orcl/spfileorcl.ora'
martes, 12 de agosto de 2014
Respaldos
- Puedes utilizar los siguientes métodos para habilitar copias duplicadas en los repaldos de RMAN. Utilizar la opción BACKUP COPIES en el comando RMAN CONFIGURE. Utilizar la opción BACKUP COPIES en el comando ALLOCATE CHANNEL
- Cuando se utiliza la característica OMF (Oracle-managed Files), ¿cuál de los siguientes parámetros de inicialización especifica la ubicación estándar donde Oracle crea los archivos de datos? DB_CREATE_FILE_DEST
- 1 a 64 Megabytes es un rango valido para especificar el tamaño de unidades de asignación ASM.
- Cuando la característica (Oracle-Managed Files) es usada, ¿Cuál de los siguientes parámetros de inicialización especifica la ubicación estándar donde Oracle crea los los archivos de redo y de control DB_CREATE_ONLINE_LOG_DEST_n
- El procedimiento CREATE_SIMPLE_PLAN del paquete DBMS_RESOURCE_MANAGER crea en un paso un plan de recursos de nivel único que contiene hasta 8 grupos de consumo.
- Cuál de los siguientes procesos de segundo plano utiliza el algoritmo LRU(Least Recentrly Used) DBWn (Database writer process).Tipos de prácticas de respaldo y recuperación1. Los tipos de respaldo y recuperación de bases de datos son:i) Admistrados por el usuario: No se utiliza RMAN.1.1.1.1. Utiliza los comandos del sistema operátivo para mover los archivos1.1.1.2. Requiere que el DBA mantenga registros manuales de la actividad)ii) Administrados por el servidor: Se utiliza RMAN
Realizando un respaldo administrado por el usuarioSe puede respaldar la base de datos utilizando comandos del sistema operativo para hacer las copias de los archivos de datos. Esta acción depende si la base de datos esta en modo de ARCHIVELOG o no. Si esta en modo archivelog entonces se puede mantener la base de datos abierta y disponible poniendo cada tablespace en modo de respaldo antes de copiar sus archivos de datos. De otra manera se tiene que apagar la base de datos antes de copiar los archivos de datos.Respaldando manualmente una base de datos en modoNOARCHIVELOG respaldo consistente.Puedes hacer un respaldo consistente completo de una base de datos en modo NOARCHIVELOG apagando la base de datos y copiando todos los archivos de datos y archivos de control a un directorio de respaldo. Debido a que la acción de copiar los archivos es realizada usando comandos del Sistema Operativo (en este caso el comando Linux cp), la base de datos debe apagarse primero. Esto la pone en un estado consistente. Sí tu base de datos esta siendo usada en modo NOARCHIVELOG, esta es la opción. De otra manera , puedes hacer respaldos inconsistentes, lo que te permite dejar la base de datos corriendo mientras tomas el respaldo.
Respaldando manualmente una base de datos en modo
ARCHIVELOG respaldo inconsistente.
Si la base de datos esta en modo ARCHIVELOG, entonces no necesariamente necesitas apagar la base de datos antes de copiar sus archivos de datos, Tu terminas con un respaldo inconsistente., pero los datos de los redos de la aplicación la recuperan a un estado consistente.
Suscribirse a:
Entradas (Atom)