Oracle apex выгрузка в excel

Обновлено: 04.07.2024

This topic describes how to export and import data between Oracle Database XE 11.2 and XE 18c for Oracle Application Express (APEX) users.

Application Express Installation Guide for more information about Upgrading Oracle Application Express (APEX) within Oracle Database Express Edition

To export the data from your 11.2 XE database, perform the following steps:

Create a directory on the local file system for the DUMP_DIR directory object.

Connect to the 11.2 XE database as user SYS using the SYSDBA privilege.

Create directory object DUMP_DIR and grant READ and WRITE privileges on the directory to the SYSTEM user.

Export data from the 11.2 XE database in the DUMP_DIR directory.

Deinstall Oracle Database XE 11.2 if installation of Oracle Database XE 18c is planned on the same system. See Deinstalling Oracle Database XE for more information

Install Oracle Database XE 18c.

To import data to the 18c XE database, perform the following steps:

Connect to 18c XE database as user SYS using the SYSDBA privilege.

Create directory object DUMP_DIR and grant READ and WRITE privileges on the directory to the SYSTEM user.

Import data to your 18c XE database from the dump folder.

Remapping the directory is necessary when you use different directory file naming conventions. The first argument of the REMAP_DIRECTORY parameter is the location of your 11.2 XE data files (the source) and the second argument is the location of the 18c XE data files (target).

See Oracle Database Utilities for more information about impdp REMAP_DIRECTORY parameter syntax

ORA-39083: Object type TABLESPACE:"SYSAUX" failed to create with error

ORA-31685: Object type USER:"SYS" failed due to insufficient privileges

ORA-39083: Object type PROCACT_SYSTEM failed to create with error

ORA-01917: user or role 'APEX_040000' does not exist

ORA-31684 "already exists" errors

Copy the file apxfix.sql into the top level directory of the APEX source you used to upgrade APEX in your 11.2 XE database. Change your working directory to that source.

Run apxfix.sql passing the schema name that owns the APEX software. For example, if you upgraded 11.2 XE to APEX 5.1.4 prior to exporting the data, provide the schema name APEX_050100 as the argument:

Configure the embedded PL/SQL gateway. Run the apex_epg_config.sql script passing the file system path to the Oracle Application Express (APEX) software. For example, if you unzipped the APEX software in /tmp:

Начальство любит отчеты. Дайте ему их! Дайте много!! Дайте быстро.

Как-то присутствовал на совещании: что делать сначала, формы или отчеты. Программисты справедливо говорят: нет форм - нет данных - не с чего отчеты делать. Представитель заказчика справедливо говорит: нет отчетов - весь ваш софт на. никому не нужен и платить начальство не станет, ему отчеты нужны. Ругались долго.

Обобщение опытного человека: делать надо формы, а сдавать отчеты. Соответственно, для создания отчетов нужна такая технология, чтоб аж заметно не было: раз - и отчет, два - и еще один. А формы, ясно-дело, бюджетировать по-полной.

Как делать отчеты БЫСТРО?

Очень просто. У нас есть база, в базе данные ("как клопы", цитируя известный сериал). Ну позовите базиста - пусть запрос напишет. Пусть вьюхой оформит. С параметром , если надо. С контекстным , если совсем круто. Он справится. А что дальше делать?

Берем Oracle APEX. Создаем в приложении "Отчеты для начальства" страницу. Или берем существующую:

Берем представление/запрос от базиста - он целых 15 минут его сочинял - и иерархический запрос применил, и аналитические функции. Oracle, работал много, однако:

select bd
, nvl(cou, 0) as cou, sum(cou) over (order by bd) as c_cou
, nvl(total_s, 0) as total_s, sum(total_s) over (order by bd) as c_total_s
, nvl(cash_s, 0) as cash_s, sum(cash_s) over (order by bd) as c_cash_s
, nvl(bank_s, 0) as bank_s, sum(bank_s) over (order by bd) as c_bank_s
from
(
select trunc(sale_date) as sd
, count(*) as cou
, sum(sale_summ) as total_s
, sum(decode(is_cash, 1,sale_summ, 0)) as cash_s
, sum(decode(is_cash, 1,0, sale_summ)) as bank_s
from sales_vi where shop_id = :P0_SHOP_ID group by trunc(sale_date)
),
(
select
(select min(trunc(sale_date)) from sales_vi where shop_id = :P0_SHOP_ID) + level - 1 as bd
from dual
connect by (select min(trunc(sale_date)) from sales_vi where shop_id = :P0_SHOP_ID) + level - 1 <= sysdate
)
where sd (+)= bd
order by bd

Читайте также: