From ddlutils-user-return-762-apmail-db-ddlutils-user-archive=db.apache.org@db.apache.org Fri Dec 07 06:23:41 2007 Return-Path: Delivered-To: apmail-db-ddlutils-user-archive@www.apache.org Received: (qmail 77327 invoked from network); 7 Dec 2007 06:23:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2007 06:23:41 -0000 Received: (qmail 36118 invoked by uid 500); 7 Dec 2007 06:23:30 -0000 Delivered-To: apmail-db-ddlutils-user-archive@db.apache.org Received: (qmail 36103 invoked by uid 500); 7 Dec 2007 06:23:30 -0000 Mailing-List: contact ddlutils-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-user@db.apache.org Delivered-To: mailing list ddlutils-user@db.apache.org Received: (qmail 36089 invoked by uid 99); 7 Dec 2007 06:23:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2007 22:23:29 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tomdzk@gmail.com designates 64.233.166.176 as permitted sender) Received: from [64.233.166.176] (HELO py-out-1112.google.com) (64.233.166.176) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Dec 2007 06:23:09 +0000 Received: by py-out-1112.google.com with SMTP id p76so1340711pyb for ; Thu, 06 Dec 2007 22:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=+r2vHH7VFBM847Hu+FIGzwZE0AxGjtBxlABtzE5Qzuc=; b=Udz7tVgqFjr8x+9LORt43mQpdJu7xuSSoKRkdemgWcSdeD9fLFjUiI3powPXGwGwTwOgDOj096rcgAM+ttLmx28rbr8b6jRmr5lu5HBVZAXOKfaYPpS6IWLp0KNAPKvPgL79/OEm7mXsF5JMaCrmDPfT4T2+ZffqzKCGYicRZtU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TeZzlKIJfATi2UHJod6SZJBv9s2j0GRzM+znVcmYo1Sf5lHzDs7eViEMsRMGpmQ+G2t+stkgDBZgA12eaV5jx/M8pax7x1LFlCox768anQHyqnnFVNHROth/xr6gRYgzlK2zCaWkmn6k90KSNXpGQxw2BKK23eByimW/huTXymg= Received: by 10.65.242.11 with SMTP id u11mr5888891qbr.1197008590546; Thu, 06 Dec 2007 22:23:10 -0800 (PST) Received: by 10.65.163.6 with HTTP; Thu, 6 Dec 2007 22:23:10 -0800 (PST) Message-ID: <224f32340712062223y6351faadw953b72505142edbd@mail.gmail.com> Date: Thu, 6 Dec 2007 22:23:10 -0800 From: "Thomas Dudziak" To: ddlutils-user@db.apache.org Subject: Re: ddl utils schema with existing db In-Reply-To: <326416.23534.qm@web51407.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <326416.23534.qm@web51407.mail.re2.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org On Dec 6, 2007 2:05 PM, tyju tiui wrote: > I'm confused about the difference between database and schema definition in ddlutils. > If I have an existing database and would like to create a new schema within that database how would I go about that (via ant or programmatically)? > > For servers like MySQL which don't have a notion of separate schema's inside a single database I would have to create a new database each time. For servers like PostgreSQL and Oracle which do support separate schemas within a single database I shouldn't need to create a new db each time I need a new schema. Does this make sense? DdlUtils' support for schemas within the database is weak at the moment. You can create tables etc. within a specific schema by prefixing the table names etc. with the schema. E.g. ...
For databases like Oracle, you can achieve somethin similar by accessing the database using a user corresponding to the schema. E.g. to place something in schema 'testschema', create the schema indirectly by creating a user of the same name, and then use this user to connect to the database. Any tables created via an unqualified name will then be placed in that schema. This also works for reading the database model from a schema (using the schema pattern to restrict which schemas to read from). Tom