How to test database behavior? - database-performance

Dear all, Is there any tool available that can check all databases in a system by sending some sample data to the database to make sure that data transaction is occurring correctly. Moreover, the sample data should be invisible an inaccessible from the outside world. If you have any idea please help.
Update
Thank you for your answer. But I have some questions regarding your given answer.
Is the above solution is applicable to MySQL and SQLite?
If so, then where to open the database.txt file?
By the way, I am using WampServer2 for the system and my database is MySQL

1) create database.txt file and
change file type with name
database.udl
2) open the file
3) select tab provider
4) select Microsoft Ole Db Provider
for ODBC Drivers and press Next
5) write . or (local) in Use data
source name
6) select database name in (Enter the
initial catalog to use)
7) Test Connection

Related

Access to __MDrivenServer locked

Although I have been using ECO from a few years, I am very new to MDriven Turnkey.
I have created an account and a site in portal.mdriven.net, but when I visit MDrivenServer I get the following message:
You currently do not have access - this is due to setting AdminRequireIdentification==true and you do not have correct role
According to the help manual in MDrivenTheBook Part 10 MDrivenTurnkey:
"When you have accidently locked yourself out you can find the admin database, open it with SqlServerCompact tools. Find table admin_GlobalSettings and set column TurnOffRegistration to 0 (false) – now you may register a new user and regain control."
The database is located in __MDrivenServer\App_Data\DatabaseCompact.sdf
I have Visual Studio 2010 and I have also downloaded the SQL Server Compact Tools, but I have not idea how to open the
https://SchoolAurelio.azurewebsites.net/__MDrivenServer/App_Data/DatabaseCompact.sdf in order to set the column TurnOffRegistration to 0.
How can I update the sdf file?
Thanks,
Jose Maria
In the Compact tools you do something like "connect" and choose the sdf downloaded file. Once there there you can do sql on the ASP_User table.
BUT - in the portal.mdriven.net you have a SendSettingsAndRestart, this operation should unlock a locked mdriven-database. It will also inject a new pwd if you have changed it in portal. Please try this operation and see if things clear up.

Replacing Data Source from one Server to Another

We are deploying Tableau for a bank.
We had created 6 test dashboards using dummy data on a staging data base using sql connection and lets say has an ip 10.10.10.10.
Now we need to use the same view we had used with the dummy data on Live data but using a different connection which is again an sql engine & IP lets say as 20.20.20.20. All the variable names and other properties are the same, not difference is that the Live data would not have calculated fields which we can deploy on the Live environment.
The challenge is: the LIVE data being of a bank is highly confidential and cannot be used from outside operations site rather we need to deploy it from an ODC [restricted environment]. Hence we simply cannot do a replace data source.
Hence we are planning to move twbx files and data extracts for each of these views using a shared folder to the ODC. Then the process would be like below:
As the LIVE sql data base is different from the dummy sql we will get error
We will select edit data connection
Will select tableau data extract for each sheet and dashboard
Will then select the option of replace data source and select LIVE SQL database
Will extract the new data
The visualization should work fine
Earlier we had just moved TWBX files hence it failed. Is there a different approach to it.
I did something similar to it
For that, you must have
same schema as of Live database and dummy database
do not change name of any source table or column
create your viz
send it in the .tbw form which is editable HTML format
Now the hard part- open your tbw in notepad and replace all connection details to new one
save and open in the tableau
tell me if it didn't worked
One method would be to modify your hosts file on your local computer, pointing the production server name the staging instance of the database. For example, let's say your production database is prod.url.com and you have a reporting staging db server instance called reportstage.otherurl.com
Open your hosts file. Add an entry for prod.url.com. Point it to reportstage.otherurl.com
Develop the report in Desktop, with the db connection string to prod.url.com.
When you publish the twb file to Server, no connection string changes are needed.
Another easier way is to publish the twb to Server with your staging connection string but edit the connection string in the data source in Server.
Develop the twb file on your local computer against your staging database.
Publish the twb file to Server.
Go to the workbook on Server and instead of looking at the views, click on Data Sources.
Edit the data source(s) connection information. This allows you to edit the server name, port, username, or password.
I've used this second method quite a bit. We have an environment where we can't hit the production db outside of the data center. Our staging environment doesn't have that restriction. We develop against the stage db, deploy, and edit the server name in the data source.

Can SQLite DB files be made read-only?

Information from an SQLite DB is presented to user through a web server (displayed in an HTML browser). The DB is loaded once for all by a small application independent from the web server. DB data cannot be changed from user browser (this is a read-only service).
As the web-server has its own user-id, it accesses the SQLite DB file with "other" permissions. For security reason, I would like to set the DB file permissions as rw-rw-r--.
Unfortunately, with this permission set, I get a warning attempt to write a readonly database at line xxx which points to a line about a SELECT transaction (which in principle is read-only). Of course, I get no result.
If permissions are changed to rw-rw-rw, everything works fine, but that means everybody can tamper with the DB.
Is there any reason why SQLite DB cannot be accessed read-only?
Are there "behind-the-scene" processings which need write access, even for SELECT transactions?
Look-up on StackOverflow shows that people usually complain for the opposite situation: encountering a read-only access permission preventing writing to the DB. My goal is to protect my DB against ANY change attempt.
For the complete story, my web app is written in Perl and uses DBD::SQLite
You must connect to your SQLite db in readonly mode.
From the docs:
You can also set sqlite_open_flags (only) when you connect to a database:
use DBD::SQLite;
my $dbh = DBI->connect("dbi:SQLite:$dbfile", undef, undef, {
sqlite_open_flags => DBD::SQLite::OPEN_READONLY,
});
-- https://metacpan.org/pod/DBD::SQLite#Database-Name-Is-A-File-Name
The solution is given in the answer to this question Perl DBI treats setting SQLite DB cache_size as a write operation when subclassing DBI.
It turns out that AutoCommit cannot be set to 0 with read-only SQLite DB. Explicitly forcing it to 1 in the read-only DB case solved the problem.
Thanks to all who gave clues and leads.

Not Able change parsing schema at run time in oracle apex 5

I am using Oracle apex 5,oracle database 12c
I have successfully configured oracle apex 5 with oracle DB 12c.
I have created authentication scheme using database table,that Authentication scheme worked successfully.
But my requirement is - Each user has to be connect to its own schema
(eg.user1 = HR; user2 = SCOTT)
with in same application.
Shortly, application must run on multiple schemas at run time.
But I am not able to get that,I have tried below stuff -
current parsing schema is 'SCOTT' try to change it using -
apex_application.g_flow_owner := 'HR'; --Failed
ALTER SESSION SET CURRENT_SCHEMA = 'HR'; --Failed
I don't understand what to do,Please some body help me for solving it.
I think you are on the right track, the apex_application.g_flow_owner := 'HR'; command should do the trick but you have to place it in shared components > security > security attributes> database session > Initialization PL/SQL Code
Edit: First of all having a schema for each user that logs into the application i do not think is the best approach. Just think that every modification has to be done to all the schemas. I suggest you take a look at Virtual Private Database (VPD) it can help you to control data access.
But if you still want to try changing the schema i think you can do it like this. Create two processes for each page in your application; one at On Load Before Header and one at On Submit. This process should contain something like this:
BEGIN
if :APP_USER='SCOTT' THEN
apex_application.g_flow_owner := 'SCOTT';
ELSE
apex_application.g_flow_owner := 'HR';
END IF
END;
Like this when Scott loads a page the schema is changed to SCOTT and he sees data from his schema. When HR loads a page the schema is changed to HR and he sees his data. Same thing when they submit a page; the schema first changes and then you do the other operations.
This second idea is not bullet proof and that's why i advise you to rethink what you want to do.
Edit2: In component view simply click on the plus sign on "Processes" to add a process and in the wizard select "On Submit - Before Computations and Validations" for the Point option.

Oracle Data Integrator 11g Reverse Engineer not importing tables

I am New To ODI 11g, i have to transport data from one Database(Oracle) to another Database(Oracle), for this the table in source was already imported in the source model, i am trying to setup Target database's meta data in ODI 11g and i have done all the steps right when i try to reverse engineer this new model which i created nothing happens. I am stuck with this problem at work since there is no error so i cannot think of any reason why meta data is not being imported
I would like to clarify this, the target table which i am trying to import is accessed from ODI with the super user
Any help would be appreciated.
Could you check that the schema used to connect to the Dataserver where the target table is located actually got the privileges to access the target table?
If not, grant select and insert (and maybe update, delete depending on the IKM you use) on that table.
I faced the same issue and resolved it by providing read access to the schema ODI is using to reverse engineer.
As I was using standalone installation, ODI studio log had the below information:
[2015-01-17T19:10:21.979+05:30] [] [NOTIFICATION] [] [] [tid: 2374]
[ecid: 0000Kfs7s20Fg4WFLzvH8A1KiWkx00000d,0] New data source:
[HR/*******#jdbc:oracle:thin:#//localhost:1521/pdb1]
HR schema was the first schema I reverse engineered, and it was being used as default user to read other schemas.
Try checking the agent logs to see what user is being used and provide it the privileges on all other schema's.
Althoug I dont know how to tell ODI to use a particular user to access database while reverse engineering. It would be great if some one gives some insight on it.
Probably on masking of reverse engineering you are missing character: %