Some pages on Software Databases & Linux
Operating Systems Security Databases Database software Some Oracle utils Nice software Some Old pages
SQL guide PL/SQL guide Jersey and Open Source Linux File server Linux Firewalls Thin clients |
Data Unload function. This script is most useful when you are developing a system and want to move test or reference data from your development system to another system, user or schema. You can of course use Database links, the Oracle Export/Import function or a number of other programs instead, but this is a simple script that can be run for one table or in batch for a number of tables. It creates a sqlplus command file that you can transfer, edit or include in your system in several ways. The script just dumps data from a table into a file with simple insert statements. This means that the data is easy to move between Oracle versions and also into other databases that understands basic SQL-insert-statements. The Script works with version 7, 8 and 9 of Oracle Rdbms (I do not remember if I tested it with earlier versions). It is limited to handle tables with the most common data types, char/varchar and numeric fields. It does not work with long data, raw long, or lobs, sorry. Moving data the other way is not possible because the script is dependent on the Oracle Data dictionary, the data in it, sqlplus and Oracle SQL functions.
To use it: Start SQLPlus, Log in on the database and run the script with: @@Unload_ldi "your_table_name" This will give you a file with insert statements for all data from the table (or view). The script takes one argument, the table or view name to be dumped and creates a temporary file $t_xxxx.sql that can be deleted. It then runs this file to create the "load" file named LDI_tablename.sql, where tablename is replaced with the name of the table you are dumping.
You can write a script to dump a number of table by creating a script with @@Unload_ldi "tbl1" @@Unload_ldi "tbl2" @@Unload_ldi "tbl3" etc. Run this script to dump all your reference information. And then load it with a script containing @@LDI_tbl1.sql @@LDI_tbl2.sql @@LDI_tbl3.sql etc.
|
>> Page 4 |
Copyright(@)2003 www.Timehole.com. You may use and redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or later. |
|
I work with databases
 And OpenSource Sw
 I use fedora linux
For non-techies try: Ubuntu or PcLinuxOs Share information and knowledge!
 I'm based in Jersey, Available for assignments in all of Europe, On-Site or Remote. Call or mail me!
 |