Help with Oracle Database XE edition tutorial

Hi,
I am a student and our instructor has told us to install 11g and now has us running through the 10g tutorial and I've run into a number of problems. There is one issue that I cannot find the solution for and was hoping that somebody could give me a hand.
The tutorial has us make a table. This works...
CREATE TABLE audit_record_tb1
user_value varchar2(25),
date_recorded timestamp(6)
Later on, we have to create a trigger that will write to the table when another table's values are updated. This one doesn't work. It gives an error stating 'too many values'
INSERT INTO audit_record_tb1
VALUES(SYS_CONTEXT('userenv', 'current_user'),
sysdate, :old.employee_id, :old.salary, :new.salary);
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-10001, 'audit trigger failure');
There has been no instruction to add columns to the audit_record_tb1 table and I am at a loss as to what the issue is at this point.
Thanks in advance for your help.

963729 wrote:
There has been no instruction to add columns to the audit_record_tb1 table and I am at a loss as to what the issue is at this point.Maybe the tutorial doesn't want you to insert 5 values into a 2 column table? Ok what is the tables task and what attributes are there?
It is named: audit_record_tb1. So the purpose is probably to track everything that was changed in some other table. The columns (=attributes) are: user_value and date_recorded.
Date_recorded clear is the data when some action took place (=sysdate). User_value could be the old value from some column or it could be the user who did the task.
As you noticed there might be some information mission. Like which column does the old value come from etc.
Of cause you could insert all this into the user_value column. Unfortunatly that is no a very large column (25 char).
You solution to add new columns is a good idea. The oracle documentation has the syntax diagrams to help you do this. It is a god idea to bookmark the documentation.
Homepage 11g: http://www.oracle.com/pls/db112/homepage
And the SQL Language reference: http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm
Another solution could be to insert each old value into a separate row.
Something like
INSERT INTO audit_record_tb1
VALUES(to_char(:old.employee_id), sysdate);
INSERT INTO audit_record_tb1
VALUES(to_char(:old.salary), sysdate);
...It is not needed to insert the new value. Why? because this value is still in the current record. And if that record is changed again the trigger will write another entry to the audit table.
Edited by: Sven W. on Oct 8, 2012 9:16 PM

Similar Messages

  • Connect Problems with Oracle Database Express Edition 11g Release 2

    Hello,
    I am a student trying to install Oracle Database Express Edition 11g Release 2 and SQL Developer on my home system, Win7 64Bit, in order to practice some things I've learned from me DBA class and Developer classes.
    Anyway, I have everything installed, but I am having difficulty connecting as SYS or SYSDBA in the 'Run SQL Command Line', I keep getting the ORA-01017: invalid username/password: logon denied.
    However, If i select the 'Start Database' I get this:
    C:\oraclexe\app\oracle\product\11.2.0\server\bin>
    and I can type sqlplus / as sysdba and it starts up just fine and show user lists me as "SYS".
    but if I go back to 'Run SQL Command Line' I still cannot connect as SYS or SYSDBA...I find this both confusing and frustrating. I don't know if I am in different instances or something like that, but I seem to be limited to connecting only as "SYSTEM". I need SYS because I want to practice creating datafiles, instances and things like that, but I seem to be lost.
    Also, I am trying to create a new DB connection with SQL Developer and I can only us SYSTEM for my login which, if I understand correctly, will limit my privileges. Again When I try to sign in with SYS or SYSDBA I get error'd out. When I installed Ora11gDBExpress I was prompted in input a single password that was supposed to grant me access as SYS or SYSTEM, but I am limited to only SYSTEM for some reason.
    So, I am looking for help/guidance as to what to do.
    Thanks in advance for any and all help,
    Warren

    General rule of thumb, don't use sysdba unless you want to shut down the database, or grant a database user privileges on a sys object.
    A SYSTEM connection is not "limiting", it has the DBA role which means a user with a system connection can do most anything needed, including select/update/delete/drop any user's objects as well as change parameters in the instance.
    The system user can indeed add datafiles, tablespaces, etc. The instance and database should already be created as long as the installer completed all its chores correctly. For XE, per the license agreement only one instance can run on one host. If you want to try creating a database, it will require shutting down the XE instance and creating a new database service, creating the database, and installing the system catalog and any other optional components desired. Good practice indeed, but a bit advanced for the new user.
    Do create users for schemas ... connect system; create user <username> identified by <password> and connect <username> for the schemas (a collection of objects) within the database. Grant the resource and create session privilege to <username> to allow the database user the ability to create tables, indexes, stored procedures, etc.
    There is no "or" in a sys as sysdba connection, from 10g onwards a sys connection requires using the sysdba privilege. To enable a sysdba connection, add your host user to the ORA_DBA group on the host. To verify the OS users in the ORA_DBA group, this might work for win7, in a cmd box ...
    $ net localgroup ora_dba
    ...If your OS user is in the ora_dba group the sys as sysdba password is not relevant, you can in fact type anything for a password. If you wish to connect with the sysdba privilege from a remote client, that is a bit different and requires knowing the password set in the instance password file. Which should be set the same as the system password defined in the installer, but you can change that by creating a new password file. Another slightly advanced topic.
    In Windows IMHO its better to leave the listener and database set to Manual start (in the services applet, Start/Run/services.msc) and start the listener, then the database, when its needed. At least for an XE instance, as its intended for practice and learning RDBMS management.
    Edited by: clcarter on Mar 2, 2012 6:19 PM
    fix typos

  • Problem with Oracle database Express Edition (Linux)

    I installed oracle-xe on my machine (ArchLinux x64), and all worked fine before a  reboot. After it, I still can connnect to the db with sqlplus, but can't connect to apex (http://localhost:8080/apex/f?p=4950) and can't get a connection using ojdbc:
    Exception in thread "main" java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection.
    I tried to reinstall the db several times, but the result was always the same: all is ok only before rebooting. I'm a newer with Oracle database and can't find a solution. Could you give me some tip about it?

    The problem was solved by changing permissions for log directory :
    sudo chmod -R 777 /usr/lib/oracle/product/11.2.0/xe/log

  • I need some serious help with Oracle Database....PLEASE!!

    I am using Microsoft Virtual PC 2007 that has Oracle Database 10g and Wondows XP installed on it.
    Database instance is DOWN but that is not the problem
    Listener is UP
    Agent Connection to Instance is DOWN, and I cannot get this running!
    How can I fix this problem? I am not an expert, but I have been trying for a long time to fix this issue, but I can't. It just came to the point that I want to grab my pc and throw it across the room.
    Error message: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)
    Here is my LISTENER.ORA file:
    # listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.109)(PORT = 1521))
    Here is my TSNNAME.ORA file:
    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.109)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    Once again, I am not an expert, so please try to explain it as simple as possible...I know, I am an idiot when it comes to networking issues.
    if you guys need some more information, just let me know!
    Thank you!

    What I mean is that I can get the Instance UP with no problem, but the Connection with the Instance is the problem.
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>lsnrctl service
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-NOV-2009 21:38
    :06
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:144 refused:0 state:ready
    LOCAL SERVER
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "D000" established:0 refused:0 current:0 max:1002 state:ready
    DISPATCHER <machine: PAOLOSCAMARDELL, pid: 2576>
    (ADDRESS=(PROTOCOL=tcp)(HOST=paoloscamardell)(PORT=2307))
    Service "orcl_XPT" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:144 refused:0 state:ready
    LOCAL SERVER
    The command completed successfully
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>lsnrctl status
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-NOV-2009 21:52
    :03
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
    ction
    Start Date 25-NOV-2009 11:50:27
    Uptime 0 days 10 hr. 1 min. 39 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File C:\oracle\product\10.2.0\db_1\network\admin\listener.o
    ra
    Listener Log File C:\oracle\product\10.2.0\db_1\network\log\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.109)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orcl_XPT" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfully
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>

  • Primavera certification with Oracle database enterprise edition

    Is Primavera (PPM) v8 certified for Oracle database 11g? Where do I find the certification matrix. Metalink does not seem to have certification information for database.
    Thanks,
    Caiping

    Yes, R8 is supported on 10Gr2, 11Gr1, 11Gr2.
    For the complete documentation see: http://download.oracle.com/docs/cd/E17266_01/English/Tested_Configurations/Tested_Config_R8.zip

  • Installing SQLDeveloper with Oracle Database Express Edition 11g Release 2

    Hello,
    I have a problem with sqldeveloper in connecting to the database with the following message:
    *"java.lang.unsatisfiedlinkerror oracle.jdbc.driver.t2cconnection.t2csetsessiontimezone"*
    I can connect to the database via SQL / SQLPLUS. I cannot select from the dual table.
    My machine is windows 7 - 64 -bit. I downloaded SQLDEVELOPER for 32-bit.
    Thanks.
    Jaffee

    I downloaded the version without the JDK, because I already had Java on my machine. I will try with the JDK included.
    New update: I download the version with the JDK. I recevied the same message. Do I need to delete the first version of Java?
    Thanks.
    Jaffee
    Edited by: Jaffee2 on Jul 24, 2012 11:50 AM

  • How Users Interact with Oracle Database Express Edition in a Network?

    Please i just want to know how users can relate or access the Oracle DB xpress on a network. Coming from an oracle enterprise edition background i know when you install oracle on a network, isqlplus for example is centrally loaded meaning you dont need to install oracle on each machine in the network, so users can access the DB from their nodes. I am presently working in a big estate management firm and i want to create a structured database for them, they use excel to store records and want to introduce Oracle.

    You can access XE remotely through the browser after following the instructions here:
    http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/network.htm#BHCBCFBA
    If you are using APEX as the application, you'd need to do that. There may be other firewall consideration though (ie opening the relevant server ports).
    [There's no isqlplus anymore, but there is a similar sql worksheet in the Apex development environment).
    If you are just using the database as a data store behind, for example, a Java application, then connections will probably be through ODBC/JDBC/OCI and probably need some client installation too.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Upgrade oracle database express edition

    good morning
    i've a question i'm working with oracle database express edition but now the memory is full and i want to upgrade it to oracle enterprise edition but i don't know the steps please can you help me in this
    best regards

    I've a question i'm working with oracle database express edition but now the memory is full and i want to upgrade it to oracle enterprise edition Hi,
    Not to dissuade you from that, but that's quite a leap from XE to EE, are you sure that SE One or SE would not be a 'better option' for you?
    Also, by 'memory is full', I assume you mean you've reached the 4Gb data limit?

  • Database Web Services and OC4J in Oracle Database Standard Edition

    Hi all,
    Oracle Database Standard Edition has database web services, which require OC4J if the database is to be used as web service provider. So, can OC4J be used in production with Oracle Database Standard Edition?
    Thank you for this clarification :)
    Mitko

    Yes. :)

  • Creating a Database with Oracle 10 Express Edition

    Hello,
    I had installed Oracle Database 10g Express Edition whith linux, fedora core 4.
    I want to create a new database with Oracle 10g Express Edition. How can i do this?
    I know that Orcale 10g express edition have only one Database which is installed by default sid 'XE', but my database must have another name.
    Thanks.

    Really you need to change database name ?
    Oracle 10g Espress Edition and change ORACLE_SID

  • Downloading Oracle Database Express Edition

    Hi everyone. I just downloaded the freeware Oracle Database Express Edition without any apparent problems. However, when I attempt to go to the Express Edition Homepage, which is location http://127.0.0.1:8080/apex,
    I get the message that my Internet Explorer cannot display the webpage. (It can, however, display other pages.) I cannot understand why this is the case since I successfully added Web site 127.0.0.1 in my Control Panel (as specified in the instructions.) Also, the instructions stated that HTTP port 8080 was the default port, unless my system said that this was not available (which it did not.) I also tried rebooting, which did not make a difference. Help!
    Thanks,
    Jason

    Hi,
    Use this forum to report problems with or suggestions for the download.oracle.com service or content.
    Please post your question in the appropriate forum for a better/faster response.
    Database - General
    General Database Discussions
    Thanks,
    Hussein

  • Localhost 127.0.0.1(oracle database express edition)

    hi all,
    i finished installing the oracle database express edition,checked the "launch the database homepage" , i still could not load the database homepage,the message i keep getting is "internet explorer cannot display the page" and i tried it on firefox i got the same message. the two browsers have the url :http://127.0.0.1:8080/apex.
    kindly help me out with this.

    please check the IP address .. looks like you IP is wrong
    --Girish                                                                                                                                                                                           

  • Unable to start Oracle Database Express Edition (XE) on window 7 - 64 bit

    I installed Oracle Database Express Edition (XE) on a WINDOWS 7 - 64 bit machine. I tried "Get Started" and http://localhost:8080/apex. It does not start/connect of anything. Please help.
    Thanks.
    Debbie

    I received the following message from lsnrctl status
    and sqlplus / as sysdba.
    C:\>lsnrctl status
    LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 20-JUL-2012 17:09
    :16
    Copyright (c) 1991, 2010, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 2: No such file or directory
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MW777SXH4ITNY4.dir.svc.a
    ccenture.com)(PORT=1521)))
    TNS-12545: Connect failed because target host or object does not exist
    TNS-12560: TNS:protocol adapter error
    TNS-00515: Connect failed because target host or object does not exist
    32-bit Windows Error: 1004: Unknown error
    C:\>sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.2.0 Production on Fri Jul 20 17:10:04 2012
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    SQL> select sysdate from dual
    2 /
    SYSDATE
    20-JUL-12
    SQL>
    Does this mean I am up and running? I selected from dual. I will continue to play with the DB.
    If I download SQL Developer, should the version be for 32-bit or 64-bit for PC - Windows 7 - 64 - bit?
    Thanks.
    Edited by: 893328 on Jul 20, 2012 2:58 PM
    Edited by: 893328 on Jul 20, 2012 2:58 PM

  • Oracle Database Express Edition - install on WIndows XP laptop

    I downloaded the Oracle Database Express Edition to my Lenovo T61 laptop - Windows XP professional, execute the setup.exe and load the software fine. When I press the Finish button on the final dialog, the Oracle Database 11G Express Edition Install Wizard is highlighted in the task bar, as if it is awaiting a response from a prompt. The Oracle Database 11G Express Edition option appears in the Start|Programs with the following sub-options: Backup Database, Restore Database, Start Database, Stop Database, Get Help, Get Started, and Run SQL Command Line.
    The Get Started option doesn't seen to do anything. This is the third time I've re-run the setup program, as i thought perhaps the Ad-Aware spyware program was blocking the Finish process.
    Any help would be greatly appreciated. Thank you, in advance, for your help.
    James

    Hello James,
    Windows XP professionalI assume you use the 32bit version?
    Are you logged in with administrative privileges?
    When I press the Finish button on the final dialog, the Oracle Database 11G Express Edition Install Wizard is highlighted in the task bar, as if it is awaiting a response from a prompt.Seems as if it's hanging at that point. Could you check whether the Oracle Services the installer created are up and running? Taking you other comments on "Get Started" into account, I wouldn't think so.
    In that case, you should start digging for errors in the log files created during your installation.
    -Udo

  • Oracle Database Express Edition 11g Database home Page is not Displaying

    As I am Java Developer and wanted to do JDBC connection for Java.....
    So I Have Installed Oracle Database Express Edition 11g......
    But the home page on url...http://127.0.0.1:8080/apex/f?p=4950
    is Not Working.....
    I am Using Windows Xp....SP 3.....
    Help Me for this....
    Thanks & In Advance.....
    Jugal Thakkar

    972423 wrote:
    As I am Java Developer and wanted to do JDBC connection for Java.....For Java, JDBC and JDeveloper related discussions, you'll find plenty of forums:
    https://forums.oracle.com/forums/category.jspa?categoryID=285
    https://forums.oracle.com/forums/category.jspa?categoryID=500
    So I Have Installed Oracle Database Express Edition 11g......
    But the home page on url...http://127.0.0.1:8080/apex/f?p=4950
    is Not Working.....Just installed? Never worked before? Unreachable 'Get Started' page usually indicates that install was not completely successful, database creation failed because of OS misconfiguration.
    Before even trying that url you should see a endpoint with port 8080 in Endpoints summary from lsnrctl stat command.
    Use search and have a look through previous threads for this FAQ.
    E.g. https://forums.oracle.com/forums/search.jspa?threadID=&q=%2Bpage+%2B4950&objID=f251&dateRange=thisyear&userID=&numResults=15&rankBy=10001

Maybe you are looking for

  • How to configure Oracle 10g to use 4GB memory

    I'm trying to configure Oracle 10g to use >4GB memory. Have configured server boot.ini with required flags (/3GB /PAE). Rebooted server then created standard database, then connected to db instance and changed oracle parameters DB_BLOCK_BUFFERS, USE_

  • How to test system down in XI? Kindly help!

    Hi Experts,     I have a JMS -> XI ->SAP R/3 scenario.     If the remote SAP R/3 is down then I have to trigger an alert.     In the runtime workbench, i have configured the alert in Alert Configuration.     In this I have given the alert category, r

  • Help with Spry Menu Bar 2.0 customization

    I am having trouble converting my original Spry menu to version 2.0. On my website http://bucknellprimaryschool.org/ the 'old' menu system works just great but not in iPads (ie the sub menu does not pop out). I discovered hat Spry 2.0 does work but I

  • BOE Downloads - Can't See Next Page

    When I go to Business Objects > Business Objects Downloads and enter my criteria, if there is more than one page of results, I cannot go to the next page.  I click the next page button, but the results disappear.  This occurs even if I try to sort or

  • ICR Process 2 - Parallel Recon by Trading Partner (TP) and TP Profit Center

    Experts, At my current implementation, I would like to reconcile accounts (Process 2) by trading partner, and also by trading partner profit center, essentially reconciling the same data for a period in two different ways. Instead of reconciling data