LightDB-指定lightdb_syntax_compatible_type切換不同資料引擎
在LightDB資料庫中,可以指定lightdb_syntax_compatible_type去切換到不同資料庫引擎,比如Oracle、MySQL,這有點類似於MySQL中儲存引擎的概念,LightDB支援不同資料庫引擎,我們分別可以在cluster、資料庫、使用者、sql級別去指定
1、cluster級別(整個例項級別)
如下配置檔案中新增lightdb_syntax_compatible_type=oracle
[lightdb@101-35-191-172 defaultCluster]$ tail -f postgresql.conf parallel_setup_cost=10000 shared_preload_libraries='canopy,pg_stat_statements,lt_stat_activity,pg_prewarm,pg_cron,pgaudit,pg_hint_plan,pg_show_plans,lt_standby_forward,pg_pathman' track_io_timing=on log_min_messages=info temp_buffers=64MB commit_siblings=10 canopy.shard_count=4 min_parallel_table_scan_size=2GB lock_timeout=1900000 lightdb_syntax_compatible_type=oracle #然後執行 lt_ctl reload lightdb@postgres=# show lightdb_syntax_compatible_type ; lightdb_syntax_compatible_type -------------------------------- Oracle (1 row)
2、使用者級別
ALTER ROLE lightdb@postgres=# \c fund60 oracle_test; oracle_test@fund60=# select * from user_ind_columns where rownum < 2; column_name | index_name | table_name -------------+---------------------+--------------- CUST_ID | i_account_custid_po | account (1 row)
3、資料庫級別
設定database級別,database下所有物件支援oracle語法相容
oracle_test@fund60=# alter database fund60 set lightdb_syntax_compatible_type to oracle; ALTER DATABASE
4、session級別
lightdb@postgres=# show lightdb_syntax_compatible_type ; lightdb_syntax_compatible_type -------------------------------- off (1 row) lightdb@postgres=# create table testoracle ( id number, name varchar2(100)); CREATE TABLE lightdb@postgres=# show search_path ; search_path ------------------------- "$user", public, oracle (1 row) lightdb@postgres=# select * from testoracle where rownum < 2; ERROR: lightdb rownum not enable, syntax compatible type is not oracle. lightdb@postgres=# set lightdb_syntax_compatible_type = oracle; SET lightdb@postgres=# select * from testoracle where rownum < 2; id | name ----+------ (0 rows)
1、lightdb_syntax_compatible_type 和 search_path 包含不同的內容,比如varchar2資料型別是Oracle特有的資料型別,其相容特性是由 search_path 控制,而 rownum等相關特性是由 lightdb_syntax_compatible_type控制
2、推薦使用資料庫級別設定lightdb_syntax_compatible_type,這樣更符合業務需求,一般業務都是跟著資料庫級別走的。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29990276/viewspace-2890790/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Typescript型別常用使用技巧1
- Vue.js 3.x 中跨層級元件如何傳遞資料?Vue
- 一文說透 MySQL JSON 資料型別(收藏)MySQL
- 深度解析javaScript常見資料型別檢查校驗JavaScript
- 資料結構篇_知識點板塊_第九章外部排序資料結構
- 2022年需要關注的十二項資料和分析趨勢
- 【資料庫資料恢復】SAP資料庫資料恢復案例資料庫
- LightDB-指定lightdb_syntax_compatible_type切換不同資料引擎(十一)
- 解決資料孤島的鑰匙
- Red Hat 7.9安裝達夢資料庫DM8 使用Xmanager Enterprise 5啟動圖形化時報錯資料庫
- Red Hat 7.9安裝達夢資料庫DM8圖形化顯示英文和亂碼資料庫
- 達夢資料庫DM8之資料快速載入工具dmfldr使用方法資料庫
- mmsegmentation中構造自己的資料集和資料載入部分,跑現有demo
- 達夢資料庫DM8在LINUX環境下安裝步驟資料庫Linux