Home » Other » Training & Certification » Oracle XE 11g & Demo Schemas (HR and OE) (Oracle XE 11g / Vista)
Oracle XE 11g & Demo Schemas (HR and OE) [message #560322] |
Thu, 12 July 2012 01:50 |
|
jtschramm
Messages: 21 Registered: June 2012 Location: Tracy, CA
|
Junior Member |
|
|
So I've installed Oracle XE 11g in order to prepare for the OCA SQL exam. Can anyone tell me how to invoke (enable, launch) the HR and OE demo schemas? My understanding is that I installed them along with Oacle XE 11g, or that I can install them via scripts. I'd like to be able to run queries against these databases and tables.
Thanks, in advance.
Cheers,
John Schramm
|
|
|
|
|
|
|
|
Re: Oracle XE 11g & Demo Schemas (HR and OE) [message #560786 is a reply to message #560763] |
Tue, 17 July 2012 02:36 |
|
jtschramm
Messages: 21 Registered: June 2012 Location: Tracy, CA
|
Junior Member |
|
|
Hi Matthew:
Thanks for your reply. I checked the thread and these are the documents I previously found. I'm not sure what to do with the scripts, and I don't have all the scripts listed in the documentation.
I went through the Getting Started guide again on another PC. This time, when I created the hr_apex workspace, and then went into Application Express, I was pleased to see that I have the HR tables, but no OE tables. I went back to SYSTEM signon and tried to create oe_apex user, but I do not have OE.
I think part of my confusion is getting all the users and workspaces straight. We have to unlock the HR and OE users, but then we create workspaces (which are like users), and then we will see the tables (if we've created them).
Am I heading down the right path? I really appreciate your help.
Cheers,
John
|
|
|
Re: Oracle XE 11g & Demo Schemas (HR and OE) [message #560818 is a reply to message #560786] |
Tue, 17 July 2012 05:01 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
What does Application Express have to do with the whole story? Are you SURE you need it? Terms you mention ("workspace", "oe_apex user" look very suspicious to me). You really do NOT need Apex to work with SQL and PL/SQL. If I'm wrong, you'll certainly say so and explain what you are really trying to do.
From your initial post, I understood that you installed 11g XE database in order to prepare for an exam. A book you have refers to some sample schemas: HR and OE. If that's so, here's a walkthrough for you. I'm connected to my 11g XE database as SYS (a note: yes, I know, "never use SYS, it is special, ..." etc. but it'll do the job just fine for now):
M:\>sqlplus sys@xe as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Uto Srp 17 11:50:03 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
Let's check users I currently have:SQL> select * from all_users order by username;
USERNAME USER_ID CREATED
------------------------------ ---------- -------------------
ANONYMOUS 35 27.08.2011 08:37:13
APEX_040000 47 27.08.2011 08:56:17
APEX_040100 48 25.10.2011 08:58:12
APEX_PUBLIC_USER 45 27.08.2011 08:56:17
CTXSYS 32 27.08.2011 08:36:19
FLOWS_FILES 44 27.08.2011 08:56:16
HR 43 27.08.2011 08:55:19
MDSYS 42 27.08.2011 08:41:10
OUTLN 9 27.08.2011 08:20:54
RADNI 52 25.10.2011 11:50:23
SYS 0 27.08.2011 08:20:52
SYSTEM 5 27.08.2011 08:20:52
XDB 34 27.08.2011 08:37:13
XS$NULL 2147483638 27.08.2011 08:40:49
14 rows selected.
SQL>
Fine! HR is here, OE is missing. Matthew posted a link to an OTN Forums discussion where one of participants posted a link which enables you to download sample schemas. The file is named "sample_schema_scripts.zip". Download it, extract files into the same directory that is "current" when you open command prompt. In my case, it is root of the M: disk:SQL> $dir oe*.*
Volume in drive M is file sharing 1
Volume Serial Number is 98A9-A7AE
Directory of M:\
13.11.2008. 12:34 9.845 oe_cre.sql
13.11.2008. 12:42 2.338 oe_main.sql
13.11.2008. 12:11 2.508 oe_p_cat.sql
13.11.2008. 12:12 67.741 oe_p_cus.sql
13.11.2008. 12:12 42.411 oe_p_itm.sql
13.11.2008. 12:12 21.860 oe_p_ord.sql
13.11.2008. 12:13 85.879 oe_p_pi.sql
7 File(s) 232.582 bytes
0 Dir(s) 458.272.768 bytes free
SQL>
If you open (in any text editor) OE_MAIN.SQL, you'll see that you should connect as SYS or SYSTEM and run this "main" script (which will then call other scripts and create the OE schema). OK, let's do it. When prompted, provide SYS' password.
SQL> show user
USER is "SYS"
SQL> @oe_main
Enter value for sys_password:
<snip>
1 row created.
Commit complete.
SQL> Let's check what we've done:SQL> show user
USER is "OE"
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
CATEGORIES TABLE
CUSTOMERS TABLE
INVENTORIES TABLE
ORDERS TABLE
ORDER_ITEMS TABLE
PRODUCT_DESCRIPTIONS TABLE
PRODUCT_INFORMATION TABLE
WAREHOUSES TABLE
8 rows selected.
SQL> select count(*) from orders;
COUNT(*)
----------
105
SQL>
Seems to be OK.
Now, try to do what I did.
|
|
|
|
|
|
|
|
Re: Oracle XE 11g & Demo Schemas (HR and OE) [message #560919 is a reply to message #560913] |
Tue, 17 July 2012 14:56 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Great, I'm glad you made it!
As of me & Apex: I like it very much. As Matthew, I developed a few applications (but I'm quite sure that mine are not that sophisticated, not even close - I'm still learning and that process will take time). I just think that one (you) should FIRST learn how to properly use SQL. Then, the next step is PL/SQL - you'll use both of these in Apex all the time. OK, Apex is supposed to let newbies create "applications", but if you want to adjust something, add certain advanced features - you MUST know (PL/)SQL.
As of SQL*Plus vs. SQL Developer: both tools are used to access an Oracle database. In SQL*Plus, there are a few simple commands you'll master in a matter of hours - rest of the time, you'll learn SQL. In SQL Developer, you first have to learn how to use that GUI properly, i.e. know the consequences of "clicking here" and "clicking there". Slip of a finger and your table is history. In SQL*Plus, you need to literally TYPE that command, letter by letter: DROP TABLE EMP. You won't do that accidentally - you have to KNOW what every command you type is doing.
Therefore (although some people will disagree, but I'm quite sure that some will agree) - perhaps you'd rather use SQL*Plus first. Then, when you learn SQL, you can use SQL Developer (or any other GUI) to significantly improve your job (above all - you'll be much faster).
|
|
|
Re: Oracle XE 11g & Demo Schemas (HR and OE) [message #561086 is a reply to message #560919] |
Wed, 18 July 2012 14:25 |
|
jtschramm
Messages: 21 Registered: June 2012 Location: Tracy, CA
|
Junior Member |
|
|
Hi Littlefoot:
I am actually pretty comfortable with SQL. I took the Orcale course (Database Design and SQL Programming). Now I am just reviewing so I can take the SQL (OCA exam), and then I want to take the Admin (OCA) exam, and earn my OCA. We used APEX for the course, so I am used to that. My study book recommends SQL Developer and SQL*Plus, and says the same as you and Matthew -- that SQL*Plus is a bit old school and SQL Developer has some challenges.
It looks like it's difficult to find SQL*Plus for download. SQL Developer does have the command interface, as I agree that it is better to type the actual commands than to depend on GUI, for studying and as a matter of practice. Do you know a good place to get a download?
I do want to learn PL/SQL, but I am also trying to get that first job. It seems like someone new would be better to try for a junior admin job for some experience, and then learn application skills. Either way, I am focusing on SQL and Admin 1 right now.
Thanks, again!
Cheers,
John
|
|
|
|
|
|
|
|
|
|
|
Re: Oracle XE 11g & Demo Schemas (HR and OE) [message #561155 is a reply to message #561145] |
Thu, 19 July 2012 02:53 |
|
jtschramm
Messages: 21 Registered: June 2012 Location: Tracy, CA
|
Junior Member |
|
|
Michel:
Many thanks for your advice, and for your offer to help, but as Littlefoot said, I do have SQL*Plus and SQL Developer up and running with HR and OE schemas.
Much appreciation again, for all your help, Littlefoot.
Cheers,
John
|
|
|
Goto Forum:
Current Time: Thu Jan 30 19:24:58 CST 2025
|