使用 PL/SQL 从 Active Directory 获取用户数据
今天我讨论了我之前写的一个 Oracle 过程。
我想使用 PL/SQL 从 Active Directory 获取 7500 个用户电子邮件地址。 AD 将最多返回 1000 行,并且 Oracle 使用的 LDAP 提供程序不支持分页。
因此,我的解决方案是过滤 sAMAccountName 的最后两个字符(*00、*01、*02...等)。这会产生 126 个查询(以数字结尾的帐户名称为 100 个,以字母结尾的帐户名称为 26 个……这对于我的 AD 设置来说已经足够了)。
与我交谈的人(顺便说一句,这是一次工作面试)说他可以用更好的方法来做,但他不会告诉我那种方法是什么。
有人能猜猜这个方法是什么吗?
I had a discussion today regarding an Oracle procedure I wrote some time ago.
I wanted to get 7500 user email addresses from Active Directory using PL/SQL. AD will return a maximum of 1000 rows and the LDAP provider used by Oracle will not support paging.
Therefore, my solution was to filter on the last two characters of the sAMAccountName (*00,*01,*02...etc.). This results in 126 queries (100 for account names ending in digits, 26 for those ending in a letter...this was sufficient for my AD setup).
The person I was speaking to (it was a job interview by the way) said he could have done it a better way, but he would not tell me what that method was.
Could anybody hazard a guess at what this method was?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
真的很琐碎,作为一个求职面试问题,我不知道他们需要什么技能,但在我看来这是一个奇怪的“Oracle”问题,因为它需要详细的 Microsoft AD 知识,但不需要特定的 PL/SQL 知识。
您可能不得不说使用属性范围检索。
这里解释一下
http://msdn.microsoft.com/en-us/library/Aa772308
Really trivial, as a job interview question, I don't know the skills they required, but in my opinion it's a strange "Oracle" question because it requires the need of a detailed knowledge of Microsoft AD, but no particular PL/SQL knowledge.
You probably had to say to use Attribute Range Retrieval.
Here it is explained
http://msdn.microsoft.com/en-us/library/Aa772308
如果结果集按名称排序,您可以只要求名称大于上一个的下一个 1.000 个。
重复此操作,直到得到的结果少于 1.000 或不再有。
If the result set is sorted by name, you could just ask for the next 1.000 with a name greater than the last one.
And repeat it until you get either less than 1.000 or no more results.