暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

openGauss每日一练第7天 | 模式的基本管理

原创 Lucifer三思而后行 2021-12-07
467

openGauss 每日一练第 7 天打卡,我来了!又可以学习,真开心~

学习

今天第 7 课,学习 openGauss 表空间!

表空间用于管理数据对象,与磁盘上的一个。

课后作业打卡

1.创建表空间,表空间tspc1使用相对路径指定所在目录,表空间tspc2指定owner为Lucy

create tablespace tspc1 relative location 'tablespace/tablespace1'; create role Lucy password 'Lucifer-4622'; create tablespace tspc2 owner Lucy relative location 'tablespace/tablespace2'; \db

2.在表空间tspc1中建表,并使用视图pg_tables查看信息

create table lucifer(id int) tablespace tspc1; select * from pg_tables where tablename = 'lucifer';

3.重命名tspc1,修改tspc2的用户为Lily,使用\db查看表空间信息

alter tablespace tspc1 rename to tspc3; create role Lily password 'Lucifer-4622'; alter tablespace tspc2 owner Lily; \db

4.删除表空间

drop table lucifer; drop tablespace if exists tspc2; drop tablespace if exists tspc3; \db

写在最后

今天的作业打卡结束!🎉

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论