Print Oracle queries in file - oracle

I have several application connected to Oracle 11g server. I would like to print all SQL queries executed into the database into text file. Is this possible?

Related

oracle sql expdp -> database pump while users a writing to the databse

I use Oracle 11GR2 on openSuse and we do a Oracle Data Pump with the command expdp of all the schemas.
My Question is: what happens if a user updates the database trough the application while the expdp command runs on the server.
Am I guaranteed to get a consistent state?
No your are not unless you specify: flashback_time or flashback_scn
here is the link to the documentation:
https://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_export.htm#SUTIL850

How to create/drop a database on DB2 through JDBC?

I have some test code using JDBC to connect to MySQL, PostgreSQL, Oracle, and SQL Server, with only some minor differences between databases. I would like to run this test code as well on DB2. To start with a blank slate, and also test our database creation DDL, the tests start by creating a database (e.g. CREATE DATABASE), and end by deleting that database (e.g. DROP DATABASE).
I read a comment from 2012 saying that, at least on DB2 for Linux, one can't run CREATE DATABASE and DROP DATABASE through JDBC, but only from the command line, which would be a bummer for running my integration tests on DB2. Is there really no way of creating, and then dropping a database through JDBC?
JDBC is for only SQL. Create database or Drop database is not SQL, and for this reason that statement cannot be executed from JDBC. You can execute DB2 commands via Runtime class, or using JNI to use the DB2 API
db2 create database command http://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001941.html
sqlecrea API http://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.apdv.api.doc/doc/r0001446.html

How to connect to Oracle DB without OracleService*?

This answer states that we should start OracleService* in order to connect to an Oracle DB.
However, there isn't a OracleService* among the list shown by services.msc.
Is there any other way to connect to an Oracle DB from command line, without using OracleService*?

Bulk export in oracle 8i

How can I export data from Oracle 8i database using command which I can run through oracle cli?
My biggest problem is, the data should be exported based in the query I use...
For ex,
select * from emp where emp_id>4
should dump the records having emp_id>4.
I don't have permission to use functions.
Please help!!
Oracle provides a set of tools that are designed for exporting data (the exp tool, for instance). These don't run via the SQL*PLUS command line (which I assume is what you mean by CLI), although they do connect via NET*8. From Oracle 8i onwards, you can use the query parameter to limit the rows exported:
exp scott/tiger tables=emp query="where deptno=10"
But you have to have the Oracle client installed and be able to connect to the database via SQL*NET.
If all you have is the ability to run queries, you're out of luck unless you can write a query that generates a CSV (tricky if you don't have the ability to call/write functions). It sounds to me like all you have access to is a web interface.

confusing about oracle when accessing data

First i want to explain what i have done with my oracle,
i use oracle XE in my win7x64.
i have 3 file contained 'insert into ..' query ..
file 1.sql is about 3MB in inserted by Oracle SQL Developer
file 2.sql is about 30MB in inserted by Oracle SQL Developer
file 3.sql is about 120MB and cannot be inserted by Oracle SQL Developer so i use SQLPlus (#3.sql)
the problem is,
i only see data 1.sql and 2.sql instead data 3.sql when i open my Oracle SQL Developer.
then i only see data 3.sql instead 1.sql and 2.sql when i login from SQL Plus.
what should i do to see my all data inserterd?
i only connect to this XE in my local laptop ..
Need your suggestion :D
== SOLVED ==
i miss commit on both Oracle SQL Developer and SQL Plus
1. commit in Oracle SQL Developer using F11
2. commit in SQL Plus just happening when you type 'exit' or 'quit'
So you have 3 files containing a bunch of INSERT statements, and imported file1.sql and file2.sql using Oracle SQL Developer and file3.sql using SQL/Plus.
What is the output of SQLPlus after running #file3.sql?
Did you do a commit in SQLPlus after importing the data?
What query did you run in SQL Developer afterwards to check whether file3.sql was imported?

Resources