diff --git a/docs/en/docs/sql-manual/sql-reference/Database-Administration-Statements/UNSET-VARIABLE.md b/docs/en/docs/sql-manual/sql-reference/Database-Administration-Statements/UNSET-VARIABLE.md
new file mode 100644
index 0000000000..6e719bfbb7
--- /dev/null
+++ b/docs/en/docs/sql-manual/sql-reference/Database-Administration-Statements/UNSET-VARIABLE.md
@@ -0,0 +1,79 @@
+---
+{
+ "title": "UNSET-VARIABLE",
+ "language": "en"
+}
+---
+
+
+
+
+
+## UNSET-VARIABLE
+
+
+
+### Name
+
+UNSET VARIABLE
+
+### Description
+
+This statement is used to restore Doris system variables. These system variables can be modified at global or session level.
+
+grammar:
+
+```sql
+UNSET [SESSION|GLOBAL] VARIABLE (variable_name | ALL)
+````
+
+illustrate:
+
+1. (variable_name | ALL): statement must be ended with a variable name or keyword `ALL`.
+
+> Note:
+>
+> 1. Only ADMIN users can unset variables to take effect globally
+> 2. When restore a variable with `GLOBAL`, it only affect your current using session and new open sessions. It does not affect other current open sessions.
+
+### Example
+
+1. Restore value of the time zone
+
+ ````
+ UNSET VARIABLE time_zone;
+ ````
+
+2. Restore the global execution memory size
+
+ ````
+ UNSET GLOBAL VARIABLE exec_mem_limit;
+ ````
+3. Restore all variables globally
+
+ ```
+ UNSET GLOBAL VARIABLE ALL;
+ ```
+### Keywords
+
+ UNSET, VARIABLE
+
+### Best Practice
+
diff --git a/docs/zh-CN/docs/sql-manual/sql-reference/Database-Administration-Statements/UNSET-VARIABLE.md b/docs/zh-CN/docs/sql-manual/sql-reference/Database-Administration-Statements/UNSET-VARIABLE.md
new file mode 100644
index 0000000000..f0c6718f4e
--- /dev/null
+++ b/docs/zh-CN/docs/sql-manual/sql-reference/Database-Administration-Statements/UNSET-VARIABLE.md
@@ -0,0 +1,82 @@
+---
+{
+ "title": "UNSET-VARIABLE",
+ "language": "zh-CN"
+}
+---
+
+
+
+
+
+## UNSET-VARIABLE
+
+
+
+### Name
+
+UNSET VARIABLE
+
+### Description
+
+该语句主要是用来恢复 Doris 系统变量为默认值,可以是全局也可以是会话级别。
+
+语法:
+
+```sql
+UNSET [SESSION|GLOBAL] VARIABLE (variable_name | ALL)
+```
+
+说明:
+
+1. (variable_name | ALL) :必须指定变量名或使用 ALL , ALL 会恢复所有变量的值。
+
+> 注意:
+>
+> 1. 只有 ADMIN 用户可以全局得恢复变量的值。
+> 2. 使用 `GLOBAL` 恢复变量值时仅在执行命令的当前会话和之后打开的会话中生效,不会恢复当前已有的其它会话中的值。
+
+
+### Example
+
+1. 恢复时区为默认值东八区
+
+ ```
+ UNSET VARIABLE time_zone;
+ ```
+
+2. 恢复全局的执行内存大小
+
+ ```
+ UNSET GLOBAL VARIABLE exec_mem_limit;
+ ```
+
+3. 从全局范围恢复所有变量的值
+
+ ```
+ UNSET GLOBAL VARIABLE ALL;
+ ```
+
+### Keywords
+
+ UNSET, VARIABLE
+
+### Best Practice
+
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/UnsetVariableStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/UnsetVariableStmt.java
index 1f456eb5b7..2b05e23333 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/UnsetVariableStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/UnsetVariableStmt.java
@@ -17,8 +17,13 @@
package org.apache.doris.analysis;
+import org.apache.doris.catalog.Env;
import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.ErrorCode;
+import org.apache.doris.common.ErrorReport;
import org.apache.doris.common.UserException;
+import org.apache.doris.mysql.privilege.PrivPredicate;
+import org.apache.doris.qe.ConnectContext;
import com.amazonaws.util.StringUtils;
@@ -65,6 +70,13 @@ public class UnsetVariableStmt extends StatementBase {
if (StringUtils.isNullOrEmpty(variable) && !applyToAll) {
throw new AnalysisException("You should specific the unset variable.");
}
+
+ if (setType == SetType.GLOBAL) {
+ if (!Env.getCurrentEnv().getAccessManager().checkGlobalPriv(ConnectContext.get(), PrivPredicate.ADMIN)) {
+ ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR,
+ "ADMIN");
+ }
+ }
}
@Override