Set up own database in SQL Developer - sql

I'm trying to make a new connection in Oracle SQL Developer, but instead of connecting to a existing database I want to make a new database where I can upload my own tables into. I know this is possible, because someone has done it on my other pc.
Trying to do 'new connection' always says that the network adapter could not make the connection. That is logical, because I want my own that I can use only on my pc.
Anyone knows how to accomplish this? Thanks in advance!
Grtz!

You cannot do this with SQL Developer.
Do you have a running database on your PC already? Is it Express Edition (XE)? Express Edition can only have one database. If it is not XE, use DBCA ( Database Configuration Assistant ) to create the database.
If you do not have Oracle on your PC, then you need to download and install the binaries. XE install creates the database during install. Other versions of Oracle will prompt you if you want a database or use DBCA after the binaries are installed.
Are you sure you want a database and not just a new user/schema to store your tables? See docs for "CREATE USER ..." command to create a new user in an existing database.

The CREATE DATABASE [databasename] command will create a new database. Make sure you're connected to the server that you want to create the database on.
CREATE DATABASE mydatabase;
You may need to supply more options depending on the configuration of the server. Also,
"To create a database, you must have the SYSDBA system privilege."
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5004.htm

Related

How to connect to SQL developer using my own database

I'm currently using SQL Developer 4.5.1.21 and want to take some time to learn language, run queries etc etc. I'm using a database that Oracle provides called "HR Schema" that is free for download. Now I know that I need to create a "connection" in order run queries onto this database. I begin running into trouble when I want to create my own connection. Can anybody walk me through the steps of creating a new connection? What I do is click the "+" button and click "new connection".
The major problem you have here is that you need to have an Oracle database instance installed before you can have something to connect to.
You have a couple of options here...
Download and use the free version of Oracle: Oracle Express Edition
You mentioned that you are a student. Check with your professor to see if they offer a more robust edition of Oracle for student use, such as:
a. Oracle Personal Edition
b. Oracle Standard Edition
c. Oracle Enterprise Edition
If you have the available funds, and you intend on persuing a future in database work, you could purchase a license of one of the above mentioned editions.
You can read more about the various editions of Oracle here.
One thing to keep in mind here is that you are wanting to use the sample schemas that Oracle provides, in particular the "HR" schema. Taking a look at the installation documentation over at the Oracle site, I do not see mention of the Express edition of Oracle server on the availability table, but that may not mean that it wont work.
To address the connection portion of your question, once you get your database set up and running, you should be able to connect to it by providing the hostname (localhost for connecting to your local machine), port, and various other information such as username and password. In all, your connection string would likely look like the following:
Host=localhost; SID=MyOracleServer; port=1677; Min Pool Size=1;
Connection Lifetime=600; User ID=EhBabay; Password=secretpassword123;
Or within SQL Developer you should be able to connect to your local instance of the Oracle database fairly easily, without having to create a connection string. The connection string would still be used though, within any applications you write that you want to connect to the database with.
The main thing here, however is that you need to have an instance of an Oracle database installed and running somewhere that you have access to.

Start Oracle SQL Developer

I have been trying to figure out how to start with Oracle SQL, but I can't get the "Connection" to work. I'm not sure what the (connection name, username, password, etc.) fields are.
If I want to create a small database on local host, why do I need to connect in the first place.
I searched Google but still can't get it to work. Any help is appreciated.
ERROR MESSAGE: IO Error: The Network Adapter could not establish the connection
SQL Developer is just a client utility that lets you connect to an existing database. It sounds like you don't have a database to connect to yet. If that's the case, you'd either need someone to create a database on another machine for you or you'd need to download the database software on to your local machine and create a database to connect to. You can download the Oracle database from the Oracle Technology Network, the same place you downloaded SQL Developer from. I would guess that you would want to download Oracle 11.2 Express Edition.
Alternately, you may want to download one of the VMs that Oracle has put together that has a lot of related software installed for you to use. For example, this VM has SQL Developer, Oracle 12.1, APEX, XML DB, and a number of labs already installed for you.
Oracle SQL Developer is a tool to ACCESS existing database, you cannot create new database here. The connection is used to define where your existing database sits and how to connect to it. So you need to name you connection (bookmark), provide host name, where database runs and user name plus password to identify yourself.

Visual Studio 2010 C# - application with centralized database - development

I've started working on my database desktop application. The goal is to have one centralized database, so that each employee could connect.
My goals:
Centralized database on SQL Server 2008 Express
Use Sql to Linq
First run of application should create structure of database on server.
Now my question: how to do the last point?
I know that I can generate sql script via SQL Managment Studio and then execute it, but maybe there is some better way?
Like the comments said, I'm not sure why you would want to do this, but if you have one centralized database machine and you want to create a new database per user upon the first connection, then you could create one canonical/template database and the clone it via scripting on the first connect.
Your UI would say something like "Please wait while we create your new database..." and you'd run CREATE scripts for the database/tables/stored procedures/views/etc.
Just remember it might be a major pain to update the schemas of these databases once the cat is out of the bag.

Create db from db project

Does anyone know how to create an entire database from a visual studio database project? Rather then running logs of smaller scripts individually.
Thanks
In VS express you do the following- It should be similar in the other versions but I don't have them in front of me.
Open Database Explorer (Ctrl-Alt-S)
Right Click "Data Connections" > "Add Connection"
Set 'Data Source' To Microsoft SQL Server Database File
Enter a name for your new Database
Choose your authentication method
It should confirm the creation of the database from there...
In Database Explorer Expand your Database and right click tables > Add new table and so on
It looks like I completely misunderstood the question. If you are trying to generate a script from an existing project for export the Database publishing wizard may do what you need.
http://www.microsoft.com/downloads/details.aspx?FamilyID=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
Are you using vs2008 team edition? If so use the db edition and you can use schema compare to create tables, along with stored procedures, views, etc.
http://www.microsoft.com/downloads/details.aspx?FamilyID=bb3ad767-5f69-4db9-b1c9-8f55759846ed&displaylang=en
The other way I have done is to publish the database, which will create a large sql file for schema and/or data, and then you can execute that in SQL Server Management Suite.

Get Started with Oracle Express Edition?

I'm novice in oracle.I'm using oracle express 10.2.0 but i don't know how to create my own database and where my database is created.(The path of my new database).
Not to be confused : in Oracle terminology, a database instance (called XE) is automatically created during installation (limitation : there can be only one database instance running at a time in Oracle Express).
What other vendors usually call a database (like in Sql Server) is a Schema in Oracle. To create one, use the CREATE USER command (and not the CREATE SCHEMA command : welcome to the marvelous world of Oracle !), using SQL*Plus or APEX.
I think it's possible to create a database schema through the web administration interface. Check the Getting Started Guide from the Oracle Database 10g Express Edition.
For the path to the files, this article may help: Creating an Oracle (XE) database manually on XP.
Creating a new database is easiest with the web frontend. Look inside the start menu for oracle.
Oracle 10g XE comes with the integrated browser interface. You can access it from http://machine-name:port/xe
It is almost similar to Oracle Enterprise manager. You can also try using Oracle Application Express on it, and develop web applications.