writing database tables into a file in unix


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users writing database tables into a file in unix
# 1  
Old 11-05-2004
writing database tables into a file in unix

I want to collect the database tables(Ex: Emp,Sal,Bonus...etc)
in a file & give this file at the command prompt, when prompted for the tables list at command prompt. How can i do that ?

Ex:- Import jason/jason1 tables=emp,sal,bonus log=j1.log
i want to change this into
Ex:- Import jason/jason1 tables=i_tables.txt log=j1.log

where i_tables.txt should contain emp,sal,bonus.
How i can acheive this at the commnad prompt in unix .

Thanks !
# 2  
Old 11-05-2004
Please don't post the same question in more than one forum.

I have removed the duplicate post.

Cheers
ZB
# 3  
Old 03-22-2005
Tools

you shoul be able to do this with a "par" file.
Here is small tip regarding export. It is possible to make a selective table export with parameter tables.

$exp parfile=exp.par

Example of parameter file:

$ cat exp.par
buffer=8388608
file=artist_full.dmp
log=artist_exp.log
consistent=y
tables=(emp,sal,bonus,...)
userid=system/manager
# 4  
Old 03-22-2005
The original question is rather unclear. It seems as though he only wants to extract the DDL.

You can do this as follows:

Code:
exp userid=user/pwd rows=n grants=n indexes=n constraints=n owner=schema_owner
imp userid=user/pwd full=y indexfile=schema_owner.sql

This will create a file called schema_owner.sql with your DDL. You can strip out the "REM" text and you have a functional DDL build script for your tables and indexes.

Thomas
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script writing for tables with binary data

Hi There, I'm trying to write a simple script that will email me when we have an application job in a certain status that needs human intervention. I've used this script for other tables and it works great. However, this one gives me the warning that there is binary data so it might not. ... (2 Replies)
Discussion started by: Colel2
2 Replies

2. UNIX for Dummies Questions & Answers

How to Understand file writing in Progress in UNIX?

Hi All, I have a requirement, where i have to pool file A data to file B continuously and need to process the data in the file B. Since the data need to be processed only once so i have to truncate the data in file A after every pool. So that on the next pooling i can get the fresh data and... (3 Replies)
Discussion started by: mayank2211
3 Replies

3. Programming

Dynamically checking rules in database tables using SQL

I want to check for rows in a table where all values (except the key) is empty. I am using MySQL 5.5. I plan to do this mechanically, so the approach should work for any table in my database schema. Suppose for illustration purposes I start with the following table: CREATE TABLE `sources` ( ... (4 Replies)
Discussion started by: figaro
4 Replies

4. Shell Programming and Scripting

Several processes writing to an SQLite database at the same time

I have several bash scripts that write to an SQLite3 database at the same time. At some occasion the database returns: SQL error: database is locked. How would be the best way, to make a process to wait until the data base is 'free' again. I tried: sqlite3 test.db ".timeout 1000; update....."... (2 Replies)
Discussion started by: creamcheese
2 Replies

5. Shell Programming and Scripting

Reading data from DataBase and Writing to a file

Hi All, Please help me in writing data to a file in one row. In database there is a column which contains large data which does not fit in the file in one row. The column contains list of paths. I want to write these paths to a file in one row. Please find the code below writes : ... (2 Replies)
Discussion started by: rajeshorpu
2 Replies

6. Programming

PHP Script Not Writing Bankfee To Database

The attached file, credits.php, is part of our new (experimental) banking / credits system for this site. I added a field bankfee in credits_transactions but it is not writing to the database (no PHP error). Can someone take a look at the attached PHP file and see if they can find out why... (4 Replies)
Discussion started by: Neo
4 Replies

7. Shell Programming and Scripting

Tables to query to find users for database from shell script

I am coding shell script. I need to connect to different databases like DB2, Oracle and Sybase. I would then need to query tables where it has all the groups, users for that database. I would also need who has what kind of permissions. EG: I know for DB2 some TABAUTH table needs to be... (0 Replies)
Discussion started by: pinnacle
0 Replies

8. Shell Programming and Scripting

writing script file for database

how to disable a constraint type of a field (present in diffrent tables) in the database unix a unix script file.. (3 Replies)
Discussion started by: shaksing
3 Replies

9. Shell Programming and Scripting

Automating back up of database tables

Hi all, i would like to set a cronjob to back up my db tables. I have written the par file, i would like to know how can i execute a exp command in a shell script. my par file userid=admin/password file=backup.dmp log=backupLOG.log tables= (Tables 1, Tables 2)My cron job script will be... (1 Reply)
Discussion started by: new2ss
1 Replies
Login or Register to Ask a Question