GP和oracle常用操作

一、gp常用命令:
1、在服务器上常用命令
(1)连接一个库:
 psql -U username -h 10.247.33.84 -d password
(2)psql  -U  用户名    -h  主机名    -d   数据库名
(3)查看所有的用户名和库名:\l
(4)在一个库中切换到别的库: \c citic_25cb439825825e9c9729a5aaeccc6185;
(5)\d:查看该库中的表
(6)\du:只查看所有的用户
(7)\q:退出该会话框

2、gp中生成表数据(测用量时可以使用):
create table tmp_monthmapping as select cast(to_char(onday,'yyyy-mm')||'-01' as char(10)) monthid,onday from (select cast('2001-01-01 00:00:00' as timestamp) + (c ||' day')::interval as onday from    generate_series(0,1000000) as tab(c)) tb;

3、gp中授权命令:
grant select on table table3 to rrrr1111;
grant insert on table table3 to rrrr1111; 
GRANT select   ON SCHEMA  PUBLIC TO rrrr1111;

4、查询数据库中的数据大小
select pg_size_pretty(pg_relation_size('znn_test')); 
二、oracle
建用户:
create user test identified by test;
改密码:
alter user test identified by 123456;
授权角色:
grant connect, resource to test;

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值