GBase 8s資料庫初體驗-01安裝

chenoracle發表於2022-11-12

國產資料庫四朵金花

GBase 8s 發展史

功能

服務架構

安裝

以圖形化安裝為例,命令列方式安裝參考連結:

https://blog.csdn.net/jihui8848/article/details/117996240?spm=1001.2014.3001.5501

[root@cjc-db-01 gbase]# ./ids_install -i swing

新增使用者環境變數

[gbasedbt@cjc-db-01 ~]$ vi .bash_profile
export GBASEDBTSERVER=ol_gbasedbt1210
export GBASEDBTDIR=/gbase/rdbms
export GBASEDBTSQLHOSTS=/gbase/rdbms/etc/sqlhosts.ol_gbasedbt1210
export ONCONFIG=onconfig.ol_gbasedbt1210
export PATH=/gbase/rdbms/bin:$PATH
export DB_LOCALE=zh_CN.utf8
export CLIENT_LOCALE=zh_CN.utf8
unset GL_USEGLU
[gbasedbt@cjc-db-01 ~]$ source .bash_profile

檢查gbase程式

[gbasedbt@cjc-db-01 ~]$ ps -ef|grep oninit|grep -v grep
gbasedbt   7876      1  0 18:14 ?        00:00:00 /gbase/rdbms/bin/oninit -ivwy
root       7877   7876  0 18:14 ?        00:00:00 /gbase/rdbms/bin/oninit -ivwy
root       7878   7877  0 18:14 ?        00:00:00 /gbase/rdbms/bin/oninit -ivwy
root       7879   7877  0 18:14 ?        00:00:00 /gbase/rdbms/bin/oninit -ivwy
root       7880   7877  0 18:14 ?        00:00:00 /gbase/rdbms/bin/oninit -ivwy
root       7881   7877  0 18:15 ?        00:00:00 /gbase/rdbms/bin/oninit -ivwy
root       7882   7877  0 18:15 ?        00:00:00 /gbase/rdbms/bin/oninit -ivwy
root       7883   7877  0 18:15 ?        00:00:00 /gbase/rdbms/bin/oninit -ivwy

檢查資料庫狀態

[gbasedbt@cjc-db-01 ~]$ onstat -
Your evaluation license will expire on 2023-11-12 00:00:00
On-Line -- Up 00:20:08 -- 175748 Kbytes


 停庫

[gbasedbt@cjc-db-01 ~]$ onmode -ky
Your evaluation license will expire on 2023-11-12 00:00:00

檢查狀態

[gbasedbt@cjc-db-01 ~]$ onstat -
Your evaluation license will expire on 2023-11-12 00:00:00
shared memory not initialized for GBASEDBTSERVER 'ol_gbasedbt1210'

啟庫

[gbasedbt@cjc-db-01 ~]$ oninit -vy
Your evaluation license will expire on 2023-11-12 00:00:00
Warning: Parameter's user-configured value was adjusted. (DS_MAX_SCANS)
Warning: Parameter's user-configured value was adjusted. (ONLIDX_MAXMEM)
Reading configuration file '/gbase/rdbms/etc/onconfig.ol_gbasedbt1210'...succeeded
Creating /GBASEDBTTMP/.infxdirs...succeeded
Allocating and attaching to shared memory...succeeded
Creating resident pool 8310 kbytes...succeeded
Creating infos file "/gbase/rdbms/etc/.infos.ol_gbasedbt1210"...succeeded
Linking conf file "/gbase/rdbms/etc/.conf.ol_gbasedbt1210"...succeeded
Initializing rhead structure...rhlock_t 16384 (512K)... rlock_t (5312K)... Writing to infos file...succeeded
Initialization of Encryption...succeeded
Initializing ASF...succeeded
Initializing Dictionary Cache and SPL Routine Cache...succeeded
Bringing up ADM VP...succeeded
Creating VP classes...succeeded
Forking main_loop thread...succeeded
Initializing DR structures...succeeded
Forking 1 'soctcp' listener threads...succeeded
Forking 1 'soctcp' listener threads...succeeded
Forking 1 'soctcp' listener threads...succeeded
Starting tracing...succeeded
Initializing 2 flushers...succeeded
Initializing SDS Server network connections...succeeded
Initializing log/checkpoint information...succeeded
Initializing dbspaces...succeeded
Opening primary chunks...succeeded
Validating chunks...succeeded
Initialize Async Log Flusher...succeeded
Starting B-tree Scanner...succeeded
Init ReadAhead Daemon...succeeded
Init DB Util Daemon...succeeded
Initializing DBSPACETEMP list...succeeded
Init Auto Tuning Daemon...succeeded
Checking database partition index...succeeded
Initializing dataskip structure...succeeded
Checking for temporary tables to drop...succeeded
Updating Global Row Counter...succeeded
Forking onmode_mon thread...succeeded
Creating periodic thread...succeeded
Creating periodic thread...succeeded
Starting scheduling system...succeeded
Verbose output complete: mode = 5


 檢視狀態

[gbasedbt@cjc-db-01 ~]$ onstat -
Your evaluation license will expire on 2023-11-12 00:00:00
On-Line -- Up 00:00:31 -- 175748 Kbytes

 登入資料庫

[gbasedbt@cjc-db-01 ~]$ dbaccess - -
Your evaluation license will expire on 2023-11-12 00:00:00
>

建立資料庫,報錯

> create database cjcdb with log;
 
  908: Attempt to connect to database server (ol_gbasedbt1210) failed.
 
  201: A syntax error has occurred.
Error in line 1
Near character position 1
>


 修改檔案

[gbasedbt@cjc-db-01 ~]$ cd /gbase/rdbms/etc/
[gbasedbt@cjc-db-01 etc]$ cp sqlhosts.ol_gbasedbt1210 sqlhosts.ol_gbasedbt1210_bak
[gbasedbt@cjc-db-01 etc]$ vi sqlhosts.ol_gbasedbt1210

原檔案

ol_gbasedbt1210 onsoctcp cjc-db-01 ol_gbasedbt1210
dr_gbasedbt1210 drsoctcp cjc-db-01 dr_gbasedbt1210
lo_gbasedbt1210 onsoctcp 127.0.0.1 lo_gbasedbt1210

將主機名改成IP

ol_gbasedbt1210 onsoctcp 192.168.126.128 ol_gbasedbt1210
dr_gbasedbt1210 drsoctcp 192.168.126.128 dr_gbasedbt1210
lo_gbasedbt1210 onsoctcp 127.0.0.1 lo_gbasedbt1210

重啟資料庫

停庫

[gbasedbt@cjc-db-01 ~]$ onmode -ky

啟庫

[gbasedbt@cjc-db-01 ~]$ oninit -vy

重新建立資料庫,成功

[gbasedbt@cjc-db-01 etc]$ dbaccess - -
Your evaluation license will expire on 2023-11-12 00:00:00
> create database cjcdb with log;
 
Database created.

建立測試資料

> create table t1(id int,name varchar(10));
> insert into t1 values(1,'aaa');
> insert into t1 values(2,'bbb');
> select * from t1;
         id name       
          1 aaa       
          2 bbb       
 
2 row(s) retrieved.



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2923084/,如需轉載,請註明出處,否則將追究法律責任。

相關文章