Can Oracle 9i enable schema/table creation to be transacted?
If anyone can help with this, that would be much appreciated.
So - the server has disabled autocommit and commits/rollbacks are handled by the application. Even though this is the case, Oracle 9i is not rolling back changes that have (i) created schemas/users and/or (ii) tables.
Worse still, it seems to be performing a partial rollback - some tables in a schema are left with data and others are not.
Now, this may be caused by our server creating tables for indexing while adding data to some existing tables - that is the table definitions have auto-committed the transaction to date, also committing the table insertions/updates.
After some delving, the JDBC driver has the following method: dataDefinitionCausesTransactionCommit - for Pointbase and other databases, this returns false - for Oracle it returns true.
The questions are therefore:
1) Is there a solution with Oracle 9i that enables schema and table creation to be transacted?
2) Does Oracle 10g allow definition clauses to be transacted?
Actually I believe there is a limited way to make DDL statements transaction based via the CREATE SCHEMA command.
From the 9.2 SQL manaul >>
Use the CREATE SCHEMA to create multiple tables and views and perform multiple grants in a single transaction.
To execute a CREATE SCHEMA statement, Oracle executes each included statement. If all statements execute successfully, Oracle commits the transaction. If any statement results in an error, Oracle rolls back all the statements.
<<
This may be of some limited use to you, but your process should probably be changed to track of the DDL and to undo (drop) any created objects if a rollback is issued.
HTH -- Mark D Powel --
Similar Messages
-
Where to find Oracle Apps HR schema table structures?
Hi!
Can someone guide me to the link where I can find the HR schema table structures for Oracle E-Biz suite 11.5.10?
Previously, i used to get them under Top Tech Docs on the metalink.
Thanks and regards,
AparnaHi Aparna,
You can also find in http://irep.oracle.com/index.html
Regards,
Naga Suresh. Challapalli -
If I am creating a BI analytical application from sample Sales Hisotory schema's transactional data, what is the first Step I need to do? Should I create a star schema from the transactional tables? If this is correct, What I tool I need to use to create such tables with data? I believe once this is done I can create dimensions , measures and cubes using OWM11g. Some on please help me. I am very very new to OLAP , But has lots of interest in it
Thanks
GeorgeHi George,
If you are working with 11g - did you install all the latest patches? I strongly recommend applying all available patches when working with 11g. All the information you need is here - http://www.oracle.com/technology/products/bi/olap/collateral/olap_certification.html
As for your question about the criteria for desgining dimension tables, the best advice I can offer is to work with star or snowflake dimensions. You can also see sample schema designs for both at these links
Also, in case you haven't already seen it, there is a good blog posting on working with different kinds of dimensions/hierarchies here - http://oracleolap.blogspot.com/2008/01/olap-workshop-4-managing-different.html
Finally, you might find this [white paper|http://www.oracle.com/technology/products/warehouse/pdf/Benefits%20of%20a%20multi-dimensional%20model.pdf] useful as you say you are new to OLAP
Let me know how you get on
Thanks,
Stuart Bunby
OLAP Blog: http://oracleOLAP.blogspot.com
OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
OLAP on OTN: http://www.oracle.com/technology/products/bi/olap/index.html
DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html -
Can Oracle view refer a table in Sql Server Database
Can a view created in Oracle database refer a table created in SQL Server database. If yes, how do we do it. Code will be very help full.
Again, if yes does it require any special software and what would be price of that software.
Thanks for your response in advance.
Venkat SathiamurthyYou would need to configure Oracle Heterogeneous Connectivity to create a database link to the SQL Server system. This can either be done via the Oracle Transparent Gateway for Microsoft SQL Server, which retails for $15,000 per server at http://store.oracle.com or by configuring Oracle Generic Connectivity and using ODBC to go after the SQL Server data. Depending on the operating system you run Oracle on, there may be a free (or cheap) ODBC driver for SQL Server that could be used.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Error installing Oracle Portal -Enabler conf table
I am trying to install Oracle portal. I am getting the fallowing error:
the enabler conf table
(WWWSEC_ENABLER_CONFG_INFO$)does not have any entries.
thanks
nullIt seems like you should run the ssodatan script.
Check out the FAQ on OTN. It explains how to solve this problem.
Rich -
Dynamic Table Creation & Fill Up
Hello,
Can anyone please guide where I can find examples for dynamic table creation (programmaticaly), with dynamic number of columns and rows, used to place inside text components (or whatever) to fill them with data.
All programmatic.
Using JSF, ADF BC
JDeveloper 10.1.3.1
Thanks
Message was edited by:
RJundiHi,
Meybe this article helps: http://technology.amis.nl/blog/?p=2306
Kuba -
Can one export a schema from a 64 bit Oracle DB into a 32 bit Oracle DB?
Hello:
I need to copy a schema from one DB to another. The source DB runs 64 bit version of Oracle DB but the target DB runs 32 bit version of Oracle DB. Can the schema in 64 bit DB instance be exported and imported into a 32 bit DB instance with exp/imp or expdp/impdp command? Thanks.Hello:
Thanks for your help. Please see part of the error message below. In the new db, I have created the same user with same password and also grant connect and resource privilege to that user. But I don't understand why some table could be recreated without any issue while all those with BLOB column cannot.
Import: Release 11.2.0.2.0 - Production on Wed Nov 9 18:02:07 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Productio
n
Export file created by EXPORT:V10.01.00 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. importing TPC's objects into TPC
. . importing table "OTPC_ACTIVE_WORKITEM" 34 rows imported
IMP-00017: following statement failed with ORACLE error 959:
"CREATE TABLE "OTPC_BLD_ARCHIVE" ("ID" NUMBER(19, 0) NOT NULL ENABLE, "TEST_"
"OUTPUT_FILE" BLOB NOT NULL ENABLE, "VERSION" NUMBER(19, 0) NOT NULL ENABLE,"
" "TEST_SCHEMA_DEFINITION_ID" NUMBER(19, 0) NOT NULL ENABLE, "BUILD_DASHBOAR"
"D_ID" NUMBER(19, 0) NOT NULL ENABLE) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXT"
"RANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DE"
"FAULT) TABLESPACE "TPC" LOGGING NOCOMPRESS LOB ("TEST_OUTPUT_FILE") STORE A"
"S (TABLESPACE "TPC" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE"
" STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))"
IMP-00003: ORACLE error 959 encountered
ORA-00959: tablespace 'TPC' does not exist
IMP-00017: following statement failed with ORACLE error 959:
"CREATE TABLE "OTPC_BLD_CHANGESET" ("ID" NUMBER(19, 0) NOT NULL ENABLE, "COM"
"MIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, "CONTENTS" BLOB, "NAME" VARCHAR2(2"
"56) NOT NULL ENABLE, "OWNER" VARCHAR2(128) NOT NULL ENABLE, "COMMENTS" VARC"
"HAR2(4000), "VERSION" NUMBER(19, 0) NOT NULL ENABLE, "CREATED_BY_ID" NUMBER"
"(19, 0)) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 655"
"36 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TPC" LOGG"
"ING NOCOMPRESS LOB ("CONTENTS") STORE AS (TABLESPACE "TPC" ENABLE STORAGE "
"IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE STORAGE(INITIAL 65536 FREELISTS 1 "
"FREELIST GROUPS 1 BUFFER_POOL DEFAULT))"
IMP-00003: ORACLE error 959 encountered
ORA-00959: tablespace 'TPC' does not exist -
How can I find the schemas used in a database? Any system table contains?
How can I find the schemas used in a database?
Any system table contains?
I would like to know sql statement (dictionary object name) which tells the all schema s in a database like dba_users.Hello,
this SQL should help:
db2 "select schemaname from syscat.schemata" -
Static Tables Creation In oracle & Diff Between Static table ,Dynamic table
Static Tables Creation In oracle & Diff Between Static table ,Dynamic table
972471 wrote:
Static Tables Creation In oracle & Diff Between Static table ,Dynamic tableAll tables in a well designed application should be static tables.
Whilst it's possible to execute dynamic code and therefore create tables dynamically at run time, this is considered poor design and should be avoided in 99.99% of cases... though for some reason some people still think they need to do this, and it's never really justified.
So what issue are you facing that you need to even bother considering dynamic tables? -
Can i use App schema from another Oracle database.
Hi everyone,
can i use application schema from another Oracle database and how can we do this. the reason is that current database where apex is installed is get very slow because of the size of database and application usage.
Regards,
Kashif.user10485983 wrote:
Please update your forum profile with a real handle instead of "user10485983".
can i use application schema from another Oracle database and how can we do this. the reason is that current database where apex is installed is get very slow because of the size of database and application usage.
You can (using database links), but this will generally result in even poorer performance (unless by "another Oracle database" you mean using RAC?)
It sounds more like you either need to upgrade your systems, or refactor your applications to have a smaller performance footprint. -
Create user who can update another schema table
Hi,
We have a prod system under which we need to update the application schema by running different update statement and create/execute function,procedure,package body. This is very easy if you use the owner schema. But i need to run those activities from another user due to some restriction. How can i do that??
May u suggested to give update any table privilege..but this would give all the dictionary table access also.
Is there any privilege that would allow any other user to update another schema table without using the schema name infront of the table name??
Plss suggestJohn,
Can we use public synonym for it ? I don't know the security risk for it though :
SQL> connect hr/hr
Connected.
SQL> select * from scott.emp;
select * from scott.emp
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> connect scott/tiger
Connected.
SQL> create public synonym scotemp for scott.emp;
Synonym created.
SQL> connect hr/hr;
Connected.
SQL> select * from scotemp;
select * from scotemp
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> connect scott/tiger
Connected.
SQL> grant select on emp to hr;
Grant succeeded.
SQL> connect hr/hr
Connected.
SQL> select * from scotemp;
14 rows selected.
SQL> show user;
USER is "hr"
SQL> update scotemp set ename='SMITHX' where empno=7369;
update scotemp set ename='SMITHX' where empno=7369
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> connect scott/tiger
Connected.
SQL> grant update on emp to hr;
Grant succeeded.
SQL> connect hr/hr
Connected.
SQL> update scotemp set ename='SMITHX' where empno=7369;
1 row updated.
SQL> rollback;
Rollback complete.
SQL>
Regards
Girish Sharma -
Oracle table creation/script help
Having a hard time running my script. Essentially I have to create a few table entries into the 3 tables shown in my E/R Diagram and create the "Personnel Emergency Vehicle Shelter" table using the primary keys from the other three tables as a foreign key.
http://img7.imageshack.us/img7/6443/dynamicenies.png
notepad+ doesn't have anything for Oracle only SQL.
drop table emergency_vehicle;
create table emergency_vehicle(
e_veh_ID varchar2(8) primary key,
e_veh_plate varchar2(8),
e_veh_registered_owner varchar2(50),
e_veh_make varchar2(50),
e_veh_model varchar2(50)
insert into emergency_vehicle values
('veh00001','ABA12345','General Hospital','FORD','E-350');
insert into emergency_vehicle values
('veh00002','ANA56844','General Hospital','FORD','E-350');
insert into emergency_vehicle values
('veh00003','TEST8408','City Fire Department','MACK','Model 95');
insert into emergency_vehicle values
('veh00004','EMRGNCEE','City Police Department','Dodge','Charger');
select * from emergency_vehicle;
drop table shelter;
create table shelter(
shelter_ID varchar2(8) primary key,
shelter_location varchar2(100),
shelter_description varchar2(50),
insert into shelter values
('she00001','1660 Main Street','This is the General hospital for the city');
insert into shelter values
('she00002',’100 Wayne Drive’,’Red Cross location #808’);
insert into shelter values
('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’);
select * from shelter;
drop table first_responders;
create table first_responders(
first_responder_ID varchar2(8) primary key,
first_responder_name varchar2(50),
first_responder_function varchar2(50),
insert into first_responders values
('FRP00001',’Jack Smith’,’EMT’);
insert into first_responders values
('FRP00002',’Officer Kimble’,’Police Officer’);
insert into first_responders values
('FRP00003',’John Matthews’,’Firemen’);
select * from first_responder;Using this code
drop table emergency_vehicle;
create table emergency_vehicle(
e_veh_ID varchar2(8) primary key,
e_veh_plate varchar2(8),
e_veh_registered_owner varchar2(50),
e_veh_make varchar2(50),
e_veh_model varchar2(50)
insert into emergency_vehicle values
('veh00001','ABA12345','General Hospital','FORD','E-350');
insert into emergency_vehicle values
('veh00002','ANA56844','General Hospital','FORD','E-350');
insert into emergency_vehicle values
('veh00003','TEST8408','City Fire Department','MACK','Model 95');
insert into emergency_vehicle values
('veh00004','EMRGNCEE','City Police Department','Dodge','Charger');
select * from emergency_vehicle;
drop table shelter;
create table shelter(
shelter_ID varchar2(8) primary key,
shelter_location varchar2(100),
shelter_description varchar2(50)
insert into shelter values('she00001','1660 Main Street','This is the General hospital for the city');
insert into shelter values('she00002',’100 Wayne Drive’,’Red Cross location #808’);
insert into shelter values('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’);
select * from shelter;
drop table first_responders;
create table first_responders(
first_responder_ID varchar2(8) primary key,
first_responder_name varchar2(50),
first_responder_function varchar2(50)
insert into first_responders values('FRP00001',’Jack Smith’,’EMT’);
insert into first_responders values('FRP00002',’Officer Kimble’,’Police Officer’);
insert into first_responders values('FRP00003',’John Matthews’,’Firemen’);
select * from first_responder;
generates these results
Table dropped.
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
E_VEH_ID E_VEH_PLATE E_VEH_REGISTERED_OWNER E_VEH_MAKE E_VEH_MODEL
veh00001 ABA12345 General Hospital FORD E-350
veh00002 ANA56844 General Hospital FORD E-350
veh00003 TEST8408 City Fire Department MACK Model 95
veh00004 EMRGNCEE City Police Department Dodge Charger
Table dropped.
Table created.
1 row created.
insert into shelter values('she00002',’100 Wayne Drive’,’Red Cross location #808’)
ERROR at line 1:
ORA-00911: invalid character
insert into shelter values('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’)
ERROR at line 1:
ORA-00911: invalid character
SHELTER_ID SHELTER_LOCATION SHELTER_DESCRIPTION
she00001 1660 Main Street This is the General hospital for the city
drop table first_responders
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
('FRP00001',’Jack Smith’,’EMT’)
ERROR at line 2:
ORA-00911: invalid character
('FRP00002',’Officer Kimble’,’Police Officer’)
ERROR at line 2:
ORA-00911: invalid character
('FRP00003',’John Matthews’,’Firemen’)
ERROR at line 2:
ORA-00911: invalid character
no rows selected
Now I don't even see anything for the 2nd or 3rd entry on first table, and nothing for 3rd Table
Edited by: 875149 on Jul 26, 2011 2:48 PM -
Can oracle temporary tables be used with distributed transactions?
Hello,
Does anybody know if temporary tables are supported with distributed transactions?
We use a temporary table to store query results and see no problems when the JDBC driver (Type 2 or Type 4) is used with local transactions. The temporary tables are set for transaction-level data persistence (delete rows on commit).
When we switch to JDBC/XA driver we occasionally get ORA-14450 error (java.sql.SQLException: ORA-14450: attempt to access a transactional temp table already in use).
Many thanks...I have been able to use temporary tables on remote databases, so I don't think that it is forbidden. Of course, I'm not using JDBC so that might be a problem.
The other thing that occurs to me is that you are doing something other than DML with the table e.g. trying to drop it. If that is the case you should re-read the documentation and remind yourself of the purpose of temporary tables.
Cheers, APC -
I've recently completed a database upgrade from 10.2.0.3 to 11.2.0.1 using the DBUA.
I've since encountered a slowdown when running a script which drops and recreates a series of ~250 tables. The script normally runs in around 19 seconds. After the upgrade, the script requires ~2 minutes to run.
By chance has anyone encountered something similar?
The problem may be related to the behavior of an "after CREATE on schema" trigger which grants select privileges to a role through the use of a dbms_job call; between 10g and the database that was upgraded from 10G to 11g. Currently researching this angle.
I will be using the following table creation DDL for this abbreviated test case:
create table ALLIANCE (
ALLIANCEID NUMBER(10) not null,
NAME VARCHAR2(40) not null,
CREATION_DATE DATE,
constraint PK_ALLIANCE primary key (ALLIANCEID)
using index
tablespace LIVE_INDEX
tablespace LIVE_DATA;When calling the above DDL, an "after CREATE on schema" trigger is fired which schedules a job to immediately run to grant select privilege to a role for the table which was just created:
create or replace
trigger select_grant
after CREATE on schema
declare
l_str varchar2(255);
l_job number;
begin
if ( ora_dict_obj_type = 'TABLE' ) then
l_str := 'execute immediate "grant select on ' ||
ora_dict_obj_name ||
' to select_role";';
dbms_job.submit( l_job, replace(l_str,'"','''') );
end if;
end;
{code}
Below I've included data on two separate test runs. The first is on the upgraded database and includes optimizer parameters and an abbreviated TKPROF. I've also, included the offending sys generate SQL which is not issued when the same test is run on a 10g environment that has been set up with a similar test case. The 10g test run's TKPROF is also included below.
The version of the database is 11.2.0.1.
These are the parameters relevant to the optimizer for the test run on the upgraded 11g SID:
{code}
SQL> show parameter optimizer
NAME TYPE VALUE
optimizer_capture_sql_plan_baselines boolean FALSE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 11.2.0.1
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
optimizer_use_invisible_indexes boolean FALSE
optimizer_use_pending_statistics boolean FALSE
optimizer_use_sql_plan_baselines boolean TRUE
SQL> show parameter db_file_multi
NAME TYPE VALUE
db_file_multiblock_read_count integer 8
SQL> show parameter db_block_size
NAME TYPE VALUE
db_block_size integer 8192
SQL> show parameter cursor_sharing
NAME TYPE VALUE
cursor_sharing string EXACT
SQL> column sname format a20
SQL> column pname format a20
SQL> column pval2 format a20
SQL> select sname, pname, pval1, pval2 from sys.aux_stats$;
SNAME PNAME PVAL1 PVAL2
SYSSTATS_INFO STATUS COMPLETED
SYSSTATS_INFO DSTART 03-11-2010 16:33
SYSSTATS_INFO DSTOP 03-11-2010 17:03
SYSSTATS_INFO FLAGS 0
SYSSTATS_MAIN CPUSPEEDNW 713.978495
SYSSTATS_MAIN IOSEEKTIM 10
SYSSTATS_MAIN IOTFRSPEED 4096
SYSSTATS_MAIN SREADTIM 1565.746
SYSSTATS_MAIN MREADTIM
SYSSTATS_MAIN CPUSPEED 2310
SYSSTATS_MAIN MBRC
SYSSTATS_MAIN MAXTHR
SYSSTATS_MAIN SLAVETHR
13 rows selected.
{code}
Output from TKPROF on the 11g SID:
{code}
create table ALLIANCE (
ALLIANCEID NUMBER(10) not null,
NAME VARCHAR2(40) not null,
CREATION_DATE DATE,
constraint PK_ALLIANCE primary key (ALLIANCEID)
using index
tablespace LIVE_INDEX
tablespace LIVE_DATA
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 4 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.00 0.00 0 0 4 0
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 324
{code}
... large section omitted ...
Here is the performance hit portion of the TKPROF on the 11g SID:
{code}
SQL ID: fsbqktj5vw6n9
Plan Hash: 1443566277
select next_run_date, obj#, run_job, sch_job
from
(select decode(bitand(a.flags, 16384), 0, a.next_run_date,
a.last_enabled_time) next_run_date, a.obj# obj#,
decode(bitand(a.flags, 16384), 0, 0, 1) run_job, a.sch_job sch_job from
(select p.obj# obj#, p.flags flags, p.next_run_date next_run_date,
p.job_status job_status, p.class_oid class_oid, p.last_enabled_time
last_enabled_time, p.instance_id instance_id, 1 sch_job from
sys.scheduler$_job p where bitand(p.job_status, 3) = 1 and
((bitand(p.flags, 134217728 + 268435456) = 0) or
(bitand(p.job_status, 1024) <> 0)) and bitand(p.flags, 4096) = 0 and
p.instance_id is NULL and (p.class_oid is null or (p.class_oid is
not null and p.class_oid in (select b.obj# from sys.scheduler$_class b
where b.affinity is null))) UNION ALL select
q.obj#, q.flags, q.next_run_date, q.job_status, q.class_oid,
q.last_enabled_time, q.instance_id, 1 from sys.scheduler$_lightweight_job
q where bitand(q.job_status, 3) = 1 and ((bitand(q.flags, 134217728 +
268435456) = 0) or (bitand(q.job_status, 1024) <> 0)) and
bitand(q.flags, 4096) = 0 and q.instance_id is NULL and (q.class_oid
is null or (q.class_oid is not null and q.class_oid in (select
c.obj# from sys.scheduler$_class c where
c.affinity is null))) UNION ALL select j.job, 0,
from_tz(cast(j.next_date as timestamp), to_char(systimestamp,'TZH:TZM')
), 1, NULL, from_tz(cast(j.next_date as timestamp),
to_char(systimestamp,'TZH:TZM')), NULL, 0 from sys.job$ j where
(j.field1 is null or j.field1 = 0) and j.this_date is null) a order by
1) where rownum = 1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.47 0.47 0 9384 0 1
total 3 0.48 0.48 0 9384 0 1
Misses in library cache during parse: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
1 COUNT STOPKEY (cr=9384 pr=0 pw=0 time=0 us)
1 VIEW (cr=9384 pr=0 pw=0 time=0 us cost=5344 size=6615380 card=194570)
1 SORT ORDER BY STOPKEY (cr=9384 pr=0 pw=0 time=0 us cost=5344 size=11479630 card=194570)
194790 VIEW (cr=9384 pr=0 pw=0 time=537269 us cost=2563 size=11479630 card=194570)
194790 UNION-ALL (cr=9384 pr=0 pw=0 time=439235 us)
231 FILTER (cr=68 pr=0 pw=0 time=920 us)
231 TABLE ACCESS FULL SCHEDULER$_JOB (cr=66 pr=0 pw=0 time=690 us cost=19 size=13157 card=223)
1 TABLE ACCESS BY INDEX ROWID SCHEDULER$_CLASS (cr=2 pr=0 pw=0 time=0 us cost=1 size=40 card=1)
1 INDEX UNIQUE SCAN SCHEDULER$_CLASS_PK (cr=1 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 5056)
0 FILTER (cr=3 pr=0 pw=0 time=0 us)
0 TABLE ACCESS FULL SCHEDULER$_LIGHTWEIGHT_JOB (cr=3 pr=0 pw=0 time=0 us cost=2 size=95 card=1)
0 TABLE ACCESS BY INDEX ROWID SCHEDULER$_CLASS (cr=0 pr=0 pw=0 time=0 us cost=1 size=40 card=1)
0 INDEX UNIQUE SCAN SCHEDULER$_CLASS_PK (cr=0 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 5056)
194559 TABLE ACCESS FULL JOB$ (cr=9313 pr=0 pw=0 time=167294 us cost=2542 size=2529254 card=194558)
{code}
and the totals at the end of the TKPROF on the 11g SID:
{code}
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 2 0.00 0.00 0 0 4 0
Fetch 0 0.00 0.00 0 0 0 0
total 3 0.00 0.00 0 0 4 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 70 0.00 0.00 0 0 0 0
Execute 85 0.01 0.01 0 62 208 37
Fetch 49 0.48 0.49 0 9490 0 35
total 204 0.51 0.51 0 9552 208 72
Misses in library cache during parse: 5
Misses in library cache during execute: 3
35 user SQL statements in session.
53 internal SQL statements in session.
88 SQL statements in session.
Trace file: 11gSID_ora_17721.trc
Trace file compatibility: 11.1.0.7
Sort options: default
1 session in tracefile.
35 user SQL statements in trace file.
53 internal SQL statements in trace file.
88 SQL statements in trace file.
51 unique SQL statements in trace file.
1590 lines in trace file.
18 elapsed seconds in trace file.
{code}
The version of the database is 10.2.0.3.0.
These are the parameters relevant to the optimizer for the test run on the 10g SID:
{code}
SQL> show parameter optimizer
NAME TYPE VALUE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 10.2.0.3
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
SQL> show parameter db_file_multi
NAME TYPE VALUE
db_file_multiblock_read_count integer 8
SQL> show parameter db_block_size
NAME TYPE VALUE
db_block_size integer 8192
SQL> show parameter cursor_sharing
NAME TYPE VALUE
cursor_sharing string EXACT
SQL> column sname format a20
SQL> column pname format a20
SQL> column pval2 format a20
SQL> select sname, pname, pval1, pval2 from sys.aux_stats$;
SNAME PNAME PVAL1 PVAL2
SYSSTATS_INFO STATUS COMPLETED
SYSSTATS_INFO DSTART 09-24-2007 11:09
SYSSTATS_INFO DSTOP 09-24-2007 11:09
SYSSTATS_INFO FLAGS 1
SYSSTATS_MAIN CPUSPEEDNW 2110.16949
SYSSTATS_MAIN IOSEEKTIM 10
SYSSTATS_MAIN IOTFRSPEED 4096
SYSSTATS_MAIN SREADTIM
SYSSTATS_MAIN MREADTIM
SYSSTATS_MAIN CPUSPEED
SYSSTATS_MAIN MBRC
SYSSTATS_MAIN MAXTHR
SYSSTATS_MAIN SLAVETHR
13 rows selected.
{code}
Now for the TKPROF of a mirrored test environment running on a 10G SID:
{code}
create table ALLIANCE (
ALLIANCEID NUMBER(10) not null,
NAME VARCHAR2(40) not null,
CREATION_DATE DATE,
constraint PK_ALLIANCE primary key (ALLIANCEID)
using index
tablespace LIVE_INDEX
tablespace LIVE_DATA
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.01 0 2 16 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.01 0.01 0 2 16 0
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 113
{code}
... large section omitted ...
Totals for the TKPROF on the 10g SID:
{code}
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 1 0.00 0.02 0 0 0 0
Execute 1 0.00 0.00 0 2 16 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.00 0.02 0 2 16 0
Misses in library cache during parse: 1
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 65 0.01 0.01 0 1 32 0
Execute 84 0.04 0.09 20 90 272 35
Fetch 88 0.00 0.10 30 281 0 64
total 237 0.07 0.21 50 372 304 99
Misses in library cache during parse: 38
Misses in library cache during execute: 32
10 user SQL statements in session.
76 internal SQL statements in session.
86 SQL statements in session.
Trace file: 10gSID_ora_32003.trc
Trace file compatibility: 10.01.00
Sort options: default
1 session in tracefile.
10 user SQL statements in trace file.
76 internal SQL statements in trace file.
86 SQL statements in trace file.
43 unique SQL statements in trace file.
949 lines in trace file.
0 elapsed seconds in trace file.
{code}
Edited by: user8598842 on Mar 11, 2010 5:08 PMSo while this certainly isn't the most elegant of solutions, and most assuredly isn't in the realm of supported by Oracle...
I've used the DBMS_IJOB.DROP_USER_JOBS('username'); package to remove the 194558 orphaned job entries from the job$ table. Don't ask, I've no clue how they all got there; but I've prepared some evil looks to unleash upon certain developers tomorrow morning.
Not being able to reorganize the JOB$ table to free the now wasted ~67MB of space I've opted to create a new index on the JOB$ table to sidestep the full table scan.
CREATE INDEX SYS.JOB_F1_THIS_NEXT ON SYS.JOB$ (FIELD1, THIS_DATE, NEXT_DATE) TABLESPACE SYSTEM;The next option would be to try to find a way to grant the select privilege to the role without using the aforementioned "after CREATE on schema" trigger and dbms_job call. This method was adopted to cover situations in which a developer manually added a table directly to the database rather than using the provided scripts to recreate their test environment.
I assume that the following quote from the 11gR2 documentation is mistaken, and there is no such beast as "create or replace table" in 11g:
http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_9003.htm#i2061306
"Dropping a table invalidates dependent objects and removes object privileges on the table. If you want to re-create the table, then you must regrant object privileges on the table, re-create the indexes, integrity constraints, and triggers for the table, and respecify its storage parameters. Truncating and replacing have none of these effects. Therefore, removing rows with the TRUNCATE statement or replacing the table with a *CREATE OR REPLACE TABLE* statement can be more efficient than dropping and re-creating a table." -
Oracle 11g R2, CREATE TABLE and QUOTAS
Hello everyone,
I need some insight about a strange behavior I found out in Oracle 11gR2. Don't know if I do miss something or if I just found out a security issue with Oracle.
Oracle Version : 11.2.0.1.0
The problem is related with the CREATE TABLE privilege and the QUOTA on specific tablespace.
Please, try this on your systems (if you have some spare time and care to confirm the "bug").
Create a user, grant only two privileges, CREATE SESSION and CREATE TABLE.
Grant NO quota on any tablespace.
Try to create table on any tablespace (except SYSTEM) and tell everyone if it worked or not.
The oracle documentation states the following :
To create a relational table in your own schema, you must have the CREATE TABLE system privilege. To create a table in another user's schema, you must have the CREATE ANY TABLE system privilege. Also, the owner of the schema to contain the table must have either space quota on the tablespace to contain the table or the UNLIMITED TABLESPACE system privilege.
[http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_7002.htm#SQLRF01402]
The fact is, so far, on two different instances of Oracle 11gR2, my users are not limited in creating tables only where they have quotas but wherever they want except SYSTEM.
The correct behavior would be to deny the table creation on tablespace where there is no quota but it does not.
My instance of Oracle 10g are behaving correctly and thus the table creation is denied on tablespace with no quota.
P.S1 Sorry if this a well known "bug/problem/issue". I've been ridicule on a well known forum for asking the same question. I am in no need to be "spoon filled" as stated on that famous website! I have read the documentation! I have googled a lot!
P.S2 Even though the table creation work on tablespace with no quota, you still can't insert data in it. So, big picture, the user can't filled the tablespace with irrelevant data but he can creates thousand of tables...!
Do I miss something?
Is there any "default" option I have to flag to prevent table creation where it should not?
?(?)Hi. I'm planning on taking my OCP exam. If the exam ask a question realted to this topic, what is the correct answer?
create user barry identified barry
grant create session, create table to barry
1) barry cannot create a table since he has no quota
2) barry can create a table
According to the oracle document, the barry needs quota on the tablespace to create a table. however, according to the link you provided, in 11gR2, barry does not need quota to create a table. He only needs a quota to insert data.
Maybe you are looking for
-
Gmail smtp (outgoing) mail not working with apple mail 5
Hi, I have a numbe of gmail accounts, I can receive mail through the new apple mail 5 client but can't send any at all. I've tried everything gmail help suggests but to no avail... Cheers, Alex
-
GRC 10 BRM Workflow configuration issue
Hello all, Can you suggest me, how can i set a proper workflow for BRM, without using BRF+, so that I can create a role, which should go the the approver stage for approval. I used MSMP Default workflow but did not use the "BRF". Now i have stuck at
-
Xfi-Xtreme Music Problems after updating dri
I recently updated my xtreme music sound card drivers from this website and since my music quality has not been the same. With my headphones off music seems sound poor and while watching movies the sound fades out to the point i cant even hear it. Th
-
My ipod wont charge or turn on
My battery died and when i tried to charge with the wall charger, car charger and through the computer and nothing. Inly a month old!
-
Name of database connected to this application server
dears , i have Oracle Application Server 10g (10.1.2.0.2) i want to get database UNIQUE_name that is connect to this application server !!! i run this command SELECT sys_context('USERENV', 'DB_UNIQUE_NAME') FROM dual; it gave me name of application s