Teradata用户优先级控制

Teratdata数据库中,一个用可以对应多个账户,账户包含优先级信息,在登陆的时候,如果加上账户信息,就可以控制用户优先级。本篇对此进行介绍。

[@more@]

创建并使用 Account IDs
登陆语法:
.LOGON tdpid/user_name, password, 'account_ID';

交互式登陆语法:
.LOGON tdpid/user_name,, 'account_ID' (note the two commas)
Enter password when prompted

CREATE USER tfact07 # Names user
FROM Sysdba # Name of immediate owner in hierarchy
AS PERM = 10e6 # Amount of Permanent space
,SPOOL = 100e6 # Maximum amount of Spool space
,PASSWORD = secure12 # Initial password
,FALLBACK # Default protection type when creating a table
,ACCOUNT = ( '$M', # Default account code – medium priority
'$M_9038', # Optional account code – medium priority
'$M_9038_&S&D&H', # Optional account code – medium priority with ASE
'$H_9038' ); # Optional account code – high priority

则登陆时,就可以带上ACCOUNT信息,以表明用户优先级,Example:
直接登入: .LOGON educ/tfact07,secure12,'$H'
交互式登陆:.LOGON educ/tfact07,,'$H'

动态修改 Account ID
• You can change your Account ID without logging off.
-- 可用来重设查询优先顺序.
-- 也可用来优化查询(nice a query).
• You can change Account IDs for the next SQL statement you run, or for all jobs for the remainder of the current session.
• To change Account IDs, use the SET SESSION ACCOUNT statement:
• Syntax:
-- For the next SQL statement : SET SESSION ACCOUNT = 'Account_ID' FOR REQUEST;
-- For the rest of the current session: SET SESSION ACCOUNT = 'Account_ID' FOR SESSION;
• Example:
-- For the rest of the tfact07 session: SET SESSION ACCOUNT = '$H_9038' FOR SESSION;
• Note: You can only use valid account IDs.
-- Therefore, you cannot exceed the priority defined by the performance groups in your account ID.

账户优先级:
用户优先级可有$L, $M, $H, $R几种:

修改用户优先级: modify user username as account = '$H_***'; (也可直接用pmon来修改)
查看修改结果:select * from DBC.AccountInfo

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16723161/viewspace-1013673/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/16723161/viewspace-1013673/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值