Árvore de páginas


Produto:

Datasul.

Ocorrência:

Para uma possível importação do ambiente de produção para homologação/teste do Planning.

Passo a passo:

1. Caso já exista no SQLServer as que estão sendo importadas (Ex: DecisionModeling, Datasul_BI_Metadata, etc..), clique com o botão direito sobre a base desejada, menu “Tarefas”, menu “Restaurar” e “Banco de Dados”:

2. Selecionar o arquivo de backup para que possa ser restaurado no banco de dados desejado, conforme imagem abaixo:

3. Após selecionar o arquivo backup, selecionar "Opções" e marcar para "Substituir o banco existente".

Clicar em “OK” e a base será restaurada.

Passos após a restaurações das bases do Planning:

1. No banco de dados "Datasul_BI_Metadata", alterar o nome do servidor na coluna "Datasource" na tabela “Technical_Scopes” para o nome do servidor onde está sendo restaurado o banco.

 

update Technical_Scopes
set Datasource = 'JVD0748\PLANNING'
where
Integrated_Security = 1

2. Colocar permissões para seu usuário em todos os planos/objetos executando o Script abaixo:

USE Datasul_BI_Metadata
DECLARE @OWNER AS VARCHAR(128)
SET @OWNER = 'seu.usuario'
DELETE FROM PERMISSIONS WHERE Object_Instance_Id NOT IN
(select distinct object_id AS 'Object_Instance_Id'
from DecisionModeling.dbo.analysisobject
union
select distinct object_security_id AS 'Object_Instance_Id'
from DecisionModeling.dbo.planfolder)

DELETE FROM OBJECT_SECURITY_INSTANCES WHERE Object_Instance_Id NOT IN (select distinct object_id AS 'Object_Instance_Id' from DecisionModeling.dbo.analysisobject union select distinct object_security_id AS 'Object_Instance_Id' from DecisionModeling.dbo.planfolder)
UPDATE object_security_instances SET Owner_Id = @OWNER
INSERT INTO Object_Security_Instances
SELECT DISTINCT Object_Id AS 'Object_Instance_Id', NULL, NULL, NULL, @OWNER As 'Owner_Id'
FROM DecisionModeling.DBO.AnalysisObject
WHERE DecisionModeling.DBO.AnalysisObject.Object_Id NOT IN (SELECT DISTINCT Object_Instance_Id FROM Object_Security_Instances)
UNION
SELECT DISTINCT object_security_id AS 'Object_Instance_Id', NULL, NULL, NULL, @OWNER As 'Owner_Id'
FROM DecisionModeling.DBO.PlanFolder
WHERE DecisionModeling.DBO.PlanFolder.object_security_id NOT IN (SELECT DISTINCT Object_Instance_Id FROM Object_Security_Instances)
INSERT INTO Permissions
SELECT 'Everyone' AS 'Identity_Id', 2 AS 'Read', 2 AS 'Write', 2 AS 'Delete', 0 AS 'Group', Object_Instance_Id As 'Object_Instance_Id'
FROM Object_Security_Instances WHERE Object_Instance_Id NOT IN (SELECT DISTINCT Object_Instance_Id FROM Permissions)

 

Assim concluirá a importação de um ambiente do Planning.

Observações: