LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2011, 11:04 AM   #1
smritisingh03
Member
 
Registered: Nov 2010
Posts: 43

Rep: Reputation: 0
copy translation tables from staging environment.


Hi

I have 3 translation tables,i.e,camp_generic_trans
camp_generic_trans_def
camp_generic_trans_epc

these tables exist in cntr1/cntr1@camABC1


I have to copy these tables from here to staging environment.

I need to first check if any of the tables exist in staging.If yes,then delete and create new.
There are 4 staging env from 5 to 8.

I have to pass the staging environment as parameter to ask the user which environment does he want the tables to be copied.

Any suggestion would highly be appreciated as I am new to unix.Thank you so much in advance
 
Old 04-08-2011, 02:32 PM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
This is not a solution; but, may help.

To check if a table exists you can run:

Code:
SELECT * FROM USER_TABLES WHERE TABLE_NAME='You Table Name';
Then you can check the result and delete the table if required:

Code:
DROP TABLE YOUR_TABLE_NAME;
Then create table:
Code:
CREATE TABLE YOUR_TABLE_NAME AS
(SELECT * FROM ORGINAL_TABLE_NAME);
COMMIT;
Or, insert the data:

Code:
INSERT INTO YOUR_TABLE_NAME 
(SELECT * FROM ORGINAL_TABLE_NAME);
COMMIT;
I hope that helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Red Hat YUM staging server prowla Red Hat 5 03-28-2011 04:55 AM
LXer: Advisory Against WiFi Drivers in Linux Staging Tree LXer Syndicated Linux News 0 11-24-2009 05:40 AM
Staging Servers requests Username and Password Tony Littlejohn Mandriva 3 02-22-2009 03:31 PM
LXer: Introducing the Linux-Staging Tree LXer Syndicated Linux News 0 06-14-2008 02:00 PM
LXer: Gentoo staging big UK conference July 14 LXer Syndicated Linux News 0 07-09-2007 11:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration