Copying a template database

hey,
I am wondering how to copy a template database I have created (templte.mdb)to another directory using SQL. I am writing a program in java and using the javax.sql package. The way the program operates is that at 12 o clock at night a new database is created for that date 2 year ahead. So for example tonight at 12 o'clock a copy of the database (template.mdb) would be placed in the folder c://databases//2006//march//..... The problem is that I dont know the commands to copy the template database exactly. I need to keep the same column names,structure etc in all the databases!
Any help would be greatly appricated
Stephen

An Access database file....
1. Put a blank database into a directory.
2. Copy that file using Runtime.exec() to the destination directory, giving it a new name.
3. Start using it.

Similar Messages

  • Install with a copy of existing database

    I am wondering if anybody had tried this:
    suppose you have a LiveCycle ES 8.0 running, all's well; let's call this system "A".
    now, you need to bring up another LC ES system on a separate server machine. let's call this system "B".
    But, since there are 2000 forms/processes in system "A" already,
    and you don't want to Import + Configure all those 2000 forms from "A" to "B", because it's a time-consuming, tedious and extremely boring work.
    So, is it possible to
    make a copy of the LCES database of system "A",
    and,
    during the install/configure/deploy LC ES onto "B", we configure "B" to connect to the COPY of the database (instead of letting the configuration manager configure/initialize a brand new database for B).
    would that work?
    if so, what would be the exact procedure?
    thanks

    Hello,
    Maybe the TargetDatabase and the DeployToDatabase properties can help you.
    http://www.asp.net/web-forms/tutorials/deployment/web-deployment-in-the-enterprise/deploying-database-projects
    You can deploy multiples databases from one project if you want, as explained on the following
    post:
    http://stackoverflow.com/questions/1544966/gdr-deploying-multiple-database-targets-with-one-project
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Is it possible to copy the same database multiple times simultaneously?

    This is the setup of my environment.
    I have a 'master' database that contains the full schema plus some pre-populated data such as default settings. When database schema changes are made, they get made to the master database. When a new customer signs up for the service, I make a copy of this
    master database (using SMO) that will now be the database containing all of the customer's information. The database is rather large, and the copy operation can take a couple minutes.
    Everything works fine as expected, unless I try to provision two new customers at the same time. It appears that Azure only allows for one DB copy operation at a time. Is there a way to allow for copying the same database multiple times simultaneously?
    Thanks for you input. I understand that this is likely not the optimal setup, and that there is many better ways of doing this, but I am somewhat heavily invested in the current process and I would like to find out how to make it work if I can.

    BTW, you can do this programatically by using PowerShell (https://msdn.microsoft.com/en-us/library/ee210569.aspx), SqlPackage (http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/)
    or the SQL Server binaries for .NET (http://www.vijayt.com/Post/Deploying-a-data-tier-application-in-SQL-Azure-programatically)
    Hope this helps.
    Alex

  • Is it possible to create a copy of entire database, not the data, but just database structure?

    Greetings community,
    This question is related to EXPRESS edition.
    Let’s say that I have MyDatabase2014 and I’ve been populating it with some data during the year 2014. Before the end of the year, I want to prepare another database named MyDatabase2015, which should be empty, but of course it should have
    all tables, relations, indexes and stored procedures just like MyDatabase2014. The idea is just to change a connection string and to continue using the same app for the same job.
    So in SSMS, I right-clicked the database, choose script database as / create to / new query, but I didn’t get what I wanted. In query window I’ve got just create database statement, and below that few dozen of alter database set ansi this
    or that statements, and set many other things. However, no table creation was scripted. Also, no stored procedures have been created, and about users, and other security objects better not to start to talk about.
    I could have achieved that simply by right-clicking databases node and select new database. So what’s the point of “script database as”?
    Does this work in SQL server editions other than EXPRESS?
    When it comes to express edition, what’s the best practice to get the empty copy of a database?
    Thanks for any help.

    For scripting out the users and their permissions you can use this script
    -- Capture permissions for all users in a DB
    SET NOCOUNT ON
    DECLARE @Database varchar(max)
    SET @Database = '<Db_Name>'-- set the database name here
    IF EXISTS (SELECT * FROM SYS.SYSDATABASES WHERE name = @Database)
    EXEC('USE ' + @Database + ';
    DECLARE @temp table(Extract Varchar(MAX))
    INSERT INTO @temp (Extract)
    SELECT ''EXEC( ''''USE ' + @Database + '; IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'''''''''' + name + '''''''''')IF EXISTS (SELECT *
    FROM sys.database_principals WHERE name = N'''''''''' + name + '''''''''') DROP USER ['' + name + '']''''); ''
    FROM sys.sysusers WHERE islogin = 1 AND hasdbaccess = 1 AND name NOT IN (''dbo'')
    INSERT INTO @temp (Extract)
    SELECT ''EXEC( ''''USE ' + @Database + '; IF NOT EXISTS
    (SELECT * FROM sys.database_principals WHERE name = N'''''''''' + dp.name + '''''''''')
    CREATE USER ['' + dp.name + ''] FOR LOGIN ['' + sp.name + '']''''); ''
    FROM sys.server_principals sp
    JOIN sys.database_principals dp ON (sp.sid = dp.sid)
    AND dp.name NOT IN (''dbo'')
    INSERT INTO @temp (Extract)
    SELECT ''EXEC( ''''USE ' + @Database + '; IF NOT EXISTS
    (SELECT * FROM sys.database_principals WHERE name = N'''''''''' + dp.name + '''''''''')
    CREATE USER ['' + dp.name + ''] WITHOUT LOGIN ''''); ''
    FROM sys.database_principals dp left
    JOIN sys.server_principals sp ON (sp.sid = dp.sid)
    where dp.principal_id between 5 and 16383
    INSERT INTO @temp (Extract)
    SELECT ''EXEC( ''''USE ' + @Database + '; EXEC sp_addrolemember '''''''''' + User_Name([groupuid]) + '''''''''', '''''''''' + User_Name([memberuid]) +
    FROM sys.sysmembers WHERE User_Name([memberuid]) NOT IN (''dbo'')
    INSERT INTO @temp (Extract)
    SELECT ''EXEC( ''''USE ' + @Database + '; ''
    + CASE [a].[state_desc] WHEN ''GRANT_WITH_GRANT_OPTION'' THEN ''GRANT '' ELSE [a].[state_desc] END
    + '' ''
    + [a].[permission_name] + CASE class WHEN 1 THEN '' ON [''
    + [c].[name]
    + ''].[''
    + Object_Name([a].[major_id]) + ''] '' ELSE '''' END + '' TO [''
    + User_Name([a].[grantee_principal_id])
    + ''] '' + CASE [a].[state_desc] WHEN ''GRANT_WITH_GRANT_OPTION'' THEN '' WITH GRANT OPTION'' ELSE '''' END
    + ''''''); '' COLLATE Latin1_General_CI_AS AS [SQL]
    FROM sys.database_permissions a
    inner join [sys].[all_objects] b
    ON [a].[major_id] = [b].[object_id]
    inner join [sys].[schemas] c
    ON [b].[schema_id] = [c].[schema_id]
    INSERT INTO @temp (Extract)
    SELECT ''EXEC( ''''USE ' + @Database + '; ''
    + [a].[state_desc]
    + '' ''
    + [a].[permission_name]
    + '' TO [''
    + USER_NAME([a].[grantee_principal_id])
    + ''] '''');''
    from sys.database_permissions a
    where a.class=0
    INSERT INTO @temp (Extract)
    SELECT ''EXEC( ''''USE ' + @Database + '; ''
    + [a].[state_desc]
    + '' ''
    + [a].[permission_name]
    + '' ON SCHEMA ::''
    + '' [''
    + SCHEMA_NAME([a].[major_id]) +
    + ''] TO [''
    + USER_NAME([a].[grantee_principal_id])
    + ''] '''');''
    from sys.database_permissions a
    where a.class=3
    SELECT Extract AS [Extract] FROM @temp
    GO
    ELSE
    SELECT '--NO'
    GO
     

  • Can I use vCloud Connector Basic to copy vSphere template between datacenters?

    A client has 4 datacenters around the world.   They use one a couple of vCenter servers in Linked Mode.  vSphere/vCenter only,  no vCloud.
    If they create a VM template at HQ,  could they use vCloud Connector Basic to copy the template between DC in different locations?
    If so,  would this offer anything more than cloning the template to another DC using vCenter?
    Thanks,
    -MattG

    Hi Matt,
    You can use vCloud Connector for vSphere environment to copy templates / vms across datacenters that are geographically separated.

  • Copy a standby database

    Hi
    I need to periodically make a copy of a standby database to another db. For this purpose we can use a fast copy mechanism at the storage level. We've been doing similar things with normal (non-standby) databases many times and all is fine. Normally, before the copy happens we simply switch the db into the backup mode (alter database begin backup), than clone it and start the copy on a different host under a different name.
    My question is if I can copy the standby database while it is mounted and redolog application is stopped? Nothing should be writing to data files in such case. Will this image be consistent? I cannot execute the 'alter database begin backup' command because the database is a standby database and cannot be opened. Shutting down the source database would require action from other people what I would like to avoid.
    Kind Regards,
    Tim

    Thank you for your replies.
    rajeysh wrote:
    why you are using user managed backup ?
    use rman it is faster than traditional user managed backup copy.As I wrote, we use a copy mechanism at the storage array level. It's a way faster than RMAN. We only need to make sure the copy is recoverable.
    rajeysh wrote:
    also you cannot take backup while the database is in mount stage, the image will be inconsistent.Why do you think I cannot? If no recovery actions are running in the mount state, no data files are being written. If it's inconsistent in the mount state (awaits recovery because instance was terminated), than it is recoverable. No problem, I can later use redo data to make the copy consistent.
    Iordan Iotzov wrote:
    A sure way to have you standby DB in a consistent state is to open it read-only.
    Once the copy is done you can return it back to applying redo.
    Iordan Iotzov
    http://iiotzov.wordpress.com/
    Edited by: Iordan Iotzov on Jul 12, 2011 8:00 AMIt's a great idea. In the read-only mode no changes occur to data files and nobody will accidentally start managed recovery (without restarting the instance) while I am copying the database.
    Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2):
    Making User-Managed Backups of Read-Only Tablespaces
    When backing up an online read-only tablespace, you can simply back up the online datafiles. You do not have to place the tablespace in backup mode because the database is not permitting changes to the datafiles.

  • Offline copy of SQL Database in Visual Studio Community Edition?

    I'm using an Azure Mobile Service and SQL database, and I'm interacting with it via Visual Studio Community Edition (12.0.31101.00 Update 4).
    I'm often offline, but want to work on and test the SQL code.  Is there a way to sync a local copy of the database to my pc so I can work with that to test my code?  I'm not necessarily looking to make changes to the database offline and syncing
    that back to the server, although that would be nice too.
    Thanks!

    Hello Scott,
    You could use SQL Data Sync to synchronize your local copy of the database with the Azure SQL database. The details are documented at http://msdn.microsoft.com/en-us/library/hh456371.aspx. 
    PS - the SQL Data Sync feature is still in preview and the support is only through forums.
    Regards,
    Kumar Bijayanta

  • Copying existing logical database

    HI ,
    I have copied one logical database CRMLDB_SERVICE_MON and it has lot of selection entries which doesnt comes under my requirement . My req is to just to have three selection parameters . selection parameters are under some standard include . while copying it didnt ask me to give new name for that include and it has copied as it is the standard one. No i need to change the standard include which i should not do it.
    Can you please tell me how do i copy the standard include of selections in logical database into my defined Z name as while copying it is not asking me to give a z name for standard include.
    Thanks,
    Ahmed.

    someone please reply

  • Copy BW template (cube, query, web application) to multiple BW systems

    We have a set of cube, query and web applications in a BW system. And we'd like to copy the set of objects to other BW systems as a BW template.
    (Q1) We know we can transfer the set of obejcts to other BW systems by using STMS and AWB. But if so we have to make connection between two systems. We'd like to avoid coping the template via internet or intranet.
      Is it possible to copy the BW template to other BW systems by using CD-ROM/DVD?
    (Q2) When we do copy the template, if there is an InfoObject with same name existing in copy-to system, I suppose there will be an error. Is there a solution to avoid this situation?
    Tetsuya

    Hi Tetsuya,
    here are more details for the procedure mentioned above:
    Datafiles of transport requests are in most SAP-Installations located in /usr/sap/trans/data. They are named R<# of transport request>.<SID>
    The cofiles are in most SAP-Installtions located in /usr/sap/trans/cofiles. They are named K<# of transport request>.<SID>
    Do NOT change the names of the files. We've discovered that it's safer to zip those files, as some virus scanners in email-servers may scramble the files.
    Locate the files in the appropriate directory of the target system and go to the import-queue using STMS.
    Chose Extras / Other requests / Add to add the request to the queue (note: you must use the request number of the source-system e.g. <SID>K900123)
    When you start the import, choose option "Overwrite Objects in unconfirmed Repairs", when you want existing objects to be overridden.
    Hope, this helps
    Robert

  • I/O error on ext3 while copying a template

    Hi,
    This is my config:
    Sun Server with AIC7902 SCSI card.
    2Gb RAM
    2*72 Gb disk
    I installed Oracle VM succesfully, but when I try to copy a template with FTP, HTTP, CDROM, or anything else, I got an I/O error on an ext3 partition even if I wanted to copy the file to /OVS (ocfs)
    SCSI disks:
    Host: scsi1 Channel: 00 Id: 00 Lun: 00
    Vendor: SEAGATE Model: ST373207LSUN72G Rev: 045A
    Type: Direct-Access ANSI SCSI revision: 03
    Host: scsi1 Channel: 00 Id: 01 Lun: 00
    Vendor: SEAGATE Model: ST373207LSUN72G Rev: 045A
    Type: Direct-Access ANSI SCSI revision: 03
    SCSI card:
    04:07.0 SCSI storage controller: Adaptec AIC-7902 U320 (rev 03)
    Adaptec AIC79xx driver version: 3.0
    Adaptec AIC7902 Ultra320 SCSI adapter
    aic7902: Ultra320 Wide Channel B, SCSI Id=7, PCI-X 67-100Mhz, 512 SCBs
    Allocated SCBs: 4, SG List Length: 128
    When I boot the server with the grub choice 2.6.18-8.1.6.0.18.el5BOOT I can FTP my files but xend is not loaded and I can't use VM Manager in this case.
    I tried to FTP a template into the seed_pool directory and then reboot in normal mode but when I try to create a virtual image using the template (which I created succesfully with VM Manager), nothing append.
    Thanks for your help.
    Best regards.
    O. Cimbaluria.

    1)what error did Oracle VM report when you copy templeate with FTP,HTTP,CDROM?
    # tail /var/log/xen/xend.log
    #tail /var/log/messages
    2)may you copy/create any file from one place to another?
    # cp /etc/hosts /tmp
    3) what output for the following command?
    # mount
    # fdisk -l
    4)did you make fsck your disk/partition?

  • Partial copy of the Database

    Hello!
    I need to make a partial copy of the Database, as I do from the sap? or how can I make from oracle? if possible?
    What we require is to make a copy of the configuration data SPROM and a copy two months ago of data
    greetings!

    Hello,
    QAS (or test) systems should be build the cleanest way possible.
    Remote client copy is not something I would advise. It requires to have source and target systems align with the same structure (same SP, same transport level,u2026), and it will transport client dependant objects, until you specify to move also client independent objects, then it will overwrite the objects in the target system (development, printer definitions, RFC,u2026). 
    NRIV table should not be copied between systems, even a subset of this table. Number range should be adjusted individually on each system.
    Also, if your systems are validated by regulation or industry standards (pharma, banking,u2026), you can not overwrite your QAS from any system (DEV or PRD)
    But we are still not sure about Edithu2019s motivation, and what she means by partial restore. Is it motivated to get master and transactional data in QAS to test for the next Go-live rollout? Is it a copy from the production system? Is it to align PRD and QAS in term of customizing in order to prepare for the next rollout because there is a change management gap between 2 systems? Is it to get an older version of customizing?
    Thanks in advance
    Best regards.
    Frank Markarian
    Principal consultant
    SAP America.

  • Copy linked server database and create database on same server

    Hi ALL
    I have one linked server i need to copy it whole database in SQL on same server where linked server is created .
    Kindly help me .
    Thanks
    with regards
    BI_Group

    Hi BI_group,
    You can try Microsoft SQL Server Migration Assistant for MySQL. For more detail information, please refer to the following link:
    Microsoft SQL Server Migration Assistant for MySQL
    http://www.microsoft.com/en-us/download/details.aspx?id=28764
    Migrating MySQL Databases to SQL Server / SQL Azure
    http://msdn.microsoft.com/en-us/library/hh313125.aspx
    Converting MySQL Databases (MySQL to SQL)
    http://msdn.microsoft.com/en-us/library/hh313137.aspx
    Allen Li
    TechNet Community Support

  • Copy vm template as a package

    Hi all,
    I want to give my VM template as package.
    I have a SCVMM installed on Windows. I have created a custom Linux VM and is up and running. I have created a VM Template using this existing VM. The Template is generated (which is a folder with vhd files) and is available in the SCVMM library share.
    Now I want to copy the Template folder to another Share, so as to enable people to copy the template from the share to deploy VMs in their setups. How can I do this?
    I manually copied the folder with the vhd files to another SCVMM server, did a refresh Server. But the SCVMM is not showing the folder as a template.
    Please share some light on copying this template to another host..
    The link
    http://wiki.sqlis.com/default.aspx/SQLISWiki/PackageTemplates.html in similar post looks broken.
    Thanks in advance,
    Saleem

    Only the VHD can go backward from SCVMM 2012 / R2 to SCVMM 2008 / SP 1 - not the settings.
    Going forward from SCVMM 2008 has a similar issue, since Export from SCVMM appeared with the 2012 release (if I recall properly).
    A deployed VM can be exported using Hyper-V Manager.  But again, the OS profile is lost.
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

  • Profit Center should not change after copying from Template

    Hi,
    I have a scenario wherein there is an operative project which has a profit center maintained at the project definition level. I copy the WBS structure on to the 2nd level from a template which has a different profit center maintained at the WBS level. My requirement is that the profit center maintained in the template should remain as it is after i copy the template to the operative project.
    As of now after copying the template the profit center changes to the one maintained at the project definition level after i save the operative project. Is there a way by which i can restrict the system from copying the profit center maintained at the project definition level to the 2nd level WBS (which is copied from the template)?
    Regards,
    Gokul

    Hi Mohamed,
    Thanks for your response but i already checked that note and it seems that it doesn't cater to my requirement. Presently i am checking with my ABAPer if we can use some user exit and get this done which i think will require considerable amount of time. In case you have any other suggestions please suggest.
    @ Abdul Khader : - I already tried all the possibilities using substitution. Would appreciate if you could suggest something else.
    Regards,
    Gokul

  • HOW2 FIND VERSION OF SYBASE DATABSE AND SEND A COPY OF THIS DATABASE 2 3RD PARTY

    HI, i have been asked by a colleague for the following..is this possible:
    Hornbill need to know what version of Sybase we use for Zenworks.
    Also, they would like a copy of the database.
    Is that practical ??
    We are running:
    Netware 6.5
    Zenworks for desktops 6.5
    regards
    Dennis

    Version - Sybase SQL Anywhere 10.0
    Here is how you do a backup/restore.......................
    http://www.novell.com/documentation/.../bookinfo.html
    Craig Wilson - MCNE, MCSE, CCNA
    Novell Support Forums Volunteer Sysop
    Novell does not officially monitor these forums.
    Suggestions/Opinions/Statements made by me are solely my own.
    These thoughts may not be shared by either Novell or any rational human.
    "Dennis" <[email protected]> wrote in message
    news:XEHTi.18199$[email protected] ..
    > HI, i have been asked by a colleague for the following..is this possible:
    >
    > Hornbill need to know what version of Sybase we use for Zenworks.
    >
    > Also, they would like a copy of the database.
    > Is that practical ??
    >
    >
    > We are running:
    >
    > Netware 6.5
    > Zenworks for desktops 6.5
    >
    >
    > regards
    >
    > Dennis
    >
    >
    >

Maybe you are looking for

  • How to get line error from a procedure?

    Hello, I want to know the line where the error occurs, since when I treat the exception to show a user friendly error page this erro is not logged at OAS. How to do it? Thanks in advance. EXCEPTION WHEN OTHERS THEN HTP.P('Sorry'); emailme(SQLERRM); e

  • AE Flashing Amber (Status: Internet Connection) but Internet Green

    Apologies if this has been asked before, I couldn't find an answer. I'm on an AE with a Motorola SB6120 modem, paying for Comcast service. My AE worked fine two weeks ago when I was on Centurylink at another address. Problem: AE is flashing Amber. St

  • Some text in Safari appears as fractions instead of readable text

    On some web pages certain blocks of text appear as numerical fractions. When I go to the same web page in another browser, such as Camino, the text appears as it should. I have tried to change the font in Safari's preferences, but nothing seems to fi

  • How can I make Preview behave more like it used to?

    I use Preview a LOT for doing things like annotating screenshots for IT helpdesk stuff. In 10.9 it was invaluable; but the version in 10.10 seems to be a bad  step backwards. I used to be able to select a tool, like text,  a line, or oval, for exampl

  • T510 Wireless connection issue

    I've had a T510 with the Centrino Advanced-N 6200AGN wireless for about 6 months now and it's been great. However, several days ago it started to not connect to my home network's wireless. I've reset the router numerous times and rebooted the laptop