SoFunction
Updated on 2025-04-14

1000 common fool questions for DB2 (two)



75. How to restart the database?
RESTARTDATABASEDATABASE_NAME

76. How to activate the database?
ACTIVATEDATABASEDATABASE_NAME

77. How to stop the database?
DEACTIVATEDATABASEDATABASE_NAME


78. How to delete a database?
DROPDATABASEDATABASE_NAME

79.How to establish a model?
CREATESCHEMASCHEMA_NAME

80.How to set the mode?
SETSCHEMA=SCHEMA_NAME

81. What are the types of tables?
Basic Table
Results table
Summary
Type table
Subtype
Sub-table
A temporary table for declaration
System temporary table

82. How to define a sequence?
CREATESEQUENCEORDERSEQSTARTWITH1INCREMENTBY1NOMAXVALUENOCYCLECACHE24

83. How to put the table in the check pending state?
SETINTEGRITYTABLE_NAMEOFF

84. How to obtain the table's repulsive lock?
LOCKTABLETABLE_NAMEINEXCLUSIVEMODE

85. How to adjust the table to an online status without checking data?
SETINTEGRITYFORTABLE_NAMEALLIMMEDIATEUNCHECKED

86. How to unlock tables?
COMMIT

87. How to close the log of a table?
ALTERTABLETABLE_NAMEACTIVENOTLOGGEDINIALLY

88.How to delete a table?
DROPSCHEMA.TABLE_NAME

89. How to rename a table?
RENAMETABLE_OLDTOTABLE_NEW

90. How to get the current time?
SELECTCURRENTTIMESTAMPFROMSYSIBM.SYSDUMMY1