Solved

Database Loading Question

Posted on 2000-05-08
7
449 Views
Last Modified: 2012-06-27
I have a sybase database in which data and logs are mixed up within data and log devices. If I take its dump file and load into another database it make the target database similar to the source db in terms log and data device combination. I want the target database to hold data and log in their respective devices and no mixup at all. I know we can do this by trasnferring data using bcp files.The target DB is in a different SUN Box.

Can anyone give me some useful tip ?

Thanks in advance..
Himansu
0
Comment
Question by:himansusb
  • 3
  • 3
7 Comments
 
LVL 3

Expert Comment

by:knel1234
ID: 2789458
himansub,

There are two different answers here:
first, the proper, documented, supported one and second, an alternative one that just happens to work.  If you want to do this the right way, reverse engineer the production database.  You should now have the devices (in order) and their respective device names.  Augment that script and change the device names to match the device names for your development/ standby environment.  I would recommend dropping and recreating these devices ( in the same order as the existing database).
Answer #2... If this is a test environment and you want to play around a little.... When the total size of the databases (source and destination environments) match and the total size of data and log each match (source and destination environments), I have been able to do a dump and restore in version 11.0.2.2 through versions  11.9.2.1

Note: rarely...if ever...will the company continue to supply disk space to match a development environment...
you may want to start thinking of the bcp approach.... Note If needed, code exists to perform diskless (uses memory)
bcp...which depending on your hardware can be efficent (ie no more sybase to flatfile and the flatfile to sybase)

knel
0
 
LVL 1

Accepted Solution

by:
albertsp earned 100 total points
ID: 2803903
I did the following:

Load your database in the new environment. Now you have mixed data and log devices.

1. Dump your transaction with the nolog option: dump tran db with no_log

2. use sp_logdevice to mark one of your devices as the log device. As you wil see this device is now log_only.

3. Edit your sysusages table and update the segmap column. Your segmap should be 4 for the logdevice and should be 3 for the other devices when there are no named segments (only default and system).

Warning!!!! This is not supported by Sybase but it works.

Succes, Albert
0
 

Author Comment

by:himansusb
ID: 2805813
Thanks Albert, please let me know your e-mailid..

Thanks
Himansu
New York
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:himansusb
ID: 2805901
Mr Albert, sysusages table contains dbid but does not contain information about the logdevices for which I have to update segmap to 4 and 3 for other devices. Using the approach you told I could only separate data from the logdevice but could not separate logs from the datadevices. Any more help please ?

Thanks
Himansu
0
 
LVL 1

Expert Comment

by:albertsp
ID: 2806294
Sysusages has a link to9 the sysdevices table (vstart between low and high)
Your vstart is in the sysusages and low and high in the sysdevices. This makes it possible to distinguish your devices in the sysusages table.

Succes, Albert

albert.spijkerman@dlm.nl.com
0
 

Author Comment

by:himansusb
ID: 2811890
Thanks Albert, I could find that too but could not update the sysusages table although I logged in as an sa which has a role of SSO. Any idea on this ?

I am using Adaptive Server Enterprise / 11.5.1 under Solaris platform.

Thanks for yout help
Himansu
0
 
LVL 1

Expert Comment

by:albertsp
ID: 2813664
Log in as SA.

then: sp_configure "allow updates",1

This allows you to update systemtables.

Succes, Albert
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
To form a query 10 405
Reading ASE Optimizer trace flag / switch output 4 598
Pivot and Unpivot in Sybase 2 1,672
How to get military time in Sybase? 3 94
IT certifications are a concrete representation of continual learning on the part of the candidate.  Continual learning is necessary for the long term success of an IT professional, but are IT certifications the right path for you?
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question