1

我正在针对 Oracle 运行 SchemaCrawler 命令行,但无法在输出中获取 Oracle 序列。我只得到与我的正则表达式匹配的表。我已经确认这些序列存在于模式中并且用户可以访问它们。我究竟做错了什么?我的配置如下。

SchemaCrawler:12.01.01

Oracle:11g 企业版发布 11.2.0.4.0

驱动:Oracle JDBC驱动11.1.0.7.0-Production

命令行:sc.cmd -host="my host" -user="my user" -password="my password" -server=oracle -url=jdbc:oracle:thin:@myHost:1521/myService -database="myService" -driver=oracle.jdbc.OracleDriver -schemas="mySchema" -routines= -c=schema -infolevel=standard -loglevel=FINE

特性:

# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=
# ------------------------------- SchemaCrawler --------------------------------
# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=
# SchemaCrawler is a platform (both operating system and database system)
# independent command-line tool to output your database schema and data in a
# readable form. The output is designed to be diff-ed with previous versions of
# your database schema.

# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=
# SchemaCrawler Options
# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=

# Filtering Options
# ------------------------------------------------------------------------------

# Regular expression table and column name pattern to filter table
# and column names
# Column regular expression to match fully qualified column names, 
# in the form "SCHEMANAME.TABLENAME.COLUMNNAME"
# Default: .* for include, <none> for exclude
schemacrawler.table.pattern.include=.*\.PERSOL.*
schemacrawler.table.pattern.exclude=
schemacrawler.column.pattern.include=.*
schemacrawler.column.pattern.exclude=

# Regular expression procedure and procedure parameter name pattern to filter
# procedure and procedure parameter names
# Default: .* for include, <none> for exclude
schemacrawler.procedure.pattern.include=
schemacrawler.procedure.pattern.exclude=.*
schemacrawler.procedure.inout.pattern.include=
schemacrawler.procedure.inout.pattern.exclude=.*

# Regular expression synonym pattern to  filter
# synonym names
# Default: <none> for include, .* for exclude
schemacrawler.synonym.pattern.include=.*\.PERSOL.*
schemacrawler.synonym.pattern.exclude=

# Regular expression sequence pattern to  filter
# sequence names
# Default: <none> for include, .* for exclude
schemacrawler.sequence.pattern.include=.* 
schemacrawler.sequence.pattern.exclude=

# Grep Options
# ------------------------------------------------------------------------------

schemacrawler.grep.column.pattern.exclude=
schemacrawler.grep.column.pattern.include=.*
schemacrawler.grep.procedure.inout.pattern.exclude=
schemacrawler.grep.procedure.inout.pattern.include=.*

schemacrawler.grep.invert-match=false

# Sorting Options
# ------------------------------------------------------------------------------

# Sort orders for objects that are not sorted by name by default
schemacrawler.format.sort_alphabetically.table_columns=false
schemacrawler.format.sort_alphabetically.table_foreignkeys=false
schemacrawler.format.sort_alphabetically.table_indices=false
schemacrawler.format.sort_alphabetically.procedure_columns=false

# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=
# Text Formatting Options
# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=

# Shows all object names with the catalog and schema names, for easier comparison
# across different schemas
# Default: false
schemacrawler.format.show_unqualified_names=false

# Shows standard column names instead of database specific column names
# Default: false
schemacrawler.format.show_standard_column_type_names=false

# Shows ordinal numbers for columns
# Default: false
schemacrawler.format.show_ordinal_numbers=false

# If foreign key names, constraint names, trigger names, 
# specific names for procedures, or index and primary key names 
# are not explicitly provided while creating a schema, most 
# database systems assign default names. These names can show 
# up as spurious diffs in SchemaCrawler output.
#
# All of these are hidden with the -portablenames
# command-line option.
#
# Hides foreign key names, constraint names, trigger names, 
# specific names for procedures, index and primary key names
# Default: false
schemacrawler.format.hide_primarykey_names=false
schemacrawler.format.hide_foreignkey_names=false
schemacrawler.format.hide_index_names=false
schemacrawler.format.hide_trigger_names=false
schemacrawler.format.hide_routine_specific_names=false
schemacrawler.format.hide_constraint_names=false

# Encoding of input files, such as Apache Velocity temaplates
# Default: UTF-8
schemacrawler.encoding.input=UTF-8
# Encoding of SchemaCrawler output files
# Default: UTF-8
schemacrawler.encoding.output=UTF-8

# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=
# Data Output Options
# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=

# Whether to merge rows that differ only in the last column
# Default: false
schemacrawler.data.merge_rows=false

# Whether to show data from CLOB and BLOB objects
# Default: false
schemacrawler.data.show_lobs=false

# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=
# Queries
# --=----=----=----=----=----=----=----=----=----=----=----=----=----=----=----=

编辑

我可以使用我正在连接的帐户运行下面的 SQL,并查看我感兴趣的序列。

SELECT /*+ PARALLEL(AUTO) */
  NULL AS SEQUENCE_CATALOG,
  SEQUENCE_OWNER AS SEQUENCE_SCHEMA,
  SEQUENCE_NAME AS SEQUENCE_NAME,
  INCREMENT_BY AS "INCREMENT",
  MIN_VALUE AS MINIMUM_VALUE,
  MAX_VALUE AS MAXIMUM_VALUE,
  CASE WHEN CYCLE_FLAG = 'Y' THEN 'YES' ELSE 'NO' END AS CYCLE_OPTION,
  ORDER_FLAG,
  CACHE_SIZE,
  LAST_NUMBER
FROM
  ALL_SEQUENCES
WHERE
  SEQUENCE_OWNER NOT IN ('CTXSYS', 'DBSNMP', 'DMSYS', 'MDDATA', 'MDSYS', 'OLAPSYS', 'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'SI_INFORMTN_SCHEMA', 'SYS', 'SYSMAN', 'SYSTEM', 'XDB')
  AND SEQUENCE_OWNER NOT LIKE 'APEX%' and SEQUENCE_OWNER = 'MONET' AND SEQUENCE_NAME LIKE '%PERSOL%'
ORDER BY
  SEQUENCE_OWNER,
  SEQUENCE_NAME
4

1 回答 1

1

SchemaCrawler 提供了两种连接数据库的方法。一种方法是提供 JDBC 驱动程序、url 组合,另一种是提供服务器、主机和端口组合。第二种组合(服务器、主机和端口)将为您提供丰富的数据库特定数据,比 JDBC 提供的开箱即用的数据更多,例如 Oracle 序列信息。(在上面的命令行中,您似乎混合了这两种连接模式,并且 SchemaCrawler 选择了连接到 Oracle 的通用方式。)

请尝试以下修改后的命令行,看看是否适合您:sc.cmd -user="my user" -password="my password" -server=oracle -host=myHost -database="myService" -schemas="mySchema" -routines= -sequences=.* -c=schema -infolevel=maximum

编辑

  • 请注意添加了 -sequences 开关,因为默认情况下不显示序列。
  • 请注意,信息级别需要最大

Sualeh Fatehi,SchemaCrawler

于 2014-12-19T19:43:01.707 回答