Read connection setting from a text file - oracle11g

I am developing a transformation (on pentaho 4.4.0) which basically reads data from one oracle DB (11g), makes some transformation and loads data into another Oracle DB. Now for DB table input/output when I need to select a connection I have to select it from a drop down menu in 'Edit Step'. When I edit the connection, it asks me settings, like Host name, database name, port number, user name, password.
What I want is, to create a text file called 'Pentaho_connection_properties' in some directory on my machine where I will save all these info and as soon as I choose a connection name from the connection drop down menu, Pentaho should automatically read the file and populate the settings corresponding to that connection name. The purpose is to get rid of this manual process to entering settings again and again for multiple use of same DB.
Please let me know how this can be done. I will appreciate if you can be little explicit since I am new to Pentaho.
Thanks

Switch to using database repositories. Connection definitions are shared throughout an entire database repository.

Related

Access 2010 Cannot share database across network

I have a 2010 Microsoft Access database in the format FixList.accdb
There is one table and one form in it, that i want a small number of users to access at the same time.
I have split the database, so that the back end is in a different folder to the front end.
Finally, i have gone to options and selected the following:
- Default Open Mode =Shared
- Default Record Locking = No locks
- Open Databases by using record-level locking (NOT ticked)
It opens fine when 1 user opens the database, but when a second user double clicks the Access file to open, the following message appears. "You do not have exclusive access to the database at this time. If you proceed to make changes, you may not be able to save them later". My question is, what other change(s) can i make to this database so that the error message above does not appear when more than one person opens the file?
Do NOT have more than one concurrent user open the same copy of the front-end (e.g., by having all users open the copy from a folder on the server). Each user must have their own local copy of the front-end .accdb/.accde file.

How to create data base link in oracle11g

How to create data base link in oracle 11 g to Access Tables.
You seem to have copied the example in the documentation without really understanding it.
The USING 'local' part of the statement is creating a link to 'the local database', where local is the service name of a database. (The example is a bit confusing, to be fair).
When the link is used it tries to interpret local as a service name, appending the current database's domain, as the docs say:
USING 'connect string'
Specify the service name of a remote database. If you specify only the
database name, then Oracle Database implicitly appends the database
domain to the connect string to create a complete service name.
Therefore, if the database domain of the remote database is different
from that of the current database, then you must specify the complete
service name.
If you're trying to create a link back into the same database - which would be a bit odd but I've seen it done in place of grant access across schemas, and that seems to be what the example is hinting at - then you can replace 'local' in the USING clause with the service name of your current database (e.g. USING 'orcl', or whatever).
You can also use a TNS alias; if your tnsnames.ora has an entry for SOME_DB which points to the SID or service name of another database, you can have USING'some_db'`. You should be able to use any connect string I think; certainly Easy Connect is allowed. There's more in the net services admin guide.

Using Access database for webpage, concurrent user issues

I have a simple access database that resides on a network drive. All of the people that need to make any modifications to this database have access on their machine, but they would like to have a read-only website just displaying the data contained in it. I set up a website and tried using the accessdatasource, and while I could connect, it had issues whenever a user had the database open in access. I swapped to using a sqldatasource with a connection string set up according to www.connectionstrings.com, but I seem to be having either the same or similar issues, depending on how I set up the string/database. Basically, the entire issue is, if the database is opened by any user, the webpage is prevented from opening the database. Is it possible to open the database read only from the webpage?
It is an access 2000 database, but everyone is using copies of access 2007, and in all of these instances, the ASP.NET user has read/write access to the network directory containing the database, and read access to the database itself.
When I use the connection string:
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\<source>\<database>.mdb;User Id=<USER>;Password=<PASSWORD>;Mode=Share Deny Write;"
Where is not the default "admin" user, and is configured to have open/run (not open/exclusive) permissions on the database, I get the error:
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
As far as I can tell, there is no workgroup information file, but I am not really sure what I am doing there.
When is the default "admin" user, I get the error:
Could not use ''; file already in use.
If someone has the database currently open, otherwise, it works fine.
And finally, if I use the connection string:
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\<source>\<database>.mdb;User Id=<USER>;Password=<PASSWORD>;Mode=Read;"
I get the error:
Could not lock file.
I have been googling this for the past several days now and I feel like I've just been going around in circles. Any insight at all would be appreciated.
As it's Access 2000 format there will definately have to be a workgroup file (.mdw) even if that has no security set as such. I would try the connection string whereby you also specify the workgroup location e.g:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:System Database=system.mdw;User ID=myUsername;Password=myPassword;
Furthermore, I wouldn't recommend setting the read/write properties in the connection string, instead I think you would be better to create an account in the workgroup file and only assign it read only priviledges.
Update:
This is the ODBC connection method:
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;

How to change data source in reportviewer control

I have a reportviewer (Microsoft.ReportViewer.WebForms) control on my page. All my reports use one data source. I want to be able to let my reports run on a different database when started from my UAT enviroment. So the location of the reports is the same, but the data comes from a different db. I cannot seem to find how this is done, is it even possible?
EDIT: They are server reports on SQL Server . I know you can set the dataset programmaticaly but I just want the reports to point to a different db and leave the rest of the report intact.
2005
TIA,
John
Did you want to pass a full connection string to the report as a parameter? You can do it but sometimes SSRS gets funny and make sure you delete the report off the server before you deploy a new copy when doing this...
1. Make a parameter - let's call ours connectionStr. Make it not null, not blank, single select and text as the data type. Eventually, you will want to hide this parameter but for testing please leave it visible.
2. So the value you will be using as the connection string... (for testing I set this as the default for the parameter, with nothing put under the available values section) Data Source=MySQLServerName;Initial Catalog=MyDatabaseName;Persist Security Info=True;User ID=MyUserNameForTheServer;Password=MyPasswordForTheServer;MultipleActiveResultSets=True
3. You need an unattended execution account on your report server or you get this: unattended execution account is not specified. (rsInvalidDataSourceCredentialSetting). http://msdn.microsoft.com/en-us/library/ms156302.aspx I can't provide more details because my boss had to do this part for me.
4. Under your datasource properties in SSRS... check Embedded Connection, select the type (mine is just a normal MS SQL Server), for the connection string, open the expression box and put: =Parameters!connectionStr.value and then click credentials and make sure the last option for no credentials is selected.
5. Your datasets for that datasource will no longer be happy when you try to edit them in design view but you can switch the datasource connection properties back to how they were, not using the parameter based connection string, for editing them.
My reports are on different servers, with different instances of the Report Server, too. On some servers, they need to get their data from various databases depending on whatever, stuff. This way, with the connection string as a parameter, I can use the same reports everywhere and just deploy them to the different servers. If you are having to pass this connection string around your app or to a report viewer, I suggest using encryption.
Like I said... SSRS get's funny when you start doing this, though. Your reports should always work in preview mode after doing this, if they don't even when provided with the correct connection strings, then you have an issue that won't be solved by just deploying to the server. Trouble shooting problems with this once they are on the server but not working include checking permissions, making sure the report receives the correct connection string and making all your stored procedures and functions within the SQL database are all the same.
If you want to just pass the database name and everything else is the same (server name, username, password) then just set the connection string parameter equal to your database name and for the datasource expression value use
="Data Source=MySQLServerName;Initial Catalog=" + Parameters!connectionString.value + ";Persist Security Info=True;User ID=MyUserNameForTheServer;Password=MyPasswordForTheServer;MultipleActiveResultSets=True"
I needed to pass the whole thing in, and you can play around with the credential settings - you might be able to save the server username/password info in there for each report so that the unattended execution account is not needed.

Query table from another ms sqlserver

I'm really not a database person, so forgive me if this question.
I'm using Visual Studio 2008 and I am trying to view tables on another server database.
Example:
I have my aspnetdb.mdf database, and my anaylsis.mdf database.
What I am trying to do within Visual Studio is read table columns that are inside aspnetdb.mdf from anaylsis.mdf.
How is this done?
Thanks
In order to have access to any object in other server, you need to create a linked server to that server as below:
in your aspnetdb go to server Objects -> Linked Servers ->Right click -> new linked servers .
a window will be opened that you have to fill the information in the general tab as below:
Linked Server: anaylsisDB
Server Type: otherdata source
Provider: SQL Native Client
ProductName :SQL
Data source: anaylsis(This is the server name which you want to connect to)
After you finished with this tab, in the left side of the page goto secutity tab and fill the information as below:
In the bottom of the page select be made using this secutity content and insert the anaylsis server username and password.
click ok and now you have made a linked server to the anaylsis. so you can use any objects in anaylsis with this format:
anaylsisDB.[Databasename].dbo.[tableName]
or
anaylsisDB.[Databasename].dbo.[ViewName]
Here anaylsisDB is the name of the linked server that we have made to the anaylsis server.
SELECT * FROM [linkedServer].[database].[dbo].[someTable]
You find some usefull information in the T-SQL Documentation on MSDN:
If the table or view exists outside the instance of SQL Serverl, use a four-part name in the form linked_server.catalog.schema.object. For more information, see sp_addlinkedserver (Transact-SQL).
Source:
http://msdn.microsoft.com/en-us/library/ms177634(v=SQL.100).aspx#c089161a-53bf-46d4-a2da-51252dd10e3f_c
A useful way to do that is to use VIEWS, you create view with DATAS from other databases and use it like a kind of table in your Database..
MSDN
You can either setup a linked server on the the same server you are running the sp on which will give it an alias i.e.
select *
from Server2.Database2.dbo.SomeTable
Or you can use the OpenRowset command. I always try and use the Linked server option although, the OpenRowset is useful if you don't have server admin access.
Both are obviously dependant on the servers being able to communicate ok.

Resources