SQL Server Rename Data Folder - tsql

I lost several days worth of SQL data in mdf and ldf files on my server stored at C:\Program Files\Microsoft Server\MSSQL11.MyServer\MSSQL\DATA.
I have uploaded files with the missing data to a folder called DATA_NEW in the same path.
I would like to test the Restored Data by renaming my current DATA folder to DATA_OLD and then renaming the DATA_NEW folder to DATA so that my database points to the Restored Data.
Is this a good way of verifying that the renamed data folder contains the valid data - with an option to revert back to the data in the folder named DATA_OLD?
Does anyone know of any reasons that I should not proceed with this approach?
Thanks very much,
Mark D

Related

Transferring MongoDB data

So, as the documentation says, by default, it stores data in the data/db/ directory. As I can see through the file manager, the folder is empty. I guess the documents are hidden there.
So, If I pull a repository with this folder from another PC, will I be able to access this data through MongoDB?
I guess the documents are hidden there
Unlikely. I'm betting that your data dir is set to another value.
If I pull a repository with this folder from another PC
This may work, but, at best, it'll overwrite your local data files. At worst, it'll overwrite your local data files and mongodb won't boot with your new data files.
A recommended/supported way is to use mongodump/mongorestore. Bonus point: you won't have to care about where your data files are on both computers.
If you have installed MongoDB for example from Debian/Ubuntu package the data directory will be /var/lib/mongodb.
See https://askubuntu.com/questions/982673/where-is-mongo-database-folder-on-the-filesystem

How to recreate an ATR file after it was deleted from the catalog in the file system?

How can I recreate the .atr file for a folder in OBIEE?
On the server, the catalog contains a directory, but its corresponding ATR file is missing.
As a result, the folder does not appear in the UI.
It was inadvertently deleted from the file system.
Can I reverse engineer the ATR using another ATR file, or does the Catalog Manager application have a utility to help restore it?
Instead of reverse-engineering the ATR file, let the Catalog rebuild it automatically by re-propagating folder permissions down from a higher folder level in the catalog.
After this, the missing folder (caused by the missing ATR file) will now appear in the BI Catalog.

Talend issue while copying local files to HDFS

Hi I want to know how to copy files to HDFS from source file system(Local File system),if source file already copied to HDFS,then how to eliminate or ignore that file to copy again in HDFS using Talend.
Thanks
Venkat
To copy files from local file system to the HDFS, you need to use tHDFSPut components if you have Talend for big data. If you use Talend for data integration you can easily use tSystem component with the right command.
To avoid duplicated files, you need to create a table in a RDBMS and keep track of all copied files. Each time the job start copying file, it should check if it already exists in the table.

How to upload a entire structured folder to eXist-db database through RESTful

Could someone tell me that how to upload an entire structured folder to eXist-db database through RESTful?
Here is what I attempt to achieve: I have a folder which contains data file, and it has sub-folders which form the hierarchy of the root folder. Is it possible for me to upload the entire root folder of data to the local eXist-db database using RESTful, so I can access to the data files like this:
http://localhost:8080/exist/rest/db/basefolder/branch1/dev/documents/File.xml
in Eclipse.
Thank you very much.
You need to write some script to do this. Two main options:
1) Write it client-side in the language of your choice, and have a script that loops through your files HTTP PUT'ing each of them to the database.
2) Write it server-side in XQuery. You then just Zip/Gz your directory structure and HTTP POST the zip file to your XQuery installed in eXist. Your XQuery should unpack the Zip and store each entry from the zip file into the database.

how to properly handle a file upload in wicket

I have a file upload page that takes a file and parses it.
Order of Events
user uploads file
uploaded file gets copied
copied file gets it's encoding checked, with CPDetector
determined encoding from the copied file is used to parse the original uploaded file
FileNotFoundException on Solaris Test Server during BufferedReader creation.
copied file is deleted
uploaded file is parsed/verified
parsed data is saved to a database
uploaded file is deleted (I can't remember if I'm doing this or Tomcat is.)
The Whole process works on my Windows 7 workstation. As noted above it does not work on my Solaris Test Server. Something(I Suspect Tomcat) is deleting the uploaded file before I can finish parsing it.
I've watched the directory during the process and an uploaded file does indeed get created, but it lasts less than a second before being deleted. Also It's supposed to go into /opt/tomcat/ but seems be getting created in the /var/opt/csw/tomcat6/temp/ directory instead.
Thanks for any help
I realize it's probably bad form to answer my own question like this but I wanted to leave this here in-case it helps someone else.
The Problem turned out to be How I was accessing the files.
I had hard-coded file paths, for windows, and Database loaded ones for the test server.
I switched those to using System.getProperty("catalina.home")+"/temp/" + filename
I'm also copying the temp file a second time so I end up with:
Order of Events (changes are in bold)
user uploads file
uploaded file gets copied
copied file gets it's encoding checked, with CPDetector
uploaded file gets copied again to ensure a copy survives to be parsed
determined encoding from the copied file is used to parse the original uploaded file
copy used for encoding detection is deleted
copy for parse is parsed/verified
parsed data is saved to a database
parsed file is deleted.
uploaded file is deleted (I'm not sure if I'm doing this or Tomcat is.)