hello experts,
i'm faced with the following situation:
- sybase sql anywhere database
- several hundred tables
- lots of triggers, stored procedures, heaps of dependencies between tables
and the old admin left the company - not without leaving a little gift: the dba does not have any administrative permissions anymore.
my plan is to take an old backup, set up a separate working instance with this old backup (that still includes an oparative dba) and then afterwards transfer the data from the productive database into that separated database. thus giving me a working copy of the database including all structures, permissions, functionality and data.
what sounds great at the first glance seems a wee bit harder to archive:
- first of all its my first contact to a sybase-db (worked with sql-server and some others).
- i can't unload the db as no proper dba exists
- i can't extract the data for the same reason
- with several hundred tables its hard to write enough scripts to extract manually in time
what so far looks like the best possibility to me:
- i've got a running older sql-server with dts so i could fetch the data into the sql-server (data in corresponding structure, no dependencies) and push it back into place in the sybase db
problem: lots of triggers and dependencies.
--------------------
so my questions:
1.) do you have general suggestions how i could solve that problem? is my approach appropriate or are there better ways?
2.) assuming the export and re-import would work, how could i avoid triggers and dependencies killing the task? is there a possibility to temporarily deactivate those mechanisms for a bulk-load or something like that? (i don't think manually switching triggers and dependecies off and on again would be practicable in resonable time)
advice would be greatly appreciated. thanks in advance.
You might look through his old stuff, scripts, utilities, tools, batch jobs, etc. that require DBA privs and see if there is one or more other accounts that appear to have some or all of the privs.
If, on the other hand, the old DBA was incompetent and/or has thrown himself under the wheels of a train out of guilt, you are probably going to have to do this via brute force. You are also going to have to do this relatively quickly since it sounds as if you cannot backup the database right now. I would start shutting things down for a few minutes at night and making copies of the database file(s) in place of doing a proper dump.
As you have correctly pointed out, there is no way you can manipulate all those triggers and constraints manually in a realistic amount of time. As such, I would extract them into large scripts, remove them completely from the target database, load the data, then reapply them using those scripts. I would also do the same thing with the indexes since you really don't want them to build incrementally. Load the data, add the indexes, triggers, and constraints.
You don't tell us which version of SQL Anywhere you are using or how much data you have in this system so it is kind of hard to make specific recommendations on the best way to move the data.
One other thing you might consider is trying to do an upgrade to a newer version of SQL Anywhere. It might be that the DBA privileges will get reset during that process or simply not brought forward in favor of defaults. Kind of a long shot but might be worth a try.
Of course, you need to call Sybase tech support and see if they have any ideas. First level support will come up empty so hold out and get it escalated to second level before you give up. This assumes you have a supported version and a support contract.
Best of luck with this one.
Regards,
Bill