Pesquisa

sábado, 8 de novembro de 2014

Criando Sequence no Oracle

Como criar Sequence no Oracle de forma "automática".

declare 
  cnt number;
begin
  for r in (select SEQUENCE_NAME from all_sequences where sequence_owner = 'DATABASE') loop
    dbms_output.put_line('drop sequence ' || r.Sequence_name || ' ;');
  end loop;
end;

declare 
  cnt number;
begin
  for r in (select table_name from all_tables  where owner = 'DATABASE' and SUBSTR(table_name,0,2) <> 'DM') loop
    dbms_output.put_line('create sequence sec_' || SUBSTR(r.table_name,0,26) || ' minvalue 1 maxvalue 9999999999 start with 1 increment by 1 nocache cycle;');
  end loop;
end;

Fonte: Rodrigo Araujo

domingo, 2 de novembro de 2014

Como gerenciar o IIS por programação?

Aqui está um trecho de código que irá guiá-lo criando o objeto DirectoryEntry e chamar o método Invoke (...) com o parâmetro adequado para fazer a operação específica com o pool de aplicativos do IIS:

const string APPLICATION_POOL_URL = "IIS://KUNAL-CHOWDHURY.COM/W3SVC/AppPools/BlogPool";
var directoryEntry = new DirectoryEntry(APPLICATION_POOL_URL, USERNAME, PASSWORD);

// call to stop the Application Pool
directoryEntry.Invoke("Stop", null);

// call to start the Application Pool
directoryEntry.Invoke("Start", null);

// call to recycle the Application Pool
directoryEntry.Invoke("Recycle", null);

Fonte: http://www.kunal-chowdhury.com/2013/08/how-to-manage-iis-application-pool.html