CREATE TABLE for another OWNER/SCHEMA and in another TABLESPACE?
I am logged in a SYSTEM user. Now I want to create a table aaa. The owner of this table should not be SYSTEM but user KARL. and the TABLESPACE should not be SYSTEM but the (existing) TABLESPACE tttt.
As far as I know I can achieve this by issuing the following command:
CREATE TABLE KARL.aaa ( a INTEGER, .......) TABLESPACE tttt;
Regarding the TABLESPACE parameter I am not sure. Is it possible to allocate a TABLE for User Karl in a TABLESPACE which is not assigned to him?
Furthermore I have an additional problem.
I have a script with hundreds of CREATE TABLE + ALTER TABLE + CREATE INDEX DDL statements.
All of them are not prepended with Schema/Owner and an TABLESPACE clause.
Can I put somehow one single instruction at the top of the script which telles Oracle
to use
- OWNER Karl as Schema/Owner for all subsequent DDL stements
- TABLESPACE tttt as TABLESPACE for all subsequent DDL stements
In MYsql there is a "use <database>" statement. Is there soemthing similar for Oracle?
Thank you
Peter
Yes... you can do that. Take for example a user A who has a secret password that you don't wish to give out... like an application schema. User B needs to make tables/objects in schema A and you want to track what user B is doing. First setup Oracles Fine Grained Auditing and then grant "connect through" from user A to user B as follows:
SQL> create user b identified by abc123
2 quota unlimited on users;
User created.
SQL> grant create session to b;
SQL> create user a identified by abc123
2 quota unlimited on users;
User created.
SQL> grant create table
2 , create session
3 to a;
Grant succeeded.
SQL> alter user a grant connect through b;
User altered.
SQL> connect b[a]/abc123@a486
Connected.
SQL> show user
USER is "A"
SQL> create table a.my_proxy_table
2 ( c1 number
3 , c2 varchar2(50)
4 , c3 date
5 );
Table created.-----
See that I connected using the "username[proxyuser]" syntax. Also notice that user B is by proxy user A, illustrated by my "show user" command. The connect through can be granted/revoked as needed without divulging A's password to B. In addition, your audit tables or xml logs will track the fact that user B created table a.my_proxy_table.
Hope this helps,
John
Similar Messages
-
How can i create table between different servers schema
Hi,
Can any advice me how I can create table on remote oracle schema.
Thanks in advance
Faheem LatifI am telling you what I know about remote table creation - it is impossible in Oracle, if you trust the documentation of course.
ORA-02021: DDL operations are not allowed on a remote database
Cause: An attempt was made to use a DDL operation on a remote database. For example, "CREATE TABLE tablename@remotedbname ...".
Action: To alter the remote database structure, you must connect to the remote database with the appropriate privileges. -
Create tables in different database schemas using EJB 3 Entity Persistent
Hi All,
I would like to find out how to get the following tasks done using EJB 3.0 Java Entity Persistent:
( i ) Create tables in different schemas such as STUDENT under EDUCATION schema and table PATIENT in HOSPITAL schema. We can then reference them in SQL as EDUCATION.STUDENT and HOSPITAL.PATIENT.
( ii ) Reference these tables uniquely once they are created.
There are no pre-existing tables or naming conventions that needs to be adhere to in this situation.
I have no problem creating tables on the current schema in EJB 3.0 Java Entity Persistent.
Any suggestions would be appreciated.
Thanks,
JackUse the schema attribute of the Table annotation:
package javax.persistence;
@Target({TYPE}) @Retention(RUNTIME)
public @interface Table
String name( ) default "";
String catalog( ) default "";
String schema( ) default "";
UniqueConstraint
uniqueConstraints( ) default {};
} -
Do I need to install Oracle database 12c on PC to create tables for Weblogic server
Hi,
I am new to WebLogic and I am following a book Java EE Development
with Eclipse published by PACKT Publishing to learn Java EE. I have installed Oracle Enterprise Pack for Eclipse
on the PC and I am able to log into the WebLogic Server
Administration Console and set up a Data Source. However the next step is to create
tables for the database. The book says that the tables can be
created using SQL script run from the SQL command line.
I cannot see any way of inputting SQL script into the WebLogic
Server Admistration Console. Aslo there is no SQL Command line
in DOS.
I have put a previous question on the Oracle Forum about the above and I was advised to use SQL Plus
to create the tables for the weblogic server but no mention was made of installing Oracle database.
I have downloaded InstantClient SQL Plus and Instantclient Basic on a PC and
put the files into the same directory C:\SQLPlus but now I am having a problem in that it is
looking for a username and password when I run the sqlplus.exe file.
Now I assume that I need to have an installation of Oracle databse on the
PC so as to be able to use SQL Plus. Am I correct in this or can I create tables for the
datasource in weblogic without an Oracle database?
Thanks in advance for your help. BrianYou should install it separately and also need to change the OBIEE's user.sh to tell it where is your Oracle client installed.
-
How to drop a schema and load another one?
I have an interruption during installing the central instance of a SAP Netweaver 04s System. After I restarted the installation I found this message in the Log file.
<b>ERROR 2006-08-16 16:17:04</b>
CJS-30109 The Java load in database PDV/liesc1ddbw01 has already been configured. <p> SOLUTION: Drop the schema and load it with a new load before running this installation.
<b>ERROR 2006-08-16 16:17:04</b>
CJS-30109 The Java load in database PDV/liesc1ddbw01 has already been configured. <p> SOLUTION: Drop the schema and load it with a new load before running this installation.
<b>ERROR 2006-08-16 16:17:04</b>
FCO-00011 The step getJavaLoadType with step key |NW_Java_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|10|0|getJavaLoadType was executed with status ERROR.
QUESTION: How to drop a schema and load another one?Hello,
I got the similar error....but i did reinstall from o.s. and done the installation again...it was worked successfully..
if you find out alternate solution for that ...please let us know..
Regards, -
How to create tables for control data
HI
How to create tables for controls of types of data (screen control)? what is the process for this
Regards,
AnilWell, do you want to do it the easy way? If so, then just create a table maintenance program. You can do this via SE11, utilites, table maintenance generator. The table maintenance will be generated and you can then maintain the table via SM30.
If you want to go the more challenging way, you can write your own table maintenance program using a table control on your screen. You can use the table control wizard to help you along.
Regards,
Rich Heilman -
Table for total actual cost and total actual revenue.
Hi Gurus,
Can anybody pls tell me what is the table for total acutal cost and total actual revenue for a service order.
Thanks in advance.
Regards
SatishCheck COSP
-
Tables for linking sales organization and customers
Dear Sir,
I am Nikhil. I want to know the tables for linking sales organization and customer.
Please do help me.
Regards,
Nikhilyou mean table KNVV?
please post more details
A. -
Aggregate of all Columns in each table for the entire schema
I want to calculate the report of Aggregate of all Columns in each table for the entire schema in Oracle. Pls let me know which approach is best to do this.
Thanks in advance !!Not sure about your requirement..
This?
select table_name,sum(data_length) sm
from user_tab_cols
group by table_name; -
Create user/schema is script, then tables for that user/schema
Hi;
First off, if I phrase this a little wrong - I'm from the Sql Server world and still trying to totally understand Oracle.
I have a schema (.sql file) that creates my database fine. But what I would liek to add to the .sql schema is for it to create a user and then place all the tables, indexes, sequences, and triggers in as belonging to that created user.
This way we can tell people to log in as sysop and run the script to create the schema rather than create the user, log in as the user, then run the script.
What do I need to add?
thanks - daveHi;
I have tried:
CREATE USER DAVE IDENTIFIED BY password;
CONNECT DAVE/password AS SYSDBA
I have also tried:
CONNECT DAVE/password AS SYSTEM
CONNECT DAVE AS SYSDBA
CONNECT DAVE
In all cases ApplicationExpress says it does not recognize the CONNECT command. Should I do something different? What I want to accomplish is that all subsequent commands in the script creating tables, indexes, etc are assigned to the user/schema DAVE.
thanks - dave -
For our family finances, how do I create a monthly expenditure report that automatically merges data (by category) from checking, credit card, and savings accounts?
You can set up four tables:
1) a summary table
2) a table for pasting Checking transactions
3) a table for pasting Credit Card transactions
4) a table for pasting Savings transactions
You will have catagorize each transaction or using the ones from the bank/credit card
I used pop-up menus to make the categories (Type) and summed the two accounts in the summary table. -
NESTED Tables for Sub-types when creating table for Super-type
If I create the following types, as an example:
Person with subtypes: Employee and Customer
Appointment
CREATE OR REPLACE TYPE Person_OT AS OBJECT (
person# NUMBER,
personSurname VARCHAR2(50),
personForenames VARCHAR2(50),
personDateOfBirth DATE,
personAddress Address_OT,
) NOT FINAL ;
CREATE OR REPLACE TYPE Employee UNDER Person_OT (
empSalary NUMBER,
empNoSales NUMBER,
makes Appointment_List_OT
) FINAL ;
CREATE OR REPLACE TYPE Appointment_OT AS OBJECT (
some attributes
CREATE OR REPLACE TYPE Appointment_List_OT AS TABLE OF REF Appointment_OT ;
When creating the table to hold objects of Person type, how can the requisite nested table for representing 'makes' be declared? The below approach is not correct, however the table will not compile without naming the nested tables.
CREATE TABLE Person_TBL OF Person_OT (
Person# PRIMARY KEY)
NESTED TABLE makes STORE AS Appointment_List_NTBL;
Advice very much appreciated!CREATE TABLE Person_TBL OF Person_OT(
Person# PRIMARY KEY)
NESTED TABLE TREAT(SYS_NC_ROWINFO$ AS EMPLOYEE).MAKES STORE AS Appointment_List_NTBL
Table created.
SQL> select * from user_nested_tables
2 /
TABLE_NAME TABLE_TYPE_OWNER
TABLE_TYPE_NAME PARENT_TABLE_NAME
PARENT_TABLE_COLUMN
STORAGE_SPEC RETURN_TYPE ELEMENT_SUBSTITUTABLE
APPOINTMENT_LIST_NTBL SCOTT
APPOINTMENT_LIST_OT PERSON_TBL
TREAT(SYS_NC_ROWINFO$ AS "SCOTT"."EMPLOYEE")."MAKES"
DEFAULT VALUE N
SQL> SY. -
Tables for previous emp exp and present.
Hi experts,
I created a view based on 2 tables i.e PA0023 - HR Master Record: Infotype 0023 (Other/Previous
Employers) and PA0000 - HR Master Record: Infotype 0000 (Actions).
But I am unable to get the records of employees who are freshers.
Bcz PA0023 does not hold freshers data.
Is there any table which holds both the Previous employers data as well as freshers data.
Regards,
Nishuv.hi
depends what freshers data you are wanting to update, there is no separate table for freshers employment data (as they are freshers) you can use the same infotype to store their apprentice ship details etc.......if you do not want the same to be counted as experience in some report that you may have developed for experience you may have to put a custom field for maintaining the same or configure the work/contract type here.
hope this helps.....or give more details
best regards -
Tables for following scheduling agreements and PR data
Hi All ,
Please can you tell me table names if I want the following information
1. Scheduling Agreement Created By, Amended By, Modified Date, Plant
2. Req Created by, Released by, Cost center, plant
Thanks in advance
VinayakTo view the fields listed in a table go to Tcode SE11 and enter the table name and execute
EBAN - Purchase Requisition
EBKN - Purchase Requisition Account Assignment
Req Created by Table:EBAN Field ERNAM
Released by- Table:EBAN Field FRGGR
Cost center- Table:EBAN Field FISTL (Funds Center)
plant-Table:EBAN Field WERKS
For Scheduling Agreements following are the tables:
EKEH - Scheduling Agreement Release Documentation
EKEK - Header Data for Scheduling Agreement Releases
EKET - Scheduling Agreement Schedule Lines
EKETH - Scheduling Agreement Schedules: History Tables
You will find the following list of fields in these tables:
MANDT Client
EBELN Purchasing Document Number
EBELP Item Number of Purchasing Document
ETENR Delivery Schedule Line Counter
EINDT Item Delivery Date
SLFDT Statistics-Relevant Delivery Date
LPEIN Category of Delivery Date
MENGE Scheduled Quantity
AMENG Previous Quantity (Delivery Schedule Lines
WEMNG Quantity of Goods Received
WAMNG Issued Quantity
UZEIT Delivery Date Time-Spot
BANFN Purchase Requisition Number
BNFPO Item Number of Purchase Requisition
ESTKZ Creation Indicator (Purchase Requisition/S
QUNUM Number of Quota Arrangement
QUPOS Quota Arrangement Item
MAHNZ No. of Reminders/Expediters for Schedule L
BEDAT Order date of schedule line
RSNUM Number of Reservation/Dependent Requiremen
SERNR BOM explosion number
FIXKZ Schedule Line is "Fixed"
GLMNG Quantity Delivered (Stock Transfer)
DABMG Quantity Reduced (MRP)
CHARG Batch Number
LICHA Vendor Batch Number
CHKOM Components
VERID Production Version
ABART Scheduling agreement release type
MNG02 Committed Quantity
DAT01 Committed Date
ALTDT Previous delivery date
AULWE Route Schedule
MBDAT Material Staging/Availability Date
MBUHR Material Staging Time (Local, Relating
LDDAT Loading Date
LDUHR Loading Time (Local Time Relating to a
TDDAT Transportation Planning Date
TDUHR Transp. Planning Time (Local, Relating
WADAT Goods Issue Date
WAUHR Time of Goods Issue (Local, Relating to
ELDAT Goods Receipt End Date
ELUHR Goods Receipt End Time (Local, Relating
ANZSN Number of serial numbers
NODISP Ind: Reserv. not applicable to MRP;Purc
hope this helps! -
Which privileges are needed to create workspace for using existing schema
Hi,
until now I always created new workspaces creating new schemas.
today I decided to use existing schemas. i created an user (default tablespace "users", with a lot of privileges (create any context, create table, etc..)
i tried to create a workspace.
now i got an error: no sufficient privileges for tablespace "users".
how to solve ?
LeoLeo, you might try altering your site preferences using the apex_admin app so that it doesn't try to install the sample/demo applications during workspace creation. Then repeat the provisioning attempt. If it works, then you'll know the error had something to do with sample/demo app creation in the schema. If it still gives you an error we'll know that too.
Scott
Maybe you are looking for
-
17.0.1 cookie problems that were not in 16.0.2
It used to be in the previous version 16.0.2, that I'm now thinking of going back to, that -: Tools, options, exception was a place that I could list all the cookies that I never wanted to see. I could find the cookies that I did not want by opening
-
Hi, I'm facing an issue related to the combinated use of transaction FB08 and FBRA. Actually I have to modify a custom program that is used for resetting and reversing payment document. The program asd been structured in a way in which it first uses
-
HID-Compliant Touchscreen Dell XPS 12
Hi, I have a Dell XPS 12. Recently, it was having problems with the network driver, causing me to reset the computer in an attempt to fix. It did fix the problem, however the touchscreen has completely ceased to function. The display is fine, but the
-
SAXParser.parse never returns!
I'm using sockets to transfer xml data. When I feed my InputSource (containing the xml document) into the SAXPaser.parse method I can see the events being fired correctly (ie: startDocument, characters, startElement,etc) apart from the endDocument ev
-
Printing from 10.5.6 to a Mac on ethernet network running 10.3.9
Hopefully someone will be able to help out with this problem - after upgrading our G5's to Leopard (10.5.6) we are trying to print to an Epson printer that is connected via USB to a G4 running 10.3.9 - the G4 and G5s are on an ethernet network and co