从事数据库工作多年,目前看好分布式NeSQL/HTAP数据库在企业客户市场的发展。未来的主要方向是——致力于 NewSQL/HTAP 数据库的推广普及。
分类: Sybase
2014-07-15 15:20:56
--get_par_info.sql
PARAMETERS table_name ;
select s.table_name,
case
when ps.partition_method = 1 then 'range partition'
when ps.partition_method = 3 and ifnull(ps.subpartition_method,0,ps.subpartition_method) = 0 then 'hash partition'
when ps.partition_method = 3 and ifnull(ps.subpartition_method,0,ps.subpartition_method) = 1 then 'hash-range partition'
else 'unknow partition'
end as partition_type,
tc.column_name as partition_key,
tc1.column_name as sub_partition_key,
p.partition_object_id,
p.partition_name,
p.partition_values
from systab s left outer join syspartitionscheme ps on s.object_id = ps.partitioned_object_id
inner join syspartitionkey spk on spk.partitioned_object_id = ps.partitioned_object_id
left outer join syspartition p on p.partitioned_object_id = ps.partitioned_object_id
inner join systabcol tc on tc.column_id = spk.column_id and s.table_id = tc.table_id
left outer join syssubpartitionkey sspk on sspk.partitioned_object_id = p.partitioned_object_id
left outer join systabcol tc1 on tc1.column_id = sspk.column_id and s.table_id = tc1.table_id
where s.table_name = '{table_name}'
运行dbisql执行上面的sql脚本,并传递表明参数:
dbisql -c "uid=DBA;pwd=sql" -onerror exit -nogui READ get_par_info.sql ['lineitem']
dbisql -c "uid=DBA;pwd=sql" -onerror exit -nogui READ get_par_info.sql ['table_2']