How to Create A new Database in the oracle 10g XE

i have oracle 10g XE i tried to create a new database but its giveing me error when i execute the sql command that is create database testDatabase how to create a new database in oracle 10g XE

Hi there 785434,
(This is a generic SQL question relating to Database Triggers, please post future questions of this type into the relevant forum area.)
Moderator, please move this if able
I use Before Update and Before Delete Triggers to record a 'snapshot' of the row being changed in my applications.
Example:
CREATE TABLE TEST
DATA VARCHAR2(64 CHAR),
CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
CREATED_DATE DATE NOT NULL,
CHANGED_BY_USERID VARCHAR2(20 CHAR),
CHANGED_DATE DATE
LOGGING
STORAGE
(MAXEXTENTS UNLIMITED);
CREATE TABLE TEST_HISTORY
DATA VARCHAR2(64 CHAR),
CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
CREATED_DATE DATE NOT NULL,
CHANGED_BY_USERID VARCHAR2(20 CHAR),
CHANGED_DATE DATE,
CHANGE_DESCRIPTION
NOLOGGING
STORAGE
(MAXEXTENTS UNLIMITED);
CREATE OR REPLACE TRIGGER TRG_BU_TEST
BEFORE UPDATE ON TEST FOR EACH ROW
BEGIN
INSERT /*+ append */ INTO TEST_HISTORY
(DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
VALUES
(:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'UPDATE');
END;
CREATE OR REPLACE TRIGGER TRG_BD_TEST
BEFORE DELETE ON TEST FOR EACH ROW
BEGIN
INSERT /*+ append */ INTO TEST_HISTORY
(DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
VALUES
(:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'DELETE');
END;
Using triggers like this will record who made an update or delete to the database and record the row before it was changed.
Note that this method might not be suitable for very high transaction rates.
You will need to 'clear' these history tables as part of routine maintenance.
Hope that this Helps.
Ronald.

Similar Messages

  • How can i create a new database instance in oracle 10g express edition?

    hello everybody
    i'm a student
    i am developing a database application
    i'm using oracle 10g express edition
    to run my application i need to create another database instance
    but i didn't find any option for doing so in that product
    if there is pls tell me where it is?
    if not pls tell me how to manually create it?
    regards,
    Chaitanya

    Chaitanya Babu M wrote:
    yaa i'm sure about that .
    i want one more instance of database.Can you perhaps explain why? I have a fair share of production and development servers - and not a single one of them needs to run more than one database instance.
    So I'm interested in what requirement you are trying to satisfy by using two database instances on a single platform.
    Oh yeah - if you want to create a custom XE instance (different SID, different tablespace sizes, more/less PL/SQL stuff installed, hack standard), make a copy of your XE db creation script (in your XE's +$ORACLE_HOME/bin+ and called createdb.sh ) and modify that for your needs.
    PS. even with a different SID, only a single XE instance can be run at a time - you can however have 2 different ones defined and then use one at a time (e.g. testing international settings, init param differences, etc.)

  • How to create a new ASM Diskgroup in Oracle 10g RAC?

    Hi,
    Our env is Oracle 10g R2 RAC on HP-UX. I want to create a new ASM Diskgroup. Please let me know if the following steps are ok to create a new ASM Diskgroup.
    1. Ensure the new Disk is visible in both ASM instances in RAC (v$asm_disk) and the header_status is 'CANDIDATE'
    2. From Node 1 ASM Instance issue the create diskgroup command.
    SQL> create diskgroup DATA2 external redundancy disk '/dev/rdsk/c4t0d5';
    3. Query v$asm_diskgroup and make sure the Diskgroup is created.
    4. Mount the DATA2 Diskgroup from Node 2 ASM Instance.
    5. Query v$asm_diskgroup and make sure the Diskgroup is visible from Node2 ASM instance.
    6. Ensure the header_status is 'MEMBER'.
    Rgds,

    correct.
    instead of using device file '/dev/rdsk/c4t0d5' you can create an alternate device file using mknod, which is called "asm_disk_xg" for example.
    check here: http://download.oracle.com/docs/cd/B19306_01/install.102/b14202/storage.htm#CDEECIHI
    hth

  • How to create a new database in SUP

    Hi,
    Iam using SUP 2.1 ESD#1 licensed version
    How to create a new database other than the default sampleDB.
    Thanks,
    B.Ushasri

    Hi B.Ushasri,
    This is actually pretty easy.
    1) open the Unwired Workspace (SDK in eclipse).
    2) Bottom right, add a new Database connection with the following details:
               Sybase ASA v12.x,
               host=Your Sup box,
               port=5500,
               user=dba
               password= Your password (default = dba)
    3) Once you connect successfully, right click on the connection and choose the "Create database" option.
    That should do it for you. It is the same connection as the sampleDB connection so if you already have that defined then its a simple, right click on it once connected and hit create database.
    Hope that helps,
    Brenton.

  • How to create a new folder within the video folder in media

    Hi, I'm trying to figure out how to create a new folder within the video folder in media. I can easily create new folders within the pictures folder but not in videos.....Why??? Thanks in advance for your help.
    Message Edited by dany_s on 06-25-2009 03:58 PM
    Solved!
    Go to Solution.

    Hello,
    I think you can try two things : the soft reboot, and if it does not work, the hard reboot. Don't worry, you can't lose data with these two reboots.
    Soft reboot :
    1) Hit the three following keys at the same time :
    - Alt
    - Right Shift
    - Delete
    2) wait 2 minutes for the Blackberry to wake up.
    Hard reboot :
    1) your Blackberry device is on
    2) remove the battery and wait for a minute
    3) Put the battery back
    4) wait 5 minutes for the device to wake up.
    Please tell us if it works for you.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • How to create a new folder at the specified FTP location

    Hi everyone,
    Please guide me for the following query:
    How to create a new folder at the specified FTP location if the folder does not exists at that location through ABAP program.
    Please guide.
    Thanks and Regards
    MP

    Have a look at the function group SFTP. Use function module ftp_command to create the directory sending the mkdir command.
    Use the where-used list to find sample programs.

  • How to create a new admin user in oracle 9i?.

    Hi I am new to oracle. I want to set up a new database for my application.
    How to create a new admin user in oracle 9i?. I would like to have a new schema. where I can create tables for my application from scratch.

    If I understand your question correctly:
    You need to be connected to the database with the user SYS.
    open a command-line session and do the following to create an Oracle user with DBA option other than SYS.
    C:\>sqlplus /nolog
    SQL*Plus: Release 9.2.0.1.0 - Production on Fri Oct 14 08:46:13 2005
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    SQL> conn  /  as sysdba
    Connected.
    SQL>
    SQL> create user test identified by pass;
    User created.
    SQL> grant create session to test;
    Grant succeeded.
    SQL> alter user test account unlock;
    User altered.
    SQL> grant dba to test with admin option;
    Grant succeeded.
    SQL> conn test/pass
    Connected.
    SQL>
    SQL> sho user
    USER is "TEST"
    SQL>Now you have a user with username 'test' and password 'pass' with DBA role with Admin option
    Tony Garabedian
    From now on you can connect directly with SQL*Plus no need for comman-line. Just provide the username/password and you're logged in.
    Message was edited by:
    Tony Garabedian

  • How to create a new DataBase using Oracle 10g Express Edition???

    Hello, I am new to Oracle, I am used to Microsoft SQL Server (Enterprise Manager).
    Here in Oracle I do not get how do I create a DataBase, and then create tables on it.
    could anyone please explain to me how to do it?

    A SQL Server database is roughly equivalent to an Oracle schema.
    You should rarely need to create a new database. If you do need to create a database, get a 'for fee' edition of Oracle and use the dbca tool (Database Configuration Assistant) to do that. In fact, you are only allowed to have one XE database on the machine.
    However, you can create as many schemas in an existing Oracle database as you need. (One schema, owned by userid SYS, is roughly equal to your 'master catalog'.)
    You can create other schemas simply by
    1) creating a userid that will own the schema (one designated for maintenance of the schema);
    2) grant that userid appropriate privileges, such as 'CREATE TABLE', 'CREATE VIEW' as shown in the SQL Reference manual under the GRANT section;
    3) provide that userid with a quota in one or more tablespaces (see the CREATE USER command in the SQL Reference manual);
    4) create the objects, such as tabels, views, sequences, stored procs and functions, etc. (as in the SQL Reference manual);
    5) create the users who will access the objects, and grant them the CREATE SESSION capability (as in the SQL Reference manual);
    6) grant access (select, update, execute, etc.) on the schema objects to these users (as in the SQL Reference manual);
    7) if desired, create synonyms on the schema objects so the users do not need to use fully qualified syntax such as "SELECT col FROM schema.table;" (as in the SQL Reference manual).
    In case you are interested in looking at the SQL Reference manual, it can be found at http://www.oracle.com/pls/db102/portal.portal_db?selected=1 ;-)

  • How to create a new database and use it?

    Hi there,
    I have so many tables in the current database that i'm working on. When i start to create a new table such as employee, student, person...etc it doesnt allow me to create them becuase it says the tables exists. Even when i use the drop command to drop the tables, doesn't help. So most of the time i have to create a table with postfix of 1, 2 to the table name.
    Therefore i need to create a database for every project that i do.
    How do i create a new database?
    Then how do i use the database that i just created?
    Then how do i find the out whats the database that i'm currently working on?
    Thanks!
    Message was edited by:
    dingdong
    Message was edited by:
    dingdong

    A database is a physical set of files that contains many schemas. Each schema has a one to one relationship with database users, so to create a new schema you create a new database user.
    e.g.
    CREATE USER fred IDENTIFIED BY fredspassword;Then, by logging on as fred you can create all the new tables you like as that user, in that users schema.
    If you create a new database then you will find you cannot access functions/procedures, packages, tables etc. that exist in another users schema without creating a database link to the other database that contains them.
    If you just create a new schema, you can more easily get at other users schema objects (tables, packages etc.) by referencing them with the users name e.g. JOE.TABLE1 providing that user has given permission for your user to access them. You can also create synonyms that allow you to reference other users schema objects as if they exist in your own e.g. you can have something called TABLE1 in your own schema that is in fact referencing JOE.TABLE1.
    Message was edited by:
    BluShadow
    remove quotes from password. oops! thanks padders

  • How to create a new database using Enterprise manager?

    hi all,
    thank you for all your support. i want to create a new database . I tried following these steps
    i am using Oracle 9i and windows XP
    1, opened the enterprise manager by clicking from programs
    2,selected launch standalone Application
    3, from the tree i expanded the network node and expanded the databases node ,now i can see the globaldatabase i created during installation . i can login that database using systems and manager (username & password )
    4, clicked the new database icon from the window , a small window with node named database appeared
    5 , I tried to expand that by clicking on the database node ,but it pops up a new window showing no active session selected
    I would be grateful if anyone can suggest a solution for this
    thanks & regards

    Hi,
    How can i access DBCA
    start ---> run ---> DBCA <<hit enter>>
    or
    start ---> program ---> oracle home ---> configuration tools ---> database configuration assistant.Regards
    Mohammed Taj
    http://dbataj.blogspot.com

  • How to create a new database

    hi
    I am not able to create a new database other than the one created during the installation. i am using the oracle 9i client. i am able to create new database from the enterprise manager console,add a database manually but not able to connect to the new database.Can any one help me in solving this problem
    Thanking you in advance
    Dinny

    Hi
    I am using the client and in the sever i have created a new database other than the one created during the installatiom. i have installed the standalone in the server and not the management server. From my client machine iam able to connect to the database created in the server during the installation but not to other databases that i have created in the server from the Add database to tree option in oracle enterprise manager. It is showing insufficient privilage.So can can i get the previlage ? where to set these options ?
    Thanking you in advance
    Dinny

  • How to create a single executable file in oracle 10g

    hi all
    i am a fairly new user to oracle. i would like to know if there is any way that i can compile both the database and forms that i have created, using the oracle 10g developer suite, into a single executable file and be able to install it on another system without installing the development environment?
    can anyone please help
    thanks in advance

    Hi there
    The forum software was upgraded a few months back and many links to older content were lost.
    There are possibly a few different things you need to do. First, click Project > Skin > Borders tab and DE-select the "Show Borders" check box. That will eliminate the _skin.SWF from the mix. If you have full motion clips you may need to take other steps.
    Also note that while turning off the borders eliminates the _skin.SWF, it also has the side effect of coaxing the the playback controls up onto the main part of the presentation. If you don't like this, you need to resize the movie to make room for the playback controls to be placed into its own area.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Problem during new database setup in Oracle 10g

    Hi All
    I have been trying to create a database in Oracle 10g but due to certain reasons i havent been able to create the same. I have been getting the below given error while the creation, *"Cannot create the Directory d:\oracle\admin\ORACLE_SID\bdump"*. This is due to the fact that i created the same database before but deleted using the non sys account and again create a same database overwriting the files. Then again deleted the same database with sys account, but now when i am creating the database i am getting the above error.
    Anbody knowing the solution for it, please help as i need to resolve this issue as soon as possible.
    Regards
    Deep Jyot Singh

    I can still see the directory d:\Oracle\admin\ in the directory....
    Yeah reboot is the last option that I am going to do now.....will let you know of the status..... thanks.....

  • How to create a new database instance from an existing one?

    Hi, I basically want to create a snapshot of a production
    instance (version 8.1.7) for querying purposes. Would anyone
    tell me the steps involved? What I did as follows:
    1. Copy all data files to a new location
    2. Modify init.ora accordingly. I believe there is no separate
    control file for this version.
    But when I startup the instance, got this error:
    ORA-01103: database name 'TRITON' in controlfile is not 'HERCULE'
    What is missing? Do these data files contains links to the
    previous instance name?
    Thanks for any help.

    Hi All,
    I need some help in recreating new database instance.
    Here are the steps I have done so far:
    1. Created a database with name 'LASTDB' using DBCA
    2. Connected to RMAN.
    3. RMAN>SET DBID=******; (of the source database)
    4. Connect to target. RMAN>connect target SYS/*****;
    5. Executed controlfile restore on RMAN.
         RMAN>Run{
    Allocate channel D1 Type DISK;
              Set controlfile autobackup format for device type DISK to
    ‘\\<ip_address>\Backup\Prod\%F’;
    Restore controlfile from autobackup;
    6. RMAN> ALTER DATABASE MOUNT;
    Now got an error saying ORA-01103: database name ‘PRODDB' in control file is not ‘LASTDB’
    I tried using NID to change the database name but it's throwing an error that database is not mounted.
    I have browsed a lot and found that I need to recreate a control file of the production database using ALTER DATABASE BACKUP CONTROLFILE TO TRACE and should edit the trace file. But it also says to shutdown the source database which is production database and I cannot try that.
    Also I have tried adding a line to init.ora like lock_space_name = LASTDB. Also tried replacing everything from LASTDB to PRODDB but that didn't work either.
    I have been trying to find a solution to this. Please bear with me as I'm a beginner and please let me know how I can fix the error.
    I am running oracle 10.1.0.2.0 enterprise edition on windows 2000.
    Thanks for your patience,
    KG

  • How ro create a new database ?

    hi friends
    i logged in to the oracle enterprise manager . using the Global database name and scott and tiger . How can i create a new databse using enterprise manager
    i am using ORACLE 9i
    thanks & regards

    Duplicate post - How  to create a database ?
    Probably you need to go through the concepts to find out what database, schema means. I assume you must be from SQL Server background.
    Or did you want to know how to create a table?

Maybe you are looking for