Creating new database under Oracle XE on Ubuntu - database

I've just installed Oracle XE in Ubuntu. Is there any way to create new databases, besides the one that comes with the installation, preferably from the command line so that I can do it from a script? It would be nice to have multiple databases started in the same time, if possible.
If it is not possible to create new databases, then maybe there is a way to "clean up" the default database? What I need is to be able to "start over" at any time with a fresh database.
I don't have experience with Oracle administration, so any hints, links, suggestions are welcome.
Thanks.

I don't know if you are aware of this, but most beginners confuse this about Oracle:
In Oracle, a database means a collection of data files and control files stored on disk. You can have only one database with Oracle XE. A database is mounted by a Oracle instance, which means all the background daemons and programs that you can see with ps.
You probably want a schema, which is what other DBMS products (e.g. MySQL) often refer to as a "database". IIRC there was no limit on the number of schemas in Oracle XE. You can create those from the APEX UI that comes with XE, or from command line (with CREATE USER -- again, confusingly, a user and schema are largely synonymous in this case).
I recommend reading the Concepts guide from Oracle documentation, most of this basic stuff (e.g. how things are called in Oracle-lingo) is covered there.

No. It's not possible to install multiple XE instances. Oracle XE only allows one instance by machine from the Oracle XE home page you can read:
Oracle Database XE can be installed on any size host machine with any
number of CPUs (one database per machine), but XE will store up to 4GB
of user data, use up to 1GB of memory, and use one CPU on the host machine.
To add more instances you can:
Use virtualization with an XE instace by virtual machine.
Download for free dev/personal use any other Oracle Database edition, for instance Oracle Standard Edition One.
Anyway, in most of the cases only one instance is enough for all the scenarios. Explain why do you need more instance to assistance about solutions.
To recreate the Xe instance, i thing the best and easy way is uninstall i and install again.

Related

Using DBUA for oracle on two different servers

newbie to the oracle database world...
I have a database on 11g and I want to migrate this over to 12C and then from the 12C upgrade that particular database...
Any particular help / how-to's on how to do this?
I did testing with SQL Developer and migrated one table from 11G to 12C with no issues.
Any suggestions on how to get the database copied over.
there are thousands of docs and howto's about this topic.
So all depands on your enviroment ( Data, DB, Location of Files, Target OS, Source OS..... and so on.)
"with no issus" is the main goal of every dba and need a lot of practise and knowing about the oracle architecture.
copying db files (data, control, redo, pfile/spfile, password file.....) to the new location -> maybe you have to relocate these in the controlfiles
.. and so on....
So nobody can told you here a step-by-step guide for your task.
It can be easy if you know what you are doing.

What is a SSMS analogue for Oracle?

What is (if there is) the analogue of SQL Server Management Studio for Oracle databases?
Question seems easy but Google didn't know a thing.
I've never worked with Oracle database, now I will have my first encounter soon so I'd like to be a little prepared.
It depends. There are a number of applications that could be used depending on what specifically you are trying to do.
If you are trying to administer the database, you would probably want to use Enterprise Manager. This is a web-based application that lets you monitor and administer the database. It can either be configured to run just on a particular database server (Enterprise Manager Database Control) or it can be configured to allow you to access all the databases and a variety of non-database products running in the organization (Enterprise Manager Grid Control). Grid Control is, obviously, a much more involved install. The Database Control should be installed when you install the database (though some DBAs will turn it off because they don't want to run a HTTP server on their database server).
If you are trying to write and debug PL/SQL code (packages, procedures, functions, triggers, etc.) or to just run some ad-hoc SQL statements, Oracle provides a free tool SQL Developer that can be used. There are a variety of other PL/SQL IDEs out there as well-- Toad from Quest and PL/SQL Developer from AllAroundAutomations are two of the more common ones.
Oracle also has a basic command-line SQL tool SQL*Plus that will exist pretty much wherever you are (in much the same way that vi will be available on just about any Unix machine you log in to). There are lots of DBAs (and a decent number of developers) that prefer to use SQL*Plus rather than using the various GUIs. At a minimum, in most large organizations, DBAs will use SQL*Plus to execute scripts built by the developers as part of the code promotion process so you'll want to have a basic familiarity with SQL*Plus.
You can use Oracle SQL Developer which is free from oracle.
Toad is also available.

create a database from installer file?

well for example you have build a program, for restaurant, for a cinema, wherever,
now how do you do when, you install your application, the database was installed correctly too? i dont sure but i believe this is a different database? for example a file?
(talking about sql).
and how different are going to be the queries? cuz i believe i am not going to have the same function on sql server than a file database
and what connection i shall use?
could i use entity framework?
and how capacity could to have the different file for databases?
regards
You can use a file-based database like SQLite that supports SQL queries. There are ADO adapters available as well. The link should take care of the rest of your questions as well.
Well, since you usually have absolutely no knowledge about target environment, user must configure program to his envronment at install time, or later (af first launch for example, this is much simplier than implement same functionality in installer). User specifies SQL server address (if we are talking about server-based systems) and database name he wants to use. Then database is created programmaticaly using that information.

Hosting Oracle DB and Data Ware House functions virtually

I am trying to create a test environment (for my own practice and research) on how best to virtualize an Oracle DB using windows (Unix/Linux comes later...much later).
Here's the idea:
Use Virtual PC (for win7) and install Server 2008 x64 with Hyper V. Then, create a virtual guest (XP or something) that connects to it. Install an Oracle instance (11gR2) on the server and then go to work to connect to the DB instance from furhter vitualized XP O/S.
After that, create a Data Warehouse (DWH) on another virtualized O/S using the server as the data source.
Basically:
Server(DB) to DWH
Server(DB) to client computer
client computer (DWH Manager) to DWH
I would just like to know if this seems a valid way to build a testing environment or is this not such a good idea and there are better ways to do this?
Additionally, I am largely unfamiliar with Hyper-V Server 2008 and virtualization (even after reading the docs on it - someone with practical experience would be helpful in suggestions)
I have Win 7 x64 installed on my machine and have been running an 11gR2 DB for the past 6 months as part of a personal project (and continued education)
I appreciate any and all suggestions, thanks
What are your concerns? The main disadvantage will be performance, but that's usually not that important in a development environment.

Export from a standalone database to an embedded database

I have a two-part application, where there is a central database that is edited, and then at certain times, the data is released and distributed as its own application. I would like to use a standalone database for the central database (MySQL, Postgres, Oracle, SQL Server, etc.) and then have a reliable export to an embedded database (probably SQLite) for distribution.
What tools/processes are available for such an export, or is it a practice to be avoided?
EDIT: A couple of additional pieces of information. The distributed application should be able to run without having to connect to another server (ex: your spellchecker still works even you don't have internet), and I don't want to install a full DB server for read-only access to the data.
If you really only want your clients to have read-access to the offline data it should not be that difficult to update your client-data manually.
A good practice would be to use the same product for the server database and the client database. You wouldn't have to write SQL-Statements twice since they use the same SOL-Dialect and same features.
Firebird for example offers a server
and an embedded version.
Also Microsoft offers their MS SQL Server
as a mobile version (compact edition) and there are
also Synchronization services
provided by Microsoft (good blog
describing sync services in visual
studio:
http://keithelder.net/blog/archive/2007/09/23/Sync-Services-for-SQL-Server-Compact-Edition-3.5-in-Visual.aspx)
MySQL has a product which is called "MySQLMobile" but I never actually used it.
I can also recommend SQLite as an embedded database since it is very easy to use.
Depending on your bandwidth and data amount you could even download the whole database and delete the old one. (in Firebird for example only copy the database files and it will also work with the mobile version) Very easy - BUT you have to know if it will work for your scenario. If you have more data you will need something more flexible and sophisticated, only updating the data that really changed.

Resources