I get 0 rows in the results I use
SELECT * from V$RECOVERY_FILE_DEST
V$RECOVERY_FILE_DEST is a default table name for the oracle Flash recovery area.
Does this mean that a Backup never happens on this platform or Flash recovery area name is different from the default? If yes, then how can I locate the Flash Recovery area on Oracle Database if yes?
V$RECOVERY_FILE_DEST shows target OS or ASM directories, as specified in the db_recovery_area_dir initialization parameter, which are designated to contain flash recovery area files. If there is nothing visible in the table, confirm the setting of the initialization parameter. If both are null/empty, then there is no Flash Recovery Area defined for the database.
select * from v$recovery_file_dest;
NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES CON_ID
----- ----------- ---------- ----------------- --------------- ----------
+RECO 1.3980E+10 8989442048 0 5 0
show parameter db_recovery
NAME TYPE VALUE
-------------------------- ----------- ------
db_recovery_file_dest string +RECO
db_recovery_file_dest_size big integer 13332M
Related
I selected every details customers tables in the Order Entry Schema but my data isn't ordered. How do i make the table presentable making every column and row clear to read and understand
I used the query select * from oe.customers and below is how my data was retrieved and makes it quite difficult to read.
CUSTOMER_ID CUST_FIRST_NAME CUST_LAST_NAME
----------- -------------------- --------------------
CUST_ADDRESS(STREET_ADDRESS, POSTAL_CODE, CITY, STATE_PROVINCE, COUNTRY_ID)
--------------------------------------------------------------------------------
PHONE_NUMBERS
--------------------------------------------------------------------------------
NLS NLS_TERRITORY CREDIT_LIMIT
--- ------------------------------ ------------
CUST_EMAIL ACCOUNT_MGR_ID
---------------------------------------- --------------
CUST_GEO_LOCATION(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_OR
--------------------------------------------------------------------------------
DATE_OF_B MARITAL_STATUS G INCOME_LEVEL
--------- -------------------- - --------------------
25-MAY-44 single F A: Below 30,000
CUSTOMER_ID CUST_FIRST_NAME CUST_LAST_NAME
----------- -------------------- --------------------
CUST_ADDRESS(STREET_ADDRESS, POSTAL_CODE, CITY, STATE_PROVINCE, COUNTRY_ID)
--------------------------------------------------------------------------------
PHONE_NUMBERS
--------------------------------------------------------------------------------
NLS NLS_TERRITORY CREDIT_LIMIT
--- ------------------------------ ------------
CUST_EMAIL ACCOUNT_MGR_ID
---------------------------------------- --------------
CUST_GEO_LOCATION(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_OR
--------------------------------------------------------------------------------
DATE_OF_B MARITAL_STATUS G INCOME_LEVEL
--------- -------------------- - --------------------
Image showing the problem
First off, if you're just running ad hoc queries, you probably don't want to be using SQL*Plus. You're almost certainly better off downloading SQL Developer which is an actual GUI that presents query output in a nice, GUI fashion.
SQL*Plus was designed back in a time when reporting generally meant generating fixed width output that would get spooled to a physical printer every morning and generate hundreds of pages of output on green bar paper that would get distributed to various humans in the company to review. So you need to think like an old school report developer.
First, you need to figure out how wide your output window is and set your linesize appropriately. If your output window is, say, 120 characters wide, you'd start with
set linesize 120
Now, you have to figure out how much space out of those 120 character that you want to give each column of your output knowing that larger string values will wrap within the column. So if you want to allow 15 characters for the customer first and last name
column cust_first_name format a15;
column cust_last_name format a15;
You'd need to do that for each column you're outputting. Realistically, it probably doesn't make sense to select a geographic location from SQL*Plus, you'd want to select components of that composite object.
Here is my code, pretty straight forward, but it wont work. Thank you all!
begin
-- to set the max dump file size for a given session
sys.dbms_system.set_int_param_in_session(
217,
36575,
'MAX_DUMP_FILE_SIZE',
1073741824
);
end;
It generates:
ORA-44737: Parameter MAX_DUMP_FILE_SIZE did not exist.
ORA-06512: at "SYS.DBMS_SYSTEM", line 122
ORA-06512: at line 3
It appears that 18c is just reporting an error that 11g used to silently ignore; namely that the parameter name doesn't exist, or at least isn't the right type for the procedure. In 11g this didn't error, but also didn't do anything. As a normal user:
select name, type, display_value
from v$parameter
where name in ('max_dump_file_size', 'sort_area_size');
NAME TYPE DISPLAY_VALUE
------------------------------ ---------- ------------------------------
sort_area_size 3 65536
max_dump_file_size 2 unlimited
As SYS after identifying that session:
begin
sys.dbms_system.set_int_param_in_session(
209,
34295,
'MAX_DUMP_FILE_SIZE',
123456
);
sys.dbms_system.set_int_param_in_session(
209,
34295,
'SORT_AREA_SIZE',
123456
);
end;
/
PL/SQL procedure successfully completed.
In the original user's session:
select name, type, display_value
from v$parameter
where name in ('max_dump_file_size', 'sort_area_size');
NAME TYPE DISPLAY_VALUE
------------------------------ ---------- ------------------------------
sort_area_size 3 123456
max_dump_file_size 2 unlimited
The sort_area_size change has taken effect. The max_dump_file_size has not - but it didn't report that, or complain. In fact you can pass anything you like as the parameter name and it will still silently ignore it.
In 18c it is no longer silent, so you see the ORA-44737 error.
The reason it complains, it seems, comes down to the name of the procedure - set_int_param_in_session - and the parameter type. It works for sort_area_size because that is an integer parameter; but max_dump_file_size is a string parameter. It might be more helpful if the error said "Parameter MAX_DUMP_FILE_SIZE did not exist or was the wrong type", but you can't have everything.
You happen to be trying to pass it an integer value, but you might not be - and there's no way to pass 'UNLIMITED' as a number argument. In this case it could, perhaps, have been written allow the numeric values anyway - but then you would have no way to reset it, which would be problematic.
Unfortunately there isn't an equivalent set_str_param_in_session procedure, and as it's an undocumented and unsupported package it's unlikely you'd get very far asking Oracle to add one.
I don't think there's any way to do what you're attempting from another session.
I'm not aware of any way to apply this via a profile or resource manager either. With some advance planning you could potentially have a way to tell Apex (e.g. via a parameter somewhere) to set this itself, but that sounds like a lot of work. It might be simpler to use a logon trigger to always set this (for some users, or in a role, perhaps) via an alter session call, so you don't have to think about it when starting a trace.
We currently run an ArcGIS Server over an Oracle 12c database. The GIS software handles the database itself, but we would like to do measurements on some values its tables contains.
Me, I would like to list the length of some lines contained in the geometry field (shape) of a table, but I don't succeed.
select * from TRONCON;
-- ok. Runs fine.
SELECT c.cur, SDO_GEOM.SDO_LENGTH(c.shape, m.diminfo)
FROM TRONCON c, user_sdo_geom_metadata m
WHERE m.table_name = 'TRONCON' AND m.column_name = 'SHAPE';
-- Fails with this error message :
-- ORA-06553: PLS-306: wrong number or types of arguments in call to 'SDO_LENGTH'
-- 06553. 00000 - "PLS-%s: %s"
-- *Cause:
-- *Action:
select * from user_sdo_geom_metadata;
-- Appears empty.
select * from all_sdo_geom_metadata;
-- Appears empty.
Because we aren't the ones who are filling the database with data (this is the responsability of the GIS software to manage data and perform structural changes in the schema, if needed) we don't know why the user_sdo_geom_metadata and the all_sdo_geom_metadata tables are empty, and how to regenerate them if it can be done. Because this case is unexpected.
A colleague wants to measure an area, and encounters the same kind of problems with an attempt of replacing the missing dimension by a tolerance :
SELECT sdo_geom.sdo_area(SHAPE, 0.005, 'unit=hectare') FROM ZONE_INTERET;
-- ORA-06553: PLS-306: wrong number or types of arguments in call to 'SDO_AREA'
-- 06553. 00000 - "PLS-%s: %s"
How can we make these functions working ?
The fact that the USER_SDO_GEOM_METADATA table is not filled is surprising. ArcGIS is fairly well integrated with Oracle Spatial and does a good job of maintaining that information. Whenever you define a new feature class (using ArcCatalog), you should see a new row in that table. If it is missing, then you are unable to define any spatial index on the data, which would make all queries (including viewing) very slow.
What may be happening is that you are connecting as a different user than the ArcGIS applications ? USER_SDO_GEOM_METADATA (like USER_TABLES) is for the currently connected user. ALL_SDO_GEOM_METADATA (just like ALL_TABLES) is for all the tables accessible by the current user (in other schemas).
Then again you do not need the info in that table when invoking spatial functions: you can just manually pass a tolerance value. In more recent versions (18.1 and later), the tolerance is actually optional: we pick a default value.
Here are some examples:
SQL> SELECT sdo_geom.sdo_area(geom, 0.005, 'unit=hectare') FROM us_counties where id=1;
SDO_GEOM.SDO_AREA(GEOM,0.005,'UNIT=HECTARE')
--------------------------------------------
156486.874
1 row selected.
SQL> SELECT sdo_geom.sdo_length(geom, 0.005, 'unit=km') FROM us_interstates where id=1;
SDO_GEOM.SDO_LENGTH(GEOM,0.005,'UNIT=KM')
-----------------------------------------
3956.18879
1 row selected.
The syntax error you get (ORA-06553) is very odd. Try describing the package:
describe sdo_geom
This produces a large output. But in there you should see the two signatures for SDO_LENGTH:
FUNCTION SDO_LENGTH RETURNS NUMBER
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
GEOM SDO_GEOMETRY IN
DIM SDO_DIM_ARRAY IN
UNIT VARCHAR2 IN DEFAULT
COUNT_SHARED_EDGES NUMBER IN DEFAULT
FUNCTION SDO_LENGTH RETURNS NUMBER
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
GEOM SDO_GEOMETRY IN
TOL NUMBER IN DEFAULT
UNIT VARCHAR2 IN DEFAULT
COUNT_SHARED_EDGES NUMBER IN DEFAULT
Is this what you see ?
I am using Sql Developer to access a oracle database. Recently I created a View with the option NOFORCE CREATE OR REPLACE NOFORCE VIEW XXXX (...)
Afterwards I looked into the definition of the newly created view and I got a statement looking like CREATE OR REPLACE FORCE VIEW "name"."XXXX"
Now I am not quite sure, if this is a wrong display setting for the Sql Developer or if the view is created with the force.
This just appears to be how Oracle handles views once they've been created, as you can see from the following example:
create or replace noforce view dummy_vw as select dummy from dual;
select * from user_views where view_name = 'DUMMY_VW';
VIEW_NAME TEXT_LENGTH TEXT TYPE_TEXT_LENGTH TYPE_TEXT OID_TEXT_LENGTH OID_TEXT VIEW_TYPE_OWNER VIEW_TYPE SUPERVIEW_NAME EDITIONING_VIEW READ_ONLY
--------- ----------- ---------------------- ---------------- --------- --------------- -------- --------------- --------- ------------------------------ --------------- ---------
DUMMY_VW 22 select dummy from dual N N
select DBMS_METADATA.GET_DDL('VIEW','DUMMY_VW') from DUAL;
CREATE OR REPLACE FORCE VIEW "SCHEMA"."DUMMY_VW" ("DUMMY") AS
select dummy from dual;
Since force/noforce only affects the view at the point when it's created, it doesn't really matter if the script is returned with or without the FORCE keyword, so I guess they just defaulted it to show with the FORCE keyword, since the view exists (if the view script had errors and NOFORCE was used, the view wouldn't have been created).
While running a long running report in Oracle Application Server 10g, the status of the report is exist in OAS admin console something like "25 of 3225 Pages completed".
How can I got this value from the OAS to be able to display it to the user in oracle forms.
Not certain but it's possible it might be stored in v$session_longops. See here for examples.
Some oracle code writes into V$session_longops but you can also encode into your own applications using some provided PLSQL functions.
If OAS or the report itself is writing something into here, you can get that information from an oracle form to display to the user when the report is run.
While the above code is running, the contents of the v$session_longops view can be queried as follows.
COLUMN opname FORMAT A20
COLUMN target_desc FORMAT A20
COLUMN units FORMAT A10
SELECT
opname,
target_desc,
sofar,
totalwork,
time_remaining,
units
FROM
v$session_longops
The type of output expected from this v$session_longops query is listed below.
OPNAME TARGET_DESC SOFAR TOTALWORK UNITS
-------------------- -------------------- ---------- ---------- ----
BATCH_LOAD BATCH_LOAD_TABLE 3 10 rows