ddl

Oracle - cursor using dbms_utility.exec_ddl_statement not executing properly

余生长醉 提交于 2019-12-08 07:33:01
问题 I have a requirement to run a SP across multiple DBs at the same time and one part of it is to eliminate some duplicate records from each DB. Now since the SP can be run multiple times i've included a backup table and and what's needed to truncate and drop it in case the SP is run twice in a row. Now, since i'm creating tables via DBLINK i've researched that i need to use dbms_utility.exec_ddl_statement - but in this case even though the procedure executes, the truncate and drop queries seem

Convert mysql database to Oracle

北战南征 提交于 2019-12-08 06:51:42
问题 I want to convert my MySQL database to Oracle. I read this. I tried Oracle SQL Developer and watched this as well. I downloaded the oracle developer from Oracle. But there isn't any item called "Migrations" or "Repository" in that tool. I use MySQL 5.5 and oracle 10 g servers. How do I convert a MySQL database to Oracle? Any working code or useful link would be appreciated. I am familiar with MySQL, but an absolute beginner on Oracle databases. 回答1: The download link you showed for Oracle SQL

exporting db objects for version control

久未见 提交于 2019-12-08 03:40:09
问题 We are implementing version control for our project. As part of this we need to check in all DB objects. We have tables, procedures, functions, packages, view and materialized view. Problem is there are many objects and we need to put source code file wise. e.g. There are tables T1, T2, T3 and we need files Table_T1.txt which will have T1 definition ( columns definition, indexes for the table and grants) and so on for all objects. I m aware of metadata tables such as DBA_VIEWS , dba_source

How to work with javax.persistence.sql-load-script-source?

这一生的挚爱 提交于 2019-12-08 02:34:29
问题 I want to automatically insert data into my MySQL tables. Therefore I try to use the JPA property "javax.persistence.sql-load-script-source" in my persistence.xml : <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="my-PU" transaction

SQL Server: How to generate object scripts without DMO/SMO?

孤者浪人 提交于 2019-12-08 02:17:08
问题 i want to generate scripts for database objects, e.g. tables views stored procedures functions Since: SQL Server Management Objects (SMO) SQL Distributed Management Objects (SQL-DMO) (depricated) are not installed on a fresh install of: Windows XP Windows Vista Windows 7 nor are they redistributable, they are not an option ( it will run on a customer's machine ). ( EDIT : It looks as if SMO is actually redistributable as of today.) Is there any source code that converts SELECTs from system

MySQL to PostgreSQL table create conversion - charset and collation

耗尽温柔 提交于 2019-12-07 15:21:27
I want to migrate from MySQL to PostgreSQL.My query for create table is like this. CREATE TABLE IF NOT EXISTS conftype ( CType char(1) NOT NULL, RegEx varchar(300) default NULL, ErrStr varchar(300) default NULL, Min integer default NULL, Max integer default NULL, PRIMARY KEY (CType) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin; What is the converted form of this query. I am confused with DEFAULT CHARSET=latin1 COLLATE=latin1_bin part. How can I convert this part? That one would mean that the table uses only latin-1 (iso-8859-1) character set and latin-1 binary sorting order. In

Renaming multiple columns in PostgreSQL

亡梦爱人 提交于 2019-12-07 06:41:11
问题 My table has a bunch of columns in the following format: _settingA _settingB _settingB And I want to rename them simply to add a prefix as follows: _1_settingA _1_settingB _1_settingC What is the quickest / most efficient way to achieve this? EDIT: I should add that I have a lot more than three columns to rename in this way. If I had just three, I'd just do it manually one by one. And thanks for the downvote whoever you are. 回答1: There's no single command aproach. Obviously you could type

T-SQL Scripts to copy all table constraints

。_饼干妹妹 提交于 2019-12-06 23:32:30
问题 I have created many tables on my local database and moved them to production database. Now I am working on fine tuning the database and created many constraints on my local database tables such as PK, FK, Default Values, Indexes etc. etc. Now I would like to copy only these constraints to production database. Is there a way to do it? Please note that my production database tables already populated with some data. So I can’t drop and recreate them. 回答1: If you don't want to buy any tools

Free/OSS Data model diagram generator from DDL

断了今生、忘了曾经 提交于 2019-12-06 17:01:34
I am looking for some free/oss to reverse engineer from DDL a data model diagram. My database is Oracle if that matters. Do any exist? http://schemaspy.sourceforge.net/ SQL Power architect has a GPL version (though it looks like they are releasing an 'Enterprise' edition soon) There is also FabForce's DBDesigner , though it is more geared to MySQL (but has some Oracle capability) You could also look at sql-developer and data-modeler from Oracle. both are free http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/datamodeler-087275.html 来源: https://stackoverflow.com/questions

exporting db objects for version control

为君一笑 提交于 2019-12-06 16:22:13
We are implementing version control for our project. As part of this we need to check in all DB objects. We have tables, procedures, functions, packages, view and materialized view. Problem is there are many objects and we need to put source code file wise. e.g. There are tables T1, T2, T3 and we need files Table_T1.txt which will have T1 definition ( columns definition, indexes for the table and grants) and so on for all objects. I m aware of metadata tables such as DBA_VIEWS , dba_source and DBMS_METADATA.GET_DDL etc where I can find required information but how to pull that information