1.创建表空间newtbs1
create tablespace newtbs1 relative location 'tablespace/newtbs1';
2.创建3个数据库newdb1、newdb2、newdb3,默认表空间为newtbs1
create database newdb1 with tablespace =newtbs1;create database newdb2 with tablespace =newtbs1;create database newdb3 with tablespace =newtbs1;

3.使用sql查看表空间newtbs1上有几个数据库
select datname,dattablespace,spcname from pg_database d, pg_tablespace t where d.dattablespace=t.oid and spcname='newtbs1' ;
4.在文件系统中查看表空间newtbs1中的多个数据库
select oid,datname from pg_database;select oid,* from pg_tablespace ;\qcd /var/lib/opengauss/data/pg_tblspclsls 16463/PG_9.2_201611171_gaussdb

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




