DB2: Comandos Conexoes: Difference between revisions

From Wiki
(New page: == Conexão == CONNECT TO <dbname> USER <user> USING <password> -> conecta ao banco GET CONNECT STATE -> Status da conexão CONNECT RESET -> desconecta == Conexão Exem...)
 
No edit summary
Line 1: Line 1:
== Conexão ==
== Conexão ==


CONNECT TO <dbname> USER <user> USING <password>  -> conecta ao banco
CONNECT TO <dbname> USER <user> USING <password>  -> conecta ao banco
GET CONNECT STATE   -> Status da conexão
GET CONNECT STATE   -> Status da conexão
CONNECT RESET -> desconecta
CONNECT RESET -> desconecta


== Conexão Exemplo ==
== Conexão Exemplo ==
db2 activate database sample
 
db2 connect to sample
db2 activate database sample
db2 connect reset
db2 connect to sample
db2 deactivate database sample
db2 connect reset
db2 deactivate database sample


== Conexões ==
== Conexões ==


LIST APPLICATIONS [SHOW DETAIL]  -> mostra todas as conexões
LIST APPLICATIONS [SHOW DETAIL]  -> mostra todas as conexões
FORCE APPLICATION [ALL | xxxx] -> desconecta todos os usuários
FORCE APPLICATION [ALL | xxxx] -> desconecta todos os usuários
 
LIST TABLES [FOR ALL | FOR SCHEMA xxxx]  -> mostra a tabela de usuários
LIST TABLES [FOR ALL | FOR SCHEMA xxxx]  -> mostra a tabela de usuários
 
DESC TABLE <table> -> mostra estrutura da tabela
DESC TABLE <table> -> mostra estrutura da tabela
GET INSTANCE -> mostra a instância
GET INSTANCE -> mostra a instância

Revision as of 14:36, 1 December 2011

Conexão

CONNECT TO <dbname> USER <user> USING <password>   -> conecta ao banco
GET CONNECT STATE 				   -> Status da conexão
CONNECT RESET 						-> desconecta

Conexão Exemplo

db2 activate database sample
db2 connect to sample
db2 connect reset
db2 deactivate database sample

Conexões

LIST APPLICATIONS [SHOW DETAIL]  -> mostra todas as conexões
FORCE APPLICATION [ALL | xxxx]	 -> desconecta todos os usuários

LIST TABLES [FOR ALL | FOR SCHEMA xxxx]  -> mostra a tabela de usuários

DESC TABLE

-> mostra estrutura da tabela GET INSTANCE -> mostra a instância