How to import Microstrategy dossier mstr file - microstrategy

I'm not sure if it's my access or not, but do you know how to import a dossier (.mstr) file into Microstrategy?

Related

How to manage multiple database connections?

I want a nice and clean way for accessing my Postgres databases in python.
Currently, I have a file called database.py which has some imports within it.
The imports look like this:
from DatabaseA import dbA
from DatabaseB import dbB
DatabaseA and DatabaseB each have their own methods for performing various queries against their respective database connection.
I would now, in my file where I need to use a database, add the import import database and then do something like:
database.DbA.create_table(table_name)
database.DbB.do_something(some_args)
My database scripts (eg DatabaseA) each get their connection details from a config.ini file.
This all works, but I'd like to have it more object orientated.
It would be nice to be able to specify a master DB "manager", and then access the respective DB by passing in a configuration name (so that it can get the required connection details and return the correct database file). For example:
DBManager().get_db("DbA_config_name").create_table("test_table")
Where "DbA_config_name" is the name of the configuration in the config.ini file (accessed using configparser).
What patterns exist for this type of thing in Python?

Importing Access DB file in SAS but failing

I am trying to run below code but failing with error 'ERROR: DBMS type ACCESS not valid for import.' Not sure what is the issue.
LIBNAME db 'C:\Extra';
PROC IMPORT DBMS=ACCESS
OUT=WORK.Finished_IP
DATATABLE='IP Input Data'
REPLACE;
DATABASE= "db.Finished data.accdb";
USEDATE=YES;
SCANTIME=NO;
DBSASLABEL=NONE;
RUN;
If you have the "Microsoft Access Driver (*.mdb, *.accdb)" driver installed you can use this to create your libname directly to the database file like so:
libname Test ODBC noprompt="DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};
DBQ=C:\local\Your_DB.accdb";
You can see if you have the driver under the ODBC Data Source Administrator found in Administration Tools in the Control Panel.
Using this method means that tables in the database can be read in like normal SAS datasets.

How to Import DB2 full dump

I have a DB2 v9.7 Dump(.gz format) which i need to import to an another DB2 database of same version.
All the tables needs to be imported in one go.
Can somebody help me in how to achieve this ?
Thankyou in adavnce.
-Nitika
First, the DB2 backups do not have that name structure. You should have a file inside that .gz that should have a name like this
SAMPLE.0.db2inst1.NODE0000.CATN0000.20131224235959.001
It gives the database name, the backup type; the instance that host the database; the node (when using DPF); the timestamp; and the file number.
Normally, it just change the timestamp. And in order to restore the db you should go to the directory where the file is, and then just type:
db2 restore db sample
Eventually, if it does not work, you should specify the timestamp, directory or other things:
db2 restore db sample from /dir taken at 20131224235959
If you change the instance, you should rebind some packages. Also, you should be sure that the security structure is the same in the new installation (/etc/passwd and /etc/group have the same users and groups used in DB2)
For more information, please check: http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.ha.doc/doc/c0006237.html
You can use db2move command
db2move sample export
db2move sample import
where sample is the database name.
If you are having .dmp file then you can use below commands import .dmp file.
If you have dmp file in tar or zip you need to extract this.
db2 –c- -svtf db2dump.dmp > log.txt
Note:
It is different then: restore command as below :
restore db from Path_of_the_backup_file.
eg: restore db QAST from C:\Backups\Backup_location
backup db to C:\Backups\Backup_location.
eg: restore db QISST from C:\Backups\Backup_location

How do you import a spreadsheet into DB2?

I have a CSV file, but this could apply to any txt, data, or xls file. (xlsx) I have exported the data from one source and I want to import the data into a DB2 table.
I first tried Data Tools Plugin (DTP) in eclipse Helios (3.6.3) by right clicking on the table and selecting: Data > Load...
But I got this error:
Loading "myschema"."mytable"... com.ibm.db2.jcc.am.SqlException:
[jcc][10103][10941][4.14.113] Method executeQuery cannot be used for
update. ERRORCODE=-4476, SQLSTATE=null Data loading failed.
Then I tried Eclipse SQL Explorer on Eclipse Juno, but it does not support data import.
How do I get past this error so I can import?
You can import a CSV file directly into DB2 via the IMPORT or LOAD command, even with XML or BLOB as part of the data to import.
The procedure to import depends on the structure of the file you are going to import. Probably you should modify the default behaviour of these commands; DB2 has many option to adapt the command to the input file.
For more information about:
The import command: http://publib.boulder.ibm.com/infocenter/db2luw/v10r1/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0008304.html
The Load command http://publib.boulder.ibm.com/infocenter/db2luw/v10r1/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0008305.html
I think your question was more oriented to: how to use Eclipse to import data in DB2 from a CSV file. However, as I said, you can do that directly via DB2.
If you are going to import a file like the next one, the only thing that you need is to have access to a db2 client.
data.txt
1,"Andres","2013-05-18"
2,"Tom","2011-04-16"
3,"Jessica","2002-03-09"
You import with
db2 import from data.txt of del insert into test
I solved this by installing Eclipse Juno (4.2) and Data Tools Plugin (DTP) 1.10.2.
Now Data > Load... will work fine. This is the new message I get:
Data loading was successful. 142 row(s) loaded. 135 row(s) could not
be loaded.
com.ibm.db2.jcc.am.go: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502,
SQLERRMC= , DRIVER=4.7.85 One or more values could not be set in the
following column(s): USER_TIME, USER_DATE
FYI for the entire process I was using this:
DB2 driver: /opt/IBM/db2/V9.7/java
With jar files: db2jcc4.jar, db2jcc_license_cisuz.jar
Driver Class: com.ibm.db2.jcc.DB2Driver
You can import using DB2 "Control Center" *
Right Click the table and select "Import"
Then specify the csv file and message file
message file is important because in the case of failed upload, you can find the error cause in the message file
* Control Center is now deprecated in favor of "Data Studio"
From the db2 console, try this:
Import from 'yourcommaseparatedfile.csv' of del insert into "SCHEMA"."TABLE"
Regards =)
db2 'import from /users/n0sdsds/test.csv of del insert into ENTPRISE.tmp_x'

Delete and restore postgress database in sikuli

I have used below code to delete postgress database. My issue is I am unable to find query which would restore database. Please provide your assistance. thank you!!
from __future__ import with_statement
import sys
from sikuli import *
from com.ziclix.python.sql import zxJDBC
load("C:\\Test\\SikuliX\\postgresql-9.4.1207.jre6")
connection2 = zxJDBC.connect('jdbc:postgresql://127.0.0.1/?stringtype=unspecified', 'postgres', 'pswd#123', 'org.postgresql.Driver')
connection2.autocommit = True
curs = connection2.cursor()
curs.execute('DROP DATABASE IF EXISTS sampledb')
curs.execute( < I need query to restore database>)
There is no "command" to restore a postgresql database. Usually a backup consists of a very large bunch of commands that piece by piece create a database that is mostly identical to what you have backupped before. Your only possibility is to use the shell command pg_restore.
Oh, and your question has nothing to do with sikuli-ide. The problem is programming language agnostic.
Found workaround for this, instead of restore we can copy the database
curs.execute('CREATE DATABASE [newdb] WITH TEMPLATE [originaldb] OWNER dbuser')