How do I upgrade a Chef SQL Server Cookbook to use Enterprise Edition? - sql-server-2012

I've got a Chef cookbook from GitHub. It installs SQL Server 2012 Standard Edition. Our DBA has upgraded our database code to utilize features that can only be found on SQL Server 2012 Enterprise Edition. Since this cookbook is used to generate our test environments, we must now alter this cookbook to deploy SQL Server 2012 Enterprise.
Looking at the helper.rb file in the cookbook,
require 'chef/mixin/shell_out'
module SqlServer
class Helper
extend Chef::Mixin::ShellOut
def self.firewall_rule_enabled?(rule_name=nil)
cmd = shell_out("netsh advfirewall firewall show rule \"#{rule_name}\"")
cmd.stderr.empty? && (cmd.stdout =~ /Enabled:\s*Yes/i)
end
def self.sql_server_url(version, x86_64)
if x86_64
case version
when '2008R2'
'http://download.microsoft.com/download/D/1/8/D1869DEC-2638-4854-81B7-0F37455F35EA/SQLEXPR_x64_ENU.exe'
when '2012'
'http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLEXPR_x64_ENU.exe'
end
else
case version
when '2008R2'
'http://download.microsoft.com/download/D/1/8/D1869DEC-2638-4854-81B7-0F37455F35EA/SQLEXPR32_x86_ENU.exe'
when '2012'
'http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x86/SQLEXPR_x86_ENU.exe'
end
end
end
it seems that it gets the install media from
http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLEXPR_x64_ENU.exe
When I look on MSDN (which we have access to) I don't see that the Enterprise Edition is available to download as a .EXE, only as an .ISO.
How can I alter this cookbook to deploy from an ISO instead of a EXE, assuming that I have full access to the ISO?

Re-write second half of the server.rb
Download the ISO from repo
remote_file 'C:\LocalPath' do
source
end
Mount the ISO (you can also use Chef built-in mount resource)
powershell_script 'mount_it' do
code <<-EOH
Mount-DiskImage -ImagePath "C:\PATH\TO\ISO\FILE"
EOH
end
Use MixLib::ShellOut and get the Drive name (if you don't have it hardcoded mount with a drive letter), replace the part ##### with the volume name.
output = Mixlib::ShellOut.new('(gwmi -Class Win32_LogicalDisk | Where-Object {$_.VolumeName -eq "#####"}).DeviceID')
drive_name = output.run_command.stdout
Once you know the drive the ISO mounts on, then you will be able to find the local path to the installation .EXE file.
Install using windows_package or powershell_script block

Quoting the attributes file from your link
# Set these to specify the URL, checksum, and package name. Otherwise, the cookbook will
# use default values based on the value of node['sql_server']['version'] and the
# server architecture (x86 or x64).
default['sql_server']['server']['url'] = nil
default['sql_server']['server']['checksum'] = nil
default['sql_server']['server']['package_name'] = nil
So you just have to set those values to a local package (on a internal http server for example) in a wrapper cookbook for this cookbook to install the enterprise version.

Related

Unable create tc server instance on sts 4

Creating server from server window in sts gives me this error. I am choosing base template to create server. I also tried using cmd with admin rights, still same error.
Error Details:create command failed. String runtimes not valid version format. Expected ,,[.patch][.release]
Reason: Error creating server instance with command:
D:\Users\pivotal location..\tcserver.bat create server -v runtimes -t base --property base.runtime.user=null --java-home C:\Java\jdk1.8.0_191. Check access permission for the directory D:\Users\pivotal location.. and its files and subdirectories.
Can't share the picture didn't have reputation.
It looks like the Pivotal tc Server installation sits in a read-only location on your disc or with limited write permissions. I would recommend to install tc-Server into a directory where you have full permissions, configure that install in STS, and try again. That should help.
You will get ahead if you provide a proper tc runtime version at the -v option. E.g. if you have the tc runtime tomcat-9.0.12.A.RELEASE installed, take "9.0.12.A.RELEASE" as runtime version.
Unfortunately you will not be out of the woods by doing so. Although a server instance will be created, there will be another error message: "The specified server is not valid. The .tc-runtime-instance file is missing.". There will be a .tc-runtime-instance-file in your instance-dir, but without any content. That's the point where I am currently sticking.

Play! Framework 2.2.3 SQL server connection

I have a Play! Web-app that I am developing and I'm currently using an eBean YAML database. I have a 2008 SQL server that was set-up for me by a coworker that I'd like to connect to. I tried following another tutorial on this site
PlayFramework MSSQL Database error
and downloaded the jtds jar file and placed into the proper directories but I'd get an error that the driver is not found. This is my current configuration file:
db.default.url="jdbc:jtds:sqlserver://LSA5A:1433/DatabaseName=hr_site;instance=SQL2008"
db.default.driver=net.sourceforge.jtds.jdbc.Driver
db.default.user=HUser
db.default.password="RaeSusdaRasdh!123"
I have never set-up a database like this before so I'm having difficulty understanding how to set it up and how it will all works together. I didn't understand the solution from the Play! Docs for this and I'm not using MySQL so I couldn't find the help I needed online. I'm not sure what other information I need to provide but I'm running SQL server 2008, db name is SVFSSQL5A with user HRTUser and password testPass12. Thanks for your help!!
Also I have the dependency in my build file:
val appDependencies = Seq(
"net.sourceforge.jtds" % "jtds" % "1.2"
)
I did this:
Download the SQL-Driver for JDBC from Microsoft http://www.microsoft.com/de-DE/download/details.aspx?id=11774, install it and put the sqljdbc4.jar file in the lib folder ( \YourProject\lib).
application.conf file:
db.default.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.default.url="jdbc:sqlserver://localhost\\instancename:1433;databaseName=MyDBName"
db.default.user="sa"
db.default.password="MyPassword"
db.default.logStatements=true
Enable the TCP\IP protocoll and the port 1433 in the SQL Server Configuration Tool.
That should do the job!
Manfred

Installing Orafce.sql 3.0 in Windows 7

As mention in Orafce Install.orafunc:
..install Orafce functions in the database, either run the orafce.sql script using the pgAdmin SQL tool..
I tried running the orafce--3.0.sql in pgAdmin sql editor. This give me error
ERROR: could not access file "MODULE_PATHNAME": No such file or directory.
What do you mean by module path?
Installed program:
strawberry perl with DBD::Oracle
postgresql 9.3
pgAdmin III
Not fully installed:
ora2pg
I tried installing ora2pg...with a problem.
H:\PostgreSQL\ora2pg-12.1>perl makefile.pl
Unparsable version '' for prerequisite DBD::Oracle at makefile.pl line 553
Generating a dmake-style Makefile
Writing Makefile for Ora2Pg
Writing MYMETA.yml and MYMETA.json
Done...
H:\PostgreSQL\ora2pg-12.1>dmake && dmake install
"Installing default configuration file (ora2pg_dist.conf) to C:\ora2pg"
Appending installation info to C:\strawberry\perl\lib/perllocal.pod
dmake: Warning: -- Target [install] was made but the time stamp has not been up
dated.
Suggested Solution:
I downloaded a copy of orafce from okbob github
Unzip the file to folder D:/Postgresql/orafce-master
I copy only the following files
orafce--unpackaged--3.0.6.sql
orafce--3.0.6.sql
orafce.control
to folder C:\Program Files\PostgreSQL\9.3\share\extension
Then I try running this command in pgAdmin III sql tools.
CREATE EXTENSION orafce;
I received this Warning and Error.
[WARNING ] CREATE EXTENSION orafce
ERROR: syntax error in file "C:/Program Files/PostgreSQL/9.3/share/extension/orafce.control" line 1, near end of line
I checked orafce.control content. It has this config.
# intarray extension
comment = 'Functions and operators that emulate a subset of functions and packages from the Oracle RDBMS'
default_version = '3.0.6'
module_pathname = '$libdir/orafunc'
relocatable = false`
I can't pass to this wall. What seems the problem?
So, you are working with source raw files. You should to compile these files first - and later you can use it. It is relative simply on Unix like platforms, where C compiler is usually available, and pretty hard on MS Windows, where you have to install C compiler first.
I afraid so we lost pgFoundry archive, where was orafce precompiled and packed.
Almost all Linux distributions support orafce directly - and you can install it without compilation from repositories.
see http://wiki.postgresql.org/wiki/Building_and_Installing_PostgreSQL_Extension_Modules
$libdir is symbol, that is used for PostgreSQL extensions directory. It can be different for any platform - and it is replaced inside compilation stage by actual value. MODULE_PATHNAME has similar meaning. In compilation stage is replaced by valid actual path to library with compiled code.
I am sorry - we don't provide a compiled files - mainly due high risk for MS Windows. We have no forces, and tools to maintain all Win safely. In this moment, you can:
try to contact someone who use orafce for windows for backup of orafce installers
try to compile this extension by self (Microsoft Visual Studio Express edition is free and downloadable on internet).
other possibility is migrate database server to Linux - almost all database maintenance and usage is more simply and more robust there (due missing viruses, antiviruses and less resource requests). The Linux is primary platform for Oracle too.
some tutorials:
http://blog.2ndquadrant.com/compiling-postgresql-extensions-visual-studio-windows/
http://www.scribd.com/doc/40725510/Build-PostgreSQL-C-Functions-on-Windows

Unattended Install of SQL Server 2005 Express with LOCAL Server InstanceName

I'm creating an install package using InnoSetup and installing SQL Server 2005 Express. Here's the code below that appears in my RUN section:
Filename: "{app}\SQL Server 2005 Express\SQLEXPR.exe" ; Parameters: "-q /norebootchk /qn reboot=ReallySuppress addlocal=all INSTANCENAME=(LOCAL) SCCCHECKLEVEL=IncompatibleComponents:1;MDAC25Version:0 ERRORREPORTING=2 SQLAUTOSTART=1 SAPWD=passwordhere SECURITYMODE=SQL"; WorkingDir: {app}\SQL Server 2005 Express; StatusMsg: Installing Microsoft SQL Server 2005 Express... Please Wait...;Check:SQLVerifyInstall
What I'm trying to accomplish is have the SQL Server package install but only have the instance name itself reference the name of the machine name and nothing more. What I'm receiving instead is a named instance instead of local such as MachineName\SQLEXPRESS which is not what I want to receive.
I need a local instance instead of a named instance due to the way my code is written to be able to install and talk with the databases in question. I would change it, trust me, were it not the fact that this install package is a replacement to a previous package that used the MSDE installer. I have to be able to support both through code. Any suggestions are welcome but a clear and concise method to get the installer to quietly install using only the machine name is my main goal. Thanks for the help and support!
Here's a sample for setting the InstanceName in code:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{4D044938-6185-4729-8EB9-33CFA5D51993}
AppName=My Program
AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.example.com/
AppSupportURL=http://www.example.com/
AppUpdatesURL=http://www.example.com/
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename = setup
Compression = lzma
SolidCompression = yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "SQLEXPR.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Run]
Filename: "{app}\SQLEXPR.exe" ; Parameters: "INSTANCENAME={code:MyInstanceName|'SQLEXPRESS'}";
[Code]
function MyInstanceName(Param: String): String;
begin
//This sets the value to \MSSQLSERVER.
Result := ExpandConstant('{computername}') + '\MSSQLSERVER';
end;
However, from what I've seen on the net the instance name should be MSSQLSERVER if you want it to be the default instance on the machine.

sql server 2005 command line install error ADD_LOCAL property already installed

I have a silent installation of SQL Server 2005 that works great when installing SQL Server on a machine that does not have it already installed. I use the following parameters when I perform the installation:
#define SQL_SILENT "/passive /qb"
#define SQL_USERNAME "username=MyUserName"
#define SQL_COMPANYNAME "companyname=MyCompanyName"
#define SQL_ADDLOCAL "ADDLOCAL=SQL_Engine"
#define SQL_UPGRADE ""
#define SQL_DISABLENETWORKPROTOCOLS "disablenetworkprotocols=0"
#define SQL_INSTANCENAME "instancename=MYSQLINSTANCE"
#define SQL_SQLAUTOSTART "SQLAUTOSTART=1"
#define SQL_SECURITYMODE "SECURITYMODE=SQL"
#define SQL_SAPWD "SAPWD=StrongPassword"
#define SQL_SQLACCOUNT "SQLACCOUNT="""""
#define SQL_SQLPASSWORD "SQLPASSWORD="""""
It installs the instance of SQL Server Express without a problem. However, when I attempt to install SQL Server on a machine that already has another instance with components I get the following error:
"A component that you have specified in the ADD_LOCAL property is already installed. To upgrade the existing component, refer to the template.ini and set the UPGRADE property to the name of the component."
I have also tried using the UPGRADE method as per the error message
#define SQL_UPGRADE "UPGRADE=SQL_Engine INSTANCENAME=MYSQLINSTANCE"
but get the following error:
"SQL Server Setup cannot perform the upgrade because the component is not installed on the computer. To proceed, verify the component to be upgraded in currently installed, and that the component to be upgraded is specified in the ADDLOCAL property."
Does anyone have any suggestions?
Are you sure the server name / instance name are correct?
What do you see in the registry, specifically
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Machines
I define the Instance Name in a single place and re-use it to avoid mis-typing it elsewhere.
You manually remove the workstation components from Add/Remove programs and install it
I had a similar issue when I tried to install Management Studio on top of an existing SQL 2005 installation. The cause of this problem for me was that I had the SQL Express tools installed. Since they did not show up under Add/Remomve Programs, I uninstalled them using a Microsoft tool I downloaded called "Windows Install Clean Up". After doing this, I was able to install the SQL 2005 client tools (Management Studio, etc.) by running SqlRun_Tools.msi directly from the CD.