返回首页

gbase数据、南大通用产品文档:GBase8sSYSSECPOLICYEXEMPTIONS

更新日期:2024年09月11日

syssecpolicyexemptions 系统目录表记录已经授予用户的豁免权。它具有以下列。

类型
解释
grantee
CHAR(32)
具有此豁免权的用户
secpolicyid
INTEGER
授予豁免权的策略标识
豁免权
CHAR(6)
授予在 GRANTEE 列中标识的用户的
豁免权。
这六个字符具有以下含义:
1
= 读数组2 = 读集3 = 读树4 = 写
数组5 = 写集6 = 写树
每个字符具有以下某个值:
E = 豁免D = 减记豁免U = 增记豁免
– = 无豁免

High Availability
GBase 8a MPP Cluster ensures high availability of the cluster through redundancy
mechanisms:
1)
It provides 1 or 3 copies of data redundancy (3 copies represent 1 main
shard and 2 backup shards).
2)
Data synchronization between replicas is automatic.
3)
The replication engine automatically manages data synchronization.
4)
The multi-shard mechanism reduces the bucket effect of node failures.
5)
When a node fails, the system automatically switches to another node to
ensure business continuity.
It also supports active-active cluster deployment.
Flexible configuration of cluster replica and shard numbers is supported in GBase 8a
MPP Cluster, and replicas and shards can be configured on any node in the cluster.
More primary and backup replicas can be allocated to nodes with higher
performance and larger storage space.

GBase 8a MPP Cluster Technical White Paper
General Data Technology Co., Ltd.
- 15 -
When a node is in an abnormal state, the load of the abnormal server can be evenly
distributed among several normal servers where the replicas are located. This can
effectively prevent significant performance fluctuations caused by the bucket effect
after the switch due to a failure.
Node failures are transparent to applications and do not interrupt business operations.
Once the failed node returns to normal, GBase 8a MPP Cluster will recover data
from other nodes and provide services immediately after completing the update.
Figure 3-4. Flexible configuration of data sharding and replica sharding.

开始一个数据库事务。

语法
[Visual Basic]
Public Function BeginTransaction As GBaseTransaction
[C#]
public GBaseTransaction BeginTransaction()


返回值
代表新事务的对象。

注释
这个命令等价于在GBase 数据库中执行BEGIN TRANSACTION 命令,用户必
须使用 Commit 方法提交事务,使用Rollback 方法回滚事务。
如果用户没有指定一个隔离级别,会使用默认的隔离级别。要使用



GBase 8a 程序员手册ADO.NET 篇
南大通用数据技术股份有限公司

- 171 -
BeginTransaction 指定一个隔离级别,
可以使用带有IsolationLevel 的重载函
数。

异常
InvalidOperationException 异常
异常类型
条 件
InvalidOperationException
不支持并发事务。

示例
下面的例子中演示了如何使用BeginTransaction 的Commit 和 Rollback
方法。
[Visual Basic]
Public Sub RunTransaction(gsConnString As String)
Dim gsConnection As New GBaseConnection(gsConnString)
gsConnection.Open()
Dim gsCommand As GBaseCommand = gsConnection.CreateCommand()
Dim gsTrans As GBaseTransaction
' Start a local transaction
gsTrans = gsConnection.BeginTransaction()
' Must assign both transaction object and connection
' to Command object for a pending local transaction
gsCommand.Connection = gsConnection
gsCommand.Transaction = gsTrans
Try
gsCommand.CommandText
=
"Insert
into
Test
(id,
desc)
VALUES"
_ &" (100, 'Description')"
gsCommand.ExecuteNonQuery()
gsCommand.CommandText
=
"Insert
into
Test
(id,
desc)
VALUES"
_ &" (101, 'Description')"
gsCommand.ExecuteNonQuery()
gsTrans.Commit()
Console.WriteLine("Both records are written to
database.")
Catch e As Exception
Try

GBase 8a 程序员手册ADO.NET 篇


- 172 -

南大通用数据技术股份有限公司
gsTrans.Rollback()
Catch ex As GBaseException
If Not gsTrans.Connection Is Nothing Then
Console.WriteLine("An exception of type " + _
ex.GetType().ToString()
+
"
was
encountered
while
attempting
to
roll
back the transaction.")
End If
End Try
Console.WriteLine("An exception of type " +
e.GetType().ToString() + "was encountered while inserting the data.")
Console.WriteLine("Neither record was written to
database.")
Finally
gsConnection.Close()
End Try
End Sub
[C#]
public void RunTransaction(string gsConnString)
{
GBaseConnection gsConnection = new
GBaseConnection(gsConnString);
gsConnection.Open();
GBaseCommand gsCommand = gsConnection.CreateCommand();
GBaseTransaction gsTrans;
// Start a local transaction
gsTrans = gsConnection.BeginTransaction();
// Must assign both transaction object and connection
// to Command object for a pending local transaction
gsCommand.Connection = gsConnection;
gsCommand.Transaction = gsTrans;
try
{
gsCommand.CommandText
=
"insert
into
Test
(id,
desc)
VALUES
(100, 'Description')";
gsCommand.ExecuteNonQuery();
gsCommand.CommandText
=
"insert
into
Test
(id,
desc)
VALUES



GBase 8a 程序员手册ADO.NET 篇
南大通用数据技术股份有限公司

- 173 -
(101, 'Description')";
gsCommand.ExecuteNonQuery();
gsTrans.Commit();
Console.WriteLine("Both
records
are
written
to
database.");
}
catch(Exception e)
{
try
{
gsTrans.Rollback();
}
catch (SqlException ex)
{
if (gsTrans.Connection != null)
{
Console.WriteLine("An exception of type " +
ex.GetType() +" was encountered while attempting to roll back the
transaction.");
}
}
Console.WriteLine("An exception of type " + e.GetType() +
" was encountered while inserting the data.");
Console.WriteLine("Neither record was written to
database.");
}
finally
{
gsConnection.Close();
}
}