PL/SQL :: Transferring Data From Oracle Table To A File On A Windows Server
Nov 12, 2013
I have an oracle DB version 11.2 running on oracle enterprise linux 5.9. How to transfer data from the oracle DB to a flat file on a windows server. What i have done so far is to use utl_file to create a csv file on the oracle server and am now attempting to transfer this file.
I was going to use scp or rcp but am unable to get this to work(was looking at filezilla). Another option i can use is ftp as i have a UNIX script which i can run to do this. All this is done through an oracle package which is run hourly through dbms_scheduler. I have been using sp_host_command to run unix commands directly from pl/sql so can use this to run a unix script for last resort if i cant find an easier way to automate this.
I wanted to transfer my database from Oracle 11.1.0. on windows 2003 server 32 bit to Oracle 11.2.0. windows server 2008 64 bit
i have done following
1)On new server of 11.2.0 windows 2008 64 bit use rman backup from Oracle 11.1.0. on windows 2003 server 32 bit to restore the database and recover the database when i try to open the database Alter database open it gave me message that i should start my database as upgrade I start the database with upgrade
STARTUP UPGRADE and then run following
@?/rdbms/admin/utlirp.sql
and then run following
@?/rdbms/admin/utlu112i.sql
and then run
@?/rdbms/admin/catupgrd.sql
during run of catupgrd.sql after around 30 minutes of run, i got error ORA-03113: end-of-file on communication channel
but i reconnected myself with database again and shutdown the database and open it in normal mode and it has opened there were thousands of uncompiled objects and i recompiled them.
Only uncompiled objects left 60 are 'OLAPSYS' (Locked user) USER and 30 of PUBLIC user (all Synonyms)
Have i taken correct steps?
What should i do now to check that everything will be alright in future
I have database A (Working in Live environment) and Database B copy of Database (Not live) I have Restored whole database (A) RMAN backup file on Database (B) Previous week now i don't want to change anything in any schema and want to import only updated and new records in the table in Database B
There are around 20 schema If for example i have everything in new database B all required database objects like Procedure,functions, packages with indexes in all tables and data in tables, i just want to add new data and updated data.
working on setting up connection between a Windows 2008 server and a pair of Oracle 11g DBs in a RAC Cluster. One Database (let's say DatabaseA) is in one data center, and the other (DatabaseB) is an a secondary, backup database. The RAC Cluster is all set up, working fine, etc. However, I Need to set up the machine.config file on my Windows Server, to go only connect to DatabaseA, unless it fails, in which case, we want it to connect to DatabaseB. Think we could do this if the host app server was Linux/Unix, but it is windows, and I just don't have the background as to the parameters to set up in the machine.config file. They are similar, but different, and we want a very specific behavior (use DatabaseA, unless fails, then DatabaseB). Application is .NET 4.0 app.
In production database 30 tables are there in different schemas.
In some tables data is existed for 5 years in some tables data is existed 8 years in some tables data is existed for 6 years.
And all these tables are having billions and millions of records.Let us assume the tables in the production database are
Table1 -- 8 years data -- No. Of Records 3538969000 Table2 -- 6 years data -- No. Of Records 592844435 Table3 -- 3 years data -- No. Of Records 33224993 Table4 -- 4 years data -- No. Of Records 52361756 Table5 -- 5 years data -- No. Of Records 8948567 Table15 -- 6 years data -- No. Of Records 308476987
Now I want to trnasfer these 15 tables data to test database.Based on the following conditions.
For Table1 I want to transfer 6 years data to test database, keeep 2 years data in production and delete all 6 years data from production databse.
For Table2 I want to transfer 4 years data to test database, keeep 2 years data in production and delete all 4 years data from production databse.
For Table3 I want to transfer 2 years data to test database keeep 1 years data in production and delete all 2 years data from production databse.
This will be done periodically.
I.e. suppose if we run the script now and transfer the requested data to test database,again after one year the data got increased in production then again we have to run the script and transfer data to test database based on some conditions,so it should work for long time. what is the good and fast process to transfer the data.
I need a way to ftp file to remote server by reading data from table. I searched a couple of sites which asked me to use Chris xutl_ftp package..but unfortunately the site is no accessible..
Here is the code
CREATE OR REPLACE PACKAGE UTL_FTP AUTHID CURRENT_USER AS /** * LICENSE: GNU Lesser General Public License (LGPL) * Copyright (C) 2003-2006 Russ Johnson (john_2885@yahoo.com)
I was wondering if there is any way to know in which Tablespace and Datafile my Table is located. I have exported a table and about to delete it as i am partitioning it.
My requirement is to to truncate the table and load it with the data present in file. In the control file, I used the "TRUNCATE" command as well.In case, if the file has some invalid data and sqlldr fails, my existing data will be lost. Is there any option in which the sqlldr does not TRUNCATE the table in case of a failure.
I have a Clob file as a in parameter in my PROC. . File is comma separated.need procedure that would parse this CLOB variable and populate in oracle table .
We transferred our Oracle database 11.1.0.7 from windows 2003 enterprise edition 32 bit to windows 2008 enterprise edition server 64 bit.Database is working fine but we have 53 uncompiled objects which are related to OLAPSYS and public as follows
create table revenue ( person varchar2(23), month varchar2(3), rev_amt number )
and i have data in a file like below
Person Jan Feb Mar Apr Mai Jun Jul Aug Sep Oct Nov Dez -------------------------------------------------------- Schnyder,345,223,122,345,324,244,123,123,345,121,345,197 Weber,234,234,123,457,456,287,234,123,678,656,341,567 Keller,596,276,347,134,743,545,216,456,124,753,346,456 Meyer,987,345,645,567,834,567,789,234,678,973,456,125 Holzer,509,154,876,347,146,788,174,986,568,246,324,987 Müller,456,125,678,235,878,237,567,237,788,237,324,778 Binggeli,487,347,458,347,235,864,689,235,764,964,624,347 Stoller,596,237,976,876,346,567,126,879,125,568,124,753 Marty,094,234,235,763,054,567,237,457,325,753,577,346 Studer,784,567,235,753,124,575,864,235,753,864,634,678
i want to load it into the table in the following way.
Person Month Revenue ------------------------- Schnyder Jan 345 Schnyder Feb 223 Schnyder Mar 122 Schnyder Apr 345 Schnyder Mai 324 Schnyder Jun 244 Schnyder Jul 123 Schnyder Aug 123 Schnyder Sep 345 Schnyder Oct 121 Schnyder Nov 345 Schnyder Dez 197 ........ ... ... How to write control file to load this data into the above revenue table.
I am having query regarding sql loader. my data file is comm(,) seperated and I want to load the whole file in oracle table 'bill_temp' except 1st column data of data file.
e.g. File name: bill_file.dat fields seperated by comma ',' values are like emp_id,emp_name,emp_sal,join_date oracle table bill_temp having the below column: emp_name,emp_sal,join_date
Here I want load the emp_name,emp_sal and join_date into oracle table bill_temp. emp_id should not get loaded into table.
Is there any way to skip the loading of particular column data from data file into table?
I have one .mdb (Microsoft Access Database) file and it has some tables in it. I had load it once using toad. But now i have to load it frequently into the database. Is it possible using external table, so i can access that tables using "select" statement.
I have a text file called ReturnedFile.txt. This is a comma separated text file that contains records for two fields.... Envelope and Date Returned.
At the same time, I have a table in Oracle called Manifest. This table contains the following fields:
Envelope
DateSentOut DateReturned
I need to write something that imports the ReturnedFile.txt into a temporary Oracle table named UploadTemp, and then compares the data in the Envelope field from UploadTemp with the Envelope field in Manifest. If it's a match, then the DateReturned field in Manifest needs updated with the DateReturned field in UploadTemp.
I've done this with SQL Server no problem, but I've been trying for two days to make this work with Oracle and I can't figure it out. I've been trying to use SQL*Loader, but I can't even get it to run properly on my machine.
I did create a Control file, saved as RetFile.ctl. Below is the contents of the CTL file:
LOAD DATA INFILE 'C:OracleTestReturnedFile.txt'
APPEND INTO TABLE UploadTemp FIELDS TERMINATED BY "'" ( ENVELOPE, DATERETURNED )
If I could get SQL*Loader running, below is the code I came up with to import the text file and then to do the compare to the Manifest table and update as appropriate:
Is it possible to import a dump file using impdp data pump utility on oracle 10g where the export dump was taken using traditional exp utility and vice versa.
I am not able to delete one month old archive log file manually on windows which doesn't having info about the standby on v$archived_log view of primary database. the sequence were already applied to the standby database. It shows the status as deleted in v$archived_log. while deleting the file manually. it showing an error like another program or person is using it.
I need to copy .CSV File from a Windows Server shared path (\hostnameoutput) to another server which i believe is on unix.The other server name is abc.hcl.com. On this server i need to put it in the root directory. I will have to use SFTP and not FTP.
the control file code in this path (c:externalctrl.ctl)
load data infile 'C:externalmy_data.txt' into table emp2 fields terminated by ',' (empno, ename, hiredate, etime, ejob, deptno)
this is the error :
C:>sqlldr scott/tiger control=C:externalctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Commit point reached - logical record count 5 C:>
I am trying to generate dynamic control file, as the files I want to upload are coming from different source and their name is constantly changing but following a fix pattern and naming convention.
I am able to generate dynamic control file through SQL. But while calling from BATCH file, i am unable to sent the file name as parameter.
All the examples i have searched are for UNIX, how to do it with BATCH File in WINDOWS.
I am trying to install Oracle 11g R2 on my Windows 7 Ultimate 64 bit. When I execute setup.exe as Administrator the command window flashes and exits. I could not even see what the message is. Also tried command prompt.
i have two tablespaces dictionary managed (SYSTEM,APPLSYSX) i tried to change to locally cause it will cause problem in future when trying to run OATM migration.i did it successfully on APPLSYSX,when i did it on system upon oracle procedure.i have to change all tablespaces to read only when i did that with tablespace APPLSYSD(alter tablespace APPLSYSD read only) i received errors
SQL> alter tablespace APPLSYSD READ ONLY; alter tablespace APPLSYSD READ ONLY * ERROR at line 1: ORA-01230: cannot make read only - file 636 is offline ORA-01111: name for data file 636 is unknown - rename to correct file ORA-01110: data file 636: '/vol5u/oracle/prddb/9.2.0/dbs/MISSING00636' i have not this file on the OS
I downloaded Oracle Fusion Middleware11g Forms and Reports (ofm_frmrpts_win_11.1.2.0.0_64_disk1_1of1). When I begin to extract I am getting bogged down with a password message and that is:
File Windows-amd64 is password protected. please enter the password in the box below.
BTW- I downloaded Windows64 based forms and reports on my windows xp pro machine. I am trying to unzip them and burn it on a DVD so that I can install them on my new dell windows 7 professional laptop.
We are going to upgrade our Oracle client on our clients to 11.2.0.3. But I can not record a resopnsfile with setup.exe. Have Oracle removed this feature?
Here's a dump from setup.exe
There is no possibility to run setup.exe witch -record -destinationfile option:
Preparing to launch Oracle Universal Installer from C:UsersTestAppDataLocal TempOraInstall2013-01-14_02-12-48PM. Please wait ... Usage: setup [-options] [(<CommandLineVariable=Value>)*]
Where options include:
-clusterware oracle.crs,<crs version>
Version of Cluster ready services installed.
-crsLocation <Path>
Used only for cluster installs, specifies the path to the crs home locat ion. Specifying this overrides CRS information obtained from central inventory.
-invPtrLoc <full path of oraInst.loc>
Unix only. To point to a different inventory location. The orainst.loc f ile contains: inventory_loc=<location of central inventory> inst_group=<>
-jreLoc <location>
Path where Java Runtime Environment is installed. OUI cannot be run with out it.
-logLevel <level>
To filter log messages that have a lesser priority level than <level>. V alid options are: severe, warning, info, config, fine, finer, finest, basic, gen eral, detailed, trace. The use of basic, general, detailed, trace is deprecated.
-paramFile <location of file>
Specify location of oraparam.ini file to be used by OUI.
-responseFile <Path>
Specifies the response file and path to use.
-attachHome
For attaching homes to the OUI inventory.
-cfs
Indicates that the Oracle home specified is on cluster file system (shared). This is mandatory when '-local' is specified so that Oracle Universal Installer can register the home appropriately into the inventory.
[code]....
Session/Installer variables are specified using:
[session:]varName=value Ex 1: session:ORACLE_HOME_NAME="OraHome" Ex 2: ORACLE_HOME_NAME="OraHome" The lookup order is session:varName then just varName. The session prefix is used to avoid ambiguity.
Component variables are specified using:
[compInternalName:[Version:]]varName Ex 1: oracle.comp1:1.0.1:varName="VarValue" Ex 2: oracle.comp1:varName="VarValue" The lookup order is compInternalName:Version:varName, then compInternalName: varName, then just varName.