ai-center
2020.10
false
UiPath logo, featuring letters U and I in white
AI Center
Automation CloudAutomation SuiteStandalone
Last updated 6 de jun de 2024

2. Configure o banco de dados

Observação: se sua infraestrutura foi provisionada automaticamente usando os modelos ARM, é possível ignorar essa etapa na instalação.

Essa etapa acarreta a criação dos bancos de dados necessários que serão usados pelo instalador do AI Fabric. Há duas opções disponíveis: criar vários bancos de dados ou criar um banco de dados com vários esquemas.

Importante:
  • Essa etapa cria um banco de dados e um login/usuário. Para concluir essa etapa, são necessárias credenciais que permitam essas ações. No SQL Server, são a função dbcreator e a função ddladmin, respectivamente.
  • Os mesmos bancos de dados do AI Fabric (os bancos de dados criados por esta etapa) não podem ser usados em várias instâncias do AI Fabric.

Configurar

  • Abra o Powershell na função de Administrador.
  • Baixe o script aqui, para um exemplo, usando o Powershell:
    wget https://raw.githubusercontent.com/UiPath/ai-customer-scripts/master/database/createDatabases.ps1 -outfile "createDatabases.ps1"wget https://raw.githubusercontent.com/UiPath/ai-customer-scripts/master/database/createDatabases.ps1 -outfile "createDatabases.ps1"
  • É possível se familiarizar com as opções do script inserindo:
    get-help .\)\)createDatabases.ps1 -fullget-help .\)\)createDatabases.ps1 -full
  • Os parâmetros padrão funcionarão para a maioria de cenários:
    <h1>If SQL Server can be accessed through Windows Authentication then:
    ./createDatabases.ps1 -sqlinstance "DESKTOP-LOUPTI1\)\)SQLEXPRESS" -windowsAuthentication "Y"</h1><h1>If SQL Server can be accessed through Windows Authentication then:
    ./createDatabases.ps1 -sqlinstance "DESKTOP-LOUPTI1\)\)SQLEXPRESS" -windowsAuthentication "Y"</h1>

O parâmetro sqlinstance é apenas o nome do SQL Server. Isto é exatamente o que você insere no campo Nome do servidor quando você está usando o SQL Server Management Studio. Por exemplo:



Por padrão, estamos usando vários bancos de dados. Se você deseja usar um banco de dados com vários esquemas, é possível adicionar o sinalizador singleDatabase como Y como abaixo:

<h1>If SQL Server can be accessed through Windows Authentication then:
./createDatabases.ps1 -sqlinstance "DESKTOP-LOUPTI1\)\)SQLEXPRESS" -windowsAuthentication "Y" -singleDatabase "Y"</h1><h1>If SQL Server can be accessed through Windows Authentication then:
./createDatabases.ps1 -sqlinstance "DESKTOP-LOUPTI1\)\)SQLEXPRESS" -windowsAuthentication "Y" -singleDatabase "Y"</h1>
  • O script produzirá o logon e senhas para gerenciar o(s) banco(s) de dado(s) criado(s).

    Mantenha esse login e senha à mão, pois eles serão necessários ao preencher a tela de configuração na Etapa 4. Execute o instalador do aplicativo do AI Fabric. Também na mesma etapa, você precisará dizer se você usou vários bancos de dados ou apenas um. Certifique-se de selecionar a opção certa, ou as verificações de simulação falharão.

    Importante:
    • Certifique-se de que o modo de autenticação do SQL Server esteja habilitado.
    • Certifique-se de que a máquina Linux provisionada na etapa 1 tenha sido adicionada à lista de IPs aprovados do SQL Server.
    • Certifique-se de que as regras do firewall permitam conexões de entrada na porta 1433 (a porta padrão para o SQL Server)

Configuração manual

Vários bancos de dados

Os bancos de dados e as funções também podem ser criados usando o seguinte script manual. Modifique o campo password para o novo login, aifadminmas não adicione aspas simples ou duplas à senha:
--Create Databases:
create database ai_deployer;
create database ai_trainer;
create database ai_helper;
create database ai_pkgmanager;
create database ai_appmanager;
USE [master]
GO
CREATE LOGIN [aifadmin] WITH PASSWORD=N'Admin@123!'  -- (Change the Password as per your requirement )
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- create the user on the target database i.e ai_deployer for the login
USE [ai_deployer]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_deployer]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_helper for the login
USE [ai_helper]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_helper]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_trainer for the login
USE [ai_trainer]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_trainer]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_pkgmanager for the login
USE [ai_pkgmanager]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_pkgmanager]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_appmanager for the login
USE [ai_appmanager]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_appmanager]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO--Create Databases:
create database ai_deployer;
create database ai_trainer;
create database ai_helper;
create database ai_pkgmanager;
create database ai_appmanager;
USE [master]
GO
CREATE LOGIN [aifadmin] WITH PASSWORD=N'Admin@123!'  -- (Change the Password as per your requirement )
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- create the user on the target database i.e ai_deployer for the login
USE [ai_deployer]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_deployer]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_helper for the login
USE [ai_helper]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_helper]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_trainer for the login
USE [ai_trainer]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_trainer]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_pkgmanager for the login
USE [ai_pkgmanager]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_pkgmanager]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_appmanager for the login
USE [ai_appmanager]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_appmanager]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO

Banco de dados único

O banco de dados e as funções também podem ser criados usando o seguinte script manual. Modifique o campo Senha, mas mantenha-o igual para todos os usuários e não adicione aspas simples ou duplas. Também é possível alterar o nome de usuário, mas é necessário manter o mesmo esquema, tendo _schemaName no final, conforme abaixo:

//Create Database
create database aifabric
//Create 5 logins
USE [master]
GO
CREATE LOGIN [aifadmin_helper] WITH PASSWORD=N'Admin@123!'  -- (Change the Password as per your requirement )
CREATE LOGIN [aifadmin_pkgmanager] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_deployer] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_trainer] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_appmanager] WITH PASSWORD=N'Admin@123!'
GO
//Map login to user and associate default schema with the user and grant db_ddladmin role to the user 
USE [aifabric]
GO
CREATE USER [aifadmin_helper]  FOR LOGIN  [aifadmin_helper] WITH DEFAULT_SCHEMA = ai_helper
GO
CREATE SCHEMA ai_helper AUTHORIZATION [aifadmin_helper]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_helper';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_pkgmanager] FOR LOGIN  [aifadmin_pkgmanager] WITH DEFAULT_SCHEMA = ai_pkgmanager
GO
CREATE SCHEMA ai_pkgmanager AUTHORIZATION [aifadmin_pkgmanager]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_pkgmanager';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_deployer]   FOR LOGIN  [aifadmin_deployer] WITH DEFAULT_SCHEMA = ai_deployer
GO
CREATE SCHEMA ai_deployer AUTHORIZATION [aifadmin_deployer]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_deployer';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_trainer]    FOR LOGIN  [aifadmin_trainer] WITH DEFAULT_SCHEMA = ai_trainer
GO
CREATE SCHEMA ai_trainer AUTHORIZATION [aifadmin_trainer]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_trainer';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_appmanager] FOR LOGIN  [aifadmin_appmanager] WITH DEFAULT_SCHEMA = ai_appmanager
GO
CREATE SCHEMA ai_appmanager AUTHORIZATION [aifadmin_appmanager]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_appmanager';
GO//Create Database
create database aifabric
//Create 5 logins
USE [master]
GO
CREATE LOGIN [aifadmin_helper] WITH PASSWORD=N'Admin@123!'  -- (Change the Password as per your requirement )
CREATE LOGIN [aifadmin_pkgmanager] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_deployer] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_trainer] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_appmanager] WITH PASSWORD=N'Admin@123!'
GO
//Map login to user and associate default schema with the user and grant db_ddladmin role to the user 
USE [aifabric]
GO
CREATE USER [aifadmin_helper]  FOR LOGIN  [aifadmin_helper] WITH DEFAULT_SCHEMA = ai_helper
GO
CREATE SCHEMA ai_helper AUTHORIZATION [aifadmin_helper]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_helper';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_pkgmanager] FOR LOGIN  [aifadmin_pkgmanager] WITH DEFAULT_SCHEMA = ai_pkgmanager
GO
CREATE SCHEMA ai_pkgmanager AUTHORIZATION [aifadmin_pkgmanager]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_pkgmanager';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_deployer]   FOR LOGIN  [aifadmin_deployer] WITH DEFAULT_SCHEMA = ai_deployer
GO
CREATE SCHEMA ai_deployer AUTHORIZATION [aifadmin_deployer]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_deployer';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_trainer]    FOR LOGIN  [aifadmin_trainer] WITH DEFAULT_SCHEMA = ai_trainer
GO
CREATE SCHEMA ai_trainer AUTHORIZATION [aifadmin_trainer]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_trainer';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_appmanager] FOR LOGIN  [aifadmin_appmanager] WITH DEFAULT_SCHEMA = ai_appmanager
GO
CREATE SCHEMA ai_appmanager AUTHORIZATION [aifadmin_appmanager]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_appmanager';
GO
  • Configurar
  • Configuração manual
  • Vários bancos de dados
  • Banco de dados único

Esta página foi útil?

Obtenha a ajuda que você precisa
Aprendendo RPA - Cursos de automação
Fórum da comunidade da Uipath
Uipath Logo White
Confiança e segurança
© 2005-2024 UiPath. Todos os direitos reservados.