notas:bases_de_datos
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
| notas:bases_de_datos [2010/09/24 18:22] – cayu | notas:bases_de_datos [2013/09/13 14:21] (actual) – [Replicacion facil] cayu | ||
|---|---|---|---|
| Línea 6: | Línea 6: | ||
| ==== Perl DBI ==== | ==== Perl DBI ==== | ||
| - | + | ^**MySQL**^**PostgreSQL**^ | |
| - | ^^**MySQL**^**PostgreSQL**^^ | + | |
| |$db=DBI-> | |$db=DBI-> | ||
| Línea 13: | Línea 12: | ||
| ==== Sintaxis y lenguaje ==== | ==== Sintaxis y lenguaje ==== | ||
| - | + | ^**MySQL**^**PostgreSQL**^ | |
| - | ^^**MySQL**^**PostgreSQL**^^ | + | |
| | SHOW FULL PROCESSLIST / SHOW PROCESSLIST | SELECT * FROM pg_stat_activity | | | SHOW FULL PROCESSLIST / SHOW PROCESSLIST | SELECT * FROM pg_stat_activity | | ||
| | # | -- | | | # | -- | | ||
| Línea 27: | Línea 25: | ||
| ==== Tipos de datos ==== | ==== Tipos de datos ==== | ||
| - | ^^MySQL^PostgreSQL^comments^^ | + | ^MySQL^PostgreSQL^comments^ |
| |< | |< | ||
| TINYINT | TINYINT | ||
| Línea 155: | Línea 153: | ||
| server-id=1 | server-id=1 | ||
| + | replicate-do-db=base | ||
| replicate-do-table=base.tabla | replicate-do-table=base.tabla | ||
| Línea 185: | Línea 184: | ||
| server-id=2 | server-id=2 | ||
| + | replicate-do-db=base | ||
| replicate-do-table=base.tabla | replicate-do-table=base.tabla | ||
| Línea 201: | Línea 201: | ||
| - | ==== Importar CSV ==== | + | ==== Importar/ |
| - | Ejemplo | + | Importacion |
| <code sql> | <code sql> | ||
| LOAD DATA LOCAL INFILE ' | LOAD DATA LOCAL INFILE ' | ||
| Línea 211: | Línea 211: | ||
| (nombre, pass, usuario); | (nombre, pass, usuario); | ||
| </ | </ | ||
| + | |||
| + | Exportacion : | ||
| + | <code sql> | ||
| + | SELECT * FROM usuarios ORDER BY date DESC | ||
| + | INTO OUTFILE " | ||
| + | FIELDS TERMINATED BY ',' | ||
| + | ENCLOSED BY '"' | ||
| + | LINES TERMINATED BY ' | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | mysql -u root -p cdr -B -e " | ||
| + | </ | ||
| + | ===== Oracle ===== | ||
| + | |||
| + | |||
| + | ==== Oracle XE issues ==== | ||
| + | |||
| + | Oracle xe must be the buggiest free counterpart of a commercial product ever released.Here' | ||
| + | |||
| + | * I don't set up it to be started upon boot (don't want this bag of bugs eat my memory) | ||
| + | * change the default apex port from 8080 to smth else | ||
| + | * use 8+ characters for sys/system password | ||
| + | * check status of the DB: $ sudo / | ||
| + | * start the DB - I use restart just to be sure: $ sudo / | ||
| + | |||
| + | Q: After installing and sourcing / | ||
| + | |||
| + | |||
| + | A: Change the nls_lang.sh to use your shell %%(/ | ||
| + | |||
| + | |||
| + | Q: after installing oracle xe I cannot login to apex (oracle web admin) under sys or system. It won't accept my login/ | ||
| + | |||
| + | |||
| + | A: Use a longer password! It won't complain but seems like it doesn' | ||
| + | |||
| + | |||
| + | > ORA-12519, TNS:no appropriate service handler found | ||
| + | |||
| + | |||
| + | A: Run the following statement from sqlplus or web admin (you should have it accessible due to above tips) | ||
| + | |||
| + | |||
| + | > ALTER SYSTEM SET PROCESSES=150 SCOPE=SPFILE; | ||
| + | |||
| + | |||
| + | Found [[http:// | ||
| + | |||
| + | |||
| + | Q: How to remove oracle user from ubuntu desktop login screen. | ||
| + | |||
| + | A: Change the oracle' | ||
| + | |||
| + | |||
| + | $ sudo usermod --gid 999 oracle | ||
| + | |||
| + | After that change the ownership of the files in /var/tmp/. | ||
| + | |||
| + | oracle$ sudo chown -R oracle:dba / | ||
| + | |||
| + | or you won't be able to start the DB anymore :) | ||
| + | |||
| + | |||
| + | Q: Cannot open Oracle web interface, Page cannot be displayed. Used to work before, and the DB is working. | ||
| + | |||
| + | |||
| + | A: Might happen especially if you selected to start the DB manually rather than on each boot. The symptoms might be a bit different, the DB might be started or might be not. Some services just fail to start. | ||
| + | |||
| + | Try restart : | ||
| + | |||
| + | $ sudo / | ||
| + | |||
| + | |||
| + | Fuente: http:// | ||
notas/bases_de_datos.1285352564.txt.gz · Última modificación: 2010/09/24 18:22 por cayu
