Liangda-w commented on a change in pull request #10214:
URL: https://github.com/apache/shardingsphere/pull/10214#discussion_r623102641
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
##########
@@ -1132,3 +1132,278 @@ rowArchivalVisibilityClause
defaultCollationClause
: DEFAULT_COLLATION EQ_ (collationName | NONE)
;
+
+alterDatabase
+ : ALTER DATABASE databaseName?
+ ( startupClauses
+ | recoveryClauses
+ | databaseFileClauses
+ | logfileClauses
+ | controlfileClauses
+ | standbyDatabaseClauses
+ | defaultSettingsClauses
+ | instanceClauses
+ | securityClause
+ | prepareClause
+ | dropMirrorCopy
+ | lostWriteProtection
+ | cdbFleetClauses
+ | propertyClause )
+ ;
+
+startupClauses
+ : MOUNT ((STANDBY | CLONE) DATABASE)?
+ | OPEN ((READ WRITE)? (RESETLOGS | NORESETLOGS)? (UPGRADE | DOWNGRADE)? |
READ ONLY)
+ ;
+
+recoveryClauses
+ : generalRecovery | managedStandbyRecovery | BEGIN BACKUP | END BACKUP
+ ;
+
+generalRecovery
+ : RECOVER (AUTOMATIC)? (FROM locationName)? (
+ (fullDatabaseRecovery | partialDatabaseRecovery | LOGFILE fileName)
+ ((TEST | ALLOW NUMBER_ CORRUPTION | parallelClause)+)?
+ | CONTINUE DEFAULT?
+ | CANCEL
+ )
+ ;
+
+fullDatabaseRecovery
+ : STANDBY? DATABASE
+ ((UNTIL (CANCEL | TIME dateValue | CHANGE NUMBER_ | CONSISTENT)
+ | USING BACKUP CONTROLFILE
+ | SNAPSHOT TIME dateValue
+ )+)?
+ ;
+
+dateValue
+ : dateTimeLiterals | stringLiterals | numberLiterals | expr
+ ;
Review comment:
Maybe it's better to put `dateValue` in `BaseRule.g4`?
Beside this, the definition is not precise, per
[definition](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/ALTER-DATABASE.html#GUID-8069872F-E680-4511-ADD8-A4E30AF67986):
> date must be a character literal in the format 'YYYY-MM-DD:HH24:MI:SS'. It
must represent a time that is immediately after the snapshot was completed. If
you specify the UNTIL TIME clause, then SNAPSHOT TIME date must be earlier than
UNTIL TIME date.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]