930065 wrote:Please read the Concepts guide and the 2-day DBA guide (see doc library for your version).
I dont understand the conzept of admin user in specifically in Oracle XE.
Well, these are already 2 Databases right?No. In Oracle terms those are schemas. One instance means at most one database.
The database instance has a database user named system, who has the DBA role privilege. A system connection can manage the instance, i.e. tuning, changing parameters, etc. and can also select/update/delete/drop any schema object(s). Not to be confused with the OS user "system" frequently seen with services set up on a Windows host by a system administrator. Which is not to be confused with a database user named system.Assume that I have only one user called "system"
The resource role for a database user allows almost all database privileges needed to creating tables, indexes, stored procedures, etc., but does not include the 'create view' privilege. So its a good idea to let the schema owner, or <username>, have that privilege as well.
$ sqlplus /nolog connect system ... password ... Connected. create user <username> identified by <password>; grant create session, resource to <username>; grant create view to <username>;
That's not quite correct, SYSTEM is a database user just as any other database user. SYSTEM is special in that it has the DBA role privilege allowing just about all of the instance administrative privileges.<username> should be created UNDER "system" ...
There are system catalog views for that. Or, more accurately, objects or views in the SYS schema, whom is another special database user- the owner of the database catalog. The SYS user can shut down and start up the instance- two examples of functions not available to the SYSTEM user.How can I find out whether "HR" also has the priviliges?
Yes, that is an accurate statement, as both are users defined in the instance.Both schemas from "system" and "HR" are under the operations of one instance, is that correct?
No.Is it possible to create 2 Databases ... ONE instance
That last one, the "/", means "Authenticate my session by my host login". If your Windows login, or OS login, is a member of the ORA_DBA local group the "/as sysdba' will work too, and it will assume a SYS username connection.
$ sqlplus /nolog connect sys as sysdba; ... password ... connected. select name from v$database; ... select instance_name from v$database; ... connect sys ... Password: ... ERROR: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER connect /as sysdba ... Connected. show user ... => USER is "SYS" ...