tables: List Oracle Tables

Description Usage Arguments Details Value Note See Also Examples

View source: R/tables.R

Description

List all tables in the database belonging to a specific owner or table space.

Usage

1
tables(owner="%", table="%", space="%", tolower=TRUE, ...)

Arguments

owner

owner name.

table

table name.

space

table space name.

tolower

whether owner, table, and space output entries should be lowercased.

...

passed to dbConnect.

Details

The arguments owner, table, and space are passed as patterns that are matched by LIKE, where % means any number of characters and _ means exactly one character. Literal % and _ are escaped using two backslashes: "\\%" and "\\_".

In other words, the default value "%" matches all strings.

The ... argument can be used to set username, password, and/or dbname (see dbConnect). Abbrevations like user and pass are allowed. The default database name is determined by the environment variable ORACLE_SID, which can be redefined within an R session using Sys.setenv(ORACLE_SID="foo").

Value

Data frame containing five columns:

owner

owner name.

table

table name.

space

table space name.

rows

number of rows when the table was last analyzed.

analyzed

when the table was last analyzed.

Note

The output is a subset of ALL_TABLES in Oracle, with simplified column names:

OWNER -> owner
TABLE_NAME -> table
TABLESPACE_NAME -> space
NUM_ROWS -> rows
LAST_ANALYZED -> analyzed

See Also

tables is to Oracle as ll (in package gdata) is to R environments.

ora gives an overview of the package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

# Tables belonging to owner "sys":
tables("sys")

# Tables whose name contains "map", preceded by at least one character:
tables(,"%_map%")

# Tables whose name ends with "_map":
tables(,"%\\_map")


## End(Not run)

ora documentation built on May 2, 2019, 3:22 a.m.