sexta-feira, 28 de janeiro de 2011

Ambiente gráfico remoto Linux em Windows

Um bom tutorial de como ver o ambiente gráfico Linux em Windows. Simples e sem complicações.

http://www.cse.unsw.edu.au/~helpdesk/documentation/Putty.html (em inglês)

Irão precisar do software:

http://www.straightrunning.com/XmingNotes/

sexta-feira, 21 de janeiro de 2011

Importar dados no Oracle SQL

Para importar dados para dentro de uma base de dados Oracle, pode-se usar o Import Data Pump.

Para começar é necessário criar uma directoria dentro da base de dados:

CREATE OR REPLACE DIRECTORY impdp_dir AS '/home/oracle';

E dar permissões de acesso ao utilizador que irá realizar o import:

GRANT READ, WRITE ON DIRECTORY impdp_dir TO utilizador;

Não convém nada importar os dados com um utilizador dba, pois caso não se saiba exactamente o que está dentro do dados tal importação poderá dar, eventualmente, mais permissões do que se deseja.

Seguidamente importar da linha de comandos do sistema operativo os dados. No exemplo seguinte está-se a usar Linux:

impdp utilizador/password DIRECTORY=impdp_dir DUMPFILE=dados_importar.dmp FULL=y LOGFILE=resultado.log

E pronto. Dados importados.

sexta-feira, 14 de janeiro de 2011

Instalação e Configuração do SAMBA

Para actualizar o SAMBA numa máquina Red Hat Linux efectuar os seguintes passos como root (neste caso está-se a instalar a versão 3.5.6-43):

  1. Obter o software. Por exemplo yum install samba ou em: http://ftp.sernet.de/pub/samba/3.5/rhel/5/x86_64/
  2. Descarregar os pacotes: libsmbclient0-3.5.6-43.el5.x86_64.rpm, samba3-3.5.6-43.el5.x86_64.rpm, samba3-client-3.5.6-43.el5.x86_64.rpm e libwbclient0-3.5.6-43.el5.x86_64.rpm
  3. executar o comando

    rpm -U
    libsmbclient0-3.5.6-43.el5.x86_64.rpm samba3-3.5.6-43.el5.x86_64.rpm samba3-client-3.5.6-43.el5.x86_64.rpm, libwbclient0-3.5.6-43.el5.x86_64.rpm
  4. Iniciar o serviço : service smb start
  5. Adicionar um ou mais utilizadores que poderão aceder ao serviço (caso se use tdbsam) no sistema operativo caso ainda não existam:

    useradd utilizador

    passwd palavrachave

  6. Adicionar o utilizador para que possa aceder ao SAMBA (caso se use tdbsam) e escrever a password de acesso: pdbedit -a utilizador
  7. Editar o ficheiro /etc/samba/smb.conf

    Exemplo de ficheiro com um share denominado partilha:

    [global]
    workgroup = MYGROUP
    server string = Samba Server Version %v
    load printers = yes
    security = user
    passdb backend = tdbsam
    cups options = raw
    idmap uid = 16777999-55555431
    idmap gid = 16777999-55554431
    template shell = /bin/false
    winbind use default domain = no


    [partilha]
    comment = Logs APPS Partilhados
    path = /var/logs/httpd
    browseable = yes
    writable = yes
    valid users = utilizador





  8. Reiniciar o serviço: service smb restart
  9. Experimentar aceder a partir do windows ao share

Ir ao Windows Explorer por exemplo e escrever \\123.123.123.123\partilha. Irá aparecer uma caixa para login.


Caso ocorra algum problema verificar se quer o smb.conf quer o utilizador estão bem criados com os comandos:

testparm /etc/samba/smb.conf
pdbedit -Lv utilizador

Tabelas de Sistema de Oracle SQL

Tabela de Sistema
Descrição
ALL_ARGUMENTS Arguments in object accessible to the user
ALL_CATALOG All tables, views, synonyms, sequences accessible to the user
ALL_COL_COMMENTS Comments on columns of accessible tables and views
ALL_CONSTRAINTS Constraint definitions on accessible tables
ALL_CONS_COLUMNS Information about accessible columns in constraint definitions
ALL_DB_LINKS Database links accessible to the user
ALL_ERRORS Current errors on stored objects that user is allowed to create
ALL_INDEXES Descriptions of indexes on tables accessible to the user
ALL_IND_COLUMNS COLUMNs comprising INDEXes on accessible TABLES
ALL_LOBS Description of LOBs contained in tables accessible to the user
ALL_OBJECTS Objects accessible to the user
ALL_OBJECT_TABLES Description of all object tables accessible to the user
ALL_SEQUENCES Description of SEQUENCEs accessible to the user
ALL_SNAPSHOTS Snapshots the user can access
ALL_SOURCE Current source on stored objects that user is allowed to create
ALL_SYNONYMS All synonyms accessible to the user
ALL_TABLES Description of relational tables accessible to the user
ALL_TAB_COLUMNS Colunas de tabelas, views e clusters do utilizador
ALL_TAB_COL_STATISTICS Columns of user's tables, views and clusters
ALL_TAB_COMMENTS Comments on tables and views accessible to the user
ALL_TRIGGERS Triggers accessible to the current user
ALL_TRIGGER_COLS Column usage in user's triggers or in triggers on user's tables
ALL_TYPES Description of types accessible to the user
ALL_UPDATABLE_COLUMNS Description of all updatable columns
ALL_USERS Information about all users of the database
ALL_VIEWS Description of views accessible to the user
DATABASE_COMPATIBLE_LEVEL Database compatible parameter set via init.ora
DBA_DB_LINKS All database links in the database
DBA_ERRORS Current errors on all stored objects in the database
DBA_OBJECTS All objects in the database
DBA_ROLES All Roles which exist in the database
DBA_ROLE_PRIVS Roles granted to users and roles
DBA_SOURCE Source of all stored objects in the database
DBA_TABLESPACES Description of all tablespaces
DBA_TAB_PRIVS Todos os grants em objectos da base de dados
DBA_TRIGGERS All triggers in the database
DBA_TS_QUOTAS Tablespace quotas for all users
DBA_USERS Information about all users of the database
DBA_VIEWS Description of all views in the database
DICTIONARY Description of data dictionary tables and views
DICT_COLUMNS Description of columns in data dictionary tables and views
GLOBAL_NAME global database name
NLS_DATABASE_PARAMETERS Permanent NLS parameters of the database
NLS_INSTANCE_PARAMETERS NLS parameters of the instance
NLS_SESSION_PARAMETERS NLS parameters of the user session
PRODUCT_COMPONENT_VERSION version and status information for component products
ROLE_TAB_PRIVS Table privileges granted to roles
SESSION_PRIVS Privileges which the user currently has set
SESSION_ROLES Roles which the user currently has enabled.
SYSTEM_PRIVILEGE_MAP Description table for privilege type codes. Maps privilege type numbers to type names
TABLE_PRIVILEGES Grants on objects for which the user is the grantor, grantee, owner, or an enabled role or PUBLIC is the grantee
TABLE_PRIVILEGE_MAP Description table for privilege (auditing option) type codes. Maps privilege (auditing option) type numbers to type names

quarta-feira, 12 de janeiro de 2011

Ant - Failed to create task or type scp

Ao executar o ant ocorre o erro: "Failed to create task or type scp".

A solução para este problema é simples. Basta ir ao site: http://www.jcraft.com/jsch, efectuar download do jar e colocar o mesmo dentro da pasta lib do ant que estão a executar.