SSRS connection to Oracle database - reporting-services

I know that there are many sources on the Internet on how to do that, but non of them is exact.
Can anybody write clear steps on what have to be done (downloaded, together with links) to connect to oracle database from SSRS, and where to find connection string names from Oracle.
Using:
SQL Server 2012
Oracle Database 11g Enterprise Edition
for example, this link https://support.microsoft.com/en-us/kb/834305, says that I have to install oracle client tools, I typed that in Google, and brought me to this page http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html, I've chose my OS type and downloaded the file, unzipped it, tried to run exe files, but non of them runned. Maybe I don't have to run exe files, or where should I put that folder?

Here are the steps:
Download the right Oracle client (based on your Operating System) from following link http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
After installing it, navigate to <Installed_Location>/app/<user_name>/product/client/network/admin
Open the tnsnames.ora file and add the entry (example given below)
ORA12DB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.0)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORA12)
)
)
To make sure you have installed the client properly and set the right entry in tns file, please do the following:
(i) Open command prompt
(ii) Type tnsping ORA12DB
(iii) Hit Enter key
(iv) You should see a successful message that says; tns adapter is able to resolve the alias. OK.
Once all the above steps are performed, provide that same alias name (in the above example, it was ORA12DB) in "Connection String" in the SSRS.

Related

How to configure Squirrel SQL client to work with MS Access

I'm struggling to get Squirrel SQL to connect to MS Access database (just a normal one, no password):
I create an Alias and use Driver: JBDC ODBC bridge (There is a tick in front of this driver)
I don't know what to put in URL
-------- I use: Path to database file ~~> Unsuccessful
-------- I use: jdbc:odbc:Path to database file ~~> Unsuccessful
I'm running it on windows 7.
I guest this should be a simple straight forward process, but please advise me how to get it working.
Now that the JDBC-ODBC Bridge has been removed from Java 8 the previous answer to this question will become less relevant over time. The following method uses the UCanAccess JDBC driver so it will work with Java 8 and it will also work on non-Windows platforms.
First, make sure that you are using UCanAccess version 3.0.5 or later. Download the latest version of the UCanAccess driver (bin.zip file) and unzip it to a convenient location. For this example I unzipped it to
/home/gord/Downloads/JDBC/UCanAccess
Note: When unzipping the distribution file be sure to specify "Keep directory structure" (or similar, depending on your unzip tool) so the folder structure appears as in the screenshot above.
Creating a Squirrel SQL "Driver" entry (one-time setup)
In Squirrel SQL, create a new "Driver" entry for UCanAccess
and specify the location of loader/ucanload.jar on the "Extra Class Path" pane
Note: Remember to enter net.ucanaccess.jdbc.UcanloadDriver as the "Class Name" (see above).
Creating a database "Alias" (one for each database)
To open a specific database, create a Squirrel SQL "Alias" entry, replacing the <path_to_database_file> placeholder with the actual path to the file
or, in Windows
Important: Make sure that the connection URL ends with ;showSchema=true.
I found the solution. Put below string in URL:
(Assuming that path to your database file is D:\DBs\DatabaseFile.mdb)
jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=D:\DBs\DatabaseFile.mdb

SSIS Error while deploying package The locale identifier (LCID) is not supported by SQL Server

I get this error when deploying a package to SQL 2012 SSISDB catalog:
A .NET Framework error occurred during execution user-defined routine or aggregate "deploy-project-internal":
System.Data.SqlClient.SqlException: The locale identifier (LCID) 9242 is not supported by SQL Server
......
I had a very similar issue (different LCID) and took me weeks to resolve it but I hope is the same issue you where having and it helps for any other users.
So somehow something got bad installed on the SQL Server, the service account that is setup to run the SQL Server Service doesn't have all the necessary permissions.
I tracked this issue down to a very specific procedure, try to execute on the SSISDB the procedure [catalog].[check_schema_version] and you should be getting the same error message you are getting.
If executing the procedure gives you the same error, then the soultion is going to be the same. You basically need to change the account that is running SQL Server Service (not Integration Services) to be a local admin, and change the Locale on the RegEdit for that Local Admin acccount to be the one you want.
TO do so, do the following:
Execute on Command Prompt the following to get the SID:
wmic useraccount where name='Administrator' get sid (Replace
Administrator by your Local Admin Account)
Go to RegEdit -> HKEY_USERS -> [SID Local Admin] -> Control Panel ->
International and change keys "Locale" and "LocaleName" for the
desired region,(in my case it was Locale 00000409, LocaleName en-US)
Open Windows Services, look for the SQL SERVER (MSSQLSERVER) and
change the running account to be your local admin
Restart the Service
That should be it. I figured all that out thanks to the combination of these 2 pages:
https://www.facebook.com/allaboutssis/posts/329497130467714
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9f409937-772a-41bd-8270-7804fdd5b94e/failure-in-deploying-ssis-project-from-ssdt-to-sqlserver-2014?forum=sqlintegrationservices&prof=required
Also I had a similar issue with the LCID for the Palestinian State which was added recently to windows and it seems that the SSIS doesn't recognize this LCID. So changing the windows LCID to another one solved the problem (from contorl panel then regions)
I solved it in the following way.
First, check in Services which user SQL Server (MSSQLSERVER) runs as:
Next, open the Registry Editor and navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\. Find which ID the user has. In my case, the user MSSQLSERVER has the ID S-1-5-80-3880718306-3832830129-1677859214-2598158968-1052248003:
When you have the user's ID, in the Registry Editor, go to the path Computer\HKEY_USERS\[USER ID]\Control Panel\International. In my case, the path is Computer\HKEY_USERS\S-1-5-80-3880718306-3832830129-1677859214-2598158968-1052248003\Control Panel\International. There you will find two keys named Locale and LocaleName:
In my case, they had the following values:
Locale = 00000c00
LocaleName = en-SE
Change them to:
Locale = 00000409
LocaleName = en-US
Next, restart the service SQL Server (MSSQLSERVER).
After that, I was able to deploy the project:

Timberline ODBC Error with SQL Server Linked Server: Cannot initialize the data source object

Just to lay the ground work:
On a 64bit Windows server we have a 64bit install of SQL Server 2008 R2
We installed a 32bit version of SQL Server Express on the same machine
Using the 32bit Express version, we successfully created a linked server to a Timberline data store as follows:
EXEC sp_addlinkedserver
#server = 'TimberlineTest',
#provider = 'MSDASQL',
#srvproduct='Timberline Data',
#datasrc = 'TimberlineDSN'
This then returns all of the tables:
exec sp_tables_ex 'TimberlineTest'
We also created a user as follows:
EXEC sp_addlinkedsrvlogin
#rmtsrvname = 'TimberlineTest',
#useself = 'False',
#rmtuser = 'sa',
#rmtpassword = 'xxxxxx'
GO
Also, within a SSMS query window, this works great when run against the Master db:
select * from timberlinetest.[c:\Training\Extended]..Master_PRM_Employee
Everything works just fine so long as we execute the queries from within SSMS. However, when we fire up any sort of third party tool that might try to access that linked server, we start running into trouble. We have a little query testing tool that allows you to enter a connection string and run queries. We're using this connection string to first get to the Master db:
Provider=SQLOLEDB; Data Source=localhost\SQLEXPRESS32BIT; Libraries=Master; User ID=sa; Password=xxxxxx
That connection works, and we can ping the server and query the Master db. But when we try the same Timberline query (select * from timberlinetest....) we run into this error:
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "timberline test". OLE DB provider "MSDASQL" for linked server "timberline test" returned message "[Sage Timberline Office][Sage Timberline Office ODBCDriver][DRM File Library] Invalid account name."
A couple of things to note... for testing purposes:
On the directory c:\Training\Extended we have opened security wide up, setting Everyone to full read-write permissions
Within Timberline itself, we disabled security (Tools > Security Admin > Security Settings > Unchecked "Turn On Application Security")
I'm not sure what else to do here. Any advice would be great.
(Answered in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
Problem solved.
I changed the connection string to:
Provider=SQLOLEDB; Data Source=.\sqlexpress32bit; Libraries=master; Trusted_Connection=Yes
And that worked!!

Find the windows service name of MySql server instance

The default name of windows service which holds MySQL server instance is 'MySQL'. But MySQL 5.5 allows user to specify any name for it after installation. Now I need to know the name of MySQL windows service but I can't understand where my application should look for this name. I was trying to specially make this name unusual and then find where MySQL stored it in the system. But this unusual name was only in the services list of windows registry. my.ini, my-huge.ini, and other ini files of MySQL server does not contain information about how it's windows service is named. So where MySQL stores this name?
Windows version: 7 X86/X64, MySQL version: 5.5.
Thanks in advance.
New to MySQL, I ran into the same question. What I've done to workaround this is set the instance shared_memory_base_name to the same as the service name in the ini:
# shared_memory
shared_memory_base_name=MySQLServiceName
This make it available via the system variable ##shared_memory_base_name. I don't actually enable the shared-memory connections, just set the variable.
I haven't tried it on Linux, though maybe setting the ##socket system variable could provide the same.
I realize this is a bit late to help you now, but someone may find it useful...
It's stored in the registry. The MySQL Instance Configuration Wizard reads the registry which contains the name and also the path to the corresponded service .exe.
But I don't exactly know how to find these registry entries programmatically.
PS: The entries may can be found here:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL[xy]
(xy is the version like: 57 for 5.7)
The ServiceName is stored here in the key "DisplayName" and the path to the .exe in "ImagePath".
Note: These path may contains start parameters like the path to the my.ini file also.
MySql variable ##pid_file contains path to the file contains proccess id of mysql instanse.
Read this value and map to the windows service.
In my c# code:
public static string GetServiceNameFromPid(uint pid)
{
string result = null;
var searcher = new System.Management.ManagementObjectSearcher($"SELECT NAME FROM WIN32_SERVICE WHERE PROCESSID = {pid}");
foreach (var managementBaseObject in searcher.Get()){
if (result != null){
throw new InvalidOperationException("PID correspond two or above service name");
}
result =(string) managementBaseObject["NAME"];
}
return result;
}
MySQL does not need to store this name anywhere. The server process gets launched by Windows service controller, and the client communicates with the server via the network, so it does not need to know the name either. As you discovered, the only place this will appear is in the services list in the registry. Consider that on Linux, daemon processes don't have special names the way Windows services do. The service name is an artifact of running on Windows, and MySQL doesn't know or care about it.

Unable to attach "AdventureWorks2008" Sample Database to a named Instance in SQL Server 2008

First of all "Northwind" and "AdventureWorksDW2008" databases attached without problem, but "AdventureWorks2008" fails with the following error.
//Msg 5120, Level 16, State 105, Line 1
Unable to open the physical file
"C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents".
Operating system error 2: "2(The system cannot find the file specified.)".
Msg 5105, Level 16, State 14, Line 1
A file activation error occurred. The physical file name
'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents'
may be incorrect. Diagnose and correct additional errors, and retry the operation.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'AdventureWorks2008'. CREATE DATABASE is aborted.
I did not use the default database instance "MSSQLSERVER" during install.
So where is it finding this path "C:...\MSSQL10.MSSQLSERVER...\Documents"?
go to sql server configuration manager
sql server services SQL Server(MSSQLSERVER)
change the "log on as" to "local system"
First of all you need to enable the FILESTREAM usage:
EXEC sp_configure filestream_access_level, 2
RECONFIGURE
After that you can create the DB:
USE [master]
GO
CREATE DATABASE [AdventureWorks2008] ON
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLTRAININGKIT\MSSQL\DATA\AdventureWorks2008_Data.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLTRAININGKIT\MSSQL\DATA\AdventureWorks2008_Log.ldf' ),
FILEGROUP [PRIMARY] CONTAINS FILESTREAM DEFAULT
( NAME = N'Documents', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLTRAININGKIT\MSSQL\DATA\Documents' )
FOR ATTACH
GO
Change the TRAININGKIT instance name for your instance name and check the paths after that run with sysadmin privileges.
This is my solution for SQL2008R2 :
Create folder Documents under Data folder
Start MSSQL Mgmt Studio (run as Admin)
Set Filestream Access Level to Full Access Enabled (Srv properties/Advanced)
Attach db AdventureWorks2008R2.mdf (add db and remove Log file before attaching)
just like SQL Guy! i enabled FILESTREAM from configuration manager=>services=>yourinstance=>right-click=>properties=>advanced and then i you can
remove the necessity of the log file from the attachement menu ( right click on database in sql => attach...). and it worked!
It was appearing to work, but becoming Suspect after SQL service restart. SQL Log said:
Message FILESTREAM's file system log record 'placeholder.txt' under
log folder '\?\C:\Program Files\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents\$FSLOG' is corrupted.
Combining various suggestions found above, I got it to work (and survive service-restart without going Suspect) by:
Grant SQL service account FULL permissions to the MDF & LDF files and the Documents folder BEFORE copying them into DATA.
Delete C:\Program Files\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents\$FSLOG\placeholder.txt
(R2 BOL hints at this, but directs it at the wrong level).
CREATE DATABASE [AdventureWorks2008] ON ( FILENAME =
N'C:\Program Files\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008_Data.mdf'
), ( FILENAME = N'C:\Program Files\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008_Log.ldf' )
, FILEGROUP [PRIMARY] CONTAINS FILESTREAM DEFAULT ( NAME =
N'Documents', FILENAME = N'C:\Program Files\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents' )
FOR ATTACH_REBUILD_LOG
Solved it by below ways:
I fixed it As the .mdf and .ldf files where on different drives,
it was giving some wierd error so i attached only mdf files and the server created .ldf files on the same drive as mdf. this way i could attach it but then i took the db offline copied the log from D:\ to E:\ and then brought the db online. it worked.
and sometimes you can :
try login with Windows Authentication and
Start SQL Server manager as Administrator (right-click on the program, choose "Start as administrator")
Seems like many are having this issues, including me, and including the guy who logged this bug with MS Connect:
http://connect.microsoft.com/SQLServer/feedback/details/567193/adventureworks-2008-fails-to-attach
This is the only way I could get it to work. (Install without filestream)
Go to Download 'AdventureWorks 2008R2 OLTP Script'
Unzip and open the instawdb.sql script. Remember to set the variables at the top of the script. Run the script. This should bulk load all the data as well. Good luck!
This worked for me:
Software used-SQL Server 2008 Express R2, Windows Vista OS, Adventureworks2008R2.mdf
Place the database in the Program files(X86)\Microsoft SQL
Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA folder (or similar location
for your operating system)
All my installation files are in the default. This was done on
Windows Vista with SQL SERVER Express 2008R2. The database used was
Adventureworks2008R2.mdf.
IMPORTANT PART---After picking the database in SSMS ATTACH DIALOGUE
BOX you must Remove the log file first (within the Attach dialogue
box), (.ldf file). If you do not Remove this file the attachment
will fail with an error message.
Database attached and is working perfectly without any changes to
accounts or logins or any other steps.
In my case the problem had to do with the file I was using and the version of SQL. I have installed SQLServer2008R2 and the file I was using was AdventureWorks2008_Data.mdf. I downloaded the one from here http://msftdbprodsamples.codeplex.com/releases/view/59211 (AdventureWorks2008R2_Data.mdf) and all is fine now.