วันจันทร์ที่ 12 กรกฎาคม พ.ศ. 2553

Reporting Service , Subscription with Windows integrated security

หลังจากพยายามหาวิธีการมานาน สำหรับการทำ Subscription ใน Reporting service
ด้วยการ Connect data source ที่มี Secure เป็นแบบ Windows integrated security  ก็ได้พบซะทีว่า
"มันทำไม่ได้"  - -" แอบเซ็งครับ

REF : http://database.itags.org/sql-server/377790/

Reporting Service connecting to Analysis Service using Data source

ในกรณีที่มีการสร้าง Roles เพื่อ Grant สิทธิ์การเข้าถึงข้อมูลให้แต่ละ User ใน OLAP แล้ว
การที่จะ Deploy Reporting service ให้ทำงานตามสิทธิ์ที่แต่ละ User จะมองเห็นข้อมูลนั้น
อาจจะค่อนข้างยุ่งยากสักนิด แต่สามารถทำได้ ขึ้นอยู่กับว่า OLAP Server และ Report Server
เป็น Server ตัวเดียวกัน หรือแยกกันอยู่ ในกรณีที่เป็นเครื่องเดียวกันจะง่ายกว่านิดหน่อยครับ



กรณีแรก SSAS กับ SSRS อยู่ใน Server ตัวเดียวกัน

การ เข้าใช้งาน Report จะมีการ Set secure 2 ขั้นตอนคือ

1 การ Connect เข้า SSRS
2 การ Connect จาก SSRS --> SSAS (OLAP)

หากขั้นตอนการ Connect จาก SSRS --> SSAS นั้นปัจจุบันใช้ User ที่เป็น Admin ในการ Access
ข้อมูลใน OLAP ซึ่งไม่ว่าตอน Connect เข้า RS จะใช้ User อะไร (เช่น bi_user,oper_user,report_user)
ก็ตาม แต่ตอน Connect เข้า SSAS จะใช้ user Admin เสมอซึ่งจะทำให้ไม่สามารถใช้ความสามารถของ SSAS ในเรื่องของ Roles ได้เลย เนื่องจาก user Admin เป็น user ที่สามารถ Access data ได้ทั้งหมด

จาก Policy ใหม่เรื่องการ Set user authen ในการ Access data
จึงได้ทำ Research วิธีการใช้ Role ใน SSAS ร่วมกับ SSRS

Connect using:

(1) - Credentials supplied by the user running the report
Use as Windows credentials when connecting to the data source

Connection แบบนี้จำเป็นต้อง เลือก Window credentials เสมอ และตอนรันรายงานจะขึ้นให้ใส่ User / Password ทุกครั้งซึ่งคงไม่เหมาะ

(2) - Credentials stored securely in the report server
-Use as Windows credentials when connecting to the data source
-Impersonate the authenticated user after a connection has been made to the data source

Connection ปัจจุบันที่ใช้อยู่คือข้อนี้ ร่วมกับ Option 1

เป็นการระบุไปเลยว่าตอน Access เข้า OLAP จะใช้ User ไหน ซึ่งขัดกับนโยบายใหม่ที่ต้องการ
ให้มีการแบ่งความรับผิดชอบในเรื่อง Enterprise ที่ Key acct ดูแล
Option สองตัวนี้ไม่สามารถใช้ร่วมกันได้
 
 
(3) - Windows integrated security
 
จากการศึกษาถึงวิธีการ Connect วิธีนี้จากเครื่อง TEST
- SSRS (BI-REPORT-SERV)
- SSAS (BI-OLAP-SERV)

กระณีเครื่อง OLAP และ REPORTING เป็นคนละเครื่อง
หากจะใช้วิธีนี้จำเป็นที่จะต้องแก้ไขค่า Configure ใน ReportServer ในส่วนของ Directory Security

- Open IIS -- > Web Sites --> Default Web site
- Right click in "Reports" choose Property
- Select "Directory Security" tab
- Click edit in "Authentication and access control"
- In "Authentication access" Select "Basic authentication (password is sent in clear text)"
- Uncheck "Integrated windows authentication"
ซึ่งปกติแล้วค่า Default จะเป็น "Integrated windows authentication"

แต่หาก SSRS and SSAS เป็นเครื่องเดียวกัน สามารถใช้ Option นี้ได้เลย ไม่จำเป็นต้องแก้ Configure

วันจันทร์ที่ 5 กรกฎาคม พ.ศ. 2553

Visual Totals in MDX and Role Security

MDX , Total All members summary problem
บทความนี้ขอกล่าวถึง Measurement Summary  ในระบบ OLAP ซึ่งมีประโยชน์มากๆ
ในกรณีที่หน่วยงานมีการแบ่งส่วนการดูแลข้อมูล / ลูกค้า / ยอดขายต่าง ๆ แล้ว หากมีการสร้าง Roles ขึ้นมาควบคุมการเข้าถึงข้อมูลแล้ว อาจเคยเจอปัญหาเรื่องยอดรวมเป็นยอดรวมของทั้งหมด แทนที่จะเป็นยอดรวมของลูกค้าที่ดูแล เป็นต้น

ได้ค้นหาข้อมูลจนได้พบว่า จริงๆ แล้วใน Role ที่สร้างขึ้นในส่วนการจำกัดสิทธิ์ (Dimension data) นั้นใน Advance tab นั้นมี Option ให้เลือกซึ่งไม่ได้ Default ไว้ให้ นั่นคือ "Enable Visual Totals" ซึ่งเป็น Option ที่จะคำนวนยอดรวมเฉพาะข้อมูลที่ User มีสิทธิ์เข้าถึงได้เท่านั้น  ซึ่งจริง ๆ แล้วตามหลักการควรจะต้อง Enable option นี้เสมอเมื่อมีการสร้าง Roles ขึ้นมา (อันนี้ขึ้นอยู่กับจุดประสงค์การใช้งาน)





How to set / enable Visual Total in OLAP Roles.

To be continue....


Ref . http://blogs.microsoft.co.il/blogs/barbaro/archive/2008/02/06/visual-totals-in-mdx-and-role-security.aspx