General Question about database -- redirection

Started by akp geekalmost 16 years ago3 messagesgeneral
Jump to latest
#1akp geek
akpgeek@gmail.com

dear all -

I am not supposed to ask this. But, the question is I have 2
databases DB_1 and DB_2. I have a script that loads few tables in DB_1. The
2 databases are identical. In case , if database DB_1 is dropped, Is there
any command that I can issue to use the DB_2?

Regards

#2Jorge Godoy
jgodoy@gmail.com
In reply to: akp geek (#1)
Re: General Question about database -- redirection

create database db_1 template db_2;

This will create a new DB_1 using DB_2 as template. Otherwise, you'll
change your code to connect to DB_2 instead of connecting to DB_1.

--
Jorge Godoy <jgodoy@gmail.com>

On Thu, Apr 15, 2010 at 14:49, akp geek <akpgeek@gmail.com> wrote:

Show quoted text

dear all -

I am not supposed to ask this. But, the question is I have 2
databases DB_1 and DB_2. I have a script that loads few tables in DB_1. The
2 databases are identical. In case , if database DB_1 is dropped, Is there
any command that I can issue to use the DB_2?

Regards

#3akp geek
akpgeek@gmail.com
In reply to: Jorge Godoy (#2)
Re: General Question about database -- redirection

Thank you

On Thu, Apr 15, 2010 at 8:49 PM, Jorge Godoy <jgodoy@gmail.com> wrote:

Show quoted text

create database db_1 template db_2;

This will create a new DB_1 using DB_2 as template. Otherwise, you'll
change your code to connect to DB_2 instead of connecting to DB_1.

--
Jorge Godoy <jgodoy@gmail.com>

On Thu, Apr 15, 2010 at 14:49, akp geek <akpgeek@gmail.com> wrote:

dear all -

I am not supposed to ask this. But, the question is I have 2
databases DB_1 and DB_2. I have a script that loads few tables in DB_1. The
2 databases are identical. In case , if database DB_1 is dropped, Is there
any command that I can issue to use the DB_2?

Regards