免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 11238 | 回复: 5

如何知道自己所使用的license信息? [复制链接]

论坛徽章:
0
发表于 2007-01-19 14:13 |显示全部楼层
查看了公司数据库服务器里sybase的SYSAM 2.0目录里的license文件夹,发现里面一堆license。我想知道sybase目前正在使用哪个license文件,通过什么方式可以知道该license的使用截止时间?

论坛徽章:
0
发表于 2007-01-19 15:44 |显示全部楼层
有一个license_enabled的函数,可以查询你的license信息
还有你可以从sysam中的log日志中,查看license信息

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-06-20 06:20:00
发表于 2007-01-23 09:07 |显示全部楼层
(转的)一个很好的存储过程 sp_license
set nocount on
go
set flushmessage on
go
use master
go
if charindex("sa_role", show_role()) = 0
or charindex("sso_role", show_role()) = 0
begin
   print ""
   print ""
   print "***************************************"
   print "***************************************"
   print " You need 'sa_role' and 'sso_role' "
   print " to run this script."
   print " Please retry with these roles enabled."
   print " Aborting..."
   print "***************************************"
   print "***************************************"
   print " "
   print " "
   print " "
   print ""
   set background on  -- terminate this script now
end
go

--
-- check we're at version 12.0 or later
--
if isnull(object_id("master.dbo.sysqueryplans"),99) >= 99
begin
   print ""
   print ""
   print "****************************************"
   print "****************************************"
   print " This script requires ASE 12.0 or later."
   print " Aborting..."
   print "****************************************"
   print "****************************************"
   print " "
   print " "
   print ""
   set background on  -- terminate this script now
end
go

------------------------------------------------------------------------------

use sybsystemprocs
go

print "Creating procedure 'sp_license'..."

if object_id("sp_license") <> NULL
begin
   drop proc sp_license
end
go

create proc sp_license
/* Copyright (c) 2004 Rob Verschoor/Sypron B.V. */
   @p_option varchar(20)=NULL
as
begin
    declare @cfgopt int, @cfgval int, @cfgval_fmt varchar(20), @cfgname varchar(40)
        declare @v varchar(80), @c varchar(80)
        declare @x1 int, @x2 int, @x3 int
    set nocount on

    select @p_option = ltrim(rtrim(upper(@p_option)))

        select @x1 = charindex("/", substring(@@version,28,50))
        select @x2 = charindex("/", substring(@@version,28+@x1,50))
        select @x3 = charindex("/", substring(@@version,28+@x1+@x2,50))

        select @v = "(" + substring(@@version,28,@x1+@x2+@x3) + ")"
        select @c = " Current ASE server: " + @@servername + " " + @v
        print @c

   create table #licensekeys (optname varchar(15), version varchar(12), description varchar(28), cfgopt int)
   insert #licensekeys values ('ASE_SERVER',                "12.0+",                "Enterprise Edition", 0)
   insert #licensekeys values ('ASE_SBE',                        "12.5.0.2+",        "ASE Small Business Edition", 0)
   insert #licensekeys values ('ASE_DEV',                        "12.5.0.1+",        "ASE Developer's Edition", 0)
   insert #licensekeys values ('ASE_HA',                        "12.0+",                "High Availability", 378)
   insert #licensekeys values ('ASE_JAVA',                        "12.0+",                "Java-in-ASE", 339)
   insert #licensekeys values ('ASE_ASM',                        "12.0+",                "Advanced Security Mechanisms", 400)
   insert #licensekeys values ('ASE_DTM',                        "12.0+",                "Distributed Transaction Mgt.", 381)
   insert #licensekeys values ('ASE_EJB',                        "12.5+",                "Enterprise Java Beans", 392)
   insert #licensekeys values ('ASE_XFS',                        "12.5+",                "External File Systems", 285)
   insert #licensekeys values ('ASE_EFTS',                        "12.5+",                "Full text search", 287)
   insert #licensekeys values ('ASE_DIR',                        "pre-12.5.0.2",        "LDAP", -1)
   insert #licensekeys values ('ASE_DIRS',                        "12.5.0.2+",        "LDAP", 418)
   insert #licensekeys values ('ASE_XRAY',                        "12.5.0.3+",        "DBXRay", -1)
   insert #licensekeys values ('ASE_XML',                        "12.5.1+",                "Native XML in ASE", 419)
   insert #licensekeys values ('ASE_WEBSERVICES',        "12.5.1+",                "Webservices in ASE", 420)
   insert #licensekeys values ('ASE_MESSAGING',                "12.5.2+",                "Real-Time Database Services", 429)

   -- apply filter
   print ""
   select
       l.optname "License Option",
       l.description "Description",
       case license_enabled(l.optname)
                         when 1 then "Enabled"
                         when 0 then "Disabled"
                         else version + " only"
                         end "Option Status",
                 --right(space(14)+
                 case c.value when 0 then 'Disabled (0)' when 1 then 'Enabled (1)' else '' end
                 --,14)
                 "Cfg.Value(run)"
        from master..syscurconfigs c, #licensekeys l
   where optname = isnull(@p_option, optname)
        and c.config =* l.cfgopt

   if @@rowcount = 0
        begin
           print " "
           print " No such license option: %1!", @p_option
                return(0)
        end

   if @p_option <> NULL
   begin
      select @cfgopt = cfgopt
      from #licensekeys
      where optname = @p_option

      if @cfgopt = 0
      begin
         print ""

                 if @p_option = 'ASE_SERVER'
                 begin
                   print " In 12.5+, the ASE_SERVER option is needed to run the ASE Enterprise Edition"
                   print " (no ASE-implied limits on the number of users or engines)."
                   print " In 12.0, the ASE_SERVER option is needed to enable other license options."
                 end

                 if license_enabled(@p_option) = NULL
                         return(0)

                 if @p_option = 'ASE_DEV'
                 begin
                   print " The free ASE Developer's edition automatically enables most other license "
                   print " options, but limits the number of user connections to 25 (in 12.5.1, to 5)"
                   print " and the number of engines to 1."
                 end

                 if @p_option = 'ASE_SBE'
                 begin
                   print " The ASE Small Business Edition limits the number of user connections to 256"
                   print " and the number of engines to 4."
                 end

         print ""
         print " The '%1!' option takes effect automatically during ASE startup.",  @p_option

         return(0)
      end

      if @cfgopt = -1
      begin
               if @p_option = 'ASE_DEV'
                   begin
                      print " The ASE "
                   end
           return(0)
      end

      select @cfgname = name
      from master..sysconfigures
      where config = @cfgopt

      select @cfgval = value
      from master..syscurconfigs
      where config = @cfgopt

          select @cfgval_fmt = case @cfgval when 0 then '0 (=Disabled)' when 1 then '1 (=Enabled)' else '' end

      if license_enabled(@p_option) = NULL
             return(0)

      -- note: we cannot call sp_configure here to display parameter info, since sp_configure
      -- does not allow being called from another procedure
      print ""
      print " To enable the '%1!' option, the ASE configuration parameter", @p_option
      print " '%1!' must also be enabled. The current run value is %2!", @cfgname, @cfgval_fmt
   end
   return(0)
end
go

grant exec on sp_license to public
go

--
-- end of file
--

[ 本帖最后由 echoaix 于 2007-1-23 09:08 编辑 ]

论坛徽章:
0
发表于 2007-01-23 14:37 |显示全部楼层
好东西,顶

论坛徽章:
0
发表于 2008-05-05 15:54 |显示全部楼层
谢谢。。。。。。。。。。。。。。。。。。。。。。。。。。。。

论坛徽章:
0
发表于 2008-05-05 17:28 |显示全部楼层
支持,谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP