GBase 8s默认使用操作系统用户，要创建数据库用户，按以下步骤开启用户映射创建用户：1、开启用户映射：root用户执行:mkdir /etc/gbasedbtecho "USER:daemon" > /etc/gbasedbt/allowed.surrogatesgbasedbt用户执行:onmode -wf USERMAPPING='ADMIN' onmode -cache surrogates dbaccess sysuser - <<!CREATE DEFAULT USER WITH PROPERTIES USER 'daemon'; !2、创建用户：dbaccess sysuser -<<!CREATE USER testuser WITH PASSWORD "GBase123"; !3、给用户授权(testdb)：dbaccess testdb -<<!grant dba to testuser; !
1、配置yum源，使用阿里镜像cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo2、安装Linux图形桌面yum -y groups install "GNOME Desktop"3、设置服务器启动到图形界面并重启mv /etc/systemd/system/default.target /etc/systemd/system/default.target.bak ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target[...]
SQLTrace用于跟踪执行sql的性能，可用于定位性能较差的sql，从而进行优化。Example打开sqltrace跟踪15000条sql，所需内存：15000*4k=60MBdbaccess sysadmin - <<! EXECUTE FUNCTION task("set sql tracing on","15000","4","high","global"); !查看执行耗时较长sql：dbaccess sysmaster -<<! unload to sql.unl select sql_maxtime,sql_avgtime,sql_statement from syssqltrace order by sql_maxtime desc; !查看当前路径下生成的sql.unl文件[...]
根据onstat -d 输出查看需要扩展的数据文件号。示例:chunk号为8的数据文件打开自动扩展dbaccess sysadmin -<<! EXECUTE FUNCTION task ("modify chunk extendable on", 8); !示例:chunk号为8的数据文件关闭自动扩展dbaccess sysadmin -<<! EXECUTE FUNCTION task ("modify chunk extendable off", 8); !
使用场景：gbase01实例需要访问gbase02实例中的数据。sql语法：select * from dbname@gbase02:tabname;方法一、配置信任1、配置目标服务器/etc/hosts.equiv信任如node1（192.168.17.101）上的数据库实例（gbase01) 访问node2（192.168.17.102）上的数据库实例（gbase02）2、在node1数据库实例gbase01的sqlhosts文件中增加gbase02的实例信息：echo "gbase02 onsoctcp 192.168.17.102 9088">>$GBASEDBTSQLHOSTS[...]
-243 Could not position within a table table-name.错误原因：不能在表的数据行上加锁，该行数据已被锁示例：session1dbaccess testdb - drop table if exists t; create table t(col1 int,col2 char(100)); insert into t select tabid,tabname from systables; begin; delete from t where col1=1; [...]