虛谷資料庫初體驗
一:虛谷資料庫安裝
1.1 準備安裝介質
沒有看錯,就是 4.3M 大小
[root@cjc-db-01 xg]# ls -lrth total 4.3M -rw-r--r-- 1 root root 4.3M Oct 20 14:07 XuGuServer-12_20220520-trial-linux-x64.tar.gz
解壓
解壓後可以直接使用,不需要安裝
[root@cjc-db-01 xg]# tar -zxvf XuGuServer-12_20220520-trial-linux-x64.tar.gz [root@cjc-db-01 xg]# du -sh * 11M XuguServer 4.3M XuGuServer-12_20220520-trial-linux-x64.tar.gz 508K 虛谷資料庫系統軟體安裝手冊.pdf
1.2 檢視配置檔案
如果需要修改檔案路徑,需要調整配置檔案。
[root@cjc-db-01 SETUP]# pwd /soft/xg/XuguServer/SETUP [root@cjc-db-01 SETUP]# ls mount.ini trust.ini types.ini xugu.ini
檔案路徑配置檔案
[root@cjc-db-01 SETUP]# cat mount.ini /XGLOG ./XGLOG /CATA ./XHOME/CATA /DATA ./XHOME/DATA /TEMP ./XHOME/TEMP /REDO ./XHOME/REDO /BACKUP ./XHOME/BACKUP /ARCH ./XHOME/ARCH /UNDO ./XHOME/UNDO /MODI ./XHOME/XMODI
二:啟動和關閉
2.1 授權
[root@cjc-db-01 BIN]# pwd /soft/xg/XuguServer/BIN [root@cjc-db-01 BIN]# chmod +x * [root@cjc-db-01 BIN]# ls -l total 10484 -rwxr-xr-x 1 root root 758858 May 18 10:33 xgconsole-linux-x64 -rwxr-xr-x 1 root root 9836610 May 18 10:33 xugu12_linux_x64_trial -rwxr-xr-x 1 root root 127551 May 18 10:33 xugu_init.sql -rwxr-xr-x 1 root root 37 May 18 10:33 xugu_start.sh
2.2 啟動
[root@cjc-db-01 BIN]# sh xugu_start.sh XuGu SQL Server 12.0.0 (Built:2022-05-20 12:00:00 GA) Start at: 2022-10-20 14:16:14 Daemon process is still running.
啟動後自動生成檔案
[root@cjc-db-01 XuguServer]# pwd /soft/xg/XuguServer [root@cjc-db-01 XuguServer]# ls BIN SETUP XGLOG XHOME XVOCA
檢視檔案大小
[root@cjc-db-01 XuguServer]# du -sh * 11M BIN 24K SETUP 12K XGLOG 2.1G XHOME 0 XVOCA [root@cjc-db-01 XuguServer]# cd XHOME/ [root@cjc-db-01 XHOME]# ls ARCH BACKUP CATA DATA REDO TEMP UNDO XMODI [root@cjc-db-01 XHOME]# du -sh * 0 ARCH 0 BACKUP 25M CATA 1.0G DATA 13M REDO 512M TEMP 512M UNDO 0 XMODI
2.3 啟動日誌
root@cjc-db-01 BIN]# cat stdout.txt CPU info: Node 0: 0 1 Resource limit: File number: hard limit=4096,soft limit=1024 File size(M): hard limit=-1,soft limit=-1 Data memory(M): hard limit=-1,soft limit=-1 Resident(M): hard limit=-1,soft limit=-1 Proc's total memory(M): hard limit=-1,soft limit=-1 Open file cluster.ini failed. init data buffer...ok. Trial period 360 days Mount all gstore...ok. Open all system tables...ok Create system database...ok. Open all system views...ok Load all jobs...ok All service started. Listening at port 5138
首次啟動日誌,包括資料初始化部分:
透過 EVENT.LOG 日誌可以看到停庫資訊
[root@cjc-db-01 XGLOG]# ls EVENT.LOG
EVENT.LOG
0 ^_ SYS_START ^_ 2022-10-20 14:16:14 ^_ SYSTEM ^_ ^_ Open file cluster.ini failed,start in singleton mode.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:15 ^_ SYSTEM ^_ ^_ tablespace(1,GSYS1) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:15 ^_ SYSTEM ^_ ^_ tablespace(258,LSYS1) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:15 ^_ SYSTEM ^_ ^_ tablespace(257,UNDO_SYS) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:18 ^_ SYSTEM ^_ ^_ tablespace(259,DATA1) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:19 ^_ SYSTEM ^_ ^_ tablespace(260,DATA2) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:20 ^_ SYSTEM ^_ ^_ tablespace(261,DATA3) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:21 ^_ SYSTEM ^_ ^_ tablespace(262,DATA4) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:27 ^_ SYSTEM ^_ ^_ tablespace(263,TEMP1) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:33 ^_ SYSTEM ^_ ^_ tablespace(264,TEMP2) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:34 ^_ SYSTEM ^_ ^_ tablespace(265,UNDO1) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:35 ^_ SYSTEM ^_ ^_ tablespace(266,UNDO2) inited.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:43 ^_ SYSTEM ^_ ^_ Mount all gstore...^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:43 ^_ SYSTEM ^_ ^_ Mount all gstore...done.^^ 1 ^_ CKPT ^_ 2022-10-20 14:16:43 ^_ SYSTEM ^_ ^_ Checkpoint(12723088),flush_clock(18446744073537644047),min_chkpt_no:1,max_chkpt_no:1^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:43 ^_ SYSTEM ^_ ^_ Open all system tables...^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:44 ^_ SYSTEM ^_ ^_ Open all system views...^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:44 ^_ SYSTEM ^_ ^_ Load all jobs...^^ 1 ^_ DB_OPEN ^_ 2022-10-20 14:16:44 ^_ SYSTEM ^_ ^_ opened(online).^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:44 ^_ SYSTEM ^_ ^_ All service started.^^ 1 ^_ SYS_START ^_ 2022-10-20 14:16:44 ^_ SYSTEM ^_ ^_ starting^^
第二次開始的啟動日誌:
0 SYS_START 2022-10-20 15:45:12 SYSTEM Open file cluster.ini failed,start in singleton mode. 1 SYS_START 2022-10-20 15:45:12 SYSTEM Master Load all gstores... 1 SYS_START 2022-10-20 15:45:12 SYSTEM Master Load all gstores...done. 1 SYS_START 2022-10-20 15:45:13 SYSTEM Mount all gstore... 1 SYS_START 2022-10-20 15:45:13 SYSTEM Mount all gstore...done. 1 SYS_START 2022-10-20 15:45:13 SYSTEM Open all system tables... 1 SYS_START 2022-10-20 15:45:13 SYSTEM Open all system views... 1 SYS_START 2022-10-20 15:45:13 SYSTEM Load all jobs... 1 DB_OPEN 2022-10-20 15:45:13 SYSTEM opened(online). 1 SYS_START 2022-10-20 15:45:13 SYSTEM All service started. 1 SYS_START 2022-10-20 15:45:13 SYSTEM starting
2.4 檢查資料庫程式
[root@cjc-db-01 ~]# ps -ef|grep xugu*|grep -v grep root 2860 1 2 14:16 pts/0 00:00:25 /soft/xg/XuguServer/BIN/xugu12_linux_x64_trial -service
2.5 檢查監聽狀態
[root@cjc-db-01 ~]# netstat -ntupl|grep xugu tcp 0 0 0.0.0.0:5138 0.0.0.0:* LISTEN 2860/xugu12_linux_x
2.6 關閉
顯示用了 1ms ,看日誌實際用了 4 秒。
SQL> shutdown immediate Execute successful. Use time:1 ms.
2.7 關閉日誌
透過 EVENT.LOG 日誌可以看到停庫資訊
[root@cjc-db-01 XGLOG]# ls EVENT.LOG EVENT.LOG
日誌內容如下:
1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:06 ^_ SYSTEM ^_ ^_ Recv SHUTDOWN IMMEDIATE.^^ 1 ^_ CKPT ^_ 2022-10-20 15:38:06 ^_ SYSTEM ^_ ^_ Checkpoint(12971307),flush_clock(18446744073542527542),min_chkpt_no:488,max_chkpt_no:488^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:06 ^_ SYSTEM ^_ ^_ Closing net ...^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:09 ^_ SYSTEM ^_ ^_ Closing net ...done.^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:09 ^_ SYSTEM ^_ ^_ Shutting down job manager...^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:09 ^_ SYSTEM ^_ ^_ Shutting down job manager...done.^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:09 ^_ SYSTEM ^_ ^_ Stopping sessions...^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:09 ^_ SYSTEM ^_ ^_ Stopping sessions...done.^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:09 ^_ SYSTEM ^_ ^_ Waiting tasks finish...^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:10 ^_ SYSTEM ^_ ^_ Waiting tasks finish...done.^^ 1 ^_ CKPT ^_ 2022-10-20 15:38:10 ^_ SYSTEM ^_ ^_ Checkpoint(12971387),flush_clock(18446744073542527542),min_chkpt_no:488,max_chkpt_no:488^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:10 ^_ SYSTEM ^_ ^_ Closing storages ...^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:10 ^_ SYSTEM ^_ ^_ Closing storages ...done,System terminated.^^ 1 ^_ SYS_EXIT ^_ 2022-10-20 15:38:10 ^_ SYSTEM ^_ ^_ exit(3)^^
三:登入虛谷資料庫
[root@cjc-db-01 BIN]# pwd /soft/xg/XuguServer/BIN [root@cjc-db-01 BIN]# ./xgconsole-linux-x64 nssl 127.0.0.1 5138 SYSTEM SYSDBA SYSDBA XGDBMS linux Console Release V1.2.1 Copyright (c) 2002, 2021, XuGu. All rights reserved. Connect to 127.0.0.1:5138 SYSTEM SYSDBA Connect ok. SQL>
四:檢查
4.1 檢查資料庫資訊
SQL> SELECT DB_NAME,CHAR_SET,TIME_ZONE,CREATE_TIME,MODIFY_TIME,ONLINE FROM DBA_DATABASES; DB_NAME | CHAR_SET | TIME_ZONE | CREATE_TIME | MODIFY_TIME | ONLINE | ------------------------------------------------------------------------------ SYSTEM| UTF8.UTF8_GENERAL_CI| GMT+08:00| 2022-10-20 14:16:44.619 AD | 2022-10-20 14:16:44.619 AD | T | Total 1 records. Use time:3 ms.
4.2 檢視檔案路徑
SQL> SHOW DIR '/'; DB_PATH | OS_PATH | IS_DIR | ------------------------------------------------------------------------------ /XGLOG| ./XGLOG| T | /CATA| ./XHOME/CATA| T | /DATA| ./XHOME/DATA| T | /TEMP| ./XHOME/TEMP| T | /REDO| ./XHOME/REDO| T | /BACKUP| ./XHOME/BACKUP| T | /ARCH| ./XHOME/ARCH| T | /UNDO| ./XHOME/UNDO| T | /MODI| ./XHOME/XMODI| T | Use time:0 ms.
4.3 會話資訊
SQL> desc sys_all_sessions Column_Name NULL Data_Type ------------------------------------------------------------------------------ NODEID | | INTEGER SESSION_ID | | INTEGER USER_ID | | INTEGER ...... SQL> SELECT NODEID,IP,COUNT(*) FROM SYS_ALL_SESSIONS GROUP BY NODEID,IP; NODEID | IP | EXPR1 | ------------------------------------------------------------------------------ 1 | 127.0.0.1| 1 | Total 1 records. Use time:1 ms.
語法和 Oracle 相似
4.4 建立資料庫
和 MySQL 語法相似
SQL> create database cjc; Execute successful. Use time:140 ms.
4.5 建立測試資料
SQL> use cjc db_name cjc Execute successful. Use time:1 ms. SQL> create table t1(id int); Execute successful. Use time:40 ms. SQL> insert into t1 values(1),(2),(3); Total 3 records effected. Use time:8 ms. SQL> commit; Execute successful. Use time:0 ms.
五:管理工具
5.1 XuguManager
虛谷資料庫管理工具
開啟
登入
查詢
5.2 XuguConsole
虛谷資料庫管理控制檯
開啟
登入,可以遠端連線資料庫
5.3 XuguDBeaver
虛谷資料庫外掛工具
登入
連線
執行 SQL
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2919422/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL資料庫初體驗_gwMySql資料庫
- 分散式NoSQL資料庫MongoDB初體驗-v5.0.5分散式SQL資料庫MongoDB
- GBase 8s資料庫初體驗-01安裝資料庫
- 達夢資料庫初體驗-單機環境部署記錄資料庫
- 12c 傳統資料庫的ADG初體驗資料庫
- java 21 虛擬執行緒初體驗Java執行緒
- 全棧虛擬機器GraalVM初體驗全棧虛擬機LVM
- 初識Oracle資料庫體系結構Oracle資料庫
- 資料庫介紹--初識資料庫資料庫
- oracle exadata資料庫一體機初識Oracle資料庫
- 移植了ortp庫之後的初體驗
- 拓端:資料下的隱形眼鏡初體驗
- MySQL資料庫初識——初窺MySQLMySql資料庫
- Angular 初體驗Angular
- http初體驗HTTP
- AQS初體驗AQS
- golang 初體驗Golang
- OpenCV 初體驗OpenCV
- Nuxt 初體驗UX
- indexedDB 初體驗Index
- laravel初體驗Laravel
- Flutter初體驗Flutter
- jQuery初體驗jQuery
- ollama 初體驗
- Electron初體驗
- 初試MongoDB資料庫MongoDB資料庫
- 【mySql資料庫初識】MySql資料庫
- 資料庫實驗室挑戰任務-初級任務資料庫
- [Python]_[初級]_[校驗查詢sqlite3資料庫]PythonSQLite資料庫
- 圖資料庫HugeGraph:HugeGraph-Hubble基於Web的視覺化圖管理初體驗資料庫Web視覺化
- 資料庫上雲教程(體驗有禮)資料庫
- SequoiaDB資料庫之體驗sql功能資料庫SQL
- Java高階特性1_流庫_初體驗Java
- 談談資料從sql server資料庫匯入mysql資料庫的體驗(轉)Server資料庫MySql
- 初識時序資料庫資料庫
- 初識達夢資料庫資料庫
- PHP——連線資料庫初PHP資料庫
- 圖資料庫初學者指南資料庫