4.4 OML4Rサーバーのインストールの検証

OML4Rサーバーのインストールが成功したことを検証するには、前述のspoolコマンドで作成されたログ・ファイルを表示して、次のコマンドを実行できます。

どのインストールでも、いくつかの関数を実行して、正常にインストールされたことを確認できます。

例4-1 サーバーのインストールを検証する実行例

まず、これらのコマンドをデータベース・サーバー上でRインスタンスから直接実行し、次にOML4Rクライアントから実行します。

OREスクリプトを使用してRを起動し、OREライブラリをロードします。

$ ORE
> library(ORE)

サーバーに接続します。この例では、ユーザーOMLUSERとして接続します。

ore.connect("RQUSER", password="RQUSER", service_name="ORCLPDB", 
host="<host name>", all=TRUE)

一部の関数を実行します。

## Is the OML4R client connected to the OML4R server?
## The output of this function should be TRUE.
ore.is.connected()

## List the available database tables.
ore.ls()

## Push an R dataframe to a database table.
df <- data.frame(a="abc",
                b=1.456,
                c=TRUE,
                d=as.integer(1))
of <- ore.push(df)

## Run the self-contained example code in the help files associated with the following functions.
## The examples should not return any errors.
example("ore.odmAI")     ## Builds an OML4SQL attribute importance model.
example("ore.doEval")    ## Runs an embedded R execution function.