Renaming a database
Posted in 2003
Topics: Storage & Space Management
Hi, I want to create a database on a separate dbspace from the existing one. = It will be a copy of the database ('gems') that is found on the existing = dbspace. My question is can I rename the existing gems database to = gemsold and rename this database that I am going to create from gemsnew = to gems? Also for the offset for each chunk I added to the new dbspace I made = each offset 0 (added 3 chunks). Is this appropriate? Look forward to some help. Lee Aholima, Database Administrator Thames-Coromandel District Council Ph 07 868 6025 Email lee.aholima@tcdc.govt.nz Mobile 0274333915 The contents of this e-mail maybe CONFIDENTIAL OR LEGALLY PRIVILEGED, & = is intended only for the persons named above. If this e-mail is not = addressed to you, you must not use, read, distribute or copy this = document. If you have received this document by mistake, please call us = and destroy the original. Thank you. =20
Hi,
1.
yes, you can rename your database. Look at your SQL-manual.
When nobody is connected to the database, except you as administrator :
SQL> rename database gems to gemsold ;
2.
The offset of the added chunk is depending of your O.S.
For instance : a chunk in AIX is a 'logical volume' and in
certain circumstances AIX writes in the first 4Kb.
My experience is that AIX only do this when a file system is created.
This is not our case.
Look yourself at the 'physical partition' on your system.
Is it a unix system then dump the first Kbytes with unix commands
(dd if=/dev/rchunk bs=1k count=4 | od -cx >dumpfile) and see yourself if the
O.S. uses some bytes.
On AIX we uses an offset of 4 Kbytes : onspaces -c -d dba_cel -p
/dev/vg02_form_a_avr -o 4 -s 393212
3.
Why added 3 chunks, if no good reason then possible add 1 big chunk
bye
&
have a nice day
Yves
(sorry for the html stuff, if it appears)
------_=_NextPart_001_01C37CE4.6FD120F0
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: Renaming a database [1892] </TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi,</FONT>
</P>
<P><FONT SIZE=2>1. </FONT>
<BR><FONT SIZE=2>yes, you can rename your database. Look at your
SQL-manual.</FONT>
<BR><FONT SIZE=2>When nobody is connected to the database, except you as
administrator :</FONT>
<BR><FONT SIZE=2>SQL> rename database gems to gemsold ;</FONT>
</P>
<P><FONT SIZE=2>2. </FONT>
<BR><FONT SIZE=2>The offset of the added chunk is depending of your O.S.</FONT>
<BR><FONT SIZE=2>For instance : a chunk in AIX is a 'logical volume' and
in</FONT>
<BR><FONT SIZE=2>certain circumstances AIX writes in the first 4Kb.</FONT>
<BR><FONT SIZE=2>My experience is that AIX only do this when a file system is
created.</FONT>
<BR><FONT SIZE=2>This is not our case.</FONT>
<BR><FONT SIZE=2>Look yourself at the 'physical partition' on your
system.</FONT>
<BR><FONT SIZE=2>Is it a unix system then dump the first Kbytes with unix
commands</FONT>
<BR><FONT SIZE=2>(dd if=/dev/rchunk bs=1k count=4 | od -cx >dumpfile) and
see yourself if the O.S. uses some bytes.</FONT>
<BR><FONT SIZE=2>On AIX we uses an offset of 4 Kbytes : onspaces -c -d
dba_cel -p /dev/vg02_form_a_avr -o 4 -s 393212</FONT>
</P>
<P><FONT SIZE=2>3.</FONT>
<BR><FONT SIZE=2>Why added 3 chunks, if no good reason then possible add 1 big
chunk</FONT>
</P>
<P><FONT SIZE=2>bye</FONT>
<BR><FONT SIZE=2>&</FONT>
<BR><FONT SIZE=2>have a nice day</FONT>
</P>
<P><FONT SIZE=2>Yves</FONT>
<BR><FONT SIZE=2>(sorry for the html stuff, if it appears) </FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C37CE4.6FD120F0--
----LNX_Wed_Sep_17_2003_09:19:49_V3.33--
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>Datum: 2003.09.17 01:42:15
>Sender: Lee Aholima <lee.aholima@tcdc.govt.nz>
>
>I want to create a database on a separate dbspace from the existing one.=
=3D
>It will be a copy of the database ('gems') that is found on the existing=
=3D
>dbspace. My question is can I rename the existing gems database to =3D
>gemsold and rename this database that I am going to create from gemsnew =
=3D
>to gems?
=
Yes, you can with SQL: echo "rename database <old> to <new> | dbaccess =
-
If you are using synonyms somewhere you have to check if you must change =
them.
=
If you are using dbexport/dbimport for the copy you will have to editthe =
export sql file
to change names from gems to gemsnew for the import.
=
>Also for the offset for each chunk I added to the new dbspace I made=3D
>each offset 0 (added 3 chunks). Is this appropriate?
=
Some people prefer to have a slightly higher offset (SAP for example 16) =
to give some
additional security if someone makes an error and creates a filesystem on=
your chunk.
We start with offset 0 for the first chunk on a device.
=
Regards,
Andreas Kutsche
------------------------------------------------
SPAR Oesterreichische Warenhandels-AG
Hauptzentrale
Europastra=DFe 3
A-5015 Salzburg
=
Telefon : +43 662 4470 24423
E-Mail : Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
------------------------------------------------
=
----LNX_Wed_Sep_17_2003_09:19:49_V3.33----
Lee Aholima wrote: > Hi, > > I want to create a database on a separate dbspace from the existing one. = > It will be a copy of the database ('gems') that is found on the existing = > dbspace. My question is can I rename the existing gems database to = > gemsold and rename this database that I am going to create from gemsnew = > to gems? Yes, use the RENAME DATABASE command. It would help if you told us what products you are using and what versions. As you mention dbspaces, I assume either OnLine or IDS, but I don't think RENAME DATABASE is available in all versions. Check in your manual. > Also for the offset for each chunk I added to the new dbspace I made = > each offset 0 (added 3 chunks). Is this appropriate? You tell us, it depends on the set up of your disks. You really need to speak to your systems administrator or whoever set up the chunks for you. An offset of 0 means there is no information stored by the OS or volume manager at the beginning of the disk or partition. If there was, you just trashed it. Cheers, -- Mark. +----------------------------------------------------------+-----------+ | Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /| | Mydas Solutions Ltd http://MydasSolutions.com |///// / //| | +-----------------------------------+//// / ///| | |We value your comments, which have |/// / ////| | |been recorded and automatically |// / /////| | |emailed back to us for our records.|/ ////////| +----------------------+-----------------------------------+-----------+
Related threads
- Conversion to differeent characters sets
- Problem in changing locale via dbexport/dbimport
- RE: openlink error "Unable to load locale categories"