- SQL Developer usually return a limited number of rows, to get all rows go to the last returned row and press Ctrl + End. This will fetch all rows.
- Now Select all your data by highlighting it.
- Right click on your selection and select Export Data and finally choose a file format.
- Give your file a name and location and confirm the export operation.
Showing posts with label schema. Show all posts
Showing posts with label schema. Show all posts
How to export query results from Oracle SQL Developer tool
So you ran a query in Oracle SQL Developer and it returned many rows. You would like to take this data and export it to a excel , CSV, PDF or HTML file for further processing and easier navigation. You can achieve this by following these steps:
Kill connections to an Oracle Schema
You can kill all connections by running the code below. Just Replace SCHEMA with your schema name.
declare str varchar2(100);
begin
for SES in (select sid,serial# from v$session where username='SCHEMA' )
loop
str := 'alter system disconnect session '|| '''' || to_char(SES.sid) ||','||to_char(SES.serial#)||'''' || ' ' || 'immediate';
execute immediate str;
end loop;
end;
To kill a single connection, first find the connection by running:
select * from v$session;
Then run:
alter system kill session 'sid,serial#';
where sid and serial# are extracted from your first query of v$session above.
How to export a schema in Oracle 11g
First make sure your ORACLE_SID, PATH and ORACLE_HOME Env. variables are set. If not set them like below :
export ORACLE_HOME=<your Oracle Home>
export PATH=%ORACLE_HOME%\bin;%PATH%
export ORACLE_SID=<your SID>
Then run the following command from the command line:
expdp system/system_password@sid schemas=Schema_Name dumpfile=Schema_Name.dmp
export ORACLE_HOME=<your Oracle Home>
export PATH=%ORACLE_HOME%\bin;%PATH%
export ORACLE_SID=<your SID>
Then run the following command from the command line:
expdp system/system_password@sid schemas=Schema_Name dumpfile=Schema_Name.dmp
Subscribe to:
Posts (Atom)