A while ago our database person left us and in the interim until
a new person is hired I got stuck with looking after the databases on top
of everything else. After several weeks of crash course in databases,
SQL, Oracle, etc (eg like having a real life test of my predecessor's
backup strategies), I have come up with a number of questions which are
probably quite basic but haven't been able to locate in the mounds of
reference materials, and I thought I ask here. (I have a couple of
Oracle contacts on campus, but am saving them for the more stressful
questions--- like 'My database just crashed. What should I do?')
Running Oracle 7.3.3 on Digital Unix.
- The existing database code makes reference to a table sys.dual. I can't
find any references to this table in my books, and this table seems to behave
really strangely: eg describe sys.dual lists a single column DUMMY, yet
select user from sys.dual; returns my userid. What's going on here?
- After spending close to an hour trying to enter a stored procedure in
sqlplus, I eventually learned that I need to terminate the definition with
a '/', although can't find any explanation of this in books. Did see something
about terminating with a '.', which actually succeeds in terminating (ie no
longer left with Oracle prompting me for rest of command), but also seems to
discard what I did. Since a ';' seems sufficient to terminate most every other
command, I there's some logic to all this that I am missing.
- In my crash recovery, it seems that a sequence that was used to ensure the
primary key of a table got reset several days. I assume this is because I
restored from a several day old cold backup and then imp'ed fromuser= the user
who owns all the important tables from a full export done shortly before the
crash (which I think is just a lucky coincidence, but who knows). At least,
I think that is what happened, but it also seemed to only have happened to
a single sequence. (Fortunately, the affected table is not referenced by
any other table and is actually somewhat redundant, so I don't believe manually
massaging the data to make primary key unique again will be a problem).
- Does this hypothesis seem reasonable? I.e, would an imp fromuser=dba
not update the sequences owned by user? Should I have the misfortune of being
here when this database crashes again, is there a better way to do the import?
- I need to reset the sequence (set it ahead 100 or so). The best way I see
of doing that is to alter sequence's increment to something like 100, call
nextval for the sequence, then reset increment to 1. Is there an easier way?
Thanks in advance for any help I receive.
Tom Payerle
Dept of Physics payerle_at_physics.umd.edu
University of Maryland (301) 405-6973
College Park, MD 20742-4111 Fax: (301) 314-9525
--
Tom Payerle
Dept of Physics payerle_at_physics.umd.edu
University of Maryland (301) 405-6973
College Park, MD 20742-4111 Fax: (301) 314-9525
Received on Fri Oct 16 1998 - 16:58:07 CDT