De Wiki inetshell
Saltar a: navegación, buscar

Crear usuario[editar]

CREATE USER mike FROM olddata AS
PASSWORD =   "pass" PERM = 400000000
SPOOL = 400000000;

Asignar permisos[editar]

GRANT ALL on olddata TO mike;

Bloquear y permitir usuarios[editar]

REVOKE LOGON ON ALL TO mike;
GRANT LOGON ON ALL TO mike;

Eliminar usuario[editar]

DELETE USER mike ALL;
drop user mike;

Eliminar DB[editar]

delete database olddata;
drop database olddata;

Listar tablas[editar]

SELECT tablename, databasename FROM dbc.tables;

Crear vista[editar]

CREATE VIEW dbc.view as SELECT * FROM table;

Importar datos[editar]

Eliminar tabla[editar]

drop table dbc.table1;

Eliminar vista[editar]

drop view dbc.table1;

Eliminar datos de tabla[editar]

delete from db.table;

Crear tabla[editar]

https://info.teradata.com/htmlpubs/DB_TTU_16_00/index.html#page/Database_Management/B035-1093-160K/jgp1472240548377.html

TDLOAD[editar]

tdload -f data.csv  -h host -u user -p pass -t db.table -d '|'

Easy Loader for Teradata Parallel Transporter

Exportar data[editar]

tdload -f data.csv  -h host -u user -p pass -t db.table -d '|'

FAST EXPORT

Teradata FastExport

Teradata FastExport


Errores[editar]

TPT10508: RDBMS error 2583[editar]

TPT10508: RDBMS error 2583: Worktable is missing for db.table during MLoad restart.

release mload db.table;

Problemas[editar]

Reiniciar base[editar]

/etc/init.d/tpa stop

/etc/init.d/tpa start

No inicia la base[editar]

TDExpress161003_Sles11:~ # bteq 

 Teradata BTEQ 16.10.00.00 for LINUX. PID: 5654
 Copyright 1984-2017, Teradata Corporation. ALL RIGHTS RESERVED.
 Enter your logon or BTEQ command:
.logon 127.0.0.1/dbc

.logon 127.0.0.1/dbc
Password: 

 *** Warning: RDBMS CRASHED OR SESSIONS RESET.  RECOVERY IN PROGRESS.


Ctrl+C

TDExpress161003_Sles11:~ # pdestate -a
PDE state: DOWN/HARDSTOP


TDExpress161003_Sles11:~ # cat /var/log/messages |grep recond
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: INFO: TdatTools: 29001 #tuning change: /usr/pde/etc/recondTunables.txt
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: Before:	t11_current_soft_resource_limit	 = 0
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: After:	t11_current_soft_resource_limit	 = 0xffffffff(-1)
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: INFO: TdatTools: 29001 #tuning change: /usr/pde/etc/recondTunables.txt
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: Before:	t12_maximum_hard_resource_limit	 = 0
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: After:	t12_maximum_hard_resource_limit	 = 0xffffffff(-1)
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: INFO: TdatTools: 29001 #Current Working Directory set: /var/opt/teradata/tdtemp
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: INFO: TdatTools: 29001 #TPA START: "recond -S", NODE UPTIME: 0 Days, 0 Hours, 7 Minutes, 53 Seconds
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: DEGRADED: TdatTools: 29003 #PdeMain NOT started; unexpected reboot detected. Please refer /var/opt/teradata/tdtemp/PanicLoopDetected file to resolve this issue.
Dec  1 14:58:11 TDExpress161003_Sles11 recond[5217]: INFO: TdatTools: 29001 #master(localhost, 33) expected 1 node replies, and received 1 (elapse time: 00.108) 


TDExpress161003_Sles11:~ # cat /var/opt/teradata/tdtemp/PanicLoopDetected
PdeMain NOT started a node panic, hang, or reboot loop has been detected. After determining the cause of crash loop condition and fixing the issue, you must delete the file /var/opt/teradata/tdtemp/PanicLoopDetected and attempt to start or restart Teradata. 

In some situations this condition may be caused by user actions instead of bugs in software, like powering off the system without shutting it down cleanly. When investigating the cause of the crash loop, please be sure to consider issues external to Teradata, like user actions or environmental problems that may cause this condition. 

If a node crashes or reboots without stopping Teradata, reconcile will create the PanicLoopDetected file the next time Teradata is started. If this happens again within the tpacrashcleartimeout (30 min by default, specified in startup.txt), Teradata will not be started on this node until the failure has been addressed and the PanicLoopDetected file is manually deleted. If Teradata run till tpacrashclear times out the PanicLoopDetected file will be deleted automatically to terminate the crash loop detection logic.


TDExpress161003_Sles11:~ # rm /var/opt/teradata/tdtemp/PanicLoopDetected
TDExpress161003_Sles11:~ # /etc/init.d/tpa start
Teradata Database Initiator service is starting...
Teradata Database Initiator service started successfully.


Revisar si el host tiene suficiente memoria

Definir timeout en BTEQ[editar]

.set exitondelay on 10

EXITONDELAY


http://dbsnix.com/?page_id=22/teradata/rdbms-crashed-or-sessions-reset-recovery-in-progress-second-edition

Correr BTEQ desde script[editar]

Sitios[editar]

[1]