SQL & PL/SQL :: Create Tables From Different Schema?

Mar 18, 2012

I have created 2 different databases and each have their own schema user for eg we have database ALIVE with user allive and the other database RLIVE with user rllive , actually we have implemented new module in ALIVE database and in the process we created many tables , synonyms , index and other objects now we want to list out all the tables ,sequences as scripts which are not present in RLIVE and create them in RLIVE as new objects.

View 3 Replies


ADVERTISEMENT

Create One Trigger Before DML On All Schema Tables

Nov 28, 2011

We have an application is must be connected to our database for specific requirements in our company but this application has a very bug thing as we must write the super DB password "Like HR password as example" clear in some files and these files must be shared so developers can use the HR password to do any action !!! I know that this application is a problem but we have to install

I can do this by creating trigger on each table will restrict DML. As example: if the operating system user is XXX, the trigger restrict the action. But not logic at all to create more than 1000 triggers on schema (This will impact badly on DB performance).

So, i need to create one trigger to fire before doing any DML on all schema tables. As example: If "MMM" the administrator operating system user trying to do insert action, he can do the action. BUT If "DEV" the developer operating system user trying to do insert action, the trigger must fire here to restrict this action.

Be noted also, i need this trigger not depend on any specific tool like Toad as any user can simply rename the exe file for toad then he can pass the trigger. At least, trigger must depend on (Operating system user & Action_type)

View 11 Replies View Related

SQL & PL/SQL :: Create Block Of Code That Would Search In All Tables In Schema For Column_name

Jun 14, 2011

I want to create a block of code that would search in all tables in a schema for a column_name where its data_length is like 4000 let's say. This data_length is actually dedicated for a comment column. If found, all not null column with like 4000 data_length will be changed by string "Comment has been removed". I have the following script below but it seemed lacking.

begin
for rec in (select table_name, column_name from user_tab_columns where column_name like ?data_length? = 4000 order by 1,2) loop
begin
execute immediate 'update '||rec.table_name||' set '||rec.column_name||' = ''Comment has been removed'' where '||rec.column_name||' is not null';
commit;
[code]........

View 6 Replies View Related

Client Tools :: How To Create A Table In Another Schema As In Existing Schema

Apr 26, 2010

I would like to create a table in another schema(CBF) as already exist in my schema(TLC) without data but related indexes,synonyms and grants should be include.

How could I do this without using export import. I am using TOAD 9.0.1.

View 10 Replies View Related

PL/SQL :: Trigger From Other Tables Of Same Schema?

Jan 14, 2013

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit

i'm trying since some hours to get information from inside a trigger from another table of the same schema.My trigger table is PSE_BKB.NUM_PHANTOM_BP

First i tried simple solution ...

CREATE OR REPLACE TRIGGER PSE_BKB.NUM_TR_PHANTOM_BP
BEFORE DELETE OR INSERT OR UPDATE
ON PSE_BKB.NUM_PHANTOM_BP
REFERENCING NEW AS NEW OLD AS OLD

[code]...

The last version i tried was with a cursor definition inside the trigger as in the code-block below.For debugging purposes i've inserted a RAISE_APPLICATION_ERROR in the inner loop - see below. The variable v_obj_key is never set, like in all other variations i tried - i alway see the predefined 'gugus' from the declare section.

It seems oracle cannot read from other tables at this point. The :old.phantom_key is set (in this simple example there should come one obj_key back).

trigger:

CREATE OR REPLACE TRIGGER PSE_BKB.NUM_TR_PHANTOM_BP
BEFORE DELETE OR INSERT OR UPDATE
ON PSE_BKB.NUM_PHANTOM_BP
REFERENCING NEW AS NEW OLD AS OLD

[code]...

View 11 Replies View Related

SQL & PL/SQL :: Get Row Counts Of Tables In Schema Without Using Num_rows

Aug 9, 2010

I am trying to get a row count(*) for all the tables in my schema. The NUM_ROWS column in DBA_TABLES is not appropriate in this case because they are as good as the last analyze. So I need to get real time counts.

I tried the following code but I can't seem to catch my error.

DECLARE

l_sql varchar2(150);
cursor tablelist is
select table_name from dba_tables where owner = 'ME';

[Code]....

My expected results are :

TABLE_NAME ROW_COUNT
---------- ----------

View 13 Replies View Related

How To Grant Select On All Tables Of User1 To Another Schema

Jan 18, 2012

User1 is having 10000 tables in his schema...How can i grant "select" on a all tables of a user1 to another schema(user2) so that in future when user1 will create tables , the user2 will have "select" access on those tables automatically.

I dont want user2 to have "select any table" privillege.

User2 should not have "drop" privillege on his own tables.

View 1 Replies View Related

Tool To View Schema And Relations Between Tables

Jul 4, 2008

Any tool or way to view the schema and relations between tables of an Oracle database?

View 1 Replies View Related

Server Utilities :: Import Only Tables Of A Schema

Jul 26, 2013

The way to do IMPORT of a schema's ALL the TABLES only. Through Data Pump. I don't want to import any other objects like 'package',procedure etc...

Is it the only way is specifying them within EXCLUDE parameter?

View 3 Replies View Related

Server Utilities :: How To Backup Tables In A Schema

May 31, 2012

How to backup the tables in a schema? I need som halp on this subjekt. I hav Dev envrnment that I must to backup.

View 9 Replies View Related

SQL & PL/SQL :: Query To Find List Of Tables Contains Particular Data In Schema?

Feb 3, 2012

I want to list the tables in a schema which contains a particular value or data.

View 2 Replies View Related

Security :: Enabling Audits Can They Be Applied On Tables Or Whole Schema

Apr 19, 2013

Enabling of auditing in oracle database, can this be done on some tables or applied on the whole schema/user.

View 5 Replies View Related

Backup & Recovery :: Selected Data From Tables Of Schema

Mar 7, 2012

I want to take backup of selected data from tables of a schema (as huge data, that is not used, causing slow query performance) I planned to create a seprate backup schema and tablespace to store the data from these tables. Then write procedures that can move the data to and fro among table of those schema. And create partitioned index on those backup tables.

View 11 Replies View Related

Forms :: Summit Office Supply Schema (Tables)?

Jan 21, 2013

I have this pdf (2 Volumes) from Oracle University courses, "Oracle Fusion Middleware 11g: Build Applications with Oracle Forms" In order to read the examples you must have "Summit Office Supply Schema" fmbs, mmb, pll, tables.(dmp)

indicatively some tables (not confuse it with other summit user)
customers,
departments,
warehouses,
orders,
employees,
order_items,
product_information,
inventories

View 2 Replies View Related

Sort Through Schema Tables To Find If Particular Vendor Number Exist

Nov 14, 2006

I would like to be able to sort through a schema's tables to find if particular vendor numbers exist. The decode cross tab works fine, except that it needs static data for each table. How can I code a PL/SQL to populate the table_name and give a count for each row? See example below:

col table_name format a15
set numwidth 10
set lines 1000
set pages 50

select b1.table_name,
count(case when a.vendor='86444' then 1 else null end) "86444",
count(case when a.vendor='86445' then 1 else null end) "86445",
count(case when a.vendor='86469' then 1 else null end) "86469",
count(case when a.vendor='86470' then 1 else null end) "86470",
[code]........

View 1 Replies View Related

Server Utilities :: Exporting Database Schema / Tables Without Data

Sep 22, 2010

I'm trying to export a relatively large database but it's a bit more complicated than that.For one schema I need a full export / import (data included).

For another 10 schemas I need them empty, with the exception of a table in some of them which needs to be exported / imported with all data inside.Is it possible to do this with datapump utility (impdp, expdp)?

Afterwards I will be running some scripts to populate the DB instance with critical data / metadata.

View 1 Replies View Related

Export/Import/SQL Loader :: IMPDP Into Schema With Truncated Tables

Aug 2, 2012

I've got a schema that I've truncated all tables. I have a full schema export I took awhile back, and I'm wanting to import this into the schema to basically 'reset' it.

First time run, I got the :

ORA-39151: Table "xyz.tablename" exists. All dependent metadata and data will be skipped due to table_exists_action of skip

I've been reading through, and see suggestions to add to the par file:

CONTENT=DATA_ONLY TABLE_EXISTS_ACTION=APPEND

And I've seen others use the option for:

table_exists_action=replace

I basically want to put the data back into the tables, and have the indexes rebuilt.....

View 1 Replies View Related

Security :: Create Various Users On A Schema

Nov 19, 2010

I do a schema in oracle ... an m my question is if I can create 2 o more users for access to a schema..for example i have schema Project and i need that one administrator and 2 more users with others permission.

View 3 Replies View Related

Security :: Create Table Others Schema

Oct 18, 2010

how can i grant a user permission to create tables and indexes in other user schema.Grant create table permits the user to create tables in his own schema which is part of Resource role.Grant any table will permit him to create table in any schema including system which i don't want.

View 8 Replies View Related

Security :: How To Create User Under Schema

Dec 5, 2012

To make users under one schema.

1) user should have access of all objects with limited privileges.

How can i make it under schema?

View 3 Replies View Related

Enterprise Manager :: How To Create XML Schema Using OEM

Mar 28, 2011

How to create & register XSD schema using OEM ?

View 1 Replies View Related

SQL & PL/SQL :: Efficient And Fast Method Required For Audit Trailing Tables In A Schema?

Nov 17, 2011

efficient & fast method for Audit trailing tables in a Schema for any insert /update /deletes for a table. I do not want to use db triggers because of performance issues.

presently we have as system which does audit trail as below:

1. If a user changes a column value for a table ( update/insert/delete) then we call a db package and pass the parameters like table name,col name,user, operation (ins/update/delete),old value, new value,date modified,user modified etc

2. the called package will insert a record in the audit trail table with the parameters passed

3. The audit trail table is used for report generation .

View 1 Replies View Related

Create Schema That Needs To Be Converted Using Non-oracle Syntax

Jan 27, 2011

I am new to oracle and sql in general, I received an oracle create schema that needs to be converted using non-oracle syntax. I have never seen this syntax before.

What does the following syntax mean?
CODE,line_status(1:20) char(2) null

CODE,file_line(1:6) char(40) null

View 4 Replies View Related

How To Create A User (Owner Of Coeus Schema)

Dec 9, 2010

On the database instance where you want to install Coeus, create a user who will be the owner of Coeus schema. This user should have at least the following privileges. CREATE TABLE, CREATE VIEW, CREATE PROCEDURE, CREATE PUBLIC SYNONYM, CREATE USER, CREATE ROLE, CREATE SEQUENCE, CREATE SESSION CREATE TRIGGER, AND CREATE TYPE. If you choose, you can grant DBA role to this user.

Note: Coeus Schema owner should have CREATE USER and ALTER USER right explicitly granted to it, not through a role like DBA.

View 3 Replies View Related

SQL & PL/SQL :: How To Create HR Schema Table Using Stored Scripts

Jan 3, 2012

I dropped HR schema from database by mistake.

How to create HR Schema and its all tables using oracle stored scripts.

My operating system is Windows XP and oracle version is 10g.

View 9 Replies View Related

PL/SQL :: Reverse Update - Create Synonym In Different Schema

Aug 8, 2012

I have table a in database 1 . Now i have created the MV for table a in database 2.

then i am going to create a synonym in different schema in the database 2.

Now i want to update the synonym in database 2 the same as to refresh in table a database 1.

How to achieve this??

View 2 Replies View Related

Server Utilities :: Schema Level Import By Dropping Existing User That Contain Tables

Jan 20, 2011

Our Testing DB is running in No archive log mode. I did a schema level import by dropping the existing user that contain tables, recreate the user and finished the import. Now they want the old tables back.Is there is any way to recover the old tables?

View 5 Replies View Related

PL/SQL :: Cannot Create Table After Change Schema With ALTER SESSION

Sep 1, 2012

SQL> ALTER SESSION SET CURRENT_SCHEMA = CLA_T3;

Session altered.
SQL> select sys_context('USERENV','SESSION_USER') current_user,
2 sys_context('USERENV','SESSION_SCHEMA') current_schema
3 from dual
4 ;

CURRENT_USER
--------------------------------------------------------------------------------
CURRENT_SCHEMA
--------------------------------------------------------------------------------
CSR_ETL
CLA_T3

SQL> set linesize 300;
SQL> /

CURRENT_USER
----------------------------------------------------------------------------------------------------
CURRENT_SCHEMA
----------------------------------------------------------------------------------------------------
CSR_ETL
CLA_T3

SQL> create table cla_t3.test (r number, b char(2));
create table cla_t3.test (r number, b char(2))
*
ERROR at line 1:
ORA-01031: insufficient privileges

SQL> create table test (r number, b char(2));
create table test (r number, b char(2))
*
ERROR at line 1:
ORA-01031: insufficient privileges

After Setting current schema to 'CLA_T3', I am unable to create table in cla_t3 schema.

View 5 Replies View Related

Export/Import/SQL Loader :: Trying To Create 3 Schemas From One Schema

Aug 23, 2012

DB version : 11.2.0.2 Enterprise Edition
Platform : RHEL 5.6

I have an expdp dump of a schema (HRTB_AP_PROD). I wanted to create 3 schemas from this dump in one go. So i tried this

## The parfile I used

DIRECTORY=DPUMP_DIR
DUMPFILE=HRTB_AP_PROD%u.dmp
LOGFILE=TheThreeSchemas-imp.log
remap_schema=HRTB_AP_PROD:HRTB_AP_DEV1
remap_schema=HRTB_AP_PROD:HRTB_AP_DEV2
remap_schema=HRTB_AP_PROD:HRTB_AP_DEV3
exclude=statistics
parallel=2

nohup impdp '/ as sysdba' parfile=impdp-aug23.par &But i encountered

ORA-39046: Metadata remap REMAP_SCHEMA has already been specified.When I googled it found the following link in which Dean Says , it is not possible.

Re: one dump file inport into multiple schema

So, I had to run 3 separate imports (impdp) to do this.

This is a bit wierd. I am surprized that Oracle guys haven't done anything about this . This is like DB2 !

View 2 Replies View Related

SQL & PL/SQL :: Create Trigger That Will Fire Whenever Any User Will Access Schema Of Oracle

Oct 31, 2011

I would like to create a trigger that will fire whenever any user will access to a Schema of Oracle DB (for each and every login). regardless the access will be through an application or SQLPLUS and this trigger must insert the below information into a table.

1) IP address
2) Machine Name
3) login time
4) logout time
5) name of accessed schema

writing this trigger and creating the table that will hold the required data.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved