Presentation is loading. Please wait.

Presentation is loading. Please wait.

Administration etc.. What is this ? This section is devoted to those bits that I could not find another home for… Again these may be useless, but humour.

Similar presentations


Presentation on theme: "Administration etc.. What is this ? This section is devoted to those bits that I could not find another home for… Again these may be useless, but humour."— Presentation transcript:

1 Administration etc.

2 What is this ? This section is devoted to those bits that I could not find another home for… Again these may be useless, but humour me! We will cover –BACKUP –SP_IQCHECKDB –DBCC options –Some other Stored Procedures

3 Backup Three Types of Backup –FULL backup –INCREMENTAL backup –INCREMENTAL-since-FULL backup All will backup the IQ Store and the Catalogue Store The IQ Temporary Store is never backed up

4 Backup Types FULL causes a full backup of the Catalogue and IQ Stores INCREMENTAL makes a full backup of the Catalogue Store, and backs up all changes to the IQ Store since the last IQ backup of any type INCREMENTAL SINCE FULL makes a full backup of the Catalogue Store, and backs up all changes to the IQ Store since the last FULL IQ backup

5 Backup Processing Backup backups committed data only –Backup begins and ends with a checkpoint –Any data that is committed during the backup process will be included in the backup –The transaction log is not backed up, it is deleted after a successful backup IQ Store Catalog Store Trans. Log Issue Checkpoint 1. Write Marker into Log 2. Write Catalog to Tape(s) 3. Tape Drive(s) Write (Changed) Data To Tape(s) 4. Write Marker into Log 5. Check for Completed TX. 6. If there are – backup the changed pages Then go to 5. 7a. If there are no committed TX Checkpoint,Delete Log and Stop 7b.

6 Transaction Log The log is deleted or renamed after a backup completes –Not needed for a Restore If there are ASA tables in the catalog store (other than system tables) you must retain the log to recover transactions for this data

7 Restore Before Restore –You must have dba authority –No users on the database –The database server must be running To ensure exclusive access start the server with the -gd option (-gd dba)

8 Restore Restrictions For incremental restores there must be no user access between restores Restore will create and drop dbspaces as required

9 When to do Restores If the database is corrupt - you must do a restore If the last backup was FULL restore the FULL backup only IF you have an INCREMENTAL SINCE FULL backup that precedes the database failure then restore the FULL followed by the INCREMENTAL SINCE FULL

10 Check DB The routine to check the database for potential corruptions is SP_IQCHECKDB There are no run-time options for this command, however the DBCC options control the behavior of the SP_IQCHECKDB command Also there are some (2) server startup switches that affect the performance and behavior of SP_IQCHECKDB

11 Normal Checkdb Performance If none of the defaults are set SP_IQCHECKDB –checks ALL of the allocated pages in the database –Traverses all of the index chains (and checks the reverse addresses) –Reports any errors found –If no errors are found then the free list is updated This last point is moot – if there are no errors, then the free list is OK – but well…

12 Checkdb Output DB StatisticsValueFlags ------------------------------------------------ IQ DBCC Verification Summary Total Blocks In Database20480 Blocks Marked as In Use1026 Blocks Verified as In Use1026 Blocks Detected as Duplicates0 Blocks Detected as Unowned0 Blocks Detected as Leaked0 Tables Verified9 Indexes Verified74 Join Indexes Verified0

13 Checking the database There are 3 procedures that check the system “metadata” in addition to SP_IQCHECKDB These are –SP_IQDBSIZE –SP_IQTABLESIZE –SP_IQINDEXSIZE These procedures not only report on sizes, they check on the objects, and will fail if there is an error At this point the procedure SP_IQCHECKDB should be executed

14 Warning Just because the procedures execute cleanly does not guarantee that the object is clean, but it is a good quick check If you suspect there is corruption in the database you should run SP_IQCHECKDB first But this will take time If SP_IQCHECKDB finds corruption then run the other procedures to try and localize the corruption – or run SP_IQCHECKDB with the fix options on

15 Force_Drop The FORCE_DROP option will allow a dba to drop a corrupted object (index or table) The space used by the object will not be recovered To recover the space the server should be started with the –iqfrec and –iqdropblks switches

16 Server Switches The switch –iqfrec will mark the database as clean (may not be what you want!) and allow you to try and drop any corrupted objects The switch –iqdroplks sets an option in SP_IQCHECKDB to allow the collection of dropped blocks –Effectively this rebuilds the free list

17 DBCC_OPTION - 1 The Option DBCC_OPTION controls the action of SP_IQCHECKDB when problems are encountered Value are 0 thru 7, default is Zero

18 DBCC_OPTION - 2 ValueAction 0If –iqdropblks is set this checks for leaked blocks and corrupt pages – if there are no errors the free list is rebuilt – if there are errors then the error list is reported, but no action is taken If –iqdropblks is not set then if an error is found the server (probably) will terminate 1Fast leak check – walks the block maps only. This is very fast (1-2 GB per second) 2Checks for leaked blocks and corrupt pages/chains. Runs at around 50Mb to 100Mb per second. This is the same as 0 when –iqdropblks is set ValueAction 3Server must have –iqdropblks set. Checks leaked blocks (same as 0 and –iqdropblks but only checks leaks 4Checks page chaining on all indexes 5Full chain and consistency check on all indexes, not just the index chaining (This can be slow) 6Full consistency check on all indexes, and will try to repair broken chains 7A more detailed version of 6 - more through but very much slower.

19 SP_IQDBSTATISTICS This procedure (used to) give(s) a more detailed map of the storage in the database Now (12.4) and with 12.4.2 this information is present in the SP_IQCHECKDB output

20 Sizing the database There are a series of sizing stored procedures I am not going through them – you can read as well as I can One minor issue – if the IQ_PageSize is different to the default the estimated sizes will be wrong!

21 Server/Database information Everyone knows sp_iqstatus But also try –sa_conn_properties – this does not just display the options list - there is a set of almost useful counters at the front of the report –sa_db_properties -this gives you the database related information – again sometimes useful –sa_eng_properties – this returns the engine related data

22 Sp_IQStatus Adaptive Server IQ (TM) Copyright (c) 1992-1999 by Sybase, Inc. All rights reserved. Version:12.4.0/(32bit mode)/MS Windows NT 4.0/EBF 0009 Time Now:2000-03-03 17:20:33.123 Build Time:Jan 13 2000, 03:38:09 File Format:22 on 10/29/1998 Catalog Format:2 Stored Procedure Revision:1 Page Size:1024/512blksz/2bpc Number of DB Spaces:1 Number of Temp Spaces:1 DB Blocks: 1-20480IQ_SYSTEM_MAIN Temp Blocks: 1-10240IQ_SYSTEM_TEMP Create Time:1999-08-09 16:00:11.629 Update Time:1999-08-09 16:00:26.285 Main IQ Buffers:6393, 8Mb Temporary IQ Buffers:3196, 4Mb Main IQ Blocks Used:1026 of 20480, 5%, Max Block#: 1205 Temporary IQ Blocks Used:13 of 10240, 0%, Max Block#: 0 Memory:Current: 13mb, Max: 14mb Main IQ Buffers:Used: 12, Locked: 1 Temporary IQ Buffers:Used: 6, Locked: 0 Main IQ I/O:I: L27/P12 O: D4/P1 C: D432960288 Temporary IQ I/O:I: L32/P0 O: D6/P0 C: D0

23 Sa_conn_properties NumberPropNumPropNamePropDescriptionValue 109128861729CacheHitsCache hits0 109128861730CacheReadCache reads0 109128861731DiskReadDisk reads12 109128861732DiskSyncReadDisk synchronous reads0 109128861733DiskWaitReadDisk wait for reads0 109128861734DiskWaitWriteDisk wait for writes0 109128861735CacheReadTableCache table reads0 109128861736CacheReadIndLeafCache index leaf reads0 Etc…

24 Sa_db_properties NumberPropNumPropNamePropDescriptionValue 0125NameDatabase nameasiqdemo 0126AliasMounted database nameasiqdemo 0127FileDatabase file C:\Program Files\Sybase\ASIQ12\demo\asiqdemo.db 0128PageSizeDatabase page size4096 0129LogNameDatabase log file name C:\Program Files\Sybase\ASIQ12\demo\asiqdemo.log 0131ConnCountNumber of connections2 0146FileVersionDatabase file version number1001 0147CheckpointUrgencyDatabase checkpoint urgency0 0148RecoveryUrgencyDatabase recovery urgency0 0151IQStoreIQ store is on/offON 0163CharSetCharacter Setcp1252 0164MultiByteCharSetMulti Byte Character Set ( on/off )OFF 0165LanguageLanguageunknown

25 Sa_eng_properties PropNumPropNamePropDescriptionValue 0IdleCheckIdle I/O checked0 1IdleWriteIdle I/O writes 0 2IdleChkptIdle I/O checkpoints0 3IdleChkTimeIdle I/O checkpoint time0 4ChkptCheckpoints1 5ChkptPageCheckpoint log pages2 6ChkptFlush Checkpoint flushed pages2 7ExtendDB Extend database file writes0 8ExtendTempWriteExtend temporary file writes66 9FreeWritePushFree list write to pushable list0 10FreeWriteCurrFree list write to current list0 11CommitFile Commit writes to disk 347 12PendingReq Pending requests detected0 13CurrRead Active disk read requests0 14MaxReadMaximum active disk read requests2 15CurrWriteActive disk write requests 0 16MaxWrite Maximum active disk write requests2 17CurrIO Active disk read/write requests0 18MaxIOMaximum active disk read/write requests2 19JavaNSSize Java VM Namespace size0 20IOToRecover0

26 Administration - End


Download ppt "Administration etc.. What is this ? This section is devoted to those bits that I could not find another home for… Again these may be useless, but humour."

Similar presentations


Ads by Google