Oracle 12c sample schema olaptrain is not importing tables - schema

OLAPTRAIN12232009.dmp file is not importing tables into 12c database.I followed the procedure found at http://www.oracle.com/technetwork/testcontent/readme-098894.html.
but the tables are not in c##olaptrain user's tables folder.Any idea would be helpfull to me on how to fix this...thanks

alter session set "_ORACLE_SCRIPT"=true;

Related

SSIS schema switching deadlocks

I have an SSIS package which takes data that has changed in the last 1/2 hour and transfers it from a DB2 database into a SQL server. This data is loaded into an empty import table (import.tablename) then inserted into a staging table (newlive.tablename). The staging table is then schema switched with the live (dbo) table within a transaction. FYI, the dbo tables are the backend to a visualization tool (Looker)
My problem is that the schema switching is now creating deadlocks. Everytime I run the package, it affects different tables. I've been using this process with larger tables before (also backend to Looker) and have not had this problem before.
I read in another post that the user was having a similar problem because of indexes but all the data has been written to the destination tables.
Any ideas or suggestion of where to look would be much appreciated
The schema switching code is within a Execute SQL Task in the SSIS Package with:
BEGIN TRAN
ALTER SCHEMA LAST_LIVE TRANSFER DBO.TABLENAME
ALTER SCHEMA DBO TRANSFER NEW_LIVE.TABLENAME
GRANT SELECT ON DBO.TABLENAME TO LOOKER_LOOKUP
COMMIT TRAN

Best way of importing tables to PostGre from Oracle?

I have done some queries in a read-only (Oracle/SQL developer) dB where I have absolutely no privileges to create temporary tables or anything else. I want to export the tables resulting of my queries into another db (PostGre/pgAdmin) db in order to be able to do other queries on the result.
Is there an easy way to create the columns of my exported tables in the PostGre db using pgAdmin or do I have to create all the columns manually ?
You could install the Oracle Foreign Data Wrapper in your PostgreSQL database and use IMPORT FOREIGN SCHEMA to create foreign tables for your Oracle tables.
Then you can use
CREATE TABLE local_table AS SELECT * FROM foreign_table;
to copy the data.

SQL alter schema multiple tables at once

I recently upsized my MS-Access database to SQL Server and in the process successfully exported a bunch of tables.
However, now the imported tables are prefixed with MSH-CHAMBERS\mfanimpela which I assume is my username and this is the schema (or owner property).
While I have seen posts on changing EACH table schema to the desired 'dbo', I want a statement that can help me change ALL of my tables (since these are so many).
Please help - chagbert.
Use the sp_MSForEachTable procedure like this:
EXEC **sp_MSForEachTable** 'ALTER SCHEMA dbo TRANSFER ?'
-- in the above example dbo is the targeted schema where you want to place your tables
Google sp_MSForEachTable and use it to call sp_rename
You might need to do additional checks before you rename the table to avoid mistakes.

Oracle sql developer - export DDL - only create table sql

I want to run unit tests by generating all tables in HSQLDB, present in my oracle database.
For that I want to export all DDL create table statements from oracle tables.
I tried export database, but along with create table sql I am getting lot other SQLs like,
" PARTITION BY RANGE ("CREATION_DATE") " etc.
How do I export all oracle tables(schema) to HSQLDB? is there any better way?
You can use the DBMS_METADATA.GET_DDL() function to get the table definition, and modify what is included with the SET_TRANSFORM_PARAM() options, specifically in this case the PARTITIONING parameter.
There are lots of examples for you to search for, but here's one that shows the DDL being simplified with similar transformations.
It's some work, but you can implement your own tool to create the DDL.
All you need is stored in the Oracle database catalogue.
To create just tables (without index and constraints) you need these 2 tables:
USER_TAB_COLUMNS
USER_TABLES
You will find a detailed documentation of these tablese here:
Oracle Database Reference
Other usefull Oracle tables are
USER_CONSTRAINTS
USER_INDEXES

Sql Server 2008 - Dropping a synonym

I have a utility database (customers) on my db server where I store all of the routines used to modify data on the other databases. We recently found out that using synonyms will greatly benefit us.
use Customers
IF EXISTS (SELECT * FROM employees.sys.synonyms WHERE name = 'tblPerson2') begin
drop synonym [dbo].tblPerson2
end
This doesn't work because I am using the Customers database but need to drop the synonym from my employees database.
SQL Server 2008 doesn't support this syntax -
drop synonym [employees].[dbo].tblPerson2
Anyone have any ideas on how to modify synonyms accross databases. My solution involves having to add an identical stored procedure to every database, which seems prone to error.
EXEC('USE employees;
DROP SYNONYM [dbo].tblPerson2;')