oracle sqlplus no username and database - sql

I installed oracle sqlplus and instant client on mac os using this tutorial: https://tomeuwork.wordpress.com/2014/05/12/how-to-install-oracle-sqlplus-and-oracle-client-in-mac-os/comment-page-1/
I can now open sqlplus in the terminal by typing sqlplus but it asks me for username and password.
I researched on the net that these should be created during installation however when I done it, it didn't prompt me and in the tutorial it doesn't mention it. It only says you should now be able to connect using $ sqlplus username/password#database but I don't have a username, password, nor a database ready.
How do I do this?
I want to set everything up so I can create a database and create tables etc using sqlplus.

SQLplus is a command line client for the Oracle database system and the Instant Client is a slim driver from accessing it. So you haven't installed the Oracle database (server) yet, just the client.
The Oracle server does not run on Mac OS X. You will need to install it on a machine with a different operation system.
Update
Using SQLplus you can connect to the Oracle server at your university (unless they have specifically guarded against it). You will need some information to connect:
Host name
Port number
SID or service name
username
password
Then you can connect using the following command:
sqlplus username#host:port/service
Or:
sqlplus username#'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=port))(CONNECT_DATA=(SID=sid)(SERVER=dedicated)))'
SQL Developer from Oracle is a free alternative client with a UI that will make it easier to connect to the database and do your assignment. It requires the same information though.

Related

Unable to connect to a migrated Access database on SQL Server as another user: SQL server Error 4060

I have an Access DB that I migrated to SQL server recently. The SQL server is on a Windows server. Now I can work normally with the SQL database but when others log into the same windows server with their credentials they are not able to access the database. As soon as they open Access frontend they get an error saying failed connection. Now I created an ODBC connection string(File DNS) and gave it to the other users in the network but they still are not able to connect to the database. They get an error stating "SQL server connection failed. The server rejected the connection: Access to the selected database has been denied". Can someone please help me to solve this issue so that multiple users can connect to the SQL DB without any issues? Thanks
Hard to know with the limited information. Are you using windows authentication to sql server, or are you using SQL logons? Either should work fine. The other issue to watch out for is what sql driver did you use to link with?
If you link say using the native 17 ODBC driver, then that is not installed on workstations by default - you have to download and install that driver.
Or, maybe you linked using the long time "legacy" sql driver - that is by default installed on all workstations.
So, it not clear if you using SQL logons, or using Windows authentication for the connection to the database????
If your using windows authentication, then all those other users will require permissions to be granted to the database.
If you using a SQL logon, then that logon would have been saved when you link the table(s), and again it should work for all users. Its quite common to create ONE logon on SQL server, link using that logon, and thus all users will be connecting to the database using the one same logon id/password.
And, if you linked using a FILE dsn, then zero configeration should be required, since access converts FILE dsn's into what are called dsn-less connections. (the origonal file is not required anymore once you link - you can even delete that FILE dsn, and it will still work).
So, FILE dsn is the best choice, since that dsn is NOT required to be setup on each workstation.
And if you using sql logon's, then make sure you checked the box to remember the password during linking of the tables. That is this check box:
And note during a re-link the above box does not appear - only on first time linking of table(s).

How do I create postgre SQL database locally with DataGrip

I'm getting started with Data Grip and I'm stuck before I started doing anything. First thing I've done was creating postgre Data Source with default parameters.
Now I opened a console, and tried to run a script:
drop table table1;
The console then prints:
Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
What can I do about that, so that I could create my project in e.g.: D:\Database\ instead of connecting to other hosts?
Sounds like you're not actually running PostgreSQL locally. Is it installed and running? PostgreSQL is a client/server-based database system, so it requires the server process to be running. This is not like SQLite or HSQLDB that run self-contained within your application (or DataGrip in this case). Please see here for a tutorial on how to get started with Postgres on a Mac. There are similar tutorials for other operating systems.

Oracle Instant Client - SQL*Plus - ERROR: No TNS Listener (MacOSX)

I am developing a web application that has to be connected with the ORACLE database.
Presently I am working on macOS X and I have downloaded Oracle Instant Client.
I am able to run sqlplus, but while logging in the interface I get the following error:
SQL*Plus: Release 12.2.0.1.0 Production on Sun Jul 8 10:55:48 2018
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Enter user-name: hr
Enter password:
ERROR:
ORA-12541: TNS:no listener
For your information, I have downloaded nothing except the client software by Oracle and installed it according to the official installation documentation.
I really need to work on sqlplus for the database.
PLEASE HELP.
Also, could you please tell me how can I use sqlplus in my machine?
Instant client does not provide you with a Oracle database to work with, they are just tools to connect to a database.From the documentation of Instant Client
Oracle Instant Client enables applications to connect to a local or
remote Oracle Database for development and production deployment. The
Instant Client libraries provide the necessary network connectivity,
as well as basic and high end data features, to make full use of
Oracle Database.
So, prior to using an instant client, you need to have an Oracle database somewhere(local or remote).If you have a database server on a remote host, you may connect it using the easy connect syntax.
sqlplus user/pwd#//remote_hostname:1521/remote_dbname
If you have a tnsnames.ora file in your $TNS_ADMIN preconfigured to contain the list of database instances available, you may simply use this to connect
sqlplus user/pwd#tns_entry_for_DB
Putting the tns entry in command line also works.
sqlplus user/pwd#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=remote_hostname)(Port=1521))(CONNECT_DATA=(SID=remote_dbname)))
Moreover,Oracle doesn't provide you database software versions beyond 10gr2 to install locally on a Mac.
If you want to install and connect to a local database version 12.2 in Mac, One option is to host a virtual machine for Linux/Windows or run a docker container. Please read my post here for details: Oracle SQL for Mac OS X

how to get database sql via hirens boot?

I have a windows 7 run SQL server (I don't know what is kind of SQL) of my colleague.
My colleague is stopped work.
I don't know password windows, password sql,and sql file,...
I tried crack pass windows using hirent boot but failed, and I can't load partition to remove syskey password.
His machine is sql server.
I can't connection to his machine.
I have a question:
How to get database on his machine without login windows?
Thank all
If the service of SQL server stopped, you can copy database file and copy in other location, and can attach this file to another SQL server database engine. also you can know version of your SQL server by using SQL Server connection management, and also SQL server query (select ##Version ) if you can execute query.

Access Hive Tables in SQLClient but not from the Putty

I am new to Hive, MapReduce and Hadoop.
I am using Putty to connect to hive table and access records in the tables. So what I did is- I opened Putty and in the host name I typed- vip.name.com and then I click Open. And then I entered my username and password and then few commands to get to Hive sql. Below is the list what I did
$ bash
bash-3.00$ hive
Hive history file=/tmp/rkost/hive_job_log_rkost_201207010451_1212680168.txt
hive> set mapred.job.queue.name=mdhi-technology;
hive> select * from table LIMIT 1;
So my question is-
Is there any other way I can do the same thing in any Sql client like Sql Developer or Squirel SQL Client instead of doing it from the command prompt. And if it is there then what is the step by step process to do this considering my example as I am logging to vip.name.com from Putty .
And same thing if I need to do through JDBC Program in my windows machine then how I can do it. Means with the JDBC Program, how I can access Hive tables and get the result back. As I know how I can do this with the oracle tables. But the only confusion I have is, as I am using this hostname vip.name.com to log into Putty. I am hoping the question is clear. Any suggestion will be appreciated.
In short my question is- Can I do the same thing in any SQLClient instead of logging from the Putty?
Update-
I tried doing the way Mark has suggested me. But I am always getting- Hive: Could not establish connection to vip.host.com:10000/default: java.net.ConnectionException: Connection timed out: connect
What are you doing with Putty is SSH'ing into a machine with Hive installed and set up. Then you are issuing Hive queries from the Hive command line. That is one way of issuing Hive queries. There are other ways that don't require SSH'ing, one you probably need is connection via JDBC.
Here is an article which describes how to connect to a Hive installation on Amazon's EMR cluster using SQuirreL via JDBC. The article might appear to be Amazon specific but it's not. As long you have Hive server running on one of the nodes of the cluster and no firewall impeding connection between the client machine and one running Hive, you should be able to connect.
A couple things you might want to keep in mind related to the above link:
You can ignore step 3 where it asks you to create a SSH tunnel unless you are using EMR.
The port that you enter in your connection URI might be different in your case. Replace localhost with the fully qualified domain name of the machine that Hive is running on. To find out which port Hive server is listening on, you can look into your Hive server nanny log file present in the log directory (whose location depends on your installation) or run a simple netstat -a command. I believe 10000 is the default port number, so it might make sense to try out 10000 directly.