本章节将介绍YashanDB数据库的实例启停方式。数据库安装过程中将实例自动切换成OPEN阶段,并创建名为yashandb的数据库。

执行如下SQL命令查看当前实例状态及数据库名称:

SELECT status FROM V$INSTANCE;

STATUS
-----------------
OPEN

SELECT database_name FROM V$DATABASE;

DATABASE_NAME
----------------------------------------------------------------
yashandb

执行如下命令关闭YashanDB服务:

$ yasboot cluster stop -c yashandb
 type | uuid             | name             | hostid | index    | status  | return_code | progress | cost
----------------------------------------------------------------------------------------------------------
 task | 3b62bda48bad7fd1 | StopYasdbCluster | -      | yashandb | SUCCESS | 0           | 100      | 1
------+------------------+------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS

执行如下命令开启YashanDB服务,同时会将实例切换至OPEN阶段:

$ yasboot cluster start -c yashandb
 type | uuid             | name             | hostid | index    | status  | return_code | progress | cost
----------------------------------------------------------------------------------------------------------
 task | 3b62bda48bad7fd1 | StopYasdbCluster | -      | yashandb | SUCCESS | 0           | 100      | 1
------+------------------+------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS

执行如下命令重启YashanDB数据库,并将实例启动至OPEN阶段:

$ yasboot cluster restart -c yashandb
 type | uuid             | name                | hostid | index    | status  | return_code | progress | cost
-------------------------------------------------------------------------------------------------------------
 task | 78d6449df62594b5 | ReStartYasdbCluster | -      | yashandb | SUCCESS | 0           | 100      | 3
------+------------------+---------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS

执行如下命令重启YashanDB数据库,并将实例启动至NOMOUNT阶段:

$ yasboot cluster restart -c yashandb -m nomount
 type | uuid             | name                | hostid | index    | status  | return_code | progress | cost
-------------------------------------------------------------------------------------------------------------
 task | 78d6449df62594b5 | ReStartYasdbCluster | -      | yashandb | SUCCESS | 0           | 100      | 3
------+------------------+---------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS

执行如下命令重启YashanDB数据库,并将实例启动至MOUNT阶段:

$ yasboot cluster restart -c yashandb -m mount
 type | uuid             | name                | hostid | index    | status  | return_code | progress | cost
-------------------------------------------------------------------------------------------------------------
 task | 78d6449df62594b5 | ReStartYasdbCluster | -      | yashandb | SUCCESS | 0           | 100      | 3
------+------------------+---------------------+--------+----------+---------+-------------+----------+------
task completed, status: SUCCESS

Note:

如需进行正常的数据库操作,请将实例切换至OPEN阶段。


YashanDB
1 声望0 粉丝

崖山数据库系统YashanDB是深圳计算科学研究院自主设计研发的新型数据库管理系统,融入原创的有界计算、近似计算、并行可扩展和跨模融合计算理论,可满足金融、政企、能源等关键行业对高性能、高并发及高安全性的...