Thursday 31 December 2009

Archive Database Access in ASE 15 example

ARCHIVE DATABASE ACCESS IN ASE1502


1> sp_dboption scratchdb,'scratch database', true
2>
Database option 'scratch database' turned ON for database 'scratchdb'.
Running CHECKPOINT on database 'scratchdb' for option 'scratch database' to take effect.
(return status = 0)
1> use scratchdb
2>
1> checkpoint
2>
1> use master
2>
1>

1> create database scratchdb on v_scratch=5
2>
CREATE DATABASE: allocating 2560 logical pages (5.0 megabytes) on disk 'v_scratch'.
Database 'scratchdb' is now oline.


1> dump database sag to '/OracleDumps/opctlsy2/sybase/data/sag_archive_dump.dmp'
2>
Backup Server session id is: 5. Use this value when executing the 'sp_volchanged' system stored procedure after fulfilling any volume change request from the Backup Server.
Backup Server: 4.41.1.1: Creating new disk file /OracleDumps/opctlsy2/sybase/data/sag_archive_dump.dmp.
Backup Server: 6.28.1.1: Dumpfile name 'sag082000CAD5 ' section number 1 mounted on disk file '/OracleDumps/opctlsy2/sybase/data/sag_archive_dump.dmp'
Backup Server: 4.188.1.1: Database sag: 3916 kilobytes (47%) DUMPED.
Backup Server: 4.188.1.1: Database sag: 5214 kilobytes (100%) DUMPED.
Backup Server: 3.43.1.1: Dump phase number 1 completed.
Backup Server: 3.43.1.1: Dump phase number 2 completed.
Backup Server: 4.188.1.1: Database sag: 5218 kilobytes (100%) DUMPED.
Backup Server: 3.43.1.1: Dump phase number 3 completed.
Backup Server: 4.188.1.1: Database sag: 5222 kilobytes (100%) DUMPED.
Backup Server: 3.42.1.1: DUMP is complete (database sag).
1>
1> use master
2>
1> disk init
2> name=v_archive_db
3> ,physname='/OracleDumps/opctlsy2/sybase/data/archive_db.dat',
4> size="3M"
5>
1> create archive database archive_database on v_archive_db=3 with scratch_database=scratchdb
2>
CREATE DATABASE: allocating 1536 logical pages (3.0 megabytes) on disk 'v_archive_db'.
1> sp_help
1> load database archive_database from '/OracleDumps/opctlsy2/sybase/data/sag_archive_dump.dmp'
2>
Started estimating recovery log boundaries for database 'archive_database'.
Database 'archive_database', checkpoint=(10214, 13), first=(10214, 13), last=(10214, 13).
Completed estimating recovery log boundaries for database 'archive_database'.
Started ANALYSIS pass for database 'archive_database'.
Completed ANALYSIS pass for database 'archive_database'.
Started REDO pass for database 'archive_database'. The total number of log records to process is 1.
Completed REDO pass for database 'archive_database'.
Use the ONLINE DATABASE command to bring this database online; ASE will not bring it online automatically.
1>


1> online database archive_database
2>
Started estimating recovery log boundaries for database 'archive_database'.
Database 'archive_database', checkpoint=(10214, 13), first=(10214, 13), last=(10214, 13).
Completed estimating recovery log boundaries for database 'archive_database'.
Started ANALYSIS pass for database 'archive_database'.
Completed ANALYSIS pass for database 'archive_database'.
Recovery of database 'archive_database' will undo incomplete nested top actions.
Database 'archive_database' is now online.
1>


1> use scratchdb
2>
1> select * from sysaltusages
2>
dbid location lstart size vstart vdevno segmap
------ ----------- ----------- ----------- ----------- ----------- -----------
10 4 0 5120 1 25 3
10 4 5120 5120 1 25 4
10 5 0 256 8 26 3
10 5 256 2 265 26 3
10 5 264 2 267 26 3
10 5 272 2 269 26 3
10
5 280 1 271
1> dump database archive_database to '/OracleDumps/opctlsy2/sybase/data/archive.dmp'
2>
Msg 3167, Level 16, State 2:
Server 'GALLARDO', Line 1:
DUMP DATABASE/TRANSACTION is not currently supported on archive databases.
1>

4 comments:

  1. Thanks for sharing!!! Really nice post.

    Rep database

    ReplyDelete
  2. As I understood, the size of the archive database must be at least 1/256th the size of the database dump to be loaded, is that true ? and what about the sizing of the scratch database ?

    ReplyDelete
    Replies
    1. I got error on scratch database log segment even i have more than 1 gb log size on scratchdb

      Delete
  3. I have 90 GB production database. Dump file 60GB. How much size should i need for archive database? Please inform me. my mail melihbasbug@gmail.com Thanks

    ReplyDelete