Owner of table
I am trying to get the owner of a created table test but it shows no rows selected, as my table is having 8 rows already. please see below and assist me where I am wrong.
SQL> select * from test;
FLAT_MEMBERS_ID FIRST_NAME LAST_NAME AGE
1 Himanshu Gupta 24
2 Tarun Goyal 26
3 Vipul Jain 27
4 Sourabh Singh 26
5 Vidya Pandey 24
6 Ankit Bhardwaj 25
7 Shahnawaz Ahmed 26
8 Yogesh singh 24
8 rows selected.
SQL> select owner, table_name, tablespace_name from dba_tables where table_name='test';
no rows selected
Unless you are using case-sensitive identifiers, object names are stored in upper case in the data dictionary.
select owner, table_name, tablespace_name
from dba_tables
where table_name='TEST';Justin
Similar Messages
-
View Owner and table name of public synonym
A schema user has created a public synonym of a table to another user, say U1.
How could U1 view all the details of the public synonyms, such as a list of all the public synonyms, and the corresponding owner and table names?select synonym_name
, table_owner
, table_name
from all_synonyms
where owner = 'PUBLIC'
order by 2, 3
/Be warned that this is likely to be a very long list, so you might want to also filter on
and table_owner not ('SYS', 'SYSTEM')or similar.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
Parse Tablename/Table Owner
I would like to validate a user's input (via a C Shell) for an Oracle Table name. Can anyone assist me with the SQL statement(s) needed to parse the table owner and table name?
nullI didn't understand a little bit what You mean by parse, but there is a view all_tables and columns owner and table_name.
So
SELECT owner, table_name
FROM all_tables;
will give You all tables with their respective owners
Of course there are also views, synonyms for views and tables and maybe something other ... -
Query all tables of specific owner
Hi all,
I would like to know wether a value appears in my database or not.
In other words, I have to query all tables of an owner.
Table by table is no option, because that owner contains about 25,000 tables.
Anyone with a script??
thanks in advancescott@ORA92> CREATE OR REPLACE PROCEDURE find_value
2 (p_value IN VARCHAR2,
3 p_data_type IN VARCHAR2,
4 p_owner IN VARCHAR2 DEFAULT USER)
5 AS
6 v_exists NUMBER;
7 BEGIN
8 FOR rec IN
9 (SELECT owner, table_name, column_name
10 FROM all_tab_columns
11 WHERE data_type = p_data_type
12 AND owner = p_owner)
13 LOOP
14 BEGIN
15 EXECUTE IMMEDIATE
16 'SELECT 1 FROM DUAL WHERE EXISTS (SELECT 1 FROM "'
17 || rec.owner || '"."' || rec.table_name
18 || '" WHERE ' || rec.column_name || '=:p_value)'
19 INTO v_exists USING p_value;
20 DBMS_OUTPUT.PUT_LINE (rec.table_name || '.' || rec.column_name);
21 EXCEPTION
22 WHEN NO_DATA_FOUND THEN NULL;
23 END;
24 END LOOP;
25 END find_value;
26 /
Procedure created.
scott@ORA92> SHOW ERRORS
No errors.
scott@ORA92> SET SERVEROUTPUT ON
scott@ORA92> EXECUTE find_value (10, 'NUMBER', 'SCOTT')
DEPARTMENTS.DEPARTMENT_ID
DEPT.DEPTNO
EMP.DEPTNO
EMPLOYEES.DEPARTMENT_ID
STATS.VALUE
PL/SQL procedure successfully completed.
scott@ORA92> EXECUTE find_value ('CLERK', 'VARCHAR2', 'SCOTT')
EMP.JOB
PL/SQL procedure successfully completed.
scott@ORA92> EXECUTE find_value (TO_DATE ('12-JAN-1983', 'DD-MON-YYYY'), 'DATE', 'SCOTT')
EMP.HIREDATE
PL/SQL procedure successfully completed.
scott@ORA92> DROP PROCEDURE find_value
2 /
Procedure dropped.
scott@ORA92> spool off -
Table and Materialized View in different namespaces?
I've just faced something completly new for me. It appears that there are two objects with the same name and owner. Table and Materialized View have the same names and when I look into system dictionary I can se sth. like that:
OWNER OBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE NAMESPACE
USER_A USER_TABLE 159381 159381 TABLE 1
USER_A USER_TABLE 159382 MATERIALIZED VIEW 19
(I couldn't find how to write above with const length font).
Two object in different namespace? I thought that Tables and Materialized Vievs have the same namespace.
Can you please tell me how can I create objects to achieve above result? I would also be grateful if you tell me where to find that topic in documentation.Perfectly normal.
SQL> select object_name, object_type from user_objects where object_name = 'TEST_MV';
no rows selected
SQL>
SQL> create materialized view test_mv
2 as
3 select sysdate from dual;
Materialized view created.
SQL>
SQL> select object_name, object_type from user_objects where object_name = 'TEST_MV';
OBJECT_NAME OBJECT_TYPE
TEST_MV TABLE
TEST_MV MATERIALIZED VIEW
SQL>
SQL> drop materialized view test_mv;
Materialized view dropped.
SQL>
SQL> select object_name, object_type from user_objects where object_name = 'TEST_MV';
no rows selected
SQL> -
Creating a foreign key constraint on a synonym of table in another schema.
Hi,
I am having two user operapps and oper
owner of table po_vendors is operapps ,i have created a synonym in oper with select permission.
now i am trying to create a foreign key.
ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID));
the bolded po_vendors is the synonym for the table po_vendors in operapps.
i am getting the below error message.
SQL> ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID));
ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID))
ERROR at line 1:
ORA-01031: insufficient privileges.
i have given dba privileges to oper user.
Please advice.1) You cannot create a constraint on a synonym. You have to specify a physical table (i.e. OPERAPPS.PO_VENDORS)
2) The owner of the OPS_BR_VENDORS table will need to have the REFERENCES permission on the PO_VENDORS table granted directly (not via a role).
Justin -
Text Index works fine consistently with Table, but not on underlying View
Hi,
We are facing weird issue relating to Oracle Text Indexes. Search using Oracle Text Index
works fine on a Table, but when running query on View it gives sometimes (not consistently)
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
DRG-10599: column is not indexed
Sometimes it works.
All of the below steps are run using User IR2OWNER:
STEP 1: Table CPF_CUSTOMER created as follows (3 Non Text Indexes defined at time of creation )
**Please note no Public Synonym is created for this Table**
** There is already another Table by same name CPF_CUSTOMER under different Owner (CDROWNER)
and that Table has Public Synonym CPF_CUSTOMER created. Other Table CPF_CUSTOMER does not
have any Views **
create table CPF_CUSTOMER
CPF_CUSTOMER_UUID NUMBER(20) not null,
SAP_ID VARCHAR2(10 CHAR) not null,
IRIS2_ID VARCHAR2(7 CHAR),
NAME VARCHAR2(70 CHAR) not null,
DRAFT_IND NUMBER(1) not null,
ACTIVE_IND NUMBER(1) not null,
REPLACED_BY_CUST VARCHAR2(10 CHAR),
CRE_DT_GMT DATE,
CRE_DT_LOC DATE,
TIME_ZONE VARCHAR2(3 CHAR),
CRE_USR VARCHAR2(8 CHAR),
CHG_DT_GMT DATE,
CHG_DT_LOC DATE,
CHG_TIME_ZONE VARCHAR2(3 CHAR),
CHG_USR VARCHAR2(8 CHAR),
VFY_DT_GMT DATE,
VFY_DT_LOC DATE,
VFY_USR VARCHAR2(8 CHAR),
DIVISION VARCHAR2(20 CHAR),
SALES_ADMIN VARCHAR2(3 CHAR),
MF_CUST_CDE VARCHAR2(14 CHAR),
CR_CTRL_OFCE VARCHAR2(3 CHAR),
DEFAULT_INV_CCY VARCHAR2(3 CHAR),
AUTOBILL_OVRRD_IND NUMBER(1) not null,
AUTOBILL NUMBER(1) not null,
AUTOPRT_OVRRD_IND NUMBER(1) not null,
AUTOPRT NUMBER(1) not null,
AVE_PYMT_DAY NUMBER(3),
TTL_INV_VAL NUMBER(12,2),
INHERIT_CR_TERM_ASSGMT NUMBER(1) not null,
NORMALIZED_NME VARCHAR2(70 CHAR),
OB_PYMT_OFCE VARCHAR2(3 CHAR),
IB_PYMT_OFCE VARCHAR2(3 CHAR),
CGO_SMART_ID VARCHAR2(20 CHAR),
REC_UPD_DT TIMESTAMP(6),
NCPF_CUST_ID VARCHAR2(7) not null,
CPF_CUST_LEVEL_UUID NUMBER(20) not null
tablespace DBCPFP1_LG_DATA LOGGING;
CREATE UNIQUE INDEX CPF_CUSTOMERI1 ON CPF_CUSTOMER
(SAP_ID ASC) TABLESPACE DBCPFP1_LG_INDX;
ALTER TABLE CPF_CUSTOMER
ADD CONSTRAINT CPF_CUSTOMERI1 UNIQUE (SAP_ID);
CREATE UNIQUE INDEX CPF_CUSTOMERI2 ON CPF_CUSTOMER
(CPF_CUSTOMER_UUID ASC) TABLESPACE DBCPFP1_LG_INDX;
ALTER TABLE CPF_CUSTOMER
ADD CONSTRAINT CPF_CUSTOMERI2 UNIQUE (CPF_CUSTOMER_UUID);
CREATE INDEX CPF_CUSTOMER_IDX2 ON CPF_CUSTOMER (UPPER(NAME))
TABLESPACE DBCPFP1_LG_INDX;
STEP 2: Create View CPF_CUSTOMER_RVW on above Table (and Public Synonym on View)
This View is created under same OWNER as Table created in STEP 1 (IR2OWNER)
create or replace view cpf_customer_rvw as
select
CPF_CUSTOMER_UUID,
SAP_ID,
IRIS2_ID,
NAME,
DRAFT_IND,
ACTIVE_IND,
REPLACED_BY_CUST,
CRE_DT_GMT,
CRE_DT_LOC,
TIME_ZONE,
CRE_USR,
CHG_DT_GMT,
CHG_DT_LOC,
CHG_TIME_ZONE,
CHG_USR,
VFY_DT_GMT,
VFY_DT_LOC,
VFY_USR,
DIVISION,
SALES_ADMIN,
MF_CUST_CDE,
CR_CTRL_OFCE,
DEFAULT_INV_CCY,
AUTOBILL_OVRRD_IND,
AUTOBILL,
AUTOPRT_OVRRD_IND,
AUTOPRT,
AVE_PYMT_DAY,
TTL_INV_VAL,
INHERIT_CR_TERM_ASSGMT,
NORMALIZED_NME,
OB_PYMT_OFCE,
IB_PYMT_OFCE,
CGO_SMART_ID,
NCPF_CUST_ID,
CPF_CUST_LEVEL_UUID,
REC_UPD_DT
from CPF_CUSTOMER;
CREATE OR REPLACE PUBLIC SYNONYM CPF_CUSTOMER_RVW FOR CPF_CUSTOMER_RVW;
STEP 3: Insert Test row
insert into cpf_customer (CPF_CUSTOMER_UUID, SAP_ID, IRIS2_ID, NAME, DRAFT_IND, ACTIVE_IND, REPLACED_BY_CUST, CRE_DT_GMT, CRE_DT_LOC, TIME_ZONE, CRE_USR, CHG_DT_GMT, CHG_DT_LOC, CHG_TIME_ZONE, CHG_USR, VFY_DT_GMT, VFY_DT_LOC, VFY_USR, DIVISION, SALES_ADMIN, MF_CUST_CDE, CR_CTRL_OFCE, DEFAULT_INV_CCY, AUTOBILL_OVRRD_IND, AUTOBILL, AUTOPRT_OVRRD_IND, AUTOPRT, AVE_PYMT_DAY, TTL_INV_VAL, INHERIT_CR_TERM_ASSGMT, NORMALIZED_NME, OB_PYMT_OFCE, IB_PYMT_OFCE, CGO_SMART_ID, NCPF_CUST_ID, CPF_CUST_LEVEL_UUID, REC_UPD_DT)
values (2.26283572796028E15, '6588125000', '6588125', 'S M Mooseen And Sons(PVT) Limited', 0, 1, '', to_date('15-03-2005 08:55:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('15-03-2005 14:25:00', 'dd-mm-yyyy hh24:mi:ss'), 'IST', 'licr2', to_date('19-02-2007 00:33:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('19-02-2007 06:03:00', 'dd-mm-yyyy hh24:mi:ss'), 'IST', 'BaseAdmi', to_date('15-03-2005 09:03:00', 'dd-mm-yyyy hh24:mi:ss'), to_date('15-03-2005 14:33:00', 'dd-mm-yyyy hh24:mi:ss'), 'ninwasa', '', '', 'SRI06588125000', '463', '', 0, 0, 0, 0, null, null, 0, 'SMMOOSEENANDSONSPVTLIMITED', '', '', '', '6588125', 109966195050333, '14-JAN-09 02.49.28.325774 PM');
commit;
STEP 4: Create Oracle Text Index on Table CPF_CUSTOMER
EXEC CTX_DDL.DROP_PREFERENCE('CTXCAT_IR2_STORAGE');
EXEC CTX_DDL.CREATE_PREFERENCE('CTXCAT_IR2_STORAGE', 'BASIC_STORAGE');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'K_TABLE_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'R_TABLE_CLAUSE', 'TABLESPACE COMMON_SM_INDX COMPRESS 2');
EXEC CTX_DDL.SET_ATTRIBUTE('CTXCAT_IR2_STORAGE', 'I_ROWID_INDEX_CLAUSE', 'TABLESPACE COMMON_SM_INDX storage (INITIAL 5M)');
-- Define IR2_AB_LEXER to handle Special Characters.
EXEC ctx_ddl.drop_preference('IR2_AB_LEXER');
EXEC ctx_ddl.create_preference('IR2_AB_LEXER', 'BASIC_LEXER');
EXEC ctx_ddl.set_attribute ('IR2_AB_LEXER', 'printjoins', ',_!$~%?=({;|&+-:/)}.@`^');
--Drop Indexes
drop index CPF_CUSTOMER_DIDX1;
-- CATSEARCH INDEX on CPF_CUSTOMER.NAME
CREATE INDEX CPF_CUSTOMER_DIDX1 ON CPF_CUSTOMER(NAME) INDEXTYPE IS CTXSYS.CTXCAT PARAMETERS ('STORAGE CTXCAT_IR2_STORAGE STOPLIST CTXSYS.EMPTY_STOPLIST LEXER IR2_AB_LEXER');
commit;
STEP 5: Run Query to use Oracle Text Index on Base Table (works fine always. No issues seen so far)
SELECT a.sap_id||'|'||a.name||'|' CUSTOMER_STR
FROM cpf_customer a
WHERE (catsearch(a.name, 'Mooseen'||'*', '')>0);
CUSTOMER_STR
6588125000|S M Mooseen And Sons(PVT) Limited|
STEP 6: Run Query to use Oracle Text Index on View created under Table (get below error periodically)
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
DRG-10599: column is not indexed
But it works sometimes as in STEP 5 and returns 1 row. It is never consistent. We would like to
provide access to this Table using View only. That is why we would like to get this query working consistently
using View.
Any help or tips would be greatly appreciated
Thanks
AuroThis is a known issue with CTXCAT indexes. Sometimes the optimizer will "drive" the query off another index, and request results from the CTXCAT index on a row-by-row basis ("does the row with rowid NNNN satisfy this CATSEARCH condition?"). That's known as a functional lookup, and is not supported by the CTXCAT indextype.
The only solution is to try to persuade the optimizer to use a different plan which does not use a functional lookup. This can be achieved by the use of hints, or sometimes by collecting or deleting statistics on the table. -
Hi all,
I have a wierd problem, when I am aceesing one of my oracle10g tables from my java application its showing table or view dos not exist..but the table(Name-SYSTEM_CODES) is actually present in the database and the priveleages are also there.I have tried dropping it and creating it again..but of no use...Plz do help me out with this issue..
Thanks in advance
Balutwo possibilities are there for this error
1. doesnt have select privilege on particular table
2. if not connected as owner of table, didnt give <owner>.<table_name>.
Regards
Vignesh -
What is the version of grant alter table, drop table to user in Oracle 10g?
Hi,
Oracle support "grant alter table and drop table" before, but I get the "invalid privilege" error in Oracle 10g. Oracle 10g have the "DROP ANY TABLE" and "Alter any table". Is these two means can drop and alter tables belonging to other users? How do I grant the total control (CRUD) of tables in the owner's schema to the owner in Oracle10g?
Thanks,
JiangCREATE TABLE privilege grants complete control on owner's tables :
SYS@db102 SQL> create user test01 identified by test01;
User created.
SYS@db102 SQL> grant create session, create table to test01;
Grant succeeded.
SYS@db102 SQL> alter user test01 quota unlimited on users;
User altered.
SYS@db102 SQL> conn test01/test01
Connected.
TEST01@db102 SQL> create table test(a number);
Table created.
TEST01@db102 SQL> alter table test add(b varchar2(100));
Table altered.
TEST01@db102 SQL> drop table test purge;
Table dropped.
TEST01@db102 SQL> -
Count rows from multiple tables using SQL only
Hi, I know this has probably been answered before, but I couldn't find the answer anywhere. Please help.
I'd like count(*) [rows] for all tables in database using SQL only - no PL/SQL
The result should be something like:
Table RowCount
DBA_TABLES 1000
DBA_USERS 50
etc.
Thanks!offcource write this script:
create or replace procedure count_tables (ip_schema VARCHAR2)
is
lv_owner VARCHAR2(100);
lv_table_name VARCHAR2(100);
lv_sql_statement VARCHAR2(2000);
lv_count_table NUMBER;
CURSOR c1 IS
SELECT owner, table_name
FROM all_tables
WHERE owner = ip_schema
ORDER BY table_name;
begin
dbms_output.put_line ('+--------------------------------------------------------------------+');
dbms_output.put_line ('¦ | | ¦');
dbms_output.put_line ('¦ Schema Name | Table Name | Number of Rows ¦');
dbms_output.put_line ('¦ | | ¦');
dbms_output.put_line ('¦------------------------------------------------------------------¦');
OPEN c1;
LOOP
FETCH c1 INTO lv_owner , lv_table_name;
EXIT WHEN c1%NOTFOUND;
lv_sql_statement := 'SELECT count(*) FROM ' || lv_owner || '.' || lv_table_name;
EXECUTE IMMEDIATE lv_sql_statement INTO lv_count_table;
IF lv_count_table > 0 THEN
dbms_output.put_line ('| '||rpad(lv_owner, 14, ' ')||'| '|| rpad(lv_table_name, 32, ' ')||'| '|| rpad(lv_count_table, 16, ' ')||' |');
-- dbms_output.put_line ('|---------------|---------------------------------|------------------|');
END IF;
END LOOP;
CLOSE c1;
dbms_output.put_line ('+--------------------------------------------------------------------+');
exception
WHEN OTHERS THEN
dbms_output.put_line ('owner: '||lv_owner||' - table: '||lv_table_name||' - '||sqlerrm);
end count_tables;
set serveroutput on size 1000000
exec count_tables
drop procedure count_tables; -
Hey Guys, it's Xev.
I decide to use SQL and XML and it works in one scenario, but in another scenario, it doesn't.
Here is the Code, I am passing in two variables, First, I pass in the table_name and then i pass in the schema.
If I am doing this with the "user" connected and it's looking in it's own schema, it's find the results, like so, but if i try to execute this code while not
connected to the same user i am searching on i get this error.
ORA-19202: Error occurred in XML processing
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_XMLGEN", line 288
ORA-06512: at line 1
19202. 00000 - "Error occurred in XML processing%s"
*Cause: An error occurred when processing the XML function
*Action: Check the given error message and fix the appropriate problem
This code works only of you are connected to the user that you are searching on.
But if you search for another user tables, it's blows up and gives the XML error above...
SET SERVEROUTPUT ON
exec DBMS_OUTPUT.ENABLE(1000000);
VAR search_string VARCHAR2(28)
EXEC :search_string := '^[0-9]{3}-[0-9]{2}-[0-9]{4}$'
COLUMN "Searchword" FORMAT A28
COLUMN "Table" FORMAT A9
COLUMN "Column/Value" FORMAT A50
SELECT DISTINCT SUBSTR (:search_string, 1, 28) "Searchword",
SUBSTR (table_name, 1, 14) "Table",
SUBSTR (t.column_value.getstringval (), 1, 50) "Column/Value"
FROM dba_tab_cols,
--where owner = ('&SCHEMA_NAME')
TABLE
(XMLSEQUENCE
(DBMS_XMLGEN.GETXMLTYPE
( 'SELECT ' || column_name ||
' FROM ' || table_name ||
' WHERE REGEXP_LIKE
(' || column_name || ','''
|| :search_string || ''')'
).extract ('ROWSET/ROW/*'))) t
--WHERE table_name IN ('FIND_TEST')
WHERE table_name = upper('&TABLE_NAME')
AND OWNER = upper('&SCHEMA_NAME')
ORDER BY "Table"
Can someone please explain how (DBMS_XMLGEN) works, and why it's throwing that error??
thanks,
Xev.It has nothing to do with DBMS_XMLGEN.GETXMLTYPE. It simply means user executing your SQL has no select privilege on table &SCHEMA_NAME.&TABLE_NAME.
SY. -
Three questions regarding DB_KEEP_CACHE_SIZE and caching tables.
Folks,
In my Oracle 10g db, which I got in legacy. It has the init.ora parameter DB_KEEP_CACHE_SIZE parameter configured to 4GB in size.
Also there are bunch of tables that were created with CACHE turned on for them.
By querying dba_tables table , with CACHE='Y', I can see the name of these tables.
With time, some of these tables have grown in size (no. of rows) and also some of these tables are not required to be cached any longer.
So here is my first question
1) Is there a query I can run , to find out , what tables are currently in the DB_KEEP_CACHE_SIZE.
2) Also how can I find out if my DB_KEEP_CACHE_SIZE is adqueataly sized or needs to be increased in size,as some of these
tables have grown in size.
Third question
I know for fact, that there are 2 tables that do not need to be cached any longer.
So how do I make sure they do not occupy space in the DB_KEEP_CACHE_POOL.
I tried, alter table <table_name> nocache; statement
Now the cache column value for these in dba_tables is 'N', but if I query the dba_segments tables, the BUFFER_POOL column for them still has value of 'KEEP'.
After altering these tables to nocache, I did bounce my database.
Again, So how do I make sure these tables which are not required to be cached any longer, do not occupy space in the DB_KEEP_CACHE_SIZE.
Would very much appreciate your help.
Regards
AshishHello,
1) Is there a query I can run , to find out , what tables are currently in the DB_KEEP_CACHE_SIZE:You may try this query:
select owner, segment_name, segment_type, buffer_pool
from dba_segments
where buffer_pool = 'KEEP'
order by owner, segment_name;
2) Also how can I find out if my DB_KEEP_CACHE_SIZE is adqueataly sized or needs to be increased in size,as some of these tables have grown in size.You may try to get the total size of the Segments using the KEEP BUFFER:
select sum(bytes)/(1024*10124) "Mo"
from dba_segments
where buffer_pool = 'KEEP';To be sure that all the blocks of these segments (Table / Index) won't be often aged out from the KEEP BUFFER, the total size given by the above query should be less than the size of your KEEP BUFFER.
I know for fact, that there are 2 tables that do not need to be cached any longer.
So how do I make sure they do not occupy space in the DB_KEEP_CACHE_POOL.You just have to execute the following statement:
ALTER TABLE <owner>.<table> STORAGE(BUFFER_POOL DEFAULT);Hope this help.
Best regards,
Jean-Valentin -
How to view the constarints of the table
HI All,
Could any one tell me how can i view the constraints of particulate table
Thanks
BasavQuery DBA_CONSTRAINTS (or ALL_CONSTRAINTS or USER_CONSTRAINTS depending on what privileges you're looking for and whether you're looking just at objects in your schema or in other schemas).
SELECT *
FROM all_constraints
WHERE owner = <<owner of table>>
AND table_name = <<name of the table>>Justin -
Table or View Not Found Problem
Hi all,
I am facing a strange problem where-in I am calling a query from a normal SQl window which works but the same in Procedure gives me an error.
User A...This runs this statement
Select * from B.emp which gives results. The same statement when I compile in a procedure it gives an error saying Table or View not Found.
User A has a select on B.Emp where B is the owner of table Emp.
I am not able to get to the solution of the same. Is it apossibility of a synonym conflict? Can someone help in what ways this error can come?
Thanks and Regards,
Kapil UppalHi,
>>Well the error is Table Or View Does not exist
Interesting, what version of Oracle are you using ? As you can see below, the stored procedure does not recognized the privilege that have been granted through a role.
LEGATTI@ORACLE10> create user user1 identified by user1;
User created.
LEGATTI@ORACLE10> create user user2 identified by user2;
User created.
LEGATTI@ORACLE10> grant connect,resource to user1,user2;
Grant succeeded.
LEGATTI@ORACLE10> create table user1.emp (id number);
Table created.
LEGATTI@ORACLE10> create role user1_role_tables;
Role created.
LEGATTI@ORACLE10> grant user1_role_tables to user2;
Grant succeeded.
LEGATTI@ORACLE10> grant select on user1.emp to user1_role_tables;
Grant succeeded.
LEGATTI@ORACLE10> connect user2/user2
Connected.
USER2@ORACLE10> select count(*) from user1.emp;
COUNT(*)
0
USER2@ORACLE10> create or replace procedure my_test_procedure as
2 n_id number;
3 begin
4 select count(*) into n_id from user1.emp;
5 end;
6 /
Warning: Procedure created with compilation errors.
USER2@ORACLE10> show errors
Errors for PROCEDURE MY_TEST_PROCEDURE:
LINE/COL ERROR
4/1 PL/SQL: SQL Statement ignored
4/38 PL/SQL: ORA-01031: insufficient privilegesCheers -
Unable to describe the table as system user
Hi,
I'm able to describe the below table as sys user but not able to do so as system user.
SQL> desc IA_MBR_ID_D;
Name Null? Type
MBR_ID_EDW_SK NOT NULL NUMBER
MBR_ID NOT NULL CHAR(3)
MBR_SBSCR_ALTN_ID NOT NULL VARCHAR2(13)
MBR_LST_NM VARCHAR2
MBR_FRST_NM VARCHAR2
MBR_MID_INIT VARCHAR2
MBR_EFF_DT DATE
MBR_CANC_DT DATE
MBR_BTH_DT DATE
MBR_GNDR_CD NOT NULL CHAR(1)
MBR_RLNSP_CD NOT NULL CHAR(1)
MBR_TYP_OF_CONTR_CD NOT NULL VARCHAR2(3)
MBR_UNIQ_MBR_ID NOT NULL VARCHAR2(26)
MBR_SHRT_UNIQ_MBR_ID NOT NULL VARCHAR2(16)
SQL> conn system/.....@<DB>
Connected.
SQL> desc IA_MBR_ID_D;
ERROR:
ORA-04043: object IA_MBR_ID_D does not exist
SEGMENT_NAME SEGMENT_TYPE OWNER
IA_MBR_ID_D TABLE EDW
IA_MBR_ID_D TABLE EDWSTG
Please share your thoughts.Not sure if this is a privilege issue as I'm not able to dec this as system user.
Regards,
VNuser7202581 wrote:
Hi,
I'm able to describe the below table as sys user but not able to do so as system user.
SQL> desc IA_MBR_ID_D;
Name Null? Type
MBR_ID_EDW_SK NOT NULL NUMBER
MBR_ID NOT NULL CHAR(3)
MBR_SBSCR_ALTN_ID NOT NULL VARCHAR2(13)
MBR_LST_NM VARCHAR2
MBR_FRST_NM VARCHAR2
MBR_MID_INIT VARCHAR2
MBR_EFF_DT DATE
MBR_CANC_DT DATE
MBR_BTH_DT DATE
MBR_GNDR_CD NOT NULL CHAR(1)
MBR_RLNSP_CD NOT NULL CHAR(1)
MBR_TYP_OF_CONTR_CD NOT NULL VARCHAR2(3)
MBR_UNIQ_MBR_ID NOT NULL VARCHAR2(26)
MBR_SHRT_UNIQ_MBR_ID NOT NULL VARCHAR2(16)
SQL> conn system/.....@<DB>
Connected.
SQL> desc IA_MBR_ID_D;
ERROR:
ORA-04043: object IA_MBR_ID_D does not exist
SEGMENT_NAME SEGMENT_TYPE OWNER
IA_MBR_ID_D TABLE EDW
IA_MBR_ID_D TABLE EDWSTG
Please share your thoughts.Not sure if this is a privilege issue as I'm not able to dec this as system user.
Regards,
VNconnect / as sysdba
SELECT OBJECT_TYPE, OWNER FROM DBA_OBJECTS WHERE OBJECT_NAME = 'IA_MBR_ID_D';
post results from SQL above
Maybe you are looking for
-
HI all, when I'm creating asset master at AS01, I'm getting an error "No internal number range is defined for the equipment category", I'm getting this error only for one asset class. While I'm creating asset, at ALLOCATION tab, under INTEGRATION OF
-
How do I copy all iTunes data from ext to ext disc
Hi, my RAID mirroring system had a defect. Now I bought a new 1000 GB disc (two discs seem to be safer than a RAID mirror system after all) and want to copy all my iTunes data (approx. 400 GB) from that RAID mirroring system to the new disc. How can
-
Where is the file size/free space info?
This is a minor one, but annoying. Since upgrading to Lion I no longer see the number of items or available space at the bottom of a window. Where did that information go? It's particularly noticable on external hard drives, where I need to keep trac
-
Greetings - Have tried multiple times to install vmserver, and getting a strange error... Here is the config: hda = 100gb hard drive, with WinXP and Fedora 8 installed. I attach an 80gb USB drive. I removed all partitions prior to starting. 'Auto' pa
-
How can I format my movies that I make to a lower gigabyte so it can fit onto my DVD?
Help please