Full Database Backup in DB13 for MS SQL Server databases
Hello,
We have some SAP systems using the MS SQL Server database. I want to know if it is possible to setup the Full Database Backup option in transaction DB13 to store the files in a hard disk space.
I already did this type of configuration in SAP systems in Oracle databases and for this I used the init<SID>.sap where we can put all the configuration, for instance the disk path where we want to save the backup files! But for MS SQL Server databases, in DB13, I don´t know how to do that, when I add the "Full Database Backup" option in DB13, this show me some options but only for tape, but I don´t want to store the backup files in tapes, I want to store/save the files on the server disk itself or else to an external disk but I don´t see where I can set this way of storage!
This is what you see in DB13 (when using a MS SQL Server database) in "Full Database Backup" and as you see I only have options for TAPE not for a disk or other type of storage! How can I do that? (if that is possible):
Can you help me please?
Kind regards,
samid raif
Hello Raja
Sorry for the delay of my answer! Many thanks for that tip, it helps a lot and it solve the last error/problem that I reported here, in fact, the problem was we had named the device with two words containing a space. So we removed that space from the backup device (in SQL management studio) with one word only and the job runs successfully without any errors!
It works in Development and Quality systems but in our Production system (AM1) the Full backup option in DB13 stopped with the following error, in fact the error is on verification of backup, it means that the Full backup finished with success, but when it does the backup verification, the job in DB13 stops with an error, the following one:
***************************** SQL Job information ******************************
Jobname: SAP CCMS Full DB Backup of AM1 [20140417103726-4-103726]
Type: TSQL
DB-Name: AM1
For Run: 20140417 10:37:26
**************************** Job history information *****************************
Stepname: CCMS-step 1
Command: declare @exeStmt nvarchar(2000) exec am1.sap_backup_databases @dbList=
"AM1",@r3Db="AM1",@bDev="fullprd",@expDays= 27,@jobName= "SAP CCMS Ful
l DB Backup of AM1 [20140417103726-4-103726]",@bkupChecksum="Y",@bkupT
ype="F",@nativeBkup="N",@exeDate = "20140417103726",@bkupSim = "N",@fo
rmat = 0,@init = 0,@bkupDb = "AM1",@unload = 0,@exeStmt = @exeStmt OUT
PUT
Status: (success)
Message: 3014
Severity: 0
Duration: 4 hours(s) 41 min(s) 22 sec(s)
Last msg: Executed as user: am1. Processed 7434328 pages for database 'AM1', fil
e 'A01DATA1' on file 1. [SQLSTATE 01000] (Message 4035) Processed 315
1504 pages for database 'AM1', file 'A01DATA2' on file 1. [SQLSTATE 01
000] (Message 4035) Processed 4574152 pages for database 'AM1', file
'A01DATA3' on file 1. [SQLSTATE 01000] (Message 4035) Processed 44363
92 pages for database 'AM1', file 'A01DATA4' on file 1. [SQLSTATE 0100
0] (Message 4035) Processed 25598 pages for database 'AM1', file 'A01
LOG1' on file 1. [SQLSTATE 01000] (Message 4035) BACKUP DATABASE succ
essfully processed 19621974 pages in 16881.638 seconds (9.521 MB/sec).
[SQLSTATE 01000] (Message 3014). The step succeeded.
<------------- End of Job Step History --------------->
Stepname: CCMS-step 2
Command: declare @exeStmt nvarchar(2000) exec am1.sap_verify_backups @nativeBku
p = "N",@bkupSim = "N",@bDev = "fullprd",@bkupChecksum = "Y",@exeDate
= "20140417103726",@unload = 1,@dbCnt =1,@exeStmt = @exeStmt OUTPUT
Status: (failure)
Message: 3201
Severity: 16
Duration: 0 hours(s) 8 min(s) 30 sec(s)
Last msg: Executed as user: am1. Cannot open backup device 'fullprd(\\10.0.0.45\
backupsap\prd\prdfullqua.bak)'. Operating system error 1265(error not
found). [SQLSTATE 42000] (Error 3201). The step failed.
<------------- End of Job Step History --------------->
**************************** Job history information *****************************
Can you help me please with this one!? Can you tell me why in verification it stops with that error?
Kind regards,
samid raif
Similar Messages
-
Free JDBC 4.0 driver for Microsoft Sql Server database
Is there any free JDBC 4.0 driver for Microsoft Sql Server database? The jTDS driver is JDBC 3.0 driver. http://jtds.sourceforge.net/
Sooooooo...
what's wrong with the driver provided by Microsoft themselves? Which is JDBC 4. And free. -
Dear All,
we are planning to upgrade SQL Server 2008 R2 Enterprise edition to SQL Server 2014 Enterprise edition.
please suggest the limitations for the up gradation.
Thanks in Advance
Vineet Srivastava
NIIT Technology Ltd.
New Delhi , IndiaHello,
Please note that we have 2 Enterprise Editions now:
(1) Enterprise Edition with Server + Client Access License (CAL) and (2) the Enterprise Edition licensed by core. “Enterprise Edition with Server + Client Access License (CAL) based licensing (not available
for new agreements) is limited to a maximum of 20 cores per SQL Server instance. There are no limits under the Core-based Server Licensing model”. Source:
https://msdn.microsoft.com/en-us/library/ms143760(v=sql.120).aspx
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
Hi,
I have installed the x64 SQL Server 2008 R2 Express with default settings and run MBSA 2.3 (using default settings too). It shows three SQL Server instances: MSSQL10_50.SQLEXPRESS, SQLEXPRESS and SQLEXPRESS (32-bit). For the first, authentication
mode is Windows, for the rest two - mixed. Here https://social.msdn.microsoft.com/Forums/sqlserver/en-US/03e470dc-874d-476d-849b-c805acf5b24d/sql-mbsa-question-on-folder-permission?forum=sqlsecurity question
about such multiple instances was asked and the answer is that "MSSQL10.TEST_DB
is the instance ID for the SQL Server Database Engine of the instance, TEST_DB", so in my case, it seems that MSSQL10_50.SQLEXPRESS is the instance ID for SQL Server Database Engine of the SQLEXPRESS instance.
I have two questions:
1) How can it be that SQL Server DB Engine instance has different authentication mode than corresponding SQL Server Instance?
2) Why 32-bit instance reported although I installed only 64-bit version?
Also, this https://social.technet.microsoft.com/Forums/security/en-US/6b12c019-eaf0-402c-ab40-51d31dce968f/mbsa-23-reporting-sql-32bt-instance-is-running-in-mixed-mode-when-it-is-set-to-integrated?forum=MBSA question seems to be related to this
issue, but there is no answer :(.
Upd: Tried on clean Windows 8 installation and Windows 7 with the same result.Because I DO NOT want the three people who will be having access to the production SQL Server to also have access to the primary host ProductionA. Since I have to allow them to RDC into the box to manage the SQL Server, I figure why not create
a separate VM for each one of them and they can RDC into those instead.
Does this make any sense?
Any tips are greatly appreciated. The main reason for doing this is because the three people who will be accessing the box, I need to isolate each one of them and at the same time keep them off of the primary ProductionA.
Thanks for your help.
M
Hello M,
Since you dont want the 3 guys to have access to Production machine A.You can install SQL Server client .By client i mean SQL server management studio(SSMS) on there local desktop and then create login for them in SQL Server.Open port on which your SQL server
is running for three of the machines so that they can connct.Now with SSMS installed on each machine each can connect to SQL server from there own machine.
I would also like you to be cautious with giving Sysadmin privilege to all three of them ,first please note down what task they would do and then decide what rights to be provided.
Your option will also work but you need to create 3 VM for that .Which is more tedious task.
Hope this helps
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
Can Oracle view refer a table in Sql Server Database
Can a view created in Oracle database refer a table created in SQL Server database. If yes, how do we do it. Code will be very help full.
Again, if yes does it require any special software and what would be price of that software.
Thanks for your response in advance.
Venkat SathiamurthyYou would need to configure Oracle Heterogeneous Connectivity to create a database link to the SQL Server system. This can either be done via the Oracle Transparent Gateway for Microsoft SQL Server, which retails for $15,000 per server at http://store.oracle.com or by configuring Oracle Generic Connectivity and using ODBC to go after the SQL Server data. Depending on the operating system you run Oracle on, there may be a free (or cheap) ODBC driver for SQL Server that could be used.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
WIll cancel sql server database backup cause anything to be hurt?
I run full backup of one big database. After 20 seconds, I click "stop action now" to cancel this backup. Will it cause anything to hurt? Want to make sure that database is still safe.
ThanksI run full backup of one big database. After 20 seconds, I click "stop action now" to cancel this backup. Will it cause anything to hurt? Want to make sure that database is still safe.
No it will not cause any issue to SQL server database.Backup request reads data from disk using separate thread you just killed the thread.
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
How to monitor Log Backups for MS SQL Server
Hello all.
We are running Solution Manager 7.1 on SP Stack 10 and have downloaded the latest template content.
When configuring the templates for DB monitoring, we noticed that although there is a metric that monitors the age of the last DB backup, there is no such metric to monitor the age of the last successful Log backup, or even a metric to alert us on a failed backup / log backup.
Has any of you ever had to create a custom metric to monitor either the age of the latest successful log backup for MS SQL Server, or a custom metric to alert on failed backups / log backups?
If yes, could you provide some instructions on how to create such a metric?
Thank you in advance for your answers.
PhevosDivyanshu, thank you for your answer.
I had a similar idea to check the DB log file for failed log backups. The problem is that when I opened the log file from the dbacockpit, I found no errors/warnings for the days that our log backups did not run or failed. Here is a small part of that log to show you what I mean. In this example, the log backup was not running from 25th of July until the 28th of July when we fixed the log backups again, after receiving a disk space warning (log disk drive was almost full):
The last successful log backup is mentioned in the log: "20140724091524 Backup Log was backed up"
Then as the days go by, there is no backup failure entries whatsoever to look for them in the log:
20140725000023 spid18s This instance of SQL Server has been using a process ID of 1304 since 5/27/2014 11:50:00 PM (local) 5/28/2014 6:50:00
20140725000023 spid18s AM (UTC). This is an informational message only; no user action is required.
20140726000020 spid21s This instance of SQL Server has been using a process ID of 1304 since 5/27/2014 11:50:00 PM (local) 5/28/2014 6:50:00
20140726000020 spid21s AM (UTC). This is an informational message only; no user action is required.
20140727000023 spid22s This instance of SQL Server has been using a process ID of 1304 since 5/27/2014 11:50:00 PM (local) 5/28/2014 6:50:00
20140727000023 spid22s AM (UTC). This is an informational message only; no user action is required.
20140728000022 spid17s This instance of SQL Server has been using a process ID of 1304 since 5/27/2014 11:50:00 PM (local) 5/28/2014 6:50:00
20140728000022 spid17s AM (UTC). This is an informational message only; no user action is required.
Until finally on the 28th we restored the log backup functionality:
20140728042814 Backup Log was backed up. Database: XXX, creation date(time): 2010/12/22(16:45:29)
So, I find it difficult to deduce an appropriate string to look for in the log, in order to generate an alert when my log backups are not working.
Any suggestions? Am I looking at the wrong place perhaps? -
Need help trouble shooting Database Gateway for MS SQL Server setup, getting ORA-28546 error
Dear All,
I am trying to setup Oracle Database Gateway for MS SQL Server(I don't have admin access to the MS SQL Server). When I try to test the dblink connection, I get the following error.
I issued select * from dual@xyz;
ORA-28546: connection initialization failed, probable Net8 admin error
ORA-28511: lost RPC connection to heterogeneous remote agent using SID=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=dg4msql)))
ORA-02063: preceding 2 lines from xyz
28546. 0000 - "connection initialization failed, probable Net8 admin error"
My setup is the following.
1. Oracle 11gR2 running on Oracle Linux 6, the same version gateway is installed on the same server, but different home directory.
2. Oracle DB home directory is /u01/app/oracle/product/11.2.0/dbhome_1, gateway home directory is /u01/gateway.
3. I use the same listener.ora file for both the db and the gateway.
4. the contents of my listener.ora, tnsnames.ora and the initdg4msql.ora are below.
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
#(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = db.abc.com.tw)(PORT = 1522))
mssql =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME=db.abc.com.tw)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=orcl)
SID_LIST_mssql =
(SID_LIST =
(SID_DESC =
(SID_NAME=dg4msql)
(ENVS=LD_LIBRARY_PATH=/u01/gateway/dg4msql/driver/lib:/u01/gateway/lib)
(PROGRAM_NAME=/u01/gateway/bin/dg4msql)
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = db.abc.com.tw)(PORT = 1522))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db.abc.com.tw)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.abc.com.tw)
dg4msql =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP) (HOST=localhost)(PORT = 1521))
(CONNECT_DATA=(SID=dg4msql))
(HS=OK)
/u01/gateway/dg4msql/admin/initdg4msql.ora
HS_FDS_CONNECT_INFO=[192.168.0.1]:1433//XIETEST
# alternate connect format is hostname/serverinstance/databasename
HS_FDS_TRACE_LEVEL=255
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
dblink was created using statement below.
CREATE DATABASE LINK "xyz.abc.COM.TW"
CONNECT TO SA IDENTIFIED BY
USING 'dg4msql';
Couple more things, that I have done to check the work above.
[oracle@db admin]$ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=61 time=7.61 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=61 time=7.41 ms
^C
--- 192.168.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1818ms
rtt min/avg/max/mdev = 7.417/7.516/7.615/0.099 ms
[oracle@db admin]$ tnsping dg4msql
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 11-SEP-2013 10:53:11
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP) (HOST=localhost)(PORT = 1521)) (CONNECT_DATA=(SID=dg4msql)) (HS=OK))
OK (0 msec)
[oracle@db admin]$ lsnrctl status mssql
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-SEP-2013 10:54:23
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
Alias mssql
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 11-SEP-2013 10:09:46
Uptime 0 days 0 hr. 44 min. 37 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/db/mssql/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "dg4msql" has 1 instance(s).
Instance "dg4msql", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
Obviously, I would like to get this setup to work, but I also have couple other questions regarding this setup.
1. When installing the gateway, it asks to run the root.sh script. the root.sh script as for the following.
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: n
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: n
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: n
is the above answer correct?
Thanks for reading.Dear Klaus,
I did start a new SQL*PLUS session
The output of /u01/gateway/bin/dg4msql is
[oracle@db log]$ /u01/gateway/bin/dg4msql
Oracle Corporation --- WEDNESDAY SEP 11 2013 14:45:06.604
Heterogeneous Agent Release 11.2.0.1.0 - 64bit Production Built with
Oracle Database Gateway for MSSQL
The output of env is
HOSTNAME=db.abc.com.tw
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
ORACLE_UNQNAME=orcl
TMPDIR=/tmp
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
USER=oracle
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib:/lib:/usr/lib
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
ORACLE_SID=orcl
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=db.abc.com.tw
MAIL=/var/spool/mail/oracle
PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
PWD=/home/oracle
LANG=en_US.UTF-8
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HISTCONTROL=ignoredups
SHLVL=1
HOME=/home/oracle
TMP=/tmp
LOGNAME=oracle
QTLIB=/usr/lib64/qt-3.3/lib
CVS_RSH=ssh
CLASSPATH=/u01/app/oracle/product/11.2.0/dbhome_1/jlib:/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/jlib
LESSOPEN=|/usr/bin/lesspipe.sh %s
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
G_BROKEN_FILENAMES=1
_=/bin/env -
How to take SQL Server Database backup from DB side
Dear All,
Please suggest how to take SQL Server Database backup from DB side?
System Info-
Portal Server (EP7)
MS SQL Server
Microsoft Windows 2003 Server
Suggest ASAP.
Thanks & Regards,
SameerHi,
I am planning to take SAP DB backup I need the procedure how to take backup. With in the server.
My Operating System is IBM AIX
Database is Oracle 10g
SAP BI7.0 through this I need to take backup.
Note:
1) First of all I gone to /oracle/<SID>/102_64/dbs/init<SID>.sap and I changed the settings backup_dev_type = disk
backup_root_dir = /home/db0/test/sateesh/DB0backup
stage_root_dir = /home/db0/test/sateesh/DB0backup
2) Then I gone to BRTOOLS I changed to disk there I scheduled Online backup
3) Then I came to SAP DB13 I want to take daily backup. But the backup is not going properly what to do any mistake I had done
Try to give the valuable solution to take Online backup -
Best practise for creating an application that connects to a SQL Server database
I have created an application that connects to a SQL Server database and views information using a datagrid and performs several updates when a button
is selected.
I have created a SQLcontrol.vb using the following code:
Imports System.Data.Sql
Imports System.Data.SqlClient
Public Class SQlControl
'connection 1
Public SQLCon As New SqlConnection With {.ConnectionString
= "Data Source=;Initial Catalog=;Integrated Security=True"}
'connection 2
Public SQLCon1 As New SqlConnection With {.ConnectionString
= "Data Source;Initial Catalog=;Integrated Security=True"}
Public sqlcmd As SqlCommand
Public sqlda As SqlDataAdapter
Public sqldataset As DataSet
Public Function hasconnection() As Boolean
Try
SQLCon.open()
SQLCon.close()
Return True
Catch ex As Exception
MsgBox(ex.Message)
Return False
End Try
End Function
Public Sub runquery(query As String)
Try
SQLCon.Open()
sqlcmd = New SqlCommand(query,
SQLCon)
'LOAD
SQL RECORDS FOR DATAGROD
sqlda = New SqlDataAdapter(sqlcmd)
sqldataset = New DataSet
sqlda.Fill(sqldataset)
BH READ DIRECTLY FROM THE DATABASE
'Dim
R As SqlDataReader = sqlcmd.ExecuteReader
'While
R.Read
'MsgBox(R.GetName(0)
& ": " & R(0))
'End
While
SQLCon.Close()
Catch ex As Exception
MsgBox(ex.Message)
'will
close connection if still open
If SQLCon.State
= ConnectionState.Open Then
SQLCon.Close()
End If
End Try
End Sub
Public Sub runquery1(query As String)
Try
SQLCon1.Open()
sqlcmd = New SqlCommand(query,
SQLCon1)
'LOAD
SQL RECORDS FOR DATAGROD
sqlda = New SqlDataAdapter(sqlcmd)
sqldataset = New DataSet
sqlda.Fill(sqldataset)
BH READ DIRECTLY FROM THE DATABASE
'Dim
R As SqlDataReader = sqlcmd.ExecuteReader
'While
R.Read
'MsgBox(R.GetName(0)
& ": " & R(0))
'End
While
SQLCon1.Close()
Catch ex As Exception
MsgBox(ex.Message)
'will
close connection if still open
If SQLCon1.State
= ConnectionState.Open Then
SQLCon1.Close()
End If
End Try
End Sub
End Class
A code for one of my button which views displays data grid contains the following code:
Private Sub Button1_Click_1(sender As Object,
e As EventArgs) Handles Button1.Click
If SQL.hasconnection
= True Then
SQL.runquery("select
* from tablea")
If SQL.sqldataset.Tables.Count
> 0 Then
DGVData.DataSource = SQL.sqldataset.Tables(0)
End If
End If
End Sub
I am fairly new to vb.net and have read a few books and followed a few tutorials on youtube, what I would like to know is, are there any disadvantages
to the way I have connected to a SQL database using the SQLControl.vb. A lot of the vb books include data adapter and dataset within the form, I'm not sure if I'm following best practice by have the connection details outside of the form.
My other question is, I have created two connections in the SQLControl and call these connections within the same form using the same data adapter
and dataset. It all works fine but I just wanted to know of any potential issues?
Public SQLCon As New SqlConnection With {.ConnectionString
= "Data Source=;Initial Catalog=;Integrated Security=True"}
'connection 2
Public SQLCon1 As New SqlConnection With {.ConnectionString
= "Data Source;Initial Catalog=;Integrated Security=True"}
ThanksMy other question is, I have created two connections in the SQLControl and call these connections within the same form using the same data adapter and dataset. It all works fine but
I just wanted to know of any potential issues
1) You are not using Sepration of concerns for a solution that is doing data access, like using a DAL.
http://en.wikipedia.org/wiki/Separation_of_concerns
2) You are directly issuing SQL commands at the UI, leading to sql injection attacks.
3) You are not using a UI design pattern, which leads you to tightly couple database activity to the UI.
http://www.codeproject.com/Articles/228214/Understanding-Basics-of-UI-Design-Pattern-MVC-MVP
@System243trd, parameters are important to prevent SQL injection attacks (people will insert SQL commands into the database if you do not perform basic checking of what you are passing to the database). If you write a stored procedure try to make
the variables the correct SQL server data type to avoid problems later of people trying to call it directly. Darnold924 is right, I see no code to prevent against SQL injection attacks. In addition, during development in some instances LocalSQLDB
database system is used and during deployment you usually need to use the production SQL server database. Moreover, Linq-to-SQL is used on Windows Phone 8.1 and it is required for phone development later and so I highly recommend learning
it if you plan on developing windows phone applications.
@System243trd, If you want the code for the windows phone app I think it uses the MVVM model or that might be for universal apps or regular windows phone apps. I have been using the windows phone Silverlight pivot or panorama template (it might
be pieces of both). I've already submitted to the windows phone marketplace and it had to go through certification first. I plan on later making an article on it but I need to first fix one or two simple problems I have with it. Here's a link to
the source code if you later want to look at the source code (in vb.net):
https://jeffsblogcodesamples.codeplex.com/downloads/get/1445836
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - Sherlock Holmes. speak softly and carry a big stick - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog
- http://www.computerprofessions.us -
Oracle Database Gateway for MS SQL server
Hi,
we have Oracle Database Appliance.
OS: Oracle Linux 5 x64
DB: 11.2.0.3 enterprise (Oracle Database Gateway for MS SQL server at the same version)
Communication with remote DB is OK, but CPU load is too high without any reason. CPU waste, useless HW load, energy waste.
Enterprise manager console:
http://81.89.49.222/em.JPG
OS top:
http://81.89.49.222/top.JPG
Please can you help me how to solve this issue? How can I restart these procesess? Any ideas?
Thank you
MichalHi,
we are using connection to multiple MS SQL servers:
[oracle@odamaind1 ~]$ cat /u01/app/oracle/product/11.2.0.3/dbhome_1/dg4msql/admin/initaqpdb01.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server
# HS init parameters
HS_FDS_CONNECT_INFO=[172.18.250.141]://master
# alternate connect format is hostname/serverinstance/databasename
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_FDS_SUPPORT_STATISTICS=FALSE
HS_KEEP_REMOTE_COLUMN_SIZE=LOCAL
HS_NLS_LENGTH_SEMANTICS=CHAR
HS_FDS_TRANSACTION_MODEL=READ_ONLY
HS_FDS_TRANSACTION_ISOLATION=UNCOMMITTED
[oracle@odamaind1 ~]$ cat /u01/app/oracle/product/11.2.0.3/dbhome_1/dg4msql/admin/initcosima.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server
# HS init parameters
HS_FDS_CONNECT_INFO=[172.20.250.99]//COSIMA
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
# custom init parameters
HS_FDS_SUPPORT_STATISTICS=FALSE
HS_KEEP_REMOTE_COLUMN_SIZE=LOCAL
HS_NLS_LENGTH_SEMANTICS=CHAR
HS_FDS_TRANSACTION_MODEL=READ_ONLY
HS_FDS_TRANSACTION_ISOLATION=UNCOMMITTED
[oracle@odamaind1 ~]$ cat /u01/app/oracle/product/11.2.0.3/dbhome_1/dg4msql/admin/initepos.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server
# HS init parameters
HS_FDS_CONNECT_INFO=[172.18.250.41]:1433//epos
# alternate connect format is hostname/serverinstance/databasename
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_FDS_SUPPORT_STATISTICS=FALSE
HS_KEEP_REMOTE_COLUMN_SIZE=LOCAL
HS_NLS_LENGTH_SEMANTICS=CHAR
HS_FDS_TRANSACTION_MODEL=READ_ONLY
HS_FDS_TRANSACTION_ISOLATION=UNCOMMITTED
[oracle@odamaind1 ~]$ cat /u01/app/oracle/product/11.2.0.3/dbhome_1/dg4msql/admin/initepospasohlavky.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server
# HS init parameters
HS_FDS_CONNECT_INFO=[172.31.250.41]/SQL2012/epos
# alternate connect format is hostname/serverinstance/databasename
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_FDS_SUPPORT_STATISTICS=FALSE
HS_KEEP_REMOTE_COLUMN_SIZE=LOCAL
HS_NLS_LENGTH_SEMANTICS=CHAR
HS_FDS_TRANSACTION_MODEL=READ_ONLY
HS_FDS_TRANSACTION_ISOLATION=UNCOMMITTED
dg4msl process, look at posted attachment (print screen of enterprise manager and top from OS).
Thank you
Michal -
Convert SQL server database into SAP readable (encrypted) XML for SAP tool?
Could anyone kindly let me know what is the procedure to convert SQL server database into SAP readable (encrypted) XML for SAP Authoring tool???
So If I understood it correctly there an existing propriertory question bank with SQL server. You are looking at an option to migrate all the tests and questions from the existing system to the LSO system. Right ?
I am still not clear on the xml conversion. Have you guys found a solution which could be achieved through a xml file ?
am not aware of a way through which you could import only a xml file and create tests/questions. If you have a sample xml file then forward me so that I could do some testing on my end.As per my knowledge you could do one of the following. I
1. Create the tests and questions manually in Authoring Environment. It will be a time consuming task. Based on the number of questions you have you might have to assemble a team of content developers to acheive this.
2. Alternatively, you could create a Adobe Flash based assessment. The Flash component would be the front-end and will read from a xml file to display the questions and to drive the funcationality. This would be a easier and less time consuming than creating the assessments manually in authoring environment. However, you might miss out some of the functionality available in the Test Author of Authoring Environment unless you have all the functionality replicated inside Flash. This would require one time effort in creating the Flash template and the xml file structure. Once that is created you could create multiple assessments by just replacing the xml file. If you select this approach then you would have to ensure the data from SQL is converted in the desired xml format required by your Flash component.
Please let me know if you require any further guidance or clarification regarding this.
Regards,
Ravi Sekhar -
SQL Developer 2.1.0.63 - Export Data menu missing for SQL Server databases
Hi
The Export Data menu only appears for Oracle databases in this version, it does not appear for SQL server databases.
To demonstrate:
Press F9 to run query
Right click on Query Result data
For Oracle an Export Data sub menu appears
For SQL server no Export Data sub menu appears
This worked in previous versions.
Is this functionality going to reappear?
Thanks
DaveHi,
Looks like this is exactly the same problem for third party connections as I have the exact same issue for mySQL.
I had to apply 1.5.5 version to fix it.
Hope we're going to have this solved !
Thanks,
JP -
Code for connecting to a Microsoft SQL server database
Hi
What is the code for connection to a Microsoft SQL server database using JSP? I know the structure of the code but i do not know the driver name. Any importing required besides java.sql?
ThanksBack up there. JSP's should never contain any
database code. You should write a bean to handle
database transactions and call that from your JSP.I agree wholeheartedly with that.
Why didn't you consult google to help you with your
problem? The answer is on the MS website.
http://support.microsoft.com/default.aspx?scid=kb;en-u
s;313100This is correct, too. Isn't Google installed on your machine?
% -
Support for Sybase SQL Anywhere databases
Is there support for Sybase SQL Anywhere databases available?
Specifically, using an ODBC connection.
Sybase, curiously enough, does not want to develop specific drivers for connection to its databases; instead, it relies on an outside source (ODBC) for its connection.
I am NOT in favour of using ODBC as an connection method; we have bench-marked SQL query performance using both native driver connection vs ODBC connection; you should be easily able to guess which approach won out!!
Hint: Oracle dramatically!!You can try using JTDS, it should work with Sysbase too and if you take a look at the SQL Developer certifications, you can see it's the certified way of speaking with Sysbase.
I've never used this myself and i'm not even sure if this works with SQL Anywhere but it's worth a try.
Maybe you are looking for
-
Forgot my macbook pro password
Cant log in my macbook what do I do?
-
Quick question for all of the super guru's out there, I am using a Sony DSR-11 deck and iMovie HD works fine with it and Final Cut Express HD works fine with it but iDVD doesn't recognize it. My question to anyone who might know is why? and is there
-
How can I recover my song list on my iPad that I lost accidently
how can I recover my song list on my iPad that I lost accidently
-
Hi Every one, Please send me these pdfs. I'll assign full points. mail id is [email protected] my SAP FI for ECC6.0---- TFIN50 Financial Accounting I TFIN52 Financial Accounting II TFIN54 Financial Accounting III(Casestudy) mySAP CO for ECC 6.0---- T
-
Dispathcher turn Yellow after changing SDM mode to standalone
Hi, SYstem- Dual stack NW04 Does SDM mode change to standalone cause dispatcher status to go yellow? Thanks