Start Oracle SQL Developer - sql

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.

Related

Microsoft SQL Server connection error with Visual Studio.net (Windows forms)

I've been trying for a while to connect the database to visualstudio.net and it just doesn't work.
First I made the database and made everything I needed there and when I tried connecting it in visual.net through datagridview (trying to get it displayed there) it only gives me access to the "System databases" in which I can't make a database.
After that I decided to make the tables under the "master" database to see if that worked and yeah I can select the database and everything but it says it's empty when I know it's not. It says it has no tables when I've checked multiple times and saw the tables I've created there.
I would appreciate some help to either be able to get for visual to accept a database I make (to be able to automatically detect it once I enter the server name) or to see how can I use the master one properly.
You can add a data source to your project and it will be able to connect to the user databases. Also, it is highly inadvisable to create any user objects in the master database.
master database is a system database and you should not create user objects in the system database. In the connection string, provide the user database name explicitly. If you dont provide the database name, it defaults to master database.
Refer to connection strings for Sql Server for providing the right connection string for SQL Server in .net.

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.

Data integration between IBM AS400 to SQL Server database

I'm a web developer that has been tasked with creating some sort of mechanism for moving data from an IBM AS400 to a SQL server. Unfortunately, linked servers are out of the question in this case as the SQL Server is just Standard Edition (db2 providers not available in this version) and the AS400 server is on a separate server. I've researched adding some sort of trigger on the AS400 table that calls a web service that would insert data into the SQL server, but that doesn't seem like the best method. Does anyone have any suggestions on the process to get the data from the AS400 to the SQL Server when it is committed to the AS400?
This solution assumes you are familiar with SQL Server Integration Services (SSIS):
Connection to AS400
Create a new ADO.Net connection Manager
Set the Provider to .Net Provider --> ODBC Data Provider
Create a DSN (Control Panel -->Administrative Tools-->Data Sources ODBC -->System DSN)
In the connection manager for Data source specification select the DSN created. Provide the login information.
Test the connection.
Data flow source:
Use the DataReader source
In Advanced Editor select the Ado.Net connection manager just created.
In Component Properties tab --> Custom properties, in SQLCommand specify the required query string (select * from DatabaseName.TableName)
Check the column mappings for accuracy
Go to Input and Output properties -->Data reader output -->External columns (Select the columns which were of type varchar in the table, they will now be of the datatype UnicodeString (DT_WSTR). This is because by default DataReader reads strings as unicode strings. This implies that in the destination table in SQL these columns must be of type unicode i.e NVARCHAR instead of VARCHAR)
Answer sourced from www.sqlservercentral.com/Forums
I synchronize my web applications with an IBM i. But I have my own database design and wrote a sync program on the Windows side.
Having the same database design I wonder why I would need a copy on SQL server. I would access the IBM directly. Install the drivers as #Kamran Farzami suggested and use them. That way there would be no lag between writes on the mainframe and your queries.
If a lag is acceptable for you and you can't access the IBM i directly, I see three main options:
Pull the data from your Windows system with the OLE DB driver. Using the .NET driver you can use the relative record number (RRN) to remember where you stopped synchronizing.
Read the journal files and make them available by creating a webservice on the IBM i.
Read the journal files in a scheduled job and push the changes from the journal to a webservice which updates the SQL server.
Option 1 only works if the files you sync are not reorganized. The RGZPFM command changes the record numbers. If that's okay, you can get the RRN in your SELECT statement: select *, RRN(MYTABLE) as RRNMYTABLE from MYTABLE
The web service server is included in OS400 since V5R4. So you should be able to use option 2.
I've done something similar where the SQL server was in a remote (Honduras) location where the internet connection was unreliable. It was a short VB program, using the OLE DB driver, running on the server that connected to the AS400 when it was available (or "slept" when the connection was down). When available the program would update/synchronize a uniquely keyed mirror file. Another program uploaded individual transaction records to a separate table (file).
We'd also periodically update SQL Server master tables (i.e. item master) from the AS400. That also utilized a VB program (could be any language using the driver) initiated on the server. It isn't exactly elegant, but more practical than an AS/400 trigger to a web service, I believe.

Set up own database in SQL Developer

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

Lotus Notes ODBC Connection

I need to connect and send/receive information from an MS SQL server in my Lotus Notes app using #formula in realtime (I can connect using an agent, but I need to use inline code for this).
The commands themselves seem pretty straight forward, but setting up the configurations seems to be a topic with scarce documentation. Apparently I need to install an ODBC driver. Where would I find that, and do I install that onto the server or onto the workstations that will run this app?
If any Lotus gurus could step me through setting this up, it would be greatly appreciated.
Thanks
You'll need to install the ODBC driver on the workstations that run this app, if the users will be triggering the ODBC connections. If at all possible, I highly suggest setting this up on the server side, and having it run via an agent. That'll save you from a few headaches, including having to maintain the ODBC connections on each workstation and worrying if each workstation has access to the data and server.
You first just want to make sure your ODBC setup is correct. You'll need the appropriate driver, of course, and the connection information. This site has a walkthrough to give you an idea of how to setup an ODBC database connection
If you have MS Access you can use it to test querying from the ODBC data source. Once you've tested the connection works, you'll just refer to the data source name (DSN) in your #DbColumn, #DbLookup, or #DbCommand formulas.
Back to my suggestion on setting this up on the server side, that would mean you'd keep a copy of the data you're querying within the Notes database itself, and then users would be interacting with read-only data in Notes. You could schedule updates regularly on the server side of that read-only data and effectively create a cache of the data in your Notes environment. Then that data would replicate around to other replicas of the database, but remove the trouble of the ODBC connection being needed everywhere.
If you need realtime data, though, that solution is out the window and you'll have to go with a local solution. In that case, you might want to look at the LCConnection class or using an ADODB.Connection from script, as both will allow you to create DSN-less connections to data sources. You'd then save the trouble of requiring ODBC data sources on each workstation, and only have to worry about whether they can access the server from their workstation.
I would add another option to Ken's list. It involves having the server do the queries of the external database (therefore you are only setting up ODBC in on the server - you don't have to deal with it on the workstations). You create an agent that is launched on the server using the 'run on server' technique. When the workstation needs to query the external data, the code creates a throw-away document in the database, puts the query criteria into the temporary document, saves the document, then calls the 'run on server' agent passing a reference to the temporary document. The server launches the agent, reads the criteria from the temporary document, does the query, and writes the results back to the temporary document. Then the workstation can access the query results from the temporary document. A scheduled agent can delete the temp docs on a regular basis.
It sounds complicated, and it all has to be done in script, but I've done this in many applications and it is fast, flexible, easy to administer, and gives your applications a lot of power. Note that end users must have the ACL rights to create a document in the db (the temp doc) in order for this to work.
Good luck!