PL/SQL :: Oracle SQL Template To Create Re-usable DDL / DML Scripts For Oracle Database
Jun 13, 2012
I have a requirement to put together a Oracle SQL template to create re-usable DDL/DML Scripts for Oracle databases.Only the Oracle DBA will be running the scripts so permissions is not an issue.
The workflow for any DDL is as follows:-
1) New Table
a. Check if the table exists from the system/admin views.
b. If table exists then give message "Table Exists"
c. If table does not exist then execute DDL code
2) Add Column
a. Check if Column exists for a given table from system/admin views
b. If column exists in the specified table,
b1. backup table.
b2. alter table to make changes to the column
b3. verify data or execute dml script convert from backup to the new change.
c. If Column does not exist
c1. backup table
c2. alter table to add column
c3. execute dml to populate column with default value.
The DML scripts are for populating base tables with data required for business operations.
3) Add new row
a. check if row exists by comparing old values of each column with new values to be added for the new record.
b. If exists, give message row exists
c. If not exists, add new record.
4) Update existing record (We have createtime columns in these tables so changes can be tracked)
a. check if row exists using primary key.
b. If exists,
b1. deactivate the record using the "active" column of the table
b2. Add new record with the changes required.
c. If does not exist, add new record with the changes required.
View 17 Replies
ADVERTISEMENT
May 8, 2012
how to create database instance using database template file(.dbt) while running DBCA?
View 1 Replies
View Related
Jan 5, 2012
I am trying to setup oracle look and feel project on my local machine. For that i upgraded forms to 10.1.2.3 then i also applied path no 9593176 (But not yet performed steps related to jacob and webutil).
Problem : When i run Oracle look and feel template form it comes up with following error.
Forms Applet version is : 10.1.2.3
Exception in thread "thread applet-oracle.forms.engine.Main-1" java.lang.NoSuchMethodError: oracle.forms.handler.IHandler.getApplet()Ljava/applet/Applet;
at oracle.forms.fd.DrawLAF.init(DrawLAF.java:285)
at oracle.forms.handler.UICommon.instantiate(Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
[code]..........
View 1 Replies
View Related
Dec 6, 2010
I have installed oracle 9i in my PC.I would like to know the answer for the following questions.
1.Is it possible to create more than one database in oracle? If so, can it be used simultaneously through sqlplus?
2.If it is not , how can I move from one database to another?
View 3 Replies
View Related
Jul 6, 2012
How to create own database in oracle 10g. I want to create new database in oracle.
View 10 Replies
View Related
Oct 11, 2013
on my Windows 7 machine with Oracle Client 12.0.1.0 installed I'm trying to create a database link to a database server, that runs under Oracle Standard Edition1 11.2.0.2. When i login to sqlplus on the client with "sqlplus /nolog" and type the command : SQL> create database link SID connect to user identified by passwd using 'tnsnames.ora connection'; I'm getting an SP2-0640: not logged in.
Ok, thats clear, because i use sqlplus with /nolog option. But on client side normally I have no database, where I can login. So I think, there will be no user, or? The database to which I want to connect is set in tnsnames.ora. Generally: Is it possible to use the Oracle Client to create a database link?
View 8 Replies
View Related
Jul 24, 2012
I want to know how can i create an empty database in oracle 10g and what is the meaning of empty database. basically i want to perform migration from one database to another database by using exp and imp.
How to create empty database and migrate the database one platform to another platform by using the exp and imp. I have oracle 10g (10.2.0.1.0) on both xp and linux.
View 3 Replies
View Related
Aug 30, 2013
I have been trying out the new 12c on Windows 2012 Essentials with the same type of errors. The OraDim step fails and cannot create the services. It fails a bit differently if I choose "Create New Windows User", choose a "Use Existing Windows User", or choose the Windows Built-in user.
View 3 Replies
View Related
Mar 5, 2013
how to create best profile for huge user in oracle database user which take lagre uga memory.
View 5 Replies
View Related
Jul 7, 2012
Through an Oracle Apex application I need to create/drop a user/schema in another Oracle database. i.e., create/drop user remotely using an Oracle Apex application.
View 12 Replies
View Related
Apr 20, 2010
We have many customized forms built on 6i (11i Template) and deployed to EBS 11i, We want to Upgrade to R12, what shall i do with the customized form which already applied to 11i Template ?I know i have to migrate 6i to 10g then deploy, but my problem in the Template, shall i remove 11i Template and apply R12 Template from the beggining?
View 4 Replies
View Related
May 15, 2012
I am having a template file (only .dbt file) to create the database instance.I Kept it in $ORACLE_HOME/assistant/dbca/template/,after running DBCA it was loaded with details mentioned in it ,but at the second last step when i try to see initialization parameters control file ,datafile and tablespace detail was not mentioned.when it started database creation ,got hanged on 5% completion showing failure in processing system parameters. Is it the right way to create database using DBCA?what should I do to create database using template?
View 1 Replies
View Related
Nov 7, 2013
During the database installation the two nodes after all the prerequisite check and copy of files i am getting the below error message
"Template4 General_Purpose.dbc does not exist. Please specify an existing template for database creation".
How can i overcome this error ? I am installing Oracle 11g R2 11.2.0 On Oracle Enterprise Linux (5.1.19) running on [Oracle Virtual Box 4.1.12 ]. Also what are the steps to uninstall the previously installed db_home1 which failed due to this error.
View 1 Replies
View Related
Jan 13, 2011
can we use oracle client version to create a database in that server.
View 3 Replies
View Related
Apr 30, 2007
why this query works fine:
SELECT Z.ZAJEZD_ID, Z.JMENO,
(
SELECT COUNT(ZAJEZD_ID)
FROM trasa T
WHERE T.ZAJEZD_ID = Z.ZAJEZD_ID
) AS POCET_ZASTAVEK
FROM zajezd Z
ORDER BY Z.JMENO
But when I try to use the alias to filter the results like this (note the WHERE part):
SELECT Z.ZAJEZD_ID, Z.JMENO,
(
SELECT COUNT(ZAJEZD_ID)
FROM trasa T
WHERE T.ZAJEZD_ID = Z.ZAJEZD_ID
) AS POCET_ZASTAVEK
[code]...
Then it throws an error message ORA-00904: Unknown Identifier for the column/alias POCET_ZASTAVEK?
View 2 Replies
View Related
Sep 13, 2011
I have to apply monitoring template on my databases. Databases are already added and configured into OEM. They are visible under Databases tab and also under Groups where I have added them.
But when I try applying monitoring template and look for database in search window, it doesn't appear there.
View 1 Replies
View Related
Jan 19, 2012
I need to create PROCEDURE to create user in oracle
CREATE OR REPLACE PROCEDURE "CREATE_USER_ORACLE8"
(
USER_ID in VARCHAR2,
PASSWORD in VARCHAR2,
ROLES in VARCHAR2,
nReturnCode OUT NUMBER
)
BEGIN
[code].......
Compilation errors for PROCEDURE NOG.CREATE_USER_ORACLE8
Error: PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:
; is with authid deterministic parallel_enable as
Line: 9
Text: BEGIN
i want that the customer execute PROCEDURE (user_id,password,PROCEDURE )
View 5 Replies
View Related
Jul 4, 2012
I want to configure row device to usable for creating new asm diskgroup.we are using ASM. Steps to configure that row device to available for creating new diskgroup.
View 2 Replies
View Related
Jun 19, 2013
why can not we resize online redolog files instead of re-creating the same with large size and remove the older onces.2. How can we make RMAN obsolute backups as usable ?
View 8 Replies
View Related
May 17, 2011
But i do a lot of work-arounds to make sure the installation does not make corrupt my OracleAgent,OracleService and OracleDataGatherer. If i just let the installation do its thing i have problems with my libraries, and can't start anything.
The errors are : Procedure entry point 'BlaBla' could not be located in the Dynamic Link library 'AnyName'.
I notice that i have 2 versions of the libraries in OracleHomeBIN (one version 8, one version 11). The programs that start the OracleAgent,Service and DataGatherer call the old libraries but expect to find values that can be found only in new libraries.
View 1 Replies
View Related
Jul 23, 2013
How to Create .exe in Oracle forms
View 3 Replies
View Related
Nov 18, 2010
I have encountered a problem with oracle db where by i'm unable to create a user.
oracle@kapstadt4:/export/home/oracle/scripts> ls -l
total 12
-rw-rw-rw- 1 oracle dba 1115 Sep 10 15:34 crdb.sql
-rwxrwxrwx 1 oracle dba 429 Sep 10 15:39 create_advantage_user.sql
-rw-rw-rw- 1 oracle dba 597 Sep 10 15:38 create_advantage_user_objects.sql
-rw-rw-rw- 1 oracle dba 408 Sep 10 15:37 create_advantage_user_roles.sql
-rw-rw-rw- 1 oracle dba 976 Sep 10 16:04 tbs.sql
oracle@kapstadt4:/export/home/oracle/scripts> cat create_advantage_user.sql
-- creates an advantage database user
-- the role 'advantage_admin_user' must be available!
define user_name = &1
rem define default_table_space = &2
create user &user_name
identified by &user_name#123
default tablespace IN_DEV
temporary tablespace TEMP;
grant connect to &user_name;
grant resource to &user_name;
grant advantage_admin_user to &user_name;
connect &user_name/&user_name#123
@create_advantage_user_objects.sql
[Code] ........
View 5 Replies
View Related
Feb 3, 2010
is it possible to create tables using variables in pl/sql such as the following example which is actually in php. i would like to create a table dynamically.
$create_samp_table = CREATE TABLE $MCSCHEMA.".$samp_id." AS SELECT * FROM $MCSCHEMA.".$samp_src_table." WHERE ROWNUM = 0
View 1 Replies
View Related
Jul 6, 2011
oracle version : Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
How we can create external table in oracle8i:
CREATE TABLE calls_external
(
call_id NUMBER,
emp_id NUMBER,
call_type VARCHAR2(12),
details VARCHAR2(25)
)
ORGANIZATION EXTERNAL
[code]....
Script not working in Oracle8i but working perfect in oracle10g.
View 19 Replies
View Related
Apr 11, 2011
i need to create stopwatch in oracle form 6i, i need source code or the form.
View 1 Replies
View Related
Apr 15, 2010
i have a project that needs to have a identity number in the table.this is the table:
create global temporary table BOOK_INFO
( row_id number(5),
BOOK_TITLE char(20),
BOOK_AUTHOR char(15)
) on commit preserve rows;
i dont know how can i generate row_id, in sybase i can only set the datatype of row_id in IDENTITY and it will automatically generates number and as the transaction ended the row_id will automatically back to 1.
in oracle i tried to create sequence but it didnt back to 1 when the transaction/procedure ended.. Like for example if the procedure ended and the last row_id inserted in the table is 300 the next run of the procedure will start in 301. but i need to start in 1 in every run of the procedure.
Also, i tried to set the variable v_row_id to 0 and it increment by 1 as it insert in the table, but the problem is there are times that in 1 book_title there is more than 1 author. so the v_row_id of the book_title with more than 1 author is all the same.Here is my query:
insert into BOOK_INFO
(select v_row_id, BOOK_TITLE, BOOK_AUTHOR from LIBRARY);
The result is:
ROW_ID BOOK_TITLE BOOK_AUTHOR
1 BOOK_1 AUTHOR_1
1 BOOK_1 AUTHOR_2
1 BOOK_1 AUTHOR_3
1 BOOK_1 AUTHOR_4
2 BOOK_2 AUTHOR_5
View 8 Replies
View Related
Feb 10, 2011
I have to create the two services(SID) in the same orcale 10g home.
View 2 Replies
View Related
Aug 29, 2012
I desire to create pick my date of birth from the calendar. So I have done this. I am using oracle 6i Form developer. I have not find files 'standard' and 'calendar.pll' files anywhere.
View 1 Replies
View Related
Sep 27, 2013
Can We Create Forms Runtime in Oracle Forms 10g Like Oracle Forms 6i
View 1 Replies
View Related
Mar 15, 2013
in oracle transaction table /temporary table /at the time of movement data insert
how to handle these table in merge no primary key
View 3 Replies
View Related