在新创建的数据库中,执行db2look的时候,存在这样的问题

db2v97i1@oc0644314035 ~]$ db2look -d sample -e -l -o db2look.ddl
-- No userid was specified, db2look tries to use Environment variable USER
-- USER is: DB2V97I1
-- Creating DDL for table(s)
-- Output is sent to file: db2look.ddl
-- Binding package automatically ...
--An error has occured during Binding

Error Message =
SQL0001N  Binding or precompilation did not complete successfully.

SQLCA  
Size    = 136
SQLCODE = -1
Tokens  = /home/db2v97i1/sqllib/bnd/db2lkfun.bnd
RDS fn  = sqlajbnd
RC      = 0x0000 = 0
Reason  = 0x0000 = 0
Reason2 = 0x0000 = 0
Warning flags =

--An error has occured during Binding

Error Message =
SQL0031C  File "/home/db2v97i1/db2lkfun.bnd" could not be opened.

SQLCA  
Size    = 136
SQLCODE = -31
Tokens  = /home/db2v97i1/db2lkfun.bnd
RDS fn  = sqlajbnd
RC      = 0x0000 = 0
Reason  = 0x0000 = 0
Reason2 = 0x0000 = 0
Warning flags =

Try to run the command db2 "bind  db2lkfun.bnd   blocking all grant public", got the error about authorization.

db2v97i1@oc0644314035 bnd]$  db2 "bind  db2lkfun.bnd   blocking all grant public"

LINE    MESSAGES FOR db2lkfun.bnd
------  --------------------------------------------------------------------
        SQL0061W  The binder is in progress.
12291   SQL0440N  No authorized routine named "RTRIM" of type
                  "FUNCTION" having compatible arguments was found. 
                  SQLSTATE=42884
12987   SQL0440N  No authorized routine named "RTRIM" of type
                  "FUNCTION" having compatible arguments was found. 
                  SQLSTATE=42884
        SQL0082C  An error has occurred which has terminated
                  processing.
        SQL0092N  No package was created because of previous errors.
        SQL0091N  Binding was ended with "4" errors and "0" warnings.

Check the authorizations for the user

[db2v97i1@oc0644314035 ~]$ db2 " SELECT SUBSTR(GRANTOR, 1, 10) AS GRANTOR, -- Grantor of the authority
> SUBSTR(GRANTEE, 1, 10) AS GRANTEE, -- Holder of the authority
> -- G = Grantee is a group R = Grantee is a role
> GRANTEETYPE, -- U = Grantee is an individual user
> BINDADDAUTH,
> CONNECTAUTH,
> CREATETABAUTH,
> DBADMAUTH,
> IMPLSCHEMAAUTH,
> DATAACCESSAUTH,
> LOADAUTH
> FROM SYSCAT.DBAUTH
> ORDER BY GRANTEE WITH UR "

GRANTOR    GRANTEE    GRANTEETYPE BINDADDAUTH CONNECTAUTH CREATETABAUTH DBADMAUTH IMPLSCHEMAAUTH DATAACCESSAUTH LOADAUTH
---------- ---------- ----------- ----------- ----------- ------------- --------- -------------- -------------- --------
SYSIBM     DB2V97I1   U           N           N           N             Y         N              Y              N      
SYSIBM     PUBLIC     G           Y           Y           Y             N         Y              N              N

[db2v97i1@oc0644314035 ~]$ cd sqllib/bnd
[db2v97i1@oc0644314035 bnd]$ db2 BIND db2lkfun.bnd BLOCKING ALL GRANT PUBLIC

LINE    MESSAGES FOR db2lkfun.bnd
------  --------------------------------------------------------------------
        SQL0061W  The binder is in progress.
12291   SQL0440N  No authorized routine named "RTRIM" of type
                  "FUNCTION" having compatible arguments was found. 
                  SQLSTATE=42884
12987   SQL0440N  No authorized routine named "RTRIM" of type
                  "FUNCTION" having compatible arguments was found. 
                  SQLSTATE=42884
        SQL0082C  An error has occurred which has terminated
                  processing.
        SQL0092N  No package was created because of previous errors.
        SQL0091N  Binding was ended with "4" errors and "0" warnings.

Grant SECADM to the user, solve the issue.

db2 grant SECADM on database to user db2v97i1

Security administration authority (SECADM)

SECADM authority is the security administration authority for a specific database. This authority allows you to create and manage security-related database objects and to grant and revoke all database authorities and privileges. Additionally, the security administrator can execute, and manage who else can execute, the audit system routines.

SECADM authority has the ability to SELECT from the catalog tables and catalog views, but cannot access data stored in user tables.

SECADM authority can be granted only by the security administrator (who holds SECADM authority) and can be granted to a user, a group, or a role. PUBLIC cannot obtain the SECADM authority directly or indirectly.

The database must have at least one authorization ID of type USER with the SECADM authority. The SECADM authority cannot be revoked from every authorization ID of type USER
SECADM authority gives a user the ability to perform the following operations:

Create, alter, comment on, and drop:
        Audit policies
        Security label components
        Security policies
        Trusted contexts
    Create, comment on, and drop:
        Roles
        Security labels
    Grant and revoke database privileges and authorities
    Execute the following audit routines to perform the specified tasks:
        The SYSPROC.AUDIT_ARCHIVE stored procedure and table function archive audit logs.
        The SYSPROC.AUDIT_LIST_LOGS table function allows you to locate logs of interest.
        The SYSPROC.AUDIT_DELIM_EXTRACT stored procedure extracts data into delimited files for analysis.

Also, the security administrator can grant and revoke EXECUTE privilege on these routines, therefore enabling the security administrator to delegate these tasks, if desired. Only the security administrator can grant EXECUTE privilege on these routines. EXECUTE privilege WITH GRANT OPTION cannot be granted for these routines (SQLSTATE 42501).
    Use of the AUDIT statement to associate an audit policy with a particular database or database object at the server
    Use of the TRANSFER OWNERSHIP statement to transfer objects not owned by the authorization ID of the statement

No other authority gives these abilities.

Only the security administrator has the ability to grant other users, groups, or roles the ACCESSCTRL, DATAACCESS, DBADM, and SECADM authorities.

In Version 9.7, the DB2® authorization model has been updated to clearly separate the duties of the system administrator, the database administrator, and the security administrator. As part of this enhancement, the abilities given by the SECADM authority have been extended. In releases prior to Version 9.7, SECADM authority did not provide the ability to grant and revoke all privileges and authorities. Also, SECADM authority could be granted only to a user, not to a role or a group. Additionally, SECADM authority did not provide the ability to grant EXECUTE privilege to other users on the audit system-defined procedures and table function.

新创建的数据库,执行db2look时,遇到package db2lkfun.bnd bind failed的更多相关文章

  1. 原 jeecms9自定义标签以及使用新创建的数据库表

    转载地址:https://blog.csdn.net/nice_meng/article/details/89179089 本系统使用的是jeecmsv9版本,收集网上知识后,进行个人汇总 首先,自己 ...

  2. jeecms9自定义标签以及使用新创建的数据库表

    转载 https://blog.csdn.net/nice_meng/article/details/89179089 本系统使用的是jeecmsv9版本,收集网上知识后,进行个人汇总 首先,自己创建 ...

  3. createdb - 创建一个新的 PostgreSQL 数据库

    SYNOPSIS createdb [ option...] [ dbname] [ description] DESCRIPTION 描述 createdb 创建一个新的 PostgreSQL 数据 ...

  4. 详解:数据库名、实例名、ORACLE_SID、数据库域名、全局数据库名、服务名及手工脚本创建oracle数据库

    数据库名.实例名.数据库域名.全局数据库名.服务名 , 这是几个令很多初学者容易混淆的概念.相信很多初学者都与我一样被标题上这些个概念搞得一头雾水.我们现在就来把它们弄个明白. 一.数据库名 什么是数 ...

  5. Android中当数据库需要更新时我们该怎么办?

    问题:Android数据库更新并保留原来的数据如何实现 Andoird的SQLiteOpenHelper类中有一个onUpgrade方法.帮助文档中只是说当数据库升级时该方法被触发.经过实践,解决了我 ...

  6. 如何创建PostgreSQL数据库

    PostgreSQL提供两种方式创建一个新的数据库:第一种是使用CREATE DATABASE的SQL命令.第二种使用createdb的一个命令行可执行文件. 第一种:使用CREATE DATABAS ...

  7. 创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表

    创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表 创建数据模型类(POCO类) 在Models文件夹下添 ...

  8. 动态创建MySQL数据库

    import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sq ...

  9. Ubuntu18.04系统执行语句时出现错误Failed to load module "canberra-gtk-module"

    Ubuntu18.04系统执行gnuradio-companion时,命令行提示错误Failed to load module "canberra-gtk-module",虽然看起 ...

随机推荐

  1. Oracle学习笔记(十三)

    十四.触发器(监听数据操作的工具) 1.什么是触发器? 数据库触发器是一个与表相关联的.存储的PL/SQL程序 作用: 每当一个特定的数据操作语句(insert.update.delete)在指定的表 ...

  2. Summary #ToBeContinue......

    一.请回望暑假时的第一次作业,你对于软件工程课程的想象1)对比开篇博客你对课程目标和期待,“希望通过实践锻炼,增强计算机专业的能力和就业竞争力”,对比目前的所学所练所得,在哪些方面达到了你的期待和目标 ...

  3. 动态规划 HDU1231-------最大连续子序列

    Problem Description 给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 <= i < ...

  4. oracle树形语句

    oracle树查询的最重要的就是select…start with…connect by…prior语法了.依托于该语法,我们可以将一个表形结构的以树的顺序列出来.在下面列述了oracle中树型查询的 ...

  5. [label][paypal] Paypal 支付页面的语言显示问题

    答复 Frank 通过 Email2014-11-12 02:01 上午 您好 感谢您联系PayPal商家技术支持中心. PayPal登陆页面的语言是PayPal服务器根据以下各种因素来自动判断的:1 ...

  6. Python学习-5.Python的变量与数据类型及字符串的分割与连接

    在Python中,变量类型是固定的,一旦声明就不能修改其类型(在Python里感觉不应该用声明,而应该用使用) 正确: var = 1 print(var) var = 2 print(var) 依次 ...

  7. kubernetes yaml

    apiVersion: v1 #指定api版本,此值必须在kubectl apiversion中 kind: Deployment #指定创建资源的角色/类型 metadata: #资源的元数据/属性 ...

  8. Postgresql 日志收集

    PG安装完成后默认不会记录日志,必须修改对应的(${PGDATA}/postgresql.conf)配置才可以,这里只介绍常用的日志配置. 1.logging_collector = on/off - ...

  9. Postgresql fillfactor

    一个表的填充因子(fillfactor)是一个介于 10 和 100 之间的百分数.100(完全填充)是默认值.如果指定了较小的填充因子,INSERT 操作仅按照填充因子指定的百分率填充表页.每个页上 ...

  10. 详解CSS float属性

    CSS中的float属性是一个频繁用到的属性,对于初学者来说,如果没有理解好浮动的意义和表现出来的特性,在使用的使用很容易陷入困惑,云里雾里,搞不清楚状态.本文将从最基本的知识开始说起,谈谈关于浮动的 ...