Skip to Main Content

Data Science & Machine Learning

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error in .oci.GetQuery(conn, statement, ...) : ORA-29400: data cartridge error ORA-24323: ????? O

BlueGene523Apr 3 2015 — edited Apr 14 2015

Hi,everyone,

            I had  installed  R Enterprise in my Oracle 11.2.0.1 base on win7,using the R 2.13.2, ORE 1.1,  I can using the part function: like

library(ORE)

options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient.exe', show.error.locations=TRUE)

> ore.connect(user = "RQUSER",password = "RQUSERpsw",conn_string = "", all = TRUE)

> ore.is.connected()

[1] TRUE

> ore.ls()

[1] "IRIS_TABLE"

> demo(package = "ORE")

Demos in package 'ORE':

aggregate               Aggregation

analysis                Basic analysis & data processing operations

basic                   Basic connectivity to database

binning                 Binning logic

columnfns               Column functions

cor                     Correlation matrix

crosstab                Frequency cross tabulations

derived                 Handling of derived columns

distributions           Distribution, density, and quantile functions

do_eval                 Embedded R processing

freqanalysis            Frequency cross tabulations

graphics                Demonstrates visual analysis

group_apply             Embedded R processing by group

hypothesis              Hyphothesis testing functions

matrix                  Matrix related operations

nulls                   Handling of NULL in SQL vs. NA in R

push_pull               RDBMS <-> R data transfer

rank                    Attributed-based ranking of observations

reg                     Ordinary least squares linear regression

row_apply               Embedded R processing by row chunks

sql_like                Mapping of R to SQL commands

stepwise                Stepwise OLS linear regression

summary                 Summary functionality

table_apply             Embedded R processing of entire table

> demo("aggregate",package = "ORE")

  demo(aggregate)

  ---- ~~~~~~~~~

Type  <Return> to start : Return

> #

> #     O R A C L E  R  E N T E R P R I S E  S A M P L E   L I B R A R Y

> #

> #     Name: aggregate.R

> #     Description: Demonstrates aggregations

> #     See also summary.R

> #

> #

> #

>

> ## Set page width

> options(width = 80)

> # List all accessible tables and views in the Oracle database

> ore.ls()

[1] "IRIS_TABLE"

> # Create a new table called IRIS_TABLE in the Oracle database

> # using the built-in iris data.frame

>

> # First remove previously created IRIS_TABLE objects from the

> # global environment and the database

> if (exists("IRIS_TABLE", globalenv(), inherits = FALSE))

+     rm("IRIS_TABLE", envir = globalenv())

> ore.drop(table = "IRIS_TABLE")

> # Create the table

> ore.create(iris, table = "IRIS_TABLE")

> # Show the updated list of accessible table and views

> ore.ls()

[1] "IRIS_TABLE"

> # Display the class of IRIS_TABLE and where it can be found in

> # the search path

> class(IRIS_TABLE)

[1] "ore.frame"

attr(,"package")

[1] "OREbase"

> search()

[1] ".GlobalEnv"          "ore:RQUSER"          "ESSR"              

[4] "package:ORE"         "package:ORExml"      "package:OREeda"    

[7] "package:OREgraphics" "package:OREstats"    "package:MASS"      

[10] "package:OREbase"     "package:ROracle"     "package:DBI"       

[13] "package:stats"       "package:graphics"    "package:grDevices" 

[16] "package:utils"       "package:datasets"    "package:methods"   

[19] "Autoloads"           "package:base"      

> find("IRIS_TABLE")

[1] "ore:RQUSER"

> # Select count(Petal.Length) group by species

> x = aggregate(IRIS_TABLE$Petal.Length,

+               by = list(species = IRIS_TABLE$Species),

+               FUN = length)

> class(x)

[1] "ore.frame"

attr(,"package")

[1] "OREbase"

> x

     species  x

1     setosa 50

2 versicolor 50

3  virginica 50

> # Repeat FUN = summary, mean, min, max, sd, median, IQR

> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),

+           FUN = summary)

     species Min. 1st Qu. Median  Mean 3rd Qu. Max. NA's

1     setosa  1.0     1.4   1.50 1.462   1.575  1.9    0

2 versicolor  3.0     4.0   4.35 4.260   4.600  5.1    0

3  virginica  4.5     5.1   5.55 5.552   5.875  6.9    0

> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),

+           FUN = mean)

     species     x

1     setosa 1.462

2 versicolor 4.260

3  virginica 5.552

> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),

+           FUN = min)

     species   x

1     setosa 1.0

2 versicolor 3.0

3  virginica 4.5

> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),

+           FUN = max)

     species   x

1     setosa 1.9

2 versicolor 5.1

3  virginica 6.9

> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),

+           FUN = sd)

     species         x

1     setosa 0.1736640

2 versicolor 0.4699110

3  virginica 0.5518947

> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),

+           FUN = median)

     species    x

1     setosa 1.50

2 versicolor 4.35

3  virginica 5.55

> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),

+           FUN = IQR)

     species     x

1     setosa 0.175

2 versicolor 0.600

3  virginica 0.775

> # More than one grouping column

> x = aggregate(IRIS_TABLE$Petal.Length,

+               by = list(species = IRIS_TABLE$Species,

+                         width = IRIS_TABLE$Petal.Width),

+               FUN = length)

> x

      species width  x

1      setosa   0.1  5

2      setosa   0.2 29

3      setosa   0.3  7

4      setosa   0.4  7

5      setosa   0.5  1

6      setosa   0.6  1

7  versicolor   1.0  7

8  versicolor   1.1  3

9  versicolor   1.2  5

10 versicolor   1.3 13

11 versicolor   1.4  7

12  virginica   1.4  1

13 versicolor   1.5 10

14  virginica   1.5  2

15 versicolor   1.6  3

16  virginica   1.6  1

17 versicolor   1.7  1

18  virginica   1.7  1

19 versicolor   1.8  1

20  virginica   1.8 11

21  virginica   1.9  5

22  virginica   2.0  6

23  virginica   2.1  6

24  virginica   2.2  3

25  virginica   2.3  8

26  virginica   2.4  3

27  virginica   2.5  3

> # Sort the result by ascending value of count

> ore.sort(data = x, by = "x")

      species width  x

1   virginica   1.4  1

2   virginica   1.7  1

3  versicolor   1.7  1

4   virginica   1.6  1

5      setosa   0.5  1

6      setosa   0.6  1

7  versicolor   1.8  1

8   virginica   1.5  2

9  versicolor   1.1  3

10  virginica   2.4  3

11  virginica   2.5  3

12  virginica   2.2  3

13 versicolor   1.6  3

14     setosa   0.1  5

15  virginica   1.9  5

16 versicolor   1.2  5

17  virginica   2.0  6

18  virginica   2.1  6

19     setosa   0.3  7

20 versicolor   1.4  7

21     setosa   0.4  7

22 versicolor   1.0  7

23  virginica   2.3  8

24 versicolor   1.5 10

25  virginica   1.8 11

26 versicolor   1.3 13

27     setosa   0.2 29

> # by descending value

> ore.sort(data = x, by = "x", reverse = TRUE)

      species width  x

1      setosa   0.2 29

2  versicolor   1.3 13

3   virginica   1.8 11

4  versicolor   1.5 10

5   virginica   2.3  8

6      setosa   0.4  7

7      setosa   0.3  7

8  versicolor   1.0  7

9  versicolor   1.4  7

10  virginica   2.1  6

11  virginica   2.0  6

12  virginica   1.9  5

13 versicolor   1.2  5

14     setosa   0.1  5

15 versicolor   1.6  3

16 versicolor   1.1  3

17  virginica   2.4  3

18  virginica   2.5  3

19  virginica   2.2  3

20  virginica   1.5  2

21  virginica   1.6  1

22  virginica   1.4  1

23     setosa   0.6  1

24     setosa   0.5  1

25 versicolor   1.8  1

26  virginica   1.7  1

27 versicolor   1.7  1

> # Preserve just 1 row for duplicate x's

> ore.sort(data = x, by = "x", unique.keys = TRUE)

      species width  x

1      setosa   0.5  1

2   virginica   1.5  2

3  versicolor   1.1  3

4      setosa   0.1  5

5   virginica   2.0  6

6      setosa   0.3  7

7   virginica   2.3  8

8  versicolor   1.5 10

9   virginica   1.8 11

10 versicolor   1.3 13

11     setosa   0.2 29

> ore.sort(data = x, by = "x", unique.keys = TRUE, unique.data = TRUE)

      species width  x

1      setosa   0.5  1

2   virginica   1.5  2

3  versicolor   1.1  3

4      setosa   0.1  5

5   virginica   2.0  6

6      setosa   0.3  7

7   virginica   2.3  8

8  versicolor   1.5 10

9   virginica   1.8 11

10 versicolor   1.3 13

11     setosa   0.2 29

        

but    when I  use the following The ore.doEval command  get the errors,

> ore.doEval(function() { 123 })

Error in .oci.GetQuery(conn, statement, ...) :

  ORA-29400: data cartridge error

ORA-24323: ?????

ORA-06512: at "RQSYS.RQEVALIMPL", line 23

ORA-06512: at line 4

and  I  try to run the        demo("row_apply", package="ORE")  get the  same errors:

demo("row_apply",package = "ORE")

  demo(row_apply)

  ---- ~~~~~~~~~

Type  <Return> to start : Return

> #

> #     O R A C L E  R  E N T E R P R I S E  S A M P L E   L I B R A R Y

> #

> #     Name: row_apply.R

> #     Description: Execute R code on each row

> #

> #

>

> ## Set page width

> options(width = 80)

> # List all accessible tables and views in the Oracle database

> ore.ls()

[1] "IRIS_TABLE"

> # Create a new table called IRIS_TABLE in the Oracle database

> # using the built-in iris data.frame

>

> # First remove previously created IRIS_TABLE objects from the

> # global environment and the database

> if (exists("IRIS_TABLE", globalenv(), inherits = FALSE))

+     rm("IRIS_TABLE", envir = globalenv())

> ore.drop(table = "IRIS_TABLE")

> # Create the table

> ore.create(iris, table = "IRIS_TABLE")

> # Show the updated list of accessible table and views

> ore.ls()

[1] "IRIS_TABLE"

> # Display the class of IRIS_TABLE and where it can be found in

> # the search path

> class(IRIS_TABLE)

[1] "ore.frame"

attr(,"package")

[1] "OREbase"

> search()

[1] ".GlobalEnv"          "ore:RQUSER"          "ESSR"              

[4] "package:ORE"         "package:ORExml"      "package:OREeda"    

[7] "package:OREgraphics" "package:OREstats"    "package:MASS"      

[10] "package:OREbase"     "package:ROracle"     "package:DBI"       

[13] "package:stats"       "package:graphics"    "package:grDevices" 

[16] "package:utils"       "package:datasets"    "package:methods"   

[19] "Autoloads"           "package:base"      

> find("IRIS_TABLE")

[1] "ore:RQUSER"

> # The table should now appear in your R environment automatically

> # since you have access to the table now

> ore.ls()

[1] "IRIS_TABLE"

> # This is a database resident table with just metadata on the R side.

> # You will see this below

> class(IRIS_TABLE)

[1] "ore.frame"

attr(,"package")

[1] "OREbase"

> # Apply given R function to each row

> ore.rowApply(IRIS_TABLE,

+              function(dat) {

+                  # Any R code goes here. Operates on one row of IRIS_TABLE at

+                  # a time

+                  cbind(dat, dat$Petal.Length)

+              })

Error in .oci.GetQuery(conn, statement, ...) :

  ORA-29400: data cartridge error

ORA-24323: ?????

ORA-06512: at "RQSYS.RQROWEVALIMPL", line 26

ORA-06512: at line 4

>

whether my oracle's version 11.2.0.1 has no the RDBMS bug fix, and other  problems? Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2015
Added on Apr 3 2015
3 comments
1,423 views