Can't Connect to SQL*Plus using SID - sql

I executed the following query to find the SID of the database that I was connected to as system:
SQL> select sys_context('userenv','instance_name') from dual;
SYS_CONTEXT('USERENV','INSTANCE_NAME')
--------------------------------------------------------------
orcl
I then try connecting to system with the following command:
C:\>sqlplus system/system#orcl
SQL*Plus: Release 12.2.0.1.0 Production on Wed Aug 8 23:53:02 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
What can I do to connect to the database as system while specifying the SID?

Using a SID, you say? Expand the connect string a little bit. Here's how:
I'll use TNSPING to find information I need:
M:\>tnsping orcl
TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 09-KOL-2018 07:13:18
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\0_Oracle_library\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=db_kc11g) (PORT=1521)) (CONNECT_DATA= (SID=kc11g)))
OK (20 msec)
Now, connect:
M:\>sqlplus scott/tiger#(description=(address=(protocol=tcp)(host=db_kc11g)(port=1521))(connect_data=(sid=kc11g)))
SQL*Plus: Release 11.2.0.1.0 Production on ╚et Kol 9 07:14:05 2018
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>
Or, shorter:
M:\>sqlplus scott/tiger#db_kc11g:1521/kc11g
SQL*Plus: Release 11.2.0.1.0 Production on ╚et Kol 9 07:16:59 2018
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>

Related

the backend version is not supported to design database diagrams

When i wanna create new table in ssms 2016 or ssms 2014 give me an error
The backend version is not supported to design database diagrams
Version is
Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64) Aug 22 2017 17:04:49 Copyright (C) 2017 Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2016 Standard 10.0 (Build 14393: )
There is one point here
I connect to another server from my local computer

SQL Server 2012 not reinstalling

I have uninstalled everything from control panel with sql server 2012
It can never get past the first window of installation which has product key, license terms, product updates, install Setup files. after it has has installed Setup files the next window does not appear.
my summary file looks like this:
Overall summary:
Final result: Passed
Exit code (Decimal): 0
Start time: 2018-03-07 17:22:30
End time: 2018-03-07 17:22:52
Requested action: RunRules
Machine Properties:
Machine name: DESKTOP-US6DHAO
Machine processor count: 4
OS version: Future Windows Version
OS service pack:
OS region: United States
OS language: English (United States)
OS architecture: x64
Process architecture: 64 Bit
OS clustered: No
Product features discovered:
Product Instance Instance ID Feature Language Edition Version Clustered
SQL Server 2012 SQLEXPRESS MSSQL11.SQLEXPRESS Database Engine Services 1033 Express Edition 11.0.2100.60 No
SQL Server 2012 SQLEXPRESS MSSQL11.SQLEXPRESS SQL Server Replication 1033 Express Edition 11.0.2100.60 No
SQL Server 2012 SQLEXPRESS MSSQL11.SQLEXPRESS Full-Text and Semantic Extractions for Search 1033 Express Edition 11.0.2100.60 No
SQL Server 2012 SQLEXPRESS MSRS11.SQLEXPRESS Reporting Services - Native 1033 Express Edition 11.0.2100.60 No
SQL Server 2012 Management Tools - Basic 1033 Express Edition 11.0.2100.60 No
SQL Server 2012 Management Tools - Complete 1033 Express Edition 11.0.2100.60 No
SQL Server 2012 Client Tools Connectivity 1033 Express Edition 11.0.2100.60 No
SQL Server 2012 Client Tools Backwards Compatibility 1033 Express Edition 11.0.2100.60 No
SQL Server 2012 Client Tools SDK 1033 Express Edition 11.0.2100.60 No
Package properties:
Description: Microsoft SQL Server 2012
ProductName: SQL Server 2012
Type: RTM
Version: 11
SPLevel: 0
Installation location: C:\Users\RedRam\Downloads\SQLFULL_x64_ENU\x64\setup\
Installation edition: Evaluation
User Input Settings:
ACTION: RunRules
CONFIGURATIONFILE:
ENU: true
FEATURES:
HELP: false
INDICATEPROGRESS: false
INSTANCENAME: <empty>
PID: *****
QUIET: false
QUIETSIMPLE: false
RULES: SCCCheckRules
UIMODE: Normal
X86: false
Configuration file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20180307_172224\ConfigurationFile.ini
Rules with failures:
Global rules:
There are no scenario-specific rules.
Rules report file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20180307_172224\SystemConfigurationCheck_Report.htm
Any Hints thank you
You might have to check the APPDATA folder for the remaining files of SQL Server. These needs to be deleted as well.

How to create Link server to connect Oracle database?

I just used this command to install OraOLEDB.Oracle
install.bat all c:\oracle odac
I've tested .udl file it's working fine!!! But when I test link sever I'm getting error.
SQL SERVER Information as below
Microsoft SQL Server 2014 - 12.0.2000.8 (Intel X86)
Feb 20 2014 19:20:46
Copyright (c) Microsoft Corporation
Express Edition on Windows NT 6.3 <X64> (Build 15063: ) (WOW64)
Oracle information
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
"CORE 12.1.0.2.0 Production"
TNS for 64-bit Windows: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
OS information
window 10
64 Bit
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or
batch. (Microsoft.SqlServer.ConnectionInfo)
The OLE DB provider "MSDAORA" for linked server SQL2ORACLE reported an
error. The provider did not give any information about the error.
Cannot initialize the data source object of OLE DB provider "MSDAORA"
for linked server SQL2ORACLE. (Microsoft SQL Server, Error: 7399)
Right click on the provider (MSDAORA in your case) and click on Properties. This will open the providers properties. Ensure that "Allow inprocess" is checked.

SQL Server 2016 - Dynamic Data Masking (DDM)

Does anyone know if DDM has to be enabled before it can be used (and if so how), or are there only certain versions of SQL Server 2016 that have this functionality as trying to run:
ALTER Table Employee
ALTER COLUMN NAME ADD MASKED WITH (FUNCTION='DEFAULT()')
results in the following error:
Msg 534, Level 15, State 100, Line 4 'ADD MASKED' failed because it is
not supported in the edition of this SQL Server instance
'DELL-001\SQLEXPRESS01'. See books online for more details on feature
support in different SQL Server editions.
The version of SQL I have installed is:
Microsoft SQL Server 2016 (RTM-GDR) (KB3194716) - 13.0.1722.0 (X64)
Sep 26 2016 13:17:23 Copyright (c) Microsoft Corporation Express
Edition (64-bit) on Windows 10 Home 6.3 (Build 14393: )
Thanks!
This wasn't available in any edition lower than standard when SQL Server 2016 was released.
However recently SP1 was released which does enhance the functionality of lower versions quite considerably.
So you just need to install SP1.
Image Source

Can't Type password in Sql Plus

I recently install the oracle software, after completion of installation.
i tried to open the sql plus,
there i typed my username and pressed enter
in next line, i am trying to type password, but my cursor is not moving, like it is not displaying anything, just blinking only.
then error message is displayed.
Same issue. This following command worked for me:
CONNECT SYSTEM/your password
What is your issue?
From command prompt of your OS,
Type sqlplus
For pre-12c, just give username, press enter. On 12c, mention username#pluggable database name, else by default you would be connecting to container database.
Now enter password, you won't see anything, but when typed and entered correctly, you would login successfully.
Let's see in 12c,
My OS is windows so I just typed sqlplus in command prompt,
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\lkb>sqlplus
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 31 13:06:12 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter user-name: lalit#pdborcl
Enter password:
Last Successful login time: Fri Oct 31 2014 13:02:03 +05:30
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt
ions
SQL>
The password gets typed in after you enter the username but does not get displayed due to security purpose.