Beginners question about creating first database and tables

Hi all,
i recently have installed 10g express edition, because i want to transform my php-script from mysql to oracle database. (due to the fact that mysql is "not allowed sofware" at the company i work for).
it is a quit small script, just a shift-report system, build because of frustration about an used shift report system based on excel sheets. Company likes it, but IT-department rejected it, because it is myssql. They do own a lot of oracle servers, so they set up a database for me, got a username and password.(Tnsnames entry). The rest i have to do by myself, no further support from IT department.
I have made 2 simple php functions to connect to database:
// for connection home server:
function conn()
     $user = 'user';
     $password = 'password';
     $conn = oci_connect($user, $password, 'localhost/XE');
     return $conn;
// for connection at work:
function Xconn()
     $db = '(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.eu.xxx.com)(PORT = 1521))
    (CONNECT_DATA = (SID = NVGPP)))';
     $user = 'xxxxxxxx';
     $password = 'xxxxxxx';
     $conn = oci_connect($user, $password, $db);
     return $conn;
}I just add or remove X character before function name, for use at home or at work.
both do work fine.
First thing i wanted to do, is to create my database and tables.
Schema dump from mysql:
-- phpMyAdmin SQL Dump
-- version 2.11.1
-- http://www.phpmyadmin.net
-- Host: localhost
-- Generatie Tijd: 03 Aug 2010 om 21:35
-- Server versie: 5.0.24
-- PHP Versie: 5.2.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- Database: `ewb`
-- Tabel structuur voor tabel `afsprakenblad`
CREATE TABLE IF NOT EXISTS `afsprakenblad` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `naam` tinytext NOT NULL,
  `afspraak` text NOT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Afsprakenblad' AUTO_INCREMENT=13 ;
-- Tabel structuur voor tabel `verslag`
CREATE TABLE IF NOT EXISTS `verslag` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `ewb_id` int(10) unsigned NOT NULL,
  `datum` date NOT NULL,
  `dienst` tinytext NOT NULL,
  `ploeg` tinytext NOT NULL,
  `gebouw` varchar(10) NOT NULL,
  `installatie` tinytext NOT NULL,
  `subdeel` tinytext NOT NULL,
  `subsubdeel` tinytext NOT NULL,
  `sap` int(4) unsigned NOT NULL,
  `tekst` text NOT NULL,
  `status` tinyint(3) unsigned NOT NULL,
  `afdeling` tinytext NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4663 ;
-- Tabel structuur voor tabel `wachtverslag`
CREATE TABLE IF NOT EXISTS `wachtverslag` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `datum` date NOT NULL,
  `dienst` tinytext NOT NULL,
  `team` tinytext NOT NULL,
  `afdeling` tinytext NOT NULL,
  `status` enum('open','dicht') NOT NULL default 'open',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=800 ;When i wanted to create a new databse with: CREATE TABLE ewb, i get an error that databse already is mounted??
How do i create this database and tables?
after googling i read something about schema owners, but cant find anything about how to copy my mysql database/tables to oracle.
Please, help is really appreciated by me.

Translating from mysql to Oracle will need a bit of fixups for the DDL, once an oracle instance is created, set up and running, you won't create a database but you will have a database user or users that create/own a collection of tables, indexes, functions, procedures, etc.
It will take a bit of pouring through the oracle documentation to get those table create statements to work, i.e. the engine=, charset=, auto_increment items won't succeed, datatypes need adjustments, the tic marks around the entity names aren't necessary, quite a few other items from the mysql data definition language don't have an oracle equivalent.

Similar Messages

  • How create new database and table in java db and how get java db backup

    hi master
    sir i use stuido creator
    sir please give me idea how i create new database
    and how create new table and view in this new database
    and how get this database backup
    how i give this databae backup to isp for deployment
    please give me idea with step
    thank
    aamir

    Create your own Value Object (Data Transfer Object) in Java with a structure similar to this and map the fields returned from the database to the fields of that object (preferably using SEtT methods).
    Hope this helps.

  • A question about CREATE PUBLIC DATABASE LINK and ORA-12154 error

    Dear all,
    I have a problem about public database link creation and I would appreciate if you could kindly give me a hand. I have the following connection parameters in my
    tnsnames.ora file:
    DGPAPROD.WORLD =
         (DESCRIPTION =
           (ADDRESS_LIST =
            (ADDRESS = (COMMUNITY=tcp.world)
              (PROTOCOL=TCP)(HOST=ORASR001)(PORT=1521)
           (CONNECT_DATA = (SID = DGPAPROD))
    ...Having the above mentioned parameters I can connect to this remote database directly in a SQL*Plus shell:
    $ sqlplus username/[email protected] works pretty well and the connection is established without any problem.
    Now, what I would like to do is to create a public database link to this remote database in order to avoid the user/connection switching for viewing the
    content of this database. I proceeded according to the syntax indicated in the Oracle online documentation:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm#SQLRF01205
    Therefore I run the following in order to create a public database link
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING 'DGPAPROD.WORLD';Apparently there is no error and the link is created successfully. However it cannot resolve the remote host and whenever I run the following query
    (myenterprise is the name of a table in that remote database)
    SELECT *
    FROM myenterprise@SR001_dblink
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specifiedWhat causes this problem?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    spajdy wrote:
    You must have defined DGPAPROD.WORLD in tnsnames.oar on server where you DB is runnig.Hello there,
    Thanks a lot for this nice solution. In fact I had to add the connection parameters into the tnsnames.ora file of the server on which the link was created (not the tnsnames.ora of my oracle client stored on the localhost)
    After a bit googling I found another solution that allows to create the database link:
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING '(DESCRIPTION =  (ADDRESS_LIST =  (ADDRESS = (COMMUNITY=tcp.world)
    (PROTOCOL=TCP)(HOST=ip_adresse)(PORT=1521)))(CONNECT_DATA = (SID = GPAPROD)))';Thanks a lot for your help!
    Kind Regards,
    Dariyoosh
    Edited by: dariyoosh on 18 nov. 2009 07:15

  • Questions about creating plugin_stage directory and creating the plugin

    I am new with EM and am working on creating an EM plugin to monitor our web application by using JMX. I already have a very simple mbean server running and have generated very simple metadata and default_collection files. The next step should be to convert those files to an Oracle Plug-in Archive (OPAR), but before creating the OPAR, I seem need to create the plug-in stage directory which have various sub-directories and files. I searched the whole Oracle Enterprise Manager Cloud Control Extensibility Programer's Reference 12c Release 2 (12.1.0.2) and Programer's Guide as well as online, I couldn't find how the plugin_stage is created. I hope there must be a way to create that directory, or manually creating it will be tedious. Any pointer will be highly appreciated!
    Thanks in advance!
    -JC

    There are two issues here. One is the structure of the staging area, and the other is how to do incremental development of a plug-in efficiently. Regarding the first, the directory structure is pretty straightforward and once established for a particular plug-in doesn't need to be changed unless you are adding support for some new subsystem (e.g. adding jobs). There is no tool to create the directory structure.
    The question of doing incremental development is mitigated by allowing you to use the "emctl register metadata" command once the initial version of the plug-in is deployed. This allows you to modify metadata and reload that particular file without having to build and deploy a new version of the plug-in.
    Bottom line is that there is no plug-in developer IDE so you'll have to work with the pieces that are there. We appreciate your feedback so please keep it coming as we look at improving the plug-in developer experience in future releases.

  • A question about foreign key to multiple tables

    Hello everybody,
    I have a question about creating foreign key and I would appreciate if you could kindly give me a hand. Here are my tables:
    CREATE TABLE TEAM1(team_id VARCHAR2(20), project_id VARCHAR2(20));
    ALTER TABLE TEAM1 ADD CONSTRAINT PK_TEAM1 PRIMARY KEY(team_id);
    CREATE TABLE TEAM2(team_id VARCHAR2(20), project_id VARCHAR2(20));
    ALTER TABLE TEAM2 ADD CONSTRAINT PK_TEAM2 PRIMARY KEY(team_id);although the structure of both the tables is exactly the same, the values (in particular team_id) in both tables are different.
    Also I have another table named AGENT
    CREATE TABLE AGENT(agent_id VARCHAR2(20), team_id VARCHAR2(20));
    ALTER TABLE AGENT ADD CONSTRAINT PK_AGENT PRIMARY KEY(agent_id)Now the problem is that the column team_id in AGENT table is actually a foreign key, but the value can be in either TEAM1 or TEAM2. As far as I know a foreign key points only to one table.
    How can I deal with this problem? Whenever there is an INSERT or UPDATE I have to make sure that the value of the column "team_id" in the table "AGENT" is a valid value either in "TEAM1" or "TEAM2"
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    Do you have the ability to change the data model? If so a more appropriate structure may be something like this:
    CREATE TABLE TEAM(team_id VARCHAR2(20), team_name VARCHAR2(20));
    ALTER TABLE TEAM ADD CONSTRAINT PK_TEAM PRIMARY KEY(team_id);
    ALTER TABLE TEAM ADD CONSTRAINT UK_TEAM UNIQUE (team_name);
    CREATE TABLE TEAM_PROJECT(team_id VARCHAR2(20), project_id VARCHAR2(20));
    ALTER TABLE TEAM ADD CONSTRAINT PK_TEAM_PROJECT PRIMARY KEY(team_id, project_id);
    ALTER TABLE AGENT ADD CONSTRAINT FK_TEAM_PROJECT1 FOREIGN KEY (team_id) REFERENCES TEAM(team_id);
    CREATE TABLE AGENT(agent_id VARCHAR2(20), team_id VARCHAR2(20));
    ALTER TABLE AGENT ADD CONSTRAINT PK_AGENT PRIMARY KEY(agent_id);
    ALTER TABLE AGENT ADD CONSTRAINT FK_TEAM FOREIGN KEY (team_id) REFERENCES TEAM(team_id);Edited by: Centinul on Jun 25, 2010 10:50 AM

  • Creating database and tables using datasources in a portal application

    Hi All,
    <b>
    I have created a datasource using Visual Administrator.
    Now I want to create a database and then tables using this datasource.
    I have todo this in the portal application.
    How to create a database and then tables into this database????
    </b>
    regards
    Brahmachaitanya

    Hi,
    I have created a datasource using Visual Administrator. I am trying to connect to it in my portal application. I have written the following code...
    InitialContext iContext = new InitialContext();
    DataSource ds = (DataSource) iContext.lookup("jdbc/CustomDataSource");
    Connection connection = ds.getConnection();
    But I am getting the following connection exception....
    ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException thrown by the physical connection: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sysadmin'.
    can anybody tell me how to go about this exception?????
    regards
    Brahmachaitanya

  • SQL Server 2012 Management Studio: Creating a Database and a dbo Table. Inserting VALUES into the table. How to insert 8 Values for future use in XQuery?

    Hi all,
    In my SQL Server 2012 Management Studio (SSMS2012), I tried to create a Database (MacLochainnsDB) and a dbo Table (marvel). then I wanted insert 8 VALUES into the Table by using the following code:
    USE master
    IF EXISTS
    (SELECT 1
    FROM sys.databases
    WHERE name = 'MacLochlainnsDB')
    DROP DATABASE MacLochlainnsDB
    GO
    CREATE DATABASE MacLochlainnsDB
    GO
    CREATE TABLE [dbo].[marvel] (
    [avenger_name] [char] (30) NULL)
    INSERT INTO marvel
    (avenger_name)
    VALUES
    ('Hulk', 1),
    ('Iron Man', 2),
    ('Black Widow', 3),
    ('Thor', 4),
    ('Captain America', 5),
    ('Hawkeye', 6),
    ('Winter Soldier', 7),
    ('Iron Patriot', 8)
    I got the following error Message:
    Msg 110, Level 15, State 1, Line 5
    There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
    How can I correct this problem?
    Please kindly help and advise.
    Thanks in advance,
    Scott Chang
    P. S.
    The reason I tried to create the Database, dbo Table, and then to insert the VALUES is to learn the following thing:
    You can query the entire node tree with the following xquery statement because it looks for the occurrence of any node with the /* search string:
    DECLARE @x xml;
    SET @x = N'<marvel>
    <avenger_name>Captain America</avenger_name>
    </marvel>';
    SELECT @x.query('/*');
    You can query the avenger_name elements from the marvel_xml table with the following syntax:
    SELECT xml_table.query('/marvel/avenger_name')
    FROM marvel_xml;
    It returns the following set of avenger_name elements:
    <avenger_name>Hulk</avenger_name>
    <avenger_name>Iron Man</avenger_name>
    <avenger_name>Black Widow</avenger_name>
    <avenger_name>Thor</avenger_name>
    <avenger_name>Captain America</avenger_name>
    <avenger_name>Hawkeye</avenger_name>
    <avenger_name>Winter Soldier</avenger_name>
    <avenger_name>Iron Patriot</avenger_name>
    You can query the fourth avenger_name element from the marvel_xml table with the following xquery statement:
    SELECT xml_table.query('/marvel[4]/avenger_name')
    FROM marvel_xml;
    It returns the following avenger_name element:
    <avenger_name>Thor</avenger_name>

    Hi Scott,
    The master database records all the system-level information for a SQL Server system, so best practise would be not to create any user-defined
    object within it.
    To change your default database(master by default) of your login to another, follow the next steps so that next time when connected you don't have to use "USE dbname" to switch database.
    Open SQL Server Management Studio
    --> Go to Object explorer(the left panel by default layout)
    --> Extend "Security"
    --> Extend "Logins"
    --> Right click on your login, click "propertites"
    --> Choose the "Default database" at the bottom of the pop-up window.
    --or simply by T-SQL
    Exec sp_defaultdb @loginame='yourLogin', @defdb='youDB'
    Regarding your question, you can reference the below.
    SELECT * FROM master.sys.all_objects where name ='Marvel'
    --OR
    SELECT OBJECT_ID('master.dbo.Marvel') --if non empty result returns, the object exists
    --usually the OBJECT_ID is used if a if statement as below
    IF OBJECT_ID('master.dbo.Marvel') IS NOT NULL
    PRINT ('TABLE EXISTS') --Or some other logic
    What is the sys.all_objects? See
    here.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to create database and table with GUI?

    How to create database and table with GUI?
    for linux can do that?
    or have only way to create table by use sql*plus.
    everyone please help me.
    thanks

    go to www.orasoft.org
    here is a gui tool.
    null

  • How to create first database

    Hi there,
    This is my first post on this forum. I am totaly new to Oracle as I am working on one project which require Oracle as db.
    I have installed Oracle Database 10g Express Edition. I can login by system user or as hr. Now when I am trying to create database instance for my project.net application, I am not finding the option to create the db. Its manual (even here in forum someone) pointed about Configuration and Migration Tool menu under Start/Oracle. But I don't have that option under my oracle. What I have is Start > Oracle Database 10g Express Edition > 1) Help 2) Backup Database 3) Get Started 4) Go to Homepage 5) Start SQL command line 6) Start Db etc...
    Can anyone guide me how to create first database? Thanks in adv and your answer will really be appreciated.
    Regards,
    Yatrik

    I think I didn't explain properly. I can connect. I have got two database users as well. The one is default hr and second I just created as yatrik.
    By saying how to create database, I want to accomplish this below procedure.
    Run the Oracle Database Configuration Assistant located in the Windows Start/Oracle/Configuration and Migration Tools menu to create a database instance for the Project.net application. 1. Select Create a Database the click Next.
    2. Choose the General Purpose database template.
    3. Note the Global Database Name and SID that you use.
    4. Choose your preferred management method. If unsure, chose the default.
    5. Note the password(s) you use for the various accounts.
    6. Select the appropriate storage mechanism for your installation. Again, if unsure, chose the default.
    7. Specify the storage location.
    8. And Recovery Configuration.
    9. Do not install the Sample Schemas.
    10. Select the remaining options, as appropriate to your installation, and create the database. Here when I go to Start > Oracle Database 10g Express Edition, I don't get Configuration and Migration Tools Menu anywhere. The above steps says how to create it but I can't find that tool menu.
    I know how to create tables and all such but I am looking for that particular option where I can complete the above steps.
    I hope I have explained more briefly to understand what I am trying to do.
    Yatrik

  • Question on rectangle with graph and table

    i inserted the graph chart and table in a rectangle for similar values... but when i see the preview of this scenario... its showing seperately.... its mean that first showing the rectangle and then graph and then table in the preview page. when i saved
    it into PDF; both chart and table are coming in same rectangle.
    can any one please give a quick response to this.

    Hi  Nagalinga,
    Based on my understanding, you create a chart and table with same values, then you use a rectangle to contain them. When previewing the report, rectangle, chart, table displays separately. However, when exporting to PDF, the chart and table display in a
    same rectangle.
    In Reporting Service, rectangles can be used as containers to help control the way data regions render in a report. However, a rectangle is only a container for items that you either create in the rectangle or drag into the rectangle. If you draw a rectangle
    around an item that already exists on the design surface, the rectangle will not act as its container. So in your scenario, I suppose you create a chart and table then draw a rectangle around them, rectangle, chart and table will display separately when previewing
    report. As we tested in our environment, we create a chart and table with same values, then drag them into a rectangle, the chart and table both display in a rectangle whether we preview the report or render the report as PDF. Please refer to the screenshots
    below:
    Reference:
    Rectangles and Lines (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

  • A question about creating packages as local objects in ABAP

    Hi,
    I have a question about creating packages with SE80. Whenever I create a new package it is assigned a new transport request. After that, I can create new programs inside this package, and each time I can choose whether to assign the new program to a transport request or just save it as a local object (I often do this for test programs that I don't transport and I remove them once my tests have been done).
    What I would like to ask is that, is it possible to create a package (and not just programs inside a given package) as a local object? so that every new object created in this package will be considered as a local object?
    Thanks in advane,
    Kind Regards,
    Dariyoosh

    Thomas Zloch wrote:
    Please also check the F1 help for the package field e.g. in SE80, SAP standard is in range A-S and U-X, namespaces start with "/", so you should be save. I am using the T namespace for temporary stuff since a long time and did not have a problem so far.
    > Thomas
    >
    > P.S. this applies to the package name only, of course
    Thank you very much for this remark, I checked F1 help for the package field and in fact as you mentioned these ranges are for local objects.
    Once again, thank you very much for your help.
    Kind Regards,
    Dariyoosh

  • Newbee questions - cant create/import database

    configuration:
    Oracle 9.2i
    Windows XP pro
    Norton internet security installed
    hi,
    I am new to oracle.
    I dl the 9i version (3 cds) and installed the Standard version. most of it went well but in the last cd the installer ran the configuration assistant. on some stage it seemd to get stuck on some "dos" window, so I canceled it.
    anyway i finished the installation.
    the services seem to work.
    I invoked the Enterprise Manager console.
    now I am stuck from here.
    how can I create a demo/empty database to play with?
    all it does is let me add a connection to newdatabases of which i have none.
    I also got from someone a script from someone so as to recreate his own databases on my computer but i don't know where to import it.
    to some it up i can't login or create a database in any way shape or form.
    because I'm new to this i figure there is some basic thing I am missing.
    please help.
    azriel.

    it did finish the process but i tried to look in the Enterprise Manager Console and didn't find the new database.
    i tried again to use dbca and chose a general database.
    I chose:
    General purpose database
    Global Db name: General
    SID general
    Dedicate server mode
    and marked the Create Database base.
    I than clicked the Finish button.
    it opened a Summary page of what is about to be performed
    but nothing else happened.
    everytime i clicked the finish button i opened that page.
    closing the window asked me if i wish to quit.
    how do i tell it to really create that database
    and make it visible in the console?
    Azriel.

  • How to create checkbox group and table dynamically?

    HI All
    How to create checkbox group and table dynamically?
    Regards
    Ravi

    hi
    check this links for creating  tables dnamically
    How to Create a table dynamically?
    Re: how to create a table dynamically in webdynpro
    and for checkboxgroup
    IWDTransparentContainer rootContainer =
    (IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDCheckBox check = (IWDCheckBox)view.createElement(IWDCheckBox.class,"Check"+k);
    //Here "check"+k k represents a unique value every time u create so that u wont get a duplicate instance
    check.setChecked(false);
    rootContainer.addChild(check);
    or Re: adding checkboxes dynamically

  • HT201263 What will i do?screenshot There is a problem with your iPhone. Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country. To find your nearest Apple Store, cli

    What will i do? ITune screenshot is as follows >
    There is a problem with your iPhone. Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country. To find your nearest Apple Store, click here.

    Do what it said to do.
    "Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country. "

  • TS1814 There is a problem with your iPhone. Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country. To find your nearest Apple Store, click here.

    There is a problem with your iPhone.
    Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country.
    To find your nearest Apple Store, click here.
    Please help me i can aktivate my phone imei 012423006333181.

    There is a problem with your iPhone.
    Please visit the Service Answer Center to find answers to all your questions about service options, warranty and other processes in your country.
    To find your nearest Apple Store
    no imei also

Maybe you are looking for

  • How to slove follwoing error "Unreported exception java.io.IOException;"

    Currently I'm using following: XP Professional J2sdk1.4.2_01 Xerces-2_5_0 Xalan-j_2_5_1 Jakarta-tomcat-4.1.27 Jdom-b9 Current Classpath setting User variables PATH = c:\bmrt2.5\bin; c:\j2sdk\bin;%PATH%;%JAVA_HOME%\bin; CLASSPATH=.;c:\xerces\xmlParser

  • Backing up from the iPod

    Hey. I've got a 14 gb harddrive so i've chosen to use the manually update ipod option to add songs. that way, i can add a song to my ipod, delete it from my computer, and not use up the space on my computer. So i have about 50 songs that i've downloa

  • I want my JDialog to be the only focusable window

    Hi, I have a JFrame containing a button. When the button is pressed a settings dialog (JDialog) pops up. Now I want only the JDialog to be focusable, I mean so that the user can't click on the JFrame so it'll be in focus before closing the dialog win

  • IFrames and Parent page

    hi..... i am having a Jsp(say index.jsp) file with iframes in it. Inside IFrame, i am having some user id's and a edit button. After selecting a user id, i ll click the edit button. Now, i want to render the edit page for the selected id in the paren

  • How to estimate the size of dump file

    Hi, I would like to export my full database. My database size is nearly 50G. How to know how much space the export dump will occupy? Thanks, Kavitha