Schemacrawler不输出Oracle序列

时间:2014-12-18 21:11:35

标签: oracle schemacrawler

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

SchemaCrawler:12.01.01

Oracle:11g企业版11.2.0.4.0版

驱动程序:Oracle JDBC驱动程序11.1.0.7.0-生产

命令行: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

1 个答案:

答案 0 :(得分: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

<强> EDITS

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

Sualeh Fatehi,SchemaCrawler