Posted in MySQL, Oracle, SQL on Mar 3rd, 2010 1 Comment »
Prevía: Twitter planifica la migración de MySQL a Cassandra DB
Vía: http://nosql.mypopescu.com/post/407159447/cassandra-twitter-an-interview-with-ryan-king
Cassandra @ Twitter: An Interview with Ryan King
There have been confirmed rumors[1] about Twitter planning to use Cassandra for a long time. But except the mentioned post, I couldn’t find any other references.
Twitter is fun by itself and we all know that NoSQL projects love Twitter. [...]
Posted in Oracle, SQL, Scripting on Feb 17th, 2010 No Comments »
SQL> set timing on
SQL> alter system flush buffer_cache;
SQL> select count(*) from dba_source;
COUNT(*)
101914
Elapsed: 00:00:01.23
SQL> r
COUNT(*)
101914
Elapsed: 00:00:00.67
Posted in Oracle, SQL, Scripting on Feb 17th, 2010 No Comments »
Nota: OFA = Optimal Flexibile Architecture
Los ficheros que componen la BD los podemos consultar desde el propio S.O. o desde la BD.
Podemos localizar cada tipo de fichero (datafile, control y redolog) por la extensión; por
ejemplo: dbf, ctl y log.
¡¡¡ Ojo !!!, ésto no es más que una convención, las extensiones pueden ser otras, o incluso [...]
Posted in Oracle, SQL on Feb 17th, 2010 No Comments »
* SGA: System Global Area = area global del sistema
Cada vez que se inicia una base de datos, se reserva espacio paraun área global de sistema (SGA, System Global Area) y se inician losprocesos background de Oracle. El área global del sistema es un áreade memoria utilizada para guardar la información de la base de [...]
Posted in Oracle, SQL, Scripting on Feb 17th, 2010 No Comments »
* Desde el sistema operativo (Unix / Linux):
$ ps -ef | grep Nombre-Instancia
* desde sql*plus:
SQL> spool procesos-instancia.txt
SQL> select * from v$process where background is not null;
o
SQL> select * from v$process a, v$bgprocess b where a.ADDR=b.PADDR;
SQL> spool off
Entre otros muchos datos (unos 170KB) debe de aparecer PMON:
ADDR PID SPID USERNAME SERIAL# TERMINAL PROGRAM TRACEID TRACEFILE
—- — [...]
Posted in Oracle, SQL, Scripting on Feb 16th, 2010 No Comments »
Vía: http://www.dba-oracle.com/concepts/starting_database.htm
Cuando Oracle intenta arrancar una base de datos atraviesa tres estados:
* Iniciar sin montar la bbdd : SQL> startup nomount
* Montar la bbdd ->
Si no se había iniciado: SQL> startup mount
Si ya se había iniciado con un previo startup nomount: SQL> alter database mount;
* Abrir la bbdd (Open) ->
Si no se ha iniciado [...]
Posted in Oracle, SQL, Scripting on Feb 15th, 2010 No Comments »
Referencia: What are the different options to shutdown?
Estaba parando una instancia de oracle (una bbdd en definitiva) con shutdown desde SQL*Plus e intentar arrancarla de nuevo con startup. Y al efectuar un shutdown, me salian los mensajes:
ORA-10997: another startup/shutdown operation of this instance inprogress
ORA-09968: unable to lock file
Por lo que intenté:
shutdown inmediate;
Pero seguía el mismo error. [...]
Posted in Oracle, SQL on Feb 10th, 2010 No Comments »
Vía: Experto universitario en SGBDR (sistemas de gestión de bases de datos relacionales). UNED – 2.008 / 2.009
Ejercicios con Oracle.
Sea el esquema gráfico de un modelo relacional de una bbdd:
* Crear las tablas resultantes utilizando SQL estándar y estableciendo las restricciones de integridad necesarias.
CREATE TABLE Libros
(Nro_referencia INTEGER ,
Isbn` CHAR(13) NOT NULL,
Titulo CHAR(50) ,
Precio NUMERIC(10),
Tema CHAR(50),
Autor CHAR(50)
PRIMARY KEY (Nro_referencia),
CHECK (Precio>=0),
CHECK (Tema IN (‘Filosofia’,’Matematicas’,’Economia’))
CREATE TABLE Lectores
(Nro_carnet INTEGER ,
Nombre CHAR(50) NOT NULL,
Apellidos CHAR(50) NOT NULL,
Domicilio CHAR(50),
Edad NUMERIC(10);
PRIMARY [...]
Posted in Oracle, SQL on Feb 10th, 2010 1 Comment »
Vía: http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12171/toc.htm#i788193 Alphabetic List of SQL*Plus Commands
@{url | file_name[.ext]} [arg ...] <=> Muy usado para ejecutar un fichero sql o pl/sql
@@ { url | file_name[.ext] } [arg ...] <=> ejecución anidada en comandos
/ (slash)
ACC[EPT] variable [NUM[BER] | CHAR | DATE | BINARY_FLOAT | BINARY_DOUBLE] [FOR[MAT] format] [DEF[AULT] default] [PROMPT text | NOPR[OMPT]] [HIDE]
*A[PPEND] text
* Sintaxis
SELECT [ { DISTINCT | UNIQUE } | ALL ] Lista_seleccion
FROM referencia_tabla [ , referencia_tabla] …
[ WHERE condicion]
[{ clausula_consulta_jerarquica | clausula_group_by }
[ clausula_consulta_jerarquica | clausula_group_by ] … ]
[ UNION | UNION ALL | INTERSECT | MINUS } ( subconsulta ) ]
[ clausula order_by ]
Nota:
[ ] Opcional
{ } Obligatorio
a | [...]