Detecting changes in database
Hi,
I connected to MySQL database using JDBC, displayed all data I need. But now I would like to detect changes in database (for example when somebody in network insert new row, I need get an event and then read data from database again).
Did any body know how to detect changes in database???
Thank you.
Petr
your question is too general, there are many ways of doing this. what is it you're doing?
Similar Messages
-
Ours is a SQL Server Express Edition 2008-R2 - Windows Forms based application. We have a backup/restore utility provided with our software which performs some logical checks before restoring a backup to ensure that the backup is functionally valid.
However, our clients often use the SQL Server Enterprise Manager utility to 1) Restore backups or 2) Attach data files (kept aside before formatting) directly. This type of action bypasses all our functional checks and allows the user to restore an invalid
backup.
We want to detect that a database was restored/attached and may be we will stop the software from loading if such a thing happened. We think that this information (attach/restore) should be available within some table of SQL Server itself but don't know the
right location/query.
If any change is required in our software to achieve the above, we are ready to do the same too, e.g. may be we need to store some data at some point of time to make the detection happen, please advise.
So, how can we detect that
A database backup was restored using SQL Server Management Utility
(Note: MSDB.Restorehistory may not be a good option as we have often found this table blank for unknown reasons even after backup was restored and just in case user restores the MSDB from MSDB backup or MSDB template due to a data corruption, may be due to
abnormal shutdown of system, then the RestoreHistory table data is gone)
A database was created by attaching a data/log file using SQL Server Management Utility
Any help in this regard is highly appreciated.
Rajarshi
ProjectServer 2007 BeginnerHi,
For Enterprise edition, we can enable Auditing to audit BACKUP_RESTORE_GROUP in a server audit specification. However, SQL Server audit (fine-grained auditing) feature is not available for the SQL Server Express.
Features Supported by the Editions of SQL Server 2008 R2
http://msdn.microsoft.com/en-us/library/cc645993(v=sql.105).aspx
When a database is attached, SQL Server ERRORLOG will record “Starting up database 'DBNAME'.”
Using ALTER DATABASE OFFLINE and ONLINE will re-open the database files under the SQL Server, the SQL Server error log also contains the following informational message: “Setting database option ONLINE to ON for database 'DBNAME'.”
Additional information:
SQL Server Audit (Database Engine)
http://msdn.microsoft.com/en-us/library/cc280386.aspx
Tracy Cai
TechNet Community Support -
How to change the database in a business area
Hello All,
I am trying to figure out a way to change the database that a business area connects to. When I created the business area I selected to look at tables from the default database. Now I need to change that setting to connect to a different database. The tables are exactly the same on both databases. I just need to change the database that the business area looks at.
Is there a simple way of accomplishing this? I want to avoid having to recreate the business area.
Thank you very much in advanced for your help with this matter.
Del Benavides.Hi,
Select all your folders in Disco Administrator,ALT+ENTER to go to properties, then change the database from the default database to the remote database.
Hope that helps,
Rod West -
How to reflect db changes - Verify Database doesn't seem to work
I have changed a database (MS SQL Server) column from varchar 255 to varchar 1000, but the designer doesn't pick up the change.
I read that db changes can be picked up by using 'Verify Database' feature. It doesn't seem to work for us though. Is there any configuration to turn on for the feature to work properly or any work-around to refresh the database changes?
We are making the database connection using JDBC (JNDI) option since the report is being used in a Java web application.
Any comments or insights will be very much appreciated!Hi Wallie,
Thank you very much for your reply! Here are the answers to your questions.
Are you able to create a new report off the modified database?
==> Yes.
Do new reports see the changes made to the database?
==> No.
Are the reports connecting directly to the database table, or is it a stored procedure, business view, universe being used?
==> Through a business view.
By the way, after trying so many things, I was able to figure out the reason. Since the report is using a view, not directly the table, the view itself had to be recompiled to reflect the table changes so that the view could pass the changes to the report. It was a very good thing to know. Your last question could have been a very helpful insight for this issue! Thank you so much again! -
Facing problem while changing the database at runtime
hi everyone,
Before posting this thread, i have gone through the various posts addressing the problem....but still iam unable to get the solution for this problem.
The report has been generated in one system, so the database properties (connection string....) are hardcoded in the report file...
Now when iam trying to change the database, it is still connecting to the system where the report file was created.
I have tried the changeDatasource() method, but it didnot worked....
here is the code for changeDatasource() method
public static void changeDataSource(ReportClientDocument clientDoc,
String reportName, String tableName,
String username, String password, String connectionURL,
String driverName,String jndiName) throws ReportSDKException {
PropertyBag propertyBag = null;
IConnectionInfo connectionInfo = null;
ITable origTable = null;
ITable newTable = null;
// Declare variables to hold ConnectionInfo values.
// Below is the list of values required to switch to use a JDBC/JNDI
// connection
String TRUSTED_CONNECTION = "false";
String SERVER_TYPE = "JDBC (JNDI)";
String USE_JDBC = "true";
String DATABASE_DLL = "crdb_jdbc.dll";
String JNDI_DATASOURCE_NAME = jndiName;
String CONNECTION_URL = connectionURL;
String DATABASE_CLASS_NAME = driverName;
// The next few parameters are optional parameters which you may want to
// uncomment
// You may wish to adjust the arguments of the method to pass these
// values in if necessary
// String TABLE_NAME_QUALIFIER = "new_table_name";
// String SERVER_NAME = "new_server_name";
// String CONNECTION_STRING = "new_connection_string";
// String DATABASE_NAME = "new_database_name";
// String URI = "new_URI";
// Declare variables to hold database User Name and Password values
String DB_USER_NAME = username;
String DB_PASSWORD = password;
System.out.println("DB_USER_NAME......."+DB_USER_NAME);
System.out.println("DB_PASSWORD......."+DB_USER_NAME);
// Obtain collection of tables from this database controller
if (reportName == null || reportName.equals("")) {
Tables tables = clientDoc.getDatabaseController().getDatabase().getTables();
System.out.println("Tables in reports........"+tables.size());
for(int i = 0;i < tables.size();i++){
origTable = tables.getTable(i);
System.out.println("origTable........"+origTable.getQualifiedName());
if (tableName == null || origTable.getName().equals(tableName)) {
newTable = (ITable)origTable.clone(true);
// We set the Fully qualified name to the Table Alias to keep the
// method generic
// This workflow may not work in all scenarios and should likely be
// customized to work
// in the developer's specific situation. The end result of this
// statement will be to strip
// the existing table of it's db specific identifiers. For example
// Xtreme.dbo.Customer becomes just Customer
newTable.setQualifiedName(origTable.getQualifiedName());
System.out.println("newTable........"+newTable.getQualifiedName());
// Change properties that are different from the original datasource
// For example, if the table name has changed you will be required
// to change it during this routine
// table.setQualifiedName(TABLE_NAME_QUALIFIER);
// Change connection information properties
connectionInfo = newTable.getConnectionInfo();
// Set new table connection property attributes
propertyBag = new PropertyBag();
// Overwrite any existing properties with updated values
//propertyBag.put("Trusted_Connection", TRUSTED_CONNECTION);
//propertyBag.put("Server Type", SERVER_TYPE);
propertyBag.put("Use JDBC", USE_JDBC);
propertyBag.put("Database DLL",DATABASE_DLL );
propertyBag.put("JNDI Datasource Name",JNDI_DATASOURCE_NAME );
propertyBag.put("Connection URL", CONNECTION_URL);
propertyBag.put("Database Class Name", DATABASE_CLASS_NAME);
//propertyBag.put("Server Name", SERVER_NAME); //Optional property
// propertyBag.put("Connection String", CONNECTION_STRING); //Optional property
// propertyBag.put("URI", URI); //Optional property
connectionInfo.setAttributes(propertyBag);
// Set database username and password
// NOTE: Even if the username and password properties do not change
// when switching databases, the
// database password is *not* saved in the report and must be set at
// runtime if the database is secured.
connectionInfo.setKind(ConnectionInfoKind.SQL);
connectionInfo.setUserName(DB_USER_NAME);
connectionInfo.setPassword(DB_PASSWORD);
// Update the table information
clientDoc.getDatabaseController().setTableLocation(origTable,newTable);
Also i tried with replaceConnection() method...........it displayed the report, but with not column names and data
need help regarding.......
Edited by: abhishek.c1984 on Jun 25, 2009 10:02 AMIn the report i have two tables.............so before changing the database properties for each table iam printing their names.
The names are dispalyed correctly.......but once i set the table location...i.e through the following method..
clientDoc.getDatabaseController().setTableLocation(tables.getTable(i),newTable);
every time i can see only one table i.e. properties are set for the first table ........and each time the properties are being set for the first table only.....i dont no what is happening to the rest of the tables..
I have posted the method in the above post.....can any one please trace out the problem
Note: when i comment the following code, i can see all the tables
clientDoc.getDatabaseController().setTableLocation(tables.getTable(i),newTable);
when i uncomment it, i can see only first table repeating every time...
Edited by: abhishek.c1984 on Jun 25, 2009 1:03 PM -
Hi Gurus
I am using oracle 10g on Windows platform. The issue is I need to change my database name. When i gone through the Oracle docs I found there is an utility called 'DBNEWID' . But not getting a clear cut idea. Since my DB is So critical anybody please tell me the exact steps to change the DB-Name.
Thanks & Cheers
AntonyChanging Only the Database Name
C:\>SQLPLUS/NOLOG
SQL*Plus: Release 10.1.0.2.0 - Production on Tue Aug 22 10:54:38 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
SQL> CONN / AS SYSDBA
Connected.
SQL> SELECT DBID,NAME FROM V$DATABASE;
DBID NAME
1230404613 DB01
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
Must be : Take Whole Database Backup (Oracle Recommended)
Otherwise u lost ur database.
SQL> STARTUP MOUNT;
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145488364 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
Database mounted.
--Go Command Prompt
DBNEWID UTILITY >>>NID ( OS Path : d:\oracle\product\10.1.0\db_1\bin\nid)
C:\>SET ORACLE_SID=DB01
C:\>NID TARGET=SYS/ORACLE@DB01 DBNAME=ORADB01 SETNAME=YES
DBNEWID: Release 10.1.0.2.0 - Production
Copyright (c) 2001, 2004, Oracle. All rights reserved.
Connected to database DB01 (DBID=1230404613)
Connected to server version 10.1.0
Control Files in database:
D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL01.CTL
D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL02.CTL
D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL03.CTL
Change database name of database DB01 to ORADB01? (Y/[N]) => Y
Proceeding with operation
Changing database name from DB01 to ORADB01
Control File D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL01.CTL - modified
Control File D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL02.CTL - modified
Control File D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL03.CTL - modified
Datafile D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\SYSTEM01.DBF - wrote new name
Datafile D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\UNDOTBS01.DBF - wrote new nam
e
Datafile D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\SYSAUX01.DBF - wrote new name
Datafile D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\USERS01.DBF - wrote new name
Datafile D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\TEMP01.DBF - wrote new name
Control File D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL01.CTL - wrote new
name
Control File D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL02.CTL - wrote new
name
Control File D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB01\CONTROL03.CTL - wrote new
name
Instance shut down
Database name changed to ORADB01.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.
Set the DB_NAME initialization parameter in the initialization parameter file (PFILE) to the new database name.
Note:
The DBNEWID utility does not change the server parameter file (SPFILE). Therefore, if you use SPFILE to start your Oracle database, you must re-create the initialization parameter file from the server parameter file, remove the server parameter file, change the DB_NAME in the initialization parameter file, and then re-create the server parameter file.
---Create New Password File
cmd>orapwd file=d:\oracle\product\10.1.0\db_1\database\pwddb01.ora password=oracle entries=5
SQL> STARTUP PFILE=D:\Oracle\product\10.1.0\Db_1\database\initdb01.ora
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145488364 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
Database mounted.
Database opened.
SQL> select dbid,name from v$database;
DBID NAME
1230404613 ORADB01
Note:
After Change DB Name Take Whole Database bkp.
Note: If i am missing some step or write wrong step plz. correct me.
Before doing this refer documentation.
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/dbnewid.htm
thanx
Message was edited by:
user526020
null -
Hello,
I have an XY-Graph with 4 plots. How can I detect, for example, the color change of the second plot in the legend. The active plot, using a property node, is always plot 0. So I am not able to detect changes in the 2nd/3rd ... plot.
Any ideas?
Thanks a lot.
Best regards,
Michael
Solved!
Go to Solution.You can do it with an event sturcture.
Attachments:
Plot detect.vi 25 KB -
Getting errors after changing the Database
Previously I was using a different database connection for my adf application.Now i have changed the database connection through project properties->business components. I also deleted the details of the previous connection from connection.xml file. But still i'm getting the error about the previous connection.
Please share your opinion to get rid of this problem.Try this.
1. Menu->View->Database->Database Navigator
2. Find your application specific connection.
3. Check properties of the connection, update/recreate, test the connection using Test button.
4. Menu->Build->Clean All -
Table changes in database are not captured in ODI model level
Hi All,
Can any one help me how to fix the bug in ODI.
Table changes in database are not captured in ODI model level.
Thanks in advanceI created the interface which is running successfully.
Now i did some changes in target table(data base level).
I reversed the updated table in model section. Till here its ok
The table which is updated in the model section is not automatically updated in the interface.
I have to drop the existed datastore in the interface and and re do the entire process of bringing the updated datastore, mapping,etc..
Please tell the any alternate way.
Regards
suresh -
Event Structure's value change, not detecting changes when tabbing thru array of clusters
Hi! I have an array of clusters (int, int, string, int) control, and want to detecting changes made to the it. I used the Event Structure's value change case on the array, it works excellent except that it'll only detect the changes when you click out of the element or press the enter key (the one by the numbers, not carriage return). I want it to detect the changes when I tab thru the cluster or array too, but I can't figure it out... Does anyone have any ideas?
Thanks!mfitzsimons wrote:
altenbach
Tried Value Change with my example done in 7.1 and it doesn't trgger an event. That is why I suggested Mouse Down.
Curious. I did a few minor edits in 8.0 before saving as 7.1, but the simple value change event got triggered just fine when the value vas terminated with a tab in 7.1. Every time. Strange....
Are you on 7.1 or 7.1.1? Maybe there's a difference (I am using 7.1.1).
LabVIEW Champion . Do more with less code and in less time . -
Changing the Database driver causing performance issue
Hello Experts
I am finding a strange issue where if I change the database to Oracle 11g ( you will find it if you click the database which you have created in physical layer) under Data Source definition the report takes a longer time to complete.
Actually I have upgraded the 10g rpd and catlog to 11g but database under data source definition was still using - oracle 10gR1 ( i donno whether this is a driver or not) . Everthing was running perfectly fine until I change the database under data source definition to Oracle 11g , the report takes a longer time . Also I found that the query is changed when I changed the database under data source definition to 11g.
Also to inform you that datawarehouse is Database 11g where the data lies.
what is the significance of Data source definition as changing it is changing the whole query.
Pls. help.Hello,
Do you have the Full Oracle 11g DB Client installed on the same box where you are running your BI Server .? Also can you make sure you have copy of tnsnames.ora in following directories.
1. C:\Middleware\Oracle_BI1 \network\admin directory
2. C:\Middleware\oracle_common\network\admin
Check if the SQL Features that the datasource has , sometimes when you disable SQL features the server could issue a less effcient query to the database.
Thanks,
-SVS -
Can I change the database Listener name in 11.5.10.2
Hi Hussen
Is it possible to change the Listener name and port on database node. My Application is of 4 node env. 2 rac database nodes 2 shared application tier nodes.
My requirement is to change the Database node listener name and port.
Thanks
reddyReddy,
It is possible -- Please see (How to change the hostname and/or port of the Database Tier using AutoConfig [ID 338003.1]) for details.
However, it is always recommended you have the ports on the application/database tier nodes within the same port pool -- See (How To change the Port Pool in the E-Business Suite 11i [ID 414439.1]).
Thanks,
Hussein -
Keeping track of changes in Database
Hi ,
I need to keep track to the changes in tables (New Inserts , Updates , Deletions) and Procedure / Package source changes that are done , The trace is required on OSUSER
<br><br>
Kindly guide if there is a way to do this .
<br><br>
Many thanks.
<br><br>
Ashish Roy.Hi,
You can enable auditing for tarcking any changes in database.
http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/cfgaudit.htm
regards
Jafar
http://www.oracledbarea.blogspot.com -
Change the database log on parameters in the run time with CR10 Delphi2007?
Hi,
I'm using crystal report 10 and Crystal VCL for Delphi. How can I change the database log on parameters in the run time?You have to use the ConnectBuffer. See [this|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] note for details.
Also, consider searching the notes database:
https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=&adv=true
The search; VCL database crystal, returns a number of notes that may be of use.
Ludek -
Is it possible to change the Database default date format 'dd/mm/yy'
I'm inserting a date with the format 'dd-mon-yy' in a column, it gives the error:- " a non-numeric character was found where a numeric was expected ". I also tried the TO_DATE function but not successful.
I want to change the Database default Date format 'dd/mm/yy' to 'dd-mon-yy'. Is it possible?
version is (Oracle Server 7.3.2.0). I checked it on version ( Oracle Server 7.3.4.0) with format of 'dd-mon-yy'.
May I keep the both formats at a time?
Thanks for solution(s),
Tariq.you can try with:
ALTER SESSION
SET NLS_DATE_FORMAT = 'dd-mon-yy';
Maybe you are looking for
-
I will be buying a Mac Pro in the very near future, as I'm after a machine that has plenty of upgrade potential (and I get a pretty good Apple Store discount with my employer). I have a lot of audio files, large aiff files for audio production and ar
-
Knowledge Article in 7.1
Hi, We have configured the service desk functionality in 7.1, and planning to extend the Knowledge Article functionality.We have few questions on this.. How does "Suggest Knowledge Articles" works?,what's the logic? Regards, Cherry
-
Photo albums inside photo albums
Hi Over the years I have been creating an organised photo library on my PC. What I have is folders which have dates and names of occasions eg '2011-09-12 - Holiday 1'. Some folders have folders within them ie if it was a two week holiday, pictures fr
-
Can someone explain me this?
Can someone explain me why LabVIEW embeds the graphic in sheet 1 if i specify location as "prueba"? The vi is for LV 5.0.1f1 and Excel 2000, it just creates a workbook, adds some data and creates a chart. I've tried to ask a NI engineer but i receive
-
Can i install a copy of photoshop cs6 on my laptop
This year I downloaded Photoshop CS6 for my desktop and now want to add a copy to my laptop. Please tell me how to do this. Thanks.