How to solve SSRS error message ORA-12557 TNS protocol adapter not loadable

 

 

Problem: When switching from [Design] to [Preview], you get this error message.


Sometimes, VS might fail to show the ORA 12557 message, but only show a shorter message about a dataset problem.

 

Diagnose:

How to reproduce the specific error. 

Find the Data Source that is failing.

Cick it to open it.

Click [Edit]

Click [Test Connection]






 

Suggested Solution:

Remove the environment variable ORACLE_HOME during the execution of Visual Studio; once finished, put it back.

 

Create a .bat file like this ...

@ECHO Off

 

:: remove %ORACLE_HOME% temporarily

IF DEFINED ORACLE_HOME SET ORACLE_HOME_BACKUP=%ORACLE_HOME%

IF DEFINED ORACLE_HOME SET ORACLE_HOME=

 

CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"

 

:: restore %ORACLE_HOME%

IF DEFINED ORACLE_HOME_BACKUP SET oracle_home=%ORACLE_HOME_BACKUP%

 

 

Save it as ...

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\run_devenv.bat

... being this the location where you have installed SSRS-Visual-Studio

Consider Changing your shortcut to VisualStudio accordingly.



 

How to Preview SSRS Reports on Local PC

 How to solve error during preview of  SSRS reports on local PC

 Scenario

you have an SSRS report that raises a security error when you try to preview.

 Error Message:





Cause

when your PC acts as host for the report, the security configuration does not allow you to use the referred library.

 

Solution:

Change the policy configuration on your machine, to elevate your privileges;  e.g.  to Full Trust.

 

The policy is in the file
[ C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\RSPreviewPolicy.config ]

 

Edit and find the XML node:
Configuration > mscorlib > security > policy > PolicyLevel  > CodeGroup.
(in my case, line# 55), which looks like this (before):




Consider keeping a backup of this file before modifying,  just in case.

 

Replace the “Nothing” by “FullTrust”  (case sensitive). 



Like this (after):
Save the file.
The change takes effects immediately.
Hit [Preview] and the above error should have disappeared.

 

 

 


 

Further Reading

 Partial Trust

·         How to grant permissions to a custom assembly that is referenced in a report in Reporting Services
https://support.microsoft.com/en-us/help/842419/how-to-grant-permissions-to-a-custom-assembly-that-is-referenced-in-a

·         Reporting Services Configuration Files
https://docs.microsoft.com/en-us/sql/reporting-services/report-server/reporting-services-configuration-files?view=sql-server-2017


·          Setting Security Policy for Custom Assembly in SSRS 2014 SharePoint Integrated Mode
https://joyfulcraftsmen.wordpress.com/2015/04/27/setting-security-policy-for-custom-assembly-in-ssrs-2014-sharepoint-integrated-mode/


 

 


How to query service status on a remote windows server

Use the SC command.

C:\> SC \\ServerName query "ServiceName"


C:\> SC \\ServerName query "Informatica10.1.1"
C:\> SC \\ServerName start "Informatica10.1.1"

C:\> SC \\ServerName GetDisplayName "Informatica10.1.1"
[SC] GetServiceDisplayName SUCCESS
Name = Informatica 10.1.1

C:\> SC \\ServerName  GetKeyName "Informatica 10.1.1"
[SC] GetServiceKeyName SUCCESS
Name = Informatica10.1.1


Alternative:  
Open services.msc 
Right-click on "Services (local)" on the left pane.  
Click on "Connect to another computer...".
Select the remote server.

Note: services.msc might remember which server was seected last time.  Once done, you might want to reconnect to your local computer.




 How to kill a Windows remote desktop session (RDP session) 

Use qwinsta to get all remote desktop sessions on the server.

C:\> qwinsta /server:<ServerName>    <UserName> ]

SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
services                                    0  Disc
console                                     1  Conn
rdp-tcp#2         <UserName>                 4  Active   <-----
rdp-tcp                                 65536  Listen

Observe the "ID"  !!


Then, use rwinsta to reset the session using either session ID or session name.

c:\> rwinsta /server:<ServerName> 4


It might be safer to query using username, in order to avoid killing another users' sessions by accident.


C:\> qwinsta johnsmith /server:ServerName
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
rdp-tcp#2         johnsmith                 4  Active

C:\> rwinsta /server:ServerName 4
C:\>


Followers (Guests)