AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-48285

Minu's questions

Martin Hope
Minu
Asked: 2016-07-02 07:09:28 +0800 CST

可以在可读辅助设备上启用 SQL Server R 服务吗?

  • 4

为了避免主 SQL Server 上的负载过大,我想在主服务器的辅助副本上安装并启用 R 服务。这可能吗?

另外,我可以将计算从远程 R 客户端推送到启用了 R 服务的辅助服务器吗?

这对主要有任何影响吗?

sql-server sql-server-2016
  • 2 个回答
  • 447 Views
Martin Hope
Minu
Asked: 2016-06-21 05:26:51 +0800 CST

SQL Server R 服务 - 找不到存储过程“master..xp_ScaleR_init_job”

  • 3

我正在尝试按照本教程中的说明运行数据科学实验。本教程有 5 节课,每节课都有几个小节。

对于本教程,我正在使用

  • Azure 上的 SQL Server 2016 RC3 虚拟机,启用了 R 服务。
  • RRE for Windows 8.0.0 作为数据科学客户端/R 客户端(用于远程连接到 SQL Server)
  • 创建了一个新的 SQL 登录名,具有对数据库的读、写和 ddl 访问权限 - 用于通过 R 客户端连接到 SQL Server。

我已成功完成第 1 课,即从我的 R 客户端创建 SQL Server 数据对象,查询和修改 SQL Server 数据,以及定义/设置计算上下文。

我在本教程第 2 课的开头遇到了一个错误。
一旦我将计算上下文从本地更改为 sql server,一个简单的汇总函数 (rxsummary) 就会抛出错误。

错误如下所示:

C:\Users\...\Project0\DeepDive Experiment.R(109): Error in try({ : 
  ODBC statement error: [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'master..xp_ScaleR_init_job'.
Error in rxInDbJobIdParam(schedulerJobInstance, FALSE) : 
  hpcServerJob object has an invalid id. Ensure it was returned from a prior rxStartClusterJob() call
Error in rxStartClusterJob(hpcServerJob, timesIsValidated = TRUE, continueOnFailure = FALSE) : 
  Error in try({ : 
  ODBC statement error: [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'master..xp_ScaleR_init_job'.

Error in rxInDbJobIdParam(schedulerJobInstance, FALSE) : 
  hpcServerJob object has an invalid id. Ensure it was returned from a prior rxStartClusterJob() call


任何帮助

  • 为什么会发生此错误?
  • 如何查找/检查主数据库中的存储过程 - 如何检查 xp_scaleR_init_job 是否存在?
  • 如果不存在,如何添加/创建存储过程?

将不胜感激。


为了方便访问,这里是完整的注释脚本,直到我遇到错误:

###########################################DATA SCIENCE DEEP DIVE TUTORIAL###############################################

##Create the SQL Server Data Objects##

#Provide your database connection string in an R variable. 
    #DDUser01 is a login created on the sql server instance for remote login. 
    #It has read, write and ddl access to the DeepDive database.
sqlConnString <- "Driver=SQL Server;Server=*ip address*; Database=DeepDive;Uid=DDUser01;Pwd=*******"   
#Specify the name of the table you want to create, and save it in an R variable.
sqlFraudTable <- "ccFraudSmall"
#Chunking
sqlRowsPerRead = 5000
#Define a variable to store the new data source
sqlFraudDS <- RxSqlServerData(connectionString = sqlConnString,table = sqlFraudTable, rowsPerRead = sqlRowsPerRead) 
#Create a new R variable, sqlScoreTable, to store the name of the table used for scoring.
sqlScoreTable <- "ccFraudScoreSmall"
#Define a second data source object 
sqlScoreDS <- RxSqlServerData(connectionString = sqlConnString,table = sqlScoreTable, rowsPerRead = sqlRowsPerRead)  

##Load Data into SQL Tables Using R##

#Create an R variable, and assign to the variable the file path for the CSV file.
ccFraudCsv <- file.path(rxGetOption("sampleDataDir"), "ccFraudSmall.csv")
#RxTextData function to specify the text data source.
inTextData <- RxTextData(file = ccFraudCsv,      colClasses = c(   
    "custID" = "integer", "gender" = "integer", "state" = "integer",   
    "cardholder" = "integer", "balance" = "integer",    
    "numTrans" = "integer",   
    "numIntlTrans" = "integer", "creditLine" = "integer",    
    "fraudRisk" = "integer"))  
#Call rxDataStep to insert the data into the SQL Server table
rxDataStep(inData = inTextData, outFile = sqlFraudDS, overwrite = TRUE)   

#Variable for creating a path to the source file - score
ccScoreCsv <- file.path(rxGetOption("sampleDataDir"), "ccFraudScoreSmall.csv") 
#RxTextData function to get the data and save it in the variable
inTextData <- RxTextData(file = ccScoreCsv,      colClasses = c(   
    "custID" = "integer", "gender" = "integer", "state" = "integer",   
    "cardholder" = "integer", "balance" = "integer",    
    "numTrans" = "integer",   
    "numIntlTrans" = "integer", "creditLine" = "integer"))  
#Call rxDataStep to overwrite the current table with the new schema and data.
rxDataStep(inData = inTextData, sqlScoreDS, overwrite = TRUE)

##Query the Data ##

#Use the function rxGetVarInfo and specify the data source you want to analyze
rxGetVarInfo(data = sqlFraudDS)   

##Modify Metadata##

#Mapping of USA State abbreviations (categorical) to their integer identifiers
#Create an R variable that holds the vector of strings to add to it - different states of the USA.
stateAbb <- c("AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DC",     
    "DE", "FL", "GA", "HI","IA", "ID", "IL", "IN", "KS", "KY", "LA",   
    "MA", "MD", "ME", "MI", "MN", "MO", "MS", "MT", "NB", "NC", "ND",   
    "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR", "PA", "RI","SC",   
    "SD", "TN", "TX", "UT", "VA", "VT", "WA", "WI", "WV", "WY")  
#Create a column information object that specifies the mapping of the existing integer values to the categorical levels
    #This statement also creates factor variables for gender and cardholder.
ccColInfo <- list(         
    gender = list(   
        type = "factor",    
        levels = c("1", "2"),  
        newLevels = c("Male", "Female")),      
    cardholder = list(type = "factor",    
        levels = c( "1", "2"),     
        newLevels = c("Principal", "Secondary")),     
        state = list(type = "factor", levels = as.character(1:51), newLevels = stateAbb)   
        )  
#Update the SQL Server data source that uses the updated data
sqlFraudDS <- RxSqlServerData(connectionString = sqlConnString,  
table = sqlFraudTable, colInfo = ccColInfo,  
rowsPerRead = sqlRowsPerRead) 
#Query new information
rxGetVarInfo(data = sqlFraudDS)     

##Create and Set a Compute Context##

#Specify the connection string for the instance where computations will take place.
sqlConnString <- "Driver=SQL Server;Server=*ip address*; Database=DeepDive;Uid=DDUser01;Pwd=*******"   
#Specify the location of the shared directory (temp folder for workspace objects) and save it in a variable.
sqlShareDir <- paste("c:AllShare", Sys.getenv("USERNAME"), sep="")   
#Create shared directory if it does not exist
if (!file.exists(sqlShareDir)) dir.create(sqlShareDir, recursive = TRUE)
#Specify how you want the output handled. 
    #Here, you are indicating that the R session on the workstation should always wait for R job results, 
    #but not return console output from remote computations.
sqlWait <- TRUE   
sqlConsoleOutput <- FALSE 
#Define the compute context object
sqlCompute <- RxInSqlServer(  
     connectionString = sqlConnString,        
     shareDir = sqlShareDir,       
     wait = sqlWait,   
     consoleOutput = sqlConsoleOutput)  
#ALTERNATIVE:Enable Tracing on the Compute Context
sqlComputeTrace <- RxInSqlServer(   
    connectionString = sqlConnString,        
    shareDir = sqlShareDir,  
    wait = sqlWait,   
    consoleOutput = sqlConsoleOutput,       
    traceEnabled = TRUE,    traceLevel = 7)  
#Change Compute Context to the Server
rxSetComputeContext(sqlCompute)   

##Compute Summary Statistics##

#Compute summary statistics for several of the variables
##THIS IS WHERE I FACE THE ERROR##
sumOut <- rxSummary(formula = ~gender + balance + numTrans + numIntlTrans + creditLine, data = sqlFraudDS)  
sql-server-2016 r
  • 2 个回答
  • 1252 Views
Martin Hope
Minu
Asked: 2016-06-16 13:23:07 +0800 CST

将独立的 Microsoft R Server 连接到带 R Services 的 SQL Server 和不带 R Services 的 SQL Server

  • 4

假设我有 3 台机器。
我的第一台机器上装有 SQL Server 2016 和 R Services。
我的第二台机器有 SQL Server 2016,但没有启用 R 服务。
我的第三台机器上安装了独立的 Microsoft R Server。

我知道,因为我的第一台机器有带 R 服务的 SQL Server,所以我可以将 R 脚本作为存储过程存储在 SQL Server 上,稍后调用它进行分析。

我的问题在于我的独立 Microsoft R Server 如何连接到 SQL Server(启用和不启用 R 服务)。
据我了解,它使用 ODBC 连接到 SQL Server 并使用 RevoscaleR 函数查询或分析 SQL 数据 - 在这两种情况下。

如果是这样的话,

  • 使用 R Services 连接到 SQL Server 与不使用 R Services 的 SQL Server 相比,我的机器 3(独立 MRS)有什么好处或限制?
  • 在任何一种情况下,我都可以从我的 R IDE 远程调用任何存储过程吗?
  • 在这两种情况下,我都可以将计算上下文推送到 SQL Server 吗?
  • 与没有 R Services 的 SQL Server 相比,带有 R Services 的 SQL Server 为独立的 Microsoft R Server 提供了什么特别之处。
  • 数据库引擎以任何一种方式执行其他任务的能力有什么不同吗?


想象一下,我不愿意在我的 SQL Server 上启用 R 服务,因为它可能会占用内存并降低数据库引擎本身的性能。我想要做的就是获得一个独立的 Microsoft R Server 并将其连接到没有 R Services 的 SQL Server,并获得所有可伸缩性和性能。
这样做我错过了什么?

sql-server sql-server-2016
  • 1 个回答
  • 1422 Views
Martin Hope
Minu
Asked: 2016-06-13 15:09:08 +0800 CST

SQL Server 2016 - Microsoft R Client 与独立的 Microsoft R Server 有什么不同吗?

  • 2

除了 SQL Server 2016 上的集成 R 服务,Microsoft 还提供企业级 Microsoft R Server 作为独立安装。MSDN 上的一些文档表明,独立的 MS R Server 不同于数据科学 Microsoft R Client。

这是来自 MSDN 页面的图片(左下角): https ://msdn.microsoft.com/en-us/library/mt696069.aspx
MSDN 页面上的 R 服务器与 R 客户端

数据科学客户端链接将您带到此处:https ://msdn.microsoft.com/en-us/library/mt696067.aspx

但是设置向导评论说它们是同一回事。

在此处输入图像描述 如果有人对此有任何清楚的了解,请告知。

installation sql-server-2016
  • 1 个回答
  • 952 Views
Martin Hope
Minu
Asked: 2016-06-10 06:57:51 +0800 CST

SQL Server 2016 R Services可以用来连接Hadoop数据吗?

  • 1

我最近才尝试使用 SQL Server 2016。因此,如果我的假设不正确,请纠正我:从对SQL Server R Services

的 一些研究中,我发现RxHDFSConnect和RxHDFSFileSystem函数有助于将数据从 Hadoop 直接加载到 SQL Server 2016 数据库中。

  • 如果没有与 Hadoop 的Polybase连接,这些功能仍然可以工作吗?
  • 如果是,为什么要使用 Polybase 连接?
sql-server-2016 hadoop
  • 1 个回答
  • 463 Views
Martin Hope
Minu
Asked: 2016-06-09 05:30:44 +0800 CST

通过 Microsoft R Server 的独立安装使用 SQL Server 2016 R Services

  • 3

我一直在试验 SQL Server 2016 及其 R 服务。我的机器上还安装了独立的 Microsoft R Server。

在独立的 Microsoft R Server 上使用 SQL Server R Services 是一个很好的用例,因为两者都具有企业级 R 平台的特性。

sql-server-2016 r
  • 1 个回答
  • 603 Views
Martin Hope
Minu
Asked: 2014-09-28 09:58:15 +0800 CST

我如何获得此查询?数据库服务器

  • -2

我有一个数据库模式:

member(memb_no, name, age)  
book(isbn, title, authors, publisher)  
borrowed(memb_no, isbn, date)  

这是问题:

对于每个出版商,打印出借过该出版商五本书以上的成员的姓名。

我该如何为此编写查询?

以下是我的尝试:

Select B.publisher,
M.memb_no, M.name  
From book as B,
member as M,
borrowed as R  
Where M.memb_no = R.memb_no and B.isbn = R.isbn and R.isbn in   
(select B.publisher, count (R.isbn)   
from borrowed as R and book as B   
where B.isbn = R.isbn   
group by B.publisher   
having count >5); 

请指出错误并解释。

sql-server aggregate
  • 2 个回答
  • 1263 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve