使用GBase 8s数据库
1.1?啟動/停止數據庫服務
通常情況下,使用?gbasedbt?用戶來啟動和停止數據庫服務。
成功安裝數據庫?GBase 8s?后,數據庫會自動處于啟動狀態,可通過以下命令檢查服務進程是否存在:
| [root@localhost opt]# ps -ef|grep oninit gbasedbt 10830?????1??0 19:52 ?????00:00:04 /opt/GBASE/gbase/bin/oninit -vy root?????10831 10830??0 19:52 ?????00:00:00 /opt/GBASE/gbase/bin/oninit -vy root?????10832 10831??0 19:52 ?????00:00:00 /opt/GBASE/gbase/bin/oninit -vy root?????10833 10831??0 19:52 ?????00:00:00 /opt/GBASE/gbase/bin/oninit -vy root?????10834 10831??0 19:52 ?????00:00:00 /opt/GBASE/gbase/bin/oninit -vy root?????10835 10831??0 19:52 ?????00:00:00 /opt/GBASE/gbase/bin/oninit -vy root?????10836 10831??0 19:52 ?????00:00:00 /opt/GBASE/gbase/bin/oninit -vy root?????10837 10831??0 19:52 ?????00:00:00 /opt/GBASE/gbase/bin/oninit -vy root?????10915 10831??0 19:52 ?????00:00:00 /opt/GBASE/gbase/bin/oninit -vy root?????11997??5051??0 20:02 pts/0????00:00:00 grep oninit |
以?gbasedbt?用戶身份登錄后,輸入?onmode?–ky,可停止數據庫服務,示例如下:
| [gbasedbt@localhost ~]$ onmode -ky |
輸入?oninit?–vy,啟動數據庫服務,示例如下:
| [gbasedbt@localhost ~]$ oninit -vy Warning: Parameter's user-configured value was adjusted. (DS_MAX_SCANS) Warning: Parameter's user-configured value was adjusted. (ONLIDX_MAXMEM) Reading configuration file '/opt/GBASE/gbase/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 "/opt/GBASE/gbase/etc/.infos.ol_gbasedbt1210"...succeeded Linking conf file "/opt/GBASE/gbase/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 |
輸入?ps -ef|grep oninit?檢查數據庫服務進程是否存在:
| [gbasedbt@localhost ~]$ ps -ef|grep oninit gbasedbt 12056?????1??0 20:14 ?????????00:00:00 oninit -vy root?????12057 12056??0 20:14 ?????????00:00:00 oninit -vy root?????12058 12057??0 20:14 ?????????00:00:00 oninit -vy root?????12059 12057??0 20:14 ?????????00:00:00 oninit -vy root?????12060 12057??0 20:14 ?????????00:00:00 oninit -vy root?????12061 12057??0 20:14 ?????????00:00:00 oninit -vy root?????12062 12057??0 20:14 ?????????00:00:00 oninit -vy root?????12063 12057??0 20:14 ?????????00:00:00 oninit -vy root?????12064 12057??0 20:14 ?????????00:00:00 oninit -vy gbasedbt 12134 12116??0 20:25 pts/0????00:00:00 grep oninit |
1.2?登錄數據庫
以?gbasedbt?用戶身份登錄,輸入?dbaccess - -?命令進入數據庫命令行模式,示例如下:
| [gbasedbt@localhost ~]$ dbaccess – -? > |
1.3?創建數據庫
在?dbaccess?交互命令行中,執行如下SQL語句,創建數據庫,示例如下:
| [gbasedbt@localhost~]$ dbaccess - - > create database gbase8s;?? Database created. |
?
總結
以上是生活随笔為你收集整理的使用GBase 8s数据库的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Excel从入门到入土
- 下一篇: Windows任务计划程序Task Sc