How to create a DB2 database on the fly?
Hi,
The DB2 JDBC connection string requires a name of an existing database:
jdbc:db2://server_name:port_number/database_name
Is there a way to connect DB2 thru JDBC without the database name
and then create a database afterwards?
Thinks for any input.
I definitely agree with this, but my small little open source app is meant for developers - and it's nice to have the ability to create databases from an environment they're familiar with (Ant). This is definitely NOT something that would be used for production. Most likely, it'll only be used for creating databases on local machines. Right now, I have support for doing it in MySQL, and I can't seem to get it to work for any other database types (db2 or postgresql), so I just tell those users to do it manually (which sucks IMO).
Matt
Similar Messages
-
How to Create A new Database in the oracle 10g XE
i have oracle 10g XE i tried to create a new database but its giveing me error when i execute the sql command that is create database testDatabase how to create a new database in oracle 10g XE
Hi there 785434,
(This is a generic SQL question relating to Database Triggers, please post future questions of this type into the relevant forum area.)
Moderator, please move this if able
I use Before Update and Before Delete Triggers to record a 'snapshot' of the row being changed in my applications.
Example:
CREATE TABLE TEST
DATA VARCHAR2(64 CHAR),
CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
CREATED_DATE DATE NOT NULL,
CHANGED_BY_USERID VARCHAR2(20 CHAR),
CHANGED_DATE DATE
LOGGING
STORAGE
(MAXEXTENTS UNLIMITED);
CREATE TABLE TEST_HISTORY
DATA VARCHAR2(64 CHAR),
CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
CREATED_DATE DATE NOT NULL,
CHANGED_BY_USERID VARCHAR2(20 CHAR),
CHANGED_DATE DATE,
CHANGE_DESCRIPTION
NOLOGGING
STORAGE
(MAXEXTENTS UNLIMITED);
CREATE OR REPLACE TRIGGER TRG_BU_TEST
BEFORE UPDATE ON TEST FOR EACH ROW
BEGIN
INSERT /*+ append */ INTO TEST_HISTORY
(DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
VALUES
(:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'UPDATE');
END;
CREATE OR REPLACE TRIGGER TRG_BD_TEST
BEFORE DELETE ON TEST FOR EACH ROW
BEGIN
INSERT /*+ append */ INTO TEST_HISTORY
(DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
VALUES
(:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'DELETE');
END;
Using triggers like this will record who made an update or delete to the database and record the row before it was changed.
Note that this method might not be suitable for very high transaction rates.
You will need to 'clear' these history tables as part of routine maintenance.
Hope that this Helps.
Ronald. -
How to create tree by database table
hello sir ,
my table is as follows,
NAME LINK ID PID ROLLID
User mgt. f?p=131:1: 1 - 10 ////root node///
district 10 1 1 child
Roles 16 14 4 child
Users 11 10 1 child
ROLLID is given from another table whis is (ROLES). i making tree by the combinations of id , pid, & roll id. by the roll id i can manage the tree to do not display specific nodes to specific users.
ROLE table as :
ROLE_ID NAME DESCRIPTION
1 Administrator This is administrator
2 Assistant Director -
3 Assistant Statistical Officer -
4 Data Entry Operator -
but i think it is very complicated process . give me solution about it
also i have to give my images to each node. how can i do that?You already have a thread going about this: Re: how to create tree by database table .
Scott -
How to create a record based on the name of a file in the file-system?
Hi,
With a lot of pictures I want to have a database to gather some information about these pictures.
First question is how to generate a record based on a file in the file system?
e.g. the pictures are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg" .
now i want to create records with as one of the attributes the name of the picture (not the picture itself). how to create these records (based on the information of the file-ssytem). i.e. the number of records should be the same as the number of pictures.
any suggestions?
any reaction will be appreciated.
LeoLink to Create directory
http://www.adp-gmbh.ch/ora/sql/create_directory.html
You can create a list of files in the directory and read the list files from that directory.
[UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
[Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
SS -
How to create a generalized version of the detailed polygons?
How to create a generalized version of the detailed polygons?
I have a table of detailed polygons (100+ vertices) and I want to get generalized version of these polygons.
For example, assume I have a polygon with 100 vertices. Distance between vertex n and n+1 is 1.0.
I want to get geometry (generalized polygon, line or point) where distance between vertex n and n+1 is 10.0 or more (I want vertices to be considered as one vertex if distance between them is less then 10.0).
Is it possible to create generalized version of polygons on the fly?
Any help is appreciated.
Thanks.Scenario A:
If all of your polygons have no interaction among them (No polygon shares any boundary with any other ones).
In this case you can use the sdo_util.simplify in 10g to reduce the vertices in your polygons which returns new polygon geometries on the fly.
If you found that simplify is not doing exactly what you want, you can always roll out your own implementation using PL/SQL or the new SDOAPI JGeoemtry class in Java. Both will give you complete access to the coordinate arrays in a polygon and update them back to the database after you have simplified them in your code.
Scenario B:
If your polygons share boundaries, then the above methods will not work since the simplification process may not preserve the topology among your polygons. What you can do then is to use the Java topo package to create a new topology by adding all of your polygons to to an empty topology (which you first create in the database and then load into memory using oracle.spatial.topo.TopoMap). Once you have a topology built in the memory, you can use methods such as oracle.spatial.topo.TopoMap.changeEdgeCoords() to simplify the edges of your polygons. You can then recreate the simplified polygons from the topology. This is just a rough guide; for more details you need to check out the java doc for the various packages mentioned above which are shipped with 10g spatial. -
Creating a Standby Database with the Same Directory Structure
Hello gurus,
I am self-learning the feature Oracle Data Guard, so I am testing it on Oracle 10g R2.
At Oracle documentation there is a section F.4.: Creating a Standby Database with the Same Directory Structure*, that explains how to create a standby database with RMAN but there is something that I don´t understand:
In the standby server, I created a database with the SID equal to production database* with the objetive to have the same directory structure, but when I try to startup nomount the standby database with pfile appear this expected error:
ORA-16187: LOG_ARCHIVE_CONFIG contains duplicate, conflicting or invalid attributes
So my question is: Is possible have the Same Directory Structure on both: Production and StandBy server?
Thanks in advanced.Uwe and mseberg: thanks for your quick answers
I have a doubt: How can you have the same directory structure if you have differents SIDs?, for example if you follow the OFA suggestions you would must have:
On Production server: */u01/app/oracle/oradata/PRIMARY/system.dbf*
On StandBy server: */u01/app/oracle/oradata/STANDBY/system.dbf*
Or you created the directory structure manually on StandBy server? For example replacing the string STANDBY* to PRIMARY* before create the database using dbca.
Do you understand my doubt? Excuse me for my english.
Thanks. -
How to create a standby database?
I am running Oracle 8.1.5 on Sun Solaris. How to create a standby database? Can somebody tell me the step-by-step procedure?
Can you tell what version of Oracle you are running, because the steps can vary depending on your version.
-
How to create a new database in SUP
Hi,
Iam using SUP 2.1 ESD#1 licensed version
How to create a new database other than the default sampleDB.
Thanks,
B.UshasriHi B.Ushasri,
This is actually pretty easy.
1) open the Unwired Workspace (SDK in eclipse).
2) Bottom right, add a new Database connection with the following details:
Sybase ASA v12.x,
host=Your Sup box,
port=5500,
user=dba
password= Your password (default = dba)
3) Once you connect successfully, right click on the connection and choose the "Create database" option.
That should do it for you. It is the same connection as the sampleDB connection so if you already have that defined then its a simple, right click on it once connected and hit create database.
Hope that helps,
Brenton. -
How to create a logical database?
Hi,
Can anyone tell me how to create a logical database? I am curious about it.
Thanks.
Awards will be provided.
Best regards,
Chris GuTransaction code for creating Logical db is se36.
Give the name as <ldbname>..
Specify the table names and the sub nodes according to your heirarchy.The root node used is zxxx_product and child node is zxxx_orders
The heirarchy used is ZXXX_PRODUCT---->ZXXX_ORDERS
write the below code under selections ...
Enable DYNAMIC SELECTIONS for selected nodes :
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE zxxx_product.
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE zxxx_orders.
Enable FIELD SELECTION for selected nodes :
SELECTION-SCREEN FIELD SELECTION FOR TABLE zxxx_product.
SELECTION-SCREEN FIELD SELECTION FOR TABLE zxxx_orders.
***User defined blocks :
****Root node
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
SELECT-OPTIONS :
so_pname FOR zxxx_product-prname ,
so_pdelv FOR zxxx_product-prdeldate .
SELECTION-SCREEN END OF BLOCK b1 .
****Child node
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002 .
SELECT-OPTIONS :
so_odate FOR zxxx_orders-orddate ,
so_oqty FOR zxxx_orders-ordqty .
SELECTION-SCREEN END OF BLOCK b2 .
write the below code under include include DBZXX_PRODUCTTOP
TABLES : ZXXX_product, ZXXX_orders.
DATA : gt_root TYPE table of ZXXX_product ,
gt_chld TYPE table of ZXXX_orders .
write the below code under source code...
Call event GET Zxxx_PRODUCT
FORM put_zxxx_product.
TYPES : BEGIN OF ls_pid ,
prodid TYPE zxxx_product-prodid,
END OF ls_pid .
DATA : lt_pid TYPE ls_pid OCCURS 0 ,
lt_pid_tmp TYPE ls_pid OCCURS 0 .
STATICS lv_first_time VALUE 'X'.
STATICS ls_isroot_fields TYPE rsfs_tab_fields.
STATICS ls_isroot_where TYPE rsds_where.
STATICS ls_ischld_fields TYPE rsfs_tab_fields.
STATICS ls_ischld_where TYPE rsds_where.
IF lv_first_time EQ 'X'.
CLEAR lv_first_time.
o
+ Declarations for field selection for node Zxxx_PRODUCT ***
" move table name to the corresponding field
MOVE 'Zxxx_PRODUCT' TO ls_isroot_fields-tablename.
" Read values from selection screen
READ TABLE select_fields WITH KEY ls_isroot_fields-tablename
INTO ls_isroot_fields.
" move table name to the corresponding field
MOVE 'Zxxx_PRODUCT' TO ls_isroot_where-tablename.
" Read values from dynamic selection screen
READ TABLE dyn_sel-clauses WITH KEY ls_isroot_where-tablename
INTO ls_isroot_where.
o
+ Declarations for field selection for child node Zxxx_ORDERS ***
MOVE 'Zxxx_ORDERS' TO ls_ischld_fields-tablename.
READ TABLE select_fields WITH KEY ls_ischld_fields-tablename
INTO ls_ischld_fields.
MOVE 'Zxxx_ORDERS' TO ls_ischld_where-tablename.
READ TABLE dyn_sel-clauses WITH KEY ls_ischld_where-tablename
INTO ls_ischld_where.
"...Check whether entry is made in atleast one selection field:
IF NOT so_pname IS INITIAL OR
NOT so_pdelv IS INITIAL OR
NOT so_odate IS INITIAL OR
NOT so_oqty IS INITIAL OR
NOT ls_isroot_where-where_tab IS INITIAL OR
NOT ls_ischld_where-where_tab IS INITIAL .
"...Check whether entry is made in atleast one field in root node :
IF NOT so_pname IS INITIAL OR
NOT so_pdelv IS INITIAL OR
NOT ls_isroot_where-where_tab IS INITIAL .
SELECT prodid FROM Zxxx__product
INTO CORRESPONDING FIELDS OF TABLE lt_pid
WHERE prname IN so_pname AND
prdeldate IN so_pdelv AND
(ls_isroot_where-where_tab).
"...Check whether entry is made in atleast one field in child node:
IF NOT so_odate IS INITIAL OR
NOT so_oqty IS INITIAL OR
NOT ls_ischld_where-where_tab IS INITIAL AND
NOT lt_pid IS INITIAL.
SELECT prodid FROM Zxxx_orders
INTO CORRESPONDING FIELDS OF TABLE lt_pid_tmp
FOR ALL ENTRIES IN lt_pid
WHERE prodid = lt_pid-prodid AND
orddate IN so_odate AND
ordqty IN so_oqty AND
(ls_ischld_where-where_tab).
lt_pid = lt_pid_tmp.
ENDIF.
ELSEIF NOT so_odate IS INITIAL OR
NOT so_oqty IS INITIAL OR
NOT ls_ischld_where-where_tab IS INITIAL.
SELECT prodid FROM Zxxx_orders
INTO CORRESPONDING FIELDS OF TABLE lt_pid
WHERE orddate IN so_odate AND
ordqty IN so_oqty AND
(ls_ischld_where-where_tab).
ENDIF.
******lt_pid contains all the selections based product ids
******Now retrieve all the records with the corresponding product ids
CHECK NOT lt_pid IS INITIAL.
IF NOT ls_isroot_fields IS INITIAL.
SELECT (ls_isroot_fields-fields) FROM Zxxx_product
INTO CORRESPONDING FIELDS OF TABLE gt_root
FOR ALL ENTRIES IN lt_pid WHERE prodid = lt_pid-prodid.
ENDIF.
IF NOT ls_ischld_fields IS INITIAL AND
NOT gt_root IS INITIAL.
SELECT (ls_ischld_fields-fields) FROM Zxxx_orders
INTO CORRESPONDING FIELDS OF TABLE gt_chld
FOR ALL ENTRIES IN gt_root WHERE prodid = gt_root-prodid.
ENDIF.
LOOP AT gt_root INTO Zxxx_product.
PUT Zxxx_product.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM.
write the below code under
include DBZXXX_PRODUCTNXXX -->
include DBZXXX_PRODUCTN002 .
form put_zxxx_orders
LOOP AT gt_chld INTO zxxx_orders WHERE prodid = zxxx_product-prodid.
PUT ZXXX_ORDERS.
ENDLOOP.
endform.
now write a report program and call the ldb by its name using get
get <ldbname>.
Reward if this is useful.
Regards,
devi.
Edited by: Devi Raju on Jul 15, 2008 9:13 AM -
How to create physical standby database without dataguard
Hi,
Can anyone please help me how to create Physical Standby Database without dataguard. As i am using Oracle 10.2.0.1 Standard Edition for production databases.
Please find the specifications of my server :
Database : Oracle 10.2.0.1(Standard Edition)
Server : Linux 4.0(32 bit machine)
As we know that Dataguard cannot be created in Standard Edition as we dont have that option in this edition. So please help me how to create the physical standby database.
Thanks in advance.
Regards,
FarooqHello,
I hope this link helps you out...
http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/rcmbackp.htm
http://www.dbasupport.com/oracle/ora10g/manual_standby.shtml
Thanks & Regards
Pratik Lakhpatwala
Jr Oracle DBA
Edited by: Pratik.L on Dec 31, 2009 12:03 PM -
How to create a oracle database by java code?
how to create a oracle database by java code?
please give some ways then that way's codeI'm not sure what you mean with "database". Do you mean an Oracle instance or an Oracle user/schema (probably the latter, because that's the equivalent to a MS SQL Database).
Creating an instance is definitely not possible from within Java. To create a new user this should be possible, as this can be done with SQL:
GRANT connect,resource TO <newuser> IDENTIFIED BY <password>;
I'm always cautious with questions like this. In 90% of the cases there is something wrong with the initial design. Creating a database shouldn't be something the application is doing.
Thomas -
How to create a Cloning Database
Dear all,
Would you plz help me with How to create a Cloning Database in Oracle9i and Windows 2000 Server
and how to automatically synchronize the cloned database with data
Thanks,
Ahmed Abd El LatifOracle Data Guard Concepts and Administration
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96653/toc.htm
theres the answer to your question.
In big detail.
i hope it helps -
How to create tables in Database when webdynpro project is deployed
Hi
I Created a project.in that i created stuctures using simpletypes.Based on structure i created the Context,then created screens.Now how to create tables in database using this structures .Because i want to store the values in the database.Please help.this is very urgent.i will give good points
thanks
prasadHi Prasad,
You can write normal JDBC code in your controller.
Check this Web Dynpro Java
You can use the tool for generating the classes from your DB.Check this too
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/dfad6017-0301-0010-bdb8-a8b7d2006f36
Best Regards, Anilkumar -
How to create a fresh database
Hi,
I want to create a fresh instance of database, How should I
proceed.
Another thing, is it necessary that my listener to be running
prior to creation of database instance.
please guide me.
SreekantHi
You can create a fresh database using the following command.
create database database_name
maxlogfiles 5
maxlogmembers 5
maxdatafiles 100
maxloghistory 100
logfile
group 1 ('/disk3/log1a.rdo','disk4/log1b.rdo') size 1 M,
group 2 ('/disk3/log2a.rdo,'/disk4/log2b.rdo') size 1 M
Datafile
'/disk1/system01.dbf' size 50M autoextend on charater set
<name>;
The above command will create a new database for you.And hope it
helps you out. -
How to create an Oracle DATABASE through Java Programming Language.. ?
How to create an Oracle DATABASE through Java Programming Language.. ?
Oracle database administrators tend to be control freaks, especially in financial institutions where security is paramount.
In general, they will supply you with a database, but require you to supply all the DDL scripts to create tables, indexes, views etc.
So a certain amount of manual installation will always be required.
Typically you would supply the SQL scripts, and a detailled installation document too.
regards,
Owen
Maybe you are looking for
-
How do I connect my 27" iMac to the HDMI port of my LCD TV ?
How do I connect my 27"iMac to the HDMI Port of my LCD TV ?
-
How do I follow up on my case?
I need to follow up on my case with an advisor but there is no option to. I know it's after hours right now, but where can I find the option to do so?
-
Task Manager Packaged App - edit link doesn't edit the correct task
I'm a relative new-comer to APEX, I downloaded and installed the Task Manager app from the OTN site but it's not working as it should. I have created a list of tasks, but when I click on the EDIT link (page 3) the task that opens is always the last o
-
ICS/My Music App Issues?
I just got my Razr 7 days ago. It was updated to ICS in the VZW store by the "device specialist" before it was ever in my hand. Last night, I was finally getting around to setting up playlists. When I started, the check boxes to add music to the play
-
To disable popup when closing a WEBI document
Hi, when i close a webi document i have this popup: How i can disable it? The BI platform is : BI4.1 SP2 Patch 1. Thanks. Andrea