Top Banner
Administration etc.
26

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.

Dec 24, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 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.

Administration etc.

Page 2: 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.

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

Page 3: 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.

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

Page 4: 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.

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

Page 5: 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.

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 CatalogStore

Trans.Log

Issue CheckpointIssue Checkpoint

1.

Write Marker into LogWrite Marker into Log

2.

Write Catalog to Tape(s)Write Catalog to Tape(s)

3.

Tape Drive(s)

Write (Changed) DataWrite (Changed) DataTo Tape(s)To Tape(s)

4.

Write Marker into LogWrite Marker into Log

5.

Check for Completed TX.Check for Completed TX.

6.

If there are – backup the changed pagesIf there are – backup the changed pagesThen go to 5.Then go to 5.

7a.

If there are no committed TXIf there are no committed TXCheckpoint,Delete Log and StopCheckpoint,Delete Log and Stop

7b.

Page 6: 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.

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

Page 7: 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.

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)

Page 8: 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.

Restore Restrictions

• For incremental restores there must be no user access between restores

• Restore will create and drop dbspaces as required

Page 9: 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.

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

Page 10: 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.

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

Page 11: 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.

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…

Page 12: 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.

Checkdb Output

DB Statistics Value Flags ---------------------------------- ------- ------- IQ DBCC Verification Summary  Total Blocks In Database 20480 Blocks Marked as In Use 1026 Blocks Verified as In Use 1026 Blocks Detected as Duplicates 0 Blocks Detected as Unowned 0 Blocks Detected as Leaked 0 Tables Verified 9 Indexes Verified 74 Join Indexes Verified 0

Page 13: 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.

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

Page 14: 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.

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

Page 15: 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.

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

Page 16: 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.

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

Page 17: 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.

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

Page 18: 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.

DBCC_OPTION - 2

Value Action

0 If –iqdropblks is set this checks for leakedblocks 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 isfound the server (probably) will terminate

1 Fast leak check – walks the block maps only. Thisis very fast (1-2 GB per second)

2 Checks 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

Value Action

3 Server must have –iqdropblks set. Checks leaked blocks (same as 0 and –iqdropblks but only checks leaks

4 Checks page chaining on all indexes

5 Full chain and consistency check on all indexes, not just the index chaining (This can be slow)

6 Full consistency check on all indexes, and will try to repair broken chains

7 A more detailed version of 6 - more through but very much slower.

Page 19: 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.

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

Page 20: 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.

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!

Page 21: 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.

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

Page 22: 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.

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 0009Time Now: 2000-03-03 17:20:33.123Build Time: Jan 13 2000, 03:38:09File Format: 22 on 10/29/1998Catalog Format: 2Stored Procedure Revision: 1Page Size: 1024/512blksz/2bpcNumber of DB Spaces: 1Number of Temp Spaces: 1DB Blocks: 1-20480 IQ_SYSTEM_MAINTemp Blocks: 1-10240 IQ_SYSTEM_TEMPCreate Time: 1999-08-09 16:00:11.629Update Time: 1999-08-09 16:00:26.285Main IQ Buffers: 6393, 8MbTemporary IQ Buffers: 3196, 4MbMain IQ Blocks Used: 1026 of 20480, 5%, Max Block#: 1205Temporary IQ Blocks Used: 13 of 10240, 0%, Max Block#: 0Memory: Current: 13mb, Max: 14mbMain IQ Buffers: Used: 12, Locked: 1Temporary IQ Buffers: Used: 6, Locked: 0Main IQ I/O: I: L27/P12 O: D4/P1 C: D432960288Temporary IQ I/O: I: L32/P0 O: D6/P0 C: D0

Page 23: 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.

Sa_conn_properties

Number PropNum PropName PropDescription Value1091288617 29 CacheHits Cache hits 01091288617 30 CacheRead Cache reads 01091288617 31 DiskRead Disk reads 121091288617 32 DiskSyncRead Disk synchronous reads 01091288617 33 DiskWaitRead Disk wait for reads 01091288617 34 DiskWaitWrite Disk wait for writes 01091288617 35 CacheReadTable Cache table reads 01091288617 36 CacheReadIndLeaf Cache index leaf reads 0Etc…

Page 24: 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.

Sa_db_properties

Number PropNum PropName PropDescription Value0 125 Name Database name asiqdemo0 126 Alias Mounted database name asiqdemo0 127 File Database file

C:\Program Files\Sybase\ASIQ12\demo\asiqdemo.db0 128 PageSize Database page size 40960 129 LogName Database log file name

C:\Program Files\Sybase\ASIQ12\demo\asiqdemo.log0 131 ConnCount Number of connections 20 146 FileVersion Database file version number 10010 147 CheckpointUrgency Database checkpoint urgency 00 148 RecoveryUrgency Database recovery urgency 00 151 IQStore IQ store is on/off ON0 163 CharSet Character Set cp12520 164 MultiByteCharSet Multi Byte Character Set ( on/off ) OFF0 165 Language Language unknown

Page 25: 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.

Sa_eng_properties

PropNum PropName PropDescription Value0 IdleCheck Idle I/O checked 01 IdleWrite Idle I/O writes 02 IdleChkpt Idle I/O checkpoints 03 IdleChkTime Idle I/O checkpoint time 04 Chkpt Checkpoints 15 ChkptPage Checkpoint log pages 26 ChkptFlush Checkpoint flushed pages 27 ExtendDB Extend database file writes 08 ExtendTempWrite Extend temporary file writes 669 FreeWritePush Free list write to pushable list 010 FreeWriteCurr Free list write to current list 011 CommitFile Commit writes to disk 34712 PendingReq Pending requests detected 013 CurrRead Active disk read requests 014 MaxRead Maximum active disk read requests 215 CurrWrite Active disk write requests 016 MaxWrite Maximum active disk write requests 217 CurrIO Active disk read/write requests 018 MaxIO Maximum active disk read/write requests 219 JavaNSSize Java VM Namespace size 020 IOToRecover 0

Page 26: 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.

Administration - End