GaussDB T 手工建库示例
【摘要】 GaussDB T 手工建库
Gaussdb T支持手工建库,本次示例创建数据库名称为:muggle,服务器IP为192.168.2.88,端口号为1888,以下为操作实录。
1. 创建Gaussdb配置文件目录
mkdir -p /opt/gaussdb/muggle/cfg
2. 生成Gaussdb配置文件
echo "LSNR_ADDR = 127.0.0.1,192.168.2.88">/opt/gaussdb/muggle/cfg/zengine.ini echo "LSNR_PORT = 1888">>/opt/gaussdb/muggle/cfg/zengine.ini
3. 启库到nomount
[omm@alldb cfg]$ cd $GSDB_HOME/bin [omm@alldb bin]$ python zctl.py -t start -m nomount -D /opt/gaussdb/muggle Successfully started instance.
4. 编辑建库脚本
echo " create database muggle character set utf8 CONTROLFILE('?/data/cntl1', '?/data/cntl2', '?/data/cntl3') LOGFILE('?/data/log1' size 2G, '?/data/log2' size 2G, '?/data/log3' size 2G, '?/data/log4' size 2G, '?/data/log5' size 2G, '?/data/log6' size 2G) system tablespace DATAFILE '?/data/system' size 1G undo tablespace DATAFILE '?/data/undo' size 1G default tablespace DATAFILE '?/data/user1' size 1G autoextend on next 32M, '?/data/user2' size 1G autoextend on next 32M, '?/data/user3' size 1G autoextend on next 32M, '?/data/user4' size 1G autoextend on next 32M, '?/data/user5' size 1G autoextend on next 32M temporary tablespace TEMPFILE '?/data/temp1_01' size 160M autoextend on next 32M, '?/data/temp1_02' size 160M autoextend on next 32M nologging tablespace TEMPFILE '?/data/temp2_01' size 160M autoextend on next 32M, '?/data/temp2_02' size 160M autoextend on next 32M nologging undo tablespace TEMPFILE '?/data/temp2_undo' size 1G sysaux tablespace DATAFILE '?/data/sysaux' size 160M autoextend on next 32M ARCHIVELOG;">>/opt/gaussdb/muggle/create_database.sql
5. 创建数据文件存储目录
mkdir -p /opt/gaussdb/muggle/data
6. 登陆数据库并建库
[omm@alldb cfg]$ zsql / as sysdba -D /opt/gaussdb/muggle -q connected. SQL> SQL> @/opt/gaussdb/muggle/create_database.sql SQL> Succeed.
7. 数据库状态查看
SQL> select name,status,CHARACTER_SET from v$database; NAME STATUS CHARACTER_SET -------------------------------- -------------------- -------------------- MUGGLE OPEN UTF8 1 rows fetched.
转自墨天轮
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)