Sybase Comprehensive Guide on Using sp_iqcheckdb for Database Recovery

Page 40

The dbcc_option settings of 0 and 3, when combined with the server option -iqdroplks, update the free list if no errors are detected. In order to perform this function, write transactions are prevented before and during the running of sp_iqcheckdb. The stored procedure ensures this by taking the appropriate locks during its execution. Any write transactions are blocked while sp_iqcheckdb is running.

If it detects transactions that are not committed or not checkpointed,

sp_iqcheckdb may refuse to recover leaked blocks. If this occurs, issue a checkpoint command and rerun sp_iqcheckdb. If sp_iqcheckdb still refuses to run, other users with active write transactions are connected to the database.

To recover leaked space:

In the event that the default option (dbcc_option = 0) cannot recover the free list, and a previous backup is not available, use the following procedure to try to recover the database.

1Start the server with the -iqdroplksswitch in the start_asiq command (on UNIX) or asiqsrv12 command.

2Set dbcc_option to 3, as a temporary option:

SET TEMPORARY OPTION dbcc_option = 3

3Run the stored procedure: sp_iqcheckdb

Note If this procedure fails, it is likely that the database is corrupt and beyond repair.

4 Set dbcc_option to 2, as a temporary option:

SET TEMPORARY OPTION dbcc_option = 2

5Run the stored procedure again: sp_iqcheckdb

6From the report generated, drop the objects reporting errors.

7With dbcc_option still set to 2, rerun the stored procedure to ensure no errors are present:

sp_iqcheckdb

8Reset dbcc_option to the default value, 0:

SET OPTION dbcc_option = 0

40

Image 40
Contents Release Bulletin Adaptive Server IQ For Digital Unix Product summaryRequired Operating System Patches Required Operating System Patches Adaptive Server IQAdaptive Server IQ Converting 12.0.x databases to RestrictionsRelease Bulletin for Digital Unix Following outer join format is supported Setting the Ldlibrarypath Environment Variable Installation InstructionsDocumentation for this version Accessing Current Release Bulletin Information Special migration instructionsObtaining query plans Go to support.sybase.comChanged functionality in this version Changed functionality in Adaptive Server IQImproved stored procedure output Adaptive Server IQ Known problems Adaptive Server IQ Stopasiq utilityTemporary tables in procedures Data definitionAdaptive Server IQ Queries 1 ANY, SOME, and ALL subquery supportAdaptive Server IQ Operations Large in subqueriesOutput to file in Dbisql Changing length of Dbisql column valuesUser-defined variable issue Dbspawn Error when starting a serverUnsupported terminal types cause Dbisql error User-defined variable issue Adaptive Server IQProblems with Add User-defined Data Type wizard DSE not installed on Windows client systemsAdd Service utility installed only with Server Components Notification message setting omitted from Index PropertiesDocumentation updates and clarifications Product compatibilitiesStartup, shutdown, and connection Data Type column in Table Editor retains focusAdditions to the startasiq or asiqsrv12 command-line options Specifying server switchesGm command line option Gn command-line optionUsing -v switch on 64-bit platforms Gm command line option Adaptive Server IQConfirming connections Using Odbc connectivity with UnixAdaptive Server IQ Confirming connections Using a .odbc.ini file Adaptive Server IQ Using a .odbc.ini fileStopasiq utility Addition to Stop Database statement Adaptive Server IQ Addition to Stop Database statementError in Dbstop example Configuration files do not accept quotesError in Dbstop example Adaptive Server IQ Disconnect details omittedSwitch must be uppercase Adaptive Server IQ Switch must be uppercaseData definition DDL Change to Create Database statementLowDisk functions as HighGroup Column Limit CorrectionJoint Virtual Table JVT definition IQ database file paths must be uniqueError documenting IQ Path Error in raw partition limitError on Create Dbspace Adaptive Server IQ Error documenting IQ PathAddition to Drop Database statement Size clause of Create DbspaceSize clause of Create Dbspace Adaptive Server IQ Recommended index types Changes to Using join indexesAdaptive Server IQ Recommended index types Changes to Using join indexes Adaptive Server IQ Id custid idlnameAdaptive Server IQ Changes to Using join indexes Error in Diskstriping default Data manipulation DMLAdaptive Server IQ Default Support for joins between stores or databasesNew and changed general database options New and changed general database options Adaptive Server IQAdaptive Server IQ Description InsertnumberrowsperrawiobufferCorrections to Insert Location Description Adaptive Server IQString function Repeat is supported Correction to Char functionNumber* function not supported Adaptive Server IQ String function Repeat is supportedBackup and system administration Using Isnull and CoalesceUsing Isnull and Coalesce Adaptive Server IQ New options for reserving spaceChange to error message Insufficient disk spaceForced recovery and leaked space recovery Effect of checkpoints Adaptive Server IQStorage within the database as in use Dbccoption option Spiqcheckdb Set dbccoption to 2, as a temporary option Improved output in stored procedures New Stored Procedure ColumnsSpiqstatus now displays IQ Page Size Minpasswordlength optionTransaction Log utility Maintaining a transaction log or mirror Setting PrefetchBufferLimit option Error message for buffer cache settingsGrant Connect for existing user ID Documentation on Data Backup and Recovery Dropping users may delete tablesChanges to Backup statement Cleaning up after abnormal exitMonitoring server activity Using PC client applications Creating attribute tables for PowerBuilderClient applications Help filesTechnical Support Adaptive Server IQ plug-in help reflects Multiplex supportOther sources of information Sybase Certifications on the WebTechinfo.sybase.com