Database name problem
i have database with sid RAJ. my gobal_name view shows me RAJ.US.ORACLE.COM but my database is accessed through RAJ.mydomain.com
how can i synchronize it.
thanks.
http://www.akadia.com/services/ora_dblinks.html
Similar Messages
-
Hi Everybody,
I really need your help!!!
I'm wondering if it's possible in Java to read all the database names that are installed in the computer. For example, I have about 3 databases in DB2 with the names: AAA, BBB, CCC and I want to put these names in a Combobox so that I can choose to which one to connect.
Connecting to the database or adding Items to the Combobox is not a problem , but I don't know how to get the names dynamically, I mean to avoid writing the names of the databases in a file.
Thanks in advance for any help
alinaIF your DB2 JDBC driver supports it then you can use java.sql.DatabaseMetaData to get the names of databases. Use the method getCatalogs()
-
Variable database name in SQL Server query using Oracle database link
Hi All,
I have an ApEx 4.1 app running on 11g x64 (11.2.0.1) on Windows Server 2008 x64, and I have some data integration points with a SQL Server (2005 and 2008) that I need to establish. I have configured the database link with dg4odbc and it works beautifully... I can execute queries against the SQL Server database without any problems using the database link.
However, there is a scenario where the SQL Server database name is dynamic, and I need to generate it on the fly in a PL/SQL block, and then use that in a dynamic SQL query (all of this in ApEx). This is where I run into problems... when I am querying the default database based on the ODBC connection and I don't have to specify the database name, there is no issue. But when I need to access one of several other non-default databases, I keep receiving the "invalid table" error.
This runs fine:* (note that "fv" is the name of my database link)
v_query1 := 'select "ReleaseDate" from dbo.Schedules@fv where dbo.Schedules."SchedID" = :schedule';
EXECUTE IMMEDIATE v_query1 into rel_date using schedule;
I then take that rel_date variable, convert to a varchar2 (rel_date_char), and then use it as the database name in the next query...
This returns an error_ (Error ORA-00903: invalid table name)
v_query2 := 'select "PARTNO" from :rel_date_char.dbo.ProdDetails@fv where "SchedID" = :schedule and "UnitID" = :unit
and "MasterKey" = :master and "ParentKey" = :parent';
EXECUTE IMMEDIATE v_query2 into part_number using schedule, unit, master, parent;
I have also tried using all of the following to no avail:
'select "PARTNO" from ' || :rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
'select "PARTNO" from ' || rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
'select "PARTNO" from ' || @rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
'select "PARTNO" from @rel_date_char.dbo.ProdDetails@fv where "SchedID"...
Is there a way to do this in PL/SQL?
Thanks for any help!
-Ian C.
Edited by: 946532 on Jul 15, 2012 7:45 PMJust did a test using passthrough:
SQL> set serveroutput on
SQL> declare
2 val varchar2(100);
3 c integer;
4 nr integer;
5 begin
6 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'select count(*) from EMP');
8 LOOP
9 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
10 exit when nr=0;
11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
12 dbms_output.put_line(val);
13 end loop;
14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
15 end;
16 /
24576
PL/SQL procedure successfully completed.
SQL> declare
2 val varchar2(100);
3 c integer;
4 nr integer;
5 begin
6 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'select count(*) from dbo.EMP');
8 LOOP
9 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
10 exit when nr=0;
11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
12 dbms_output.put_line(val);
13 end loop;
14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
15 end;
16 /
24576
PL/SQL procedure successfully completed.
So all 3 ways work for me.
Edited by: kgronau on Jul 23, 2012 10:08 AM
Now using variables to perform the select:
SQL> declare
2 val varchar2(100);
3 c integer;
4 nr integer;
5 tabname varchar2(20) :='EMP';
6 ownr varchar2(20) :='dbo';
7 dbname varchar2(20) :='gateway';
8 begin
9 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
10 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'SELECT count(*) FROM '||dbname||'.'|| ownr || '.'||tabname||'');
11 LOOP
12 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
13 exit when nr=0;
14 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
15 dbms_output.put_line(val);
16 end loop;
17 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
18 end;
19 /
24576
PL/SQL procedure successfully completed.
=> instead of executing the statement using "execute Immediate" we have to use PASTHROUGH package to pass the statement to the SQL Server.
Edited by: kgronau on Jul 23, 2012 10:10 AM -
Refresh tool and table name containing database name in Mysql
Hi,
when refreshing the database schema and my table name contains a database name (for example "my_other_db.my_other_table"), the refresh tool never sees weather "my_other_db.my_other_table" already exists or not. so it always generates a create-table-statement (which is syntactically correct, but of course fails, because that table exists already).
Is there known workaround for it? I am using Mysql 5.0.x, jdbc driver 5.0.7, Kodo 4.1.4 (but this problem was there before).
Right now i'm deleting the database names from my package.jdo-files, then doing the refresh command and after that i put back the database names. At runtime Kodo works very well with the database name before the table name.
Thanks very much,
Markus1. For WBS element under consideration, get OBJNR from PRPS table
2. Get PO numbers from COEP where OBJNR = PRPS-OBJNR obtained in step 1 -
Want to modify the Global Database Name in Oracle 10g R2
Hi All,
I have a global database name like GS77.UK.ORA.COM , I want it to be just GS77.What are the possible workarounds for modifying this.
Thanks & Regards,
Gaurav S.If your problem is really just the global name, yes.
You can check with
Select * from global_name;
Check the documentation first to ensure you checked all implications first
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_1004.htm#i2079942
Regards,
PP -
ORA-01161: database name ORA10G in file header does not match given name of
Database: Oracle 10g
os: windows 2000
I want to create a new database as same as of a TEST database.
i have followed the steps below however while create the controlfile i am getting the error ORA-01161
1.i took the full backup of test system(while databse is normal shutdown)
2.Prepare new initsid.ora file and change the parameter DN_NAME=newname
3.prepare new create controlfile script with new database name
4.startup pfile='initsid.ora' nomount
5.while executing the controlfile creation script, it gives the error ORA-01161
how can resolve the problemi am already using the REUSE option
CREATE CONTROLFILE REUSE DATABASE "ora10g1" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 454
LOGFILE
GROUP 1 'C:\ORA10GDB\ORADATA\Backups1\REDO01.LOG' SIZE 10M,
GROUP 2 'C:\ORA10GDB\ORADATA\Backups1\REDO02.LOG' SIZE 10M,
GROUP 3 'C:\ORA10GDB\ORADATA\Backups1\REDO03.LOG' SIZE 10M
-- STANDBY LOGFILE
DATAFILE
'C:\ORA10GDB\ORADATA\BACKUPS1\SYSTEM01.DBF',
'C:\ORA10GDB\ORADATA\BACKUPS1\UNDOTBS01.DBF',
'C:\ORA10GDB\ORADATA\BACKUPS1\SYSAUX01.DBF',
'C:\ORA10GDB\ORADATA\BACKUPS1\USERS01.DBF',
'C:\ORA10GDB\ORADATA\BACKUPS1\EXAMPLE01.DBF',
'C:\ORA10GDB\ORADATA\BACKUPS1\PLAY01DF.DBF'
CHARACTER SET WE8MSWIN1252
Test Database name : ora10g
New database name :ora10g1
I am using the same machine to create the new database. -
Database name ORCL in file header does not match given name of
Hi all,
DB version is 10.2.0.4
While doing db cloning..restoring the database..made a mistake of restoring the db to a different running mountpoint database..But in 20 minutes realised that after a while and restarted the clone.
But that running db went down..trying to recover it shows
ERROR at line 1:
ORA-01161: database name ORCL in file header does not match given name of
PRODhow can i recover it?
thanks,
baskar.lbaskar.l wrote:
Hi all,
DB version is 10.2.0.4
While doing db cloning..restoring the database..made a mistake of restoring the db to a different running mountpoint database..But in 20 minutes realised that after a while and restarted the clone.
But that running db went down..trying to recover it shows
ERROR at line 1:
ORA-01161: database name ORCL in file header does not match given name of
PRODhow can i recover it?
thanks,
baskar.lHi,Baskar.How you clone your database and which command after you got this error.You can resolve this problem with re-create controlfile as(It mean is you actually change your database name):
C:\Documents and Settings\Administrator>sqlplus "sys/sm as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jun 20 15:34:21 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> startup nomount pfile=D:\oracle\product\10.2.0\admin\SB\pfile\init.ora.5152
010163530
ORACLE instance started.
Total System Global Area 138412032 bytes
Fixed Size 1247732 bytes
Variable Size 62916108 bytes
Database Buffers 71303168 bytes
Redo Buffers 2945024 bytes
SQL> CREATE CONTROLFILE reuse DATABASE "SB1" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO01.LOG' SIZE 50M,
9 GROUP 2 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO02.LOG' SIZE 50M,
10 GROUP 3 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO03.LOG' SIZE 50M
11 DATAFILE
12 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\SYSTEM01.DBF',
13 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\UNDOTBS01.DBF',
14 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\SYSAUX01.DBF',
15 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\USERS01.DBF',
16 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\EXAMPLE01.DBF';
CREATE CONTROLFILE reuse DATABASE "SB1" NORESETLOGS ARCHIVELOG
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01161: database name SB in file header does not match given name of SB1
ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\SYSTEM01.DBF'
SQL> CREATE CONTROLFILE set DATABASE "SB1" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO01.LOG' SIZE 50M,
9 GROUP 2 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO02.LOG' SIZE 50M,
10 GROUP 3 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO03.LOG' SIZE 50M
11 DATAFILE
12 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\SYSTEM01.DBF',
13 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\UNDOTBS01.DBF',
14 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\SYSAUX01.DBF',
15 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\USERS01.DBF',
16 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\EXAMPLE01.DBF';
CREATE CONTROLFILE set DATABASE "SB1" RESETLOGS ARCHIVELOG
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: control file could not be created
ORA-00202: control file: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\CONTROL01.CTL'
ORA-27038: created file already exists
OSD-04010: <create> option specified, file already exists
/*remove all controlfile from D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\ */
SQL> CREATE CONTROLFILE set DATABASE "SB1" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO01.LOG' SIZE 50M,
9 GROUP 2 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO02.LOG' SIZE 50M,
10 GROUP 3 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\REDO03.LOG' SIZE 50M
11 DATAFILE
12 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\SYSTEM01.DBF',
13 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\UNDOTBS01.DBF',
14 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\SYSAUX01.DBF',
15 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\USERS01.DBF',
16 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SB\EXAMPLE01.DBF';
Control file created.
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 742571 generated at 06/20/2010 15:32:41 needed for thread 1
ORA-00289: suggestion :
D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\SB1\ARCHIVELOG\2010_06_20\O1_MF_1_1
1_%U_.ARC
ORA-00280: change 742571 for thread 1 is in sequence #11
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
D:\oracle\product\10.2.0\oradata\SB\REDO01.LOG
Log applied.
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.
SQL> create spfile from pfile;
File created.
SQL>In additionally see metalink note
ORA-01503 ORA-01161 While creating a clone database. [ID 294555.1]
Edited by: Chinar on Jun 20, 2010 3:52 AM -
Database Connection Problem-SQL SERVER 2005
Dear all,
I have been struggling with this database connection.I have installed sql server 2005 in my PC and i am trying to connect to the Database Adventity.But it is showing port 1432 invalid.I have placed sqljdbc jar in my lib folder.If i dont specify Database name then it will print hi Message..if i specify Database name then the error will come.
MY CODE is::
<%@page import="java.sql.*,java.io.*,java.lang.*,java.util.*,java.util.Vector,bean.*" %>
<%
Connection con;
Statement stmt;
String url= "jdbc:sqlserver://156.0.11.140:1433/Adventity";
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection(url,"sa","hcl@123");
stmt = con.createStatement();
out.println("hi");
%>
THE ERROR IS:
javax.servlet.ServletException: The port number 1433/Adventity is not valid.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.adv1_jsp._jspService(adv1_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause
PLEASE HELP ME TO GET RID OUT FROM THIS PROBLEM.
THANKS IN ADVANCE.hi
i have given what u said and it is not working but it displays blank page.even i tried to getdate..
pls help me
<%@page import="java.sql.*,java.io.*,java.lang.*,java.util.*,java.util.Vector,bean.*" %>
<%
Connection con;
Statement stmt;
try
String url= "jdbc:sqlserver://156.0.11.140:1433;databaseName=test";
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection(url,"sa","hcl@123");
stmt = con.createStatement();
String user="select getdate();"
System.out.println(user);
catch (Exception e) {
out.println(e.toString());
} finally {
try {
} catch (Exception e) {
e.printStackTrace() ;
%> -
Immediate HELP in Tomcat 5 to Postgresql 7.4 database connectivity problem
Hi,
I failed to connect Tomcat 5.0.24 with Postgresql
7.4.2. The files created by me and the changes i had
made in the existing files are rates.jsp,
conversionDAO.java, web.xml and server.xml. The error
message on the top of the rest of it was "The value of
useBean class attribute converter.conversionDAO is
invalid". So far I found out that the coding for
database connectivity purpose in conversionDAO.java
cause the error. Another thing is Postgresql jdbc
driver is required to set in the CLASSPATH for the
java file to access the Postgresql database. I don't
know where should I put it in Tomcat for web
application. Anyway, I put it in
$CATALINA_HOME/shared/lib according the book i
refered. I do the database connectivity coding refer
to the Tomcat Kick Start book from Sams Publishing.
Below are the coding involved, please show me the
mistake i had made. Thank you.
----server.xml----
<Context path="/database"
docBase="${catalina.home}/webapps/database" debug="0"
reload="true">
<ResourceParams name="jdbc/conversion">
<parameter>
<name>username</name>
<value>myusername</value>
</parameter>
<parameter>
<name>password</name>
<value>mypassword</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.postgresql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:postgresql://localhost/conversion</value>
</parameter>
</ResourceParams>
</Context>
----web.xml----
<servlet>
<servlet-name>conversionDAO</servlet-name>
<servlet-class>converters.conversionDAO</servlet-class>
</servlet>
<resource-ref>
<res-ref-name>jdbc/conversion</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
----conversionDAO.java----
public conversionDAO() throws SQLException,
NamingException
Context init = new InitialContext();
Context ctx = (Context)
init.lookup("java:comp/env");
DataSource ds = (DataSource)
ctx.lookup("jdbc/conversion");
con = ds.getConnection();
select = con.prepareStatement(
"SELECT rate FROM Exchange WHERE src= ? AND dst =Immediate HELP in Tomcat 5 to Postgresql 7.4 database connectivity problem (cont.)
Errors log
2004-06-06 01:07:53 StandardContext[servlets-examples]SessionListener: contextDestroyed()
2004-06-06 01:07:53 StandardContext[servlets-examples]ContextListener: contextDestroyed()
2004-06-06 01:07:53 StandardContext[jsp-examples]SessionListener: contextDestroyed()
2004-06-06 01:07:53 StandardContext[jsp-examples]ContextListener: contextDestroyed()
2004-06-06 01:07:59 StandardContext[balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2004-06-06 01:08:00 StandardContext[jsp-examples]ContextListener: contextInitialized()
2004-06-06 01:08:00 StandardContext[jsp-examples]SessionListener: contextInitialized()
2004-06-06 01:08:00 StandardContext[servlets-examples]ContextListener: contextInitialized()
2004-06-06 01:08:00 StandardContext[servlets-examples]SessionListener: contextInitialized()
2004-06-06 01:08:01 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /rates/rates.jsp(5,0) The value for the useBean class attribute converters.conversionDAO is invalid.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:357)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:141)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1217)
at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Generator.generate(Generator.java:3261)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
----more---- -
How can i identify the environment name or database name in the PL/SQL code
Hi,
I am using UTL_FILE to genearate the files.,
My problem is, I have to design the common sql file , which can be executed in 2 diffrent environments ( Say QA & DEV ) , with no parameters. It has to identify the environment and based on the environment , it has to generate the concern files.,
The only change needs to be incorporated is , file names , which will change based on the environment.,
can nay one tell me , how can i identify the environment name or database name in the PL/SQL code ??
RajaIn this case, USEC_GI_DEV.NA.XXXNET.NET is a TNS alias. That alias exists only on the client machine. There is no way to access that information on the database server.
You would have to find something in the v$database or v$instance table that uniquely identifies the database (and you may need some help from the DBAs to do this because you need to ensure that the data element you choose is compatible with whatever refresh process(es) are used in your environment).
Now, if you are writing a stand-alone SQL*Plus script, SQL*Plus, as a client tool, does have access to the TNS alias in later versions. But that is a client-side determination, not a server-side determination.
Justin -
SIMPLE Database Design Problem !
Mapping is a big problem for many complex applications.
So what happens if we put all the tables into one table called ENTITY?
I have more than 300 attributeTypes.And there will be lots of null values in the records of that single table as every entityType uses the same table.
Other than wasting space if I put a clustered index on my entityType coloumn in that table.What kind of performance penalties to I get?
Definition of the table
ENTITY
EntityID > uniqueidentifier
EntityType > Tells the entityTypeName
Name >
LastName >
CompanyName > 300 attributeTypes
OppurtunityPeriod >
PS:There is also another table called RELATION that points the relations between entities.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
check the coloumn with WHERE _entityType='PERSON'
as there is is clustered index on entityType...there
is NO performance decrease.
there is also a clustered index on RELATION table on
relationType
when we say WHERE _entityType ='PERSON' or
WHERE relationType='CONTACTMECHANISM'.
it scans the clustered index first.it acts like a
table as it is physically ordered.I was thinking in terms of using several conditions in the same select, such as
WHERE _entityType ='PERSON'
AND LastName LIKE 'A%' In your case you have to use at least two indices, and since your clustered index comes first ...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Have you ever thought of using constraints in your
modell? How would you realize those?
...in fact we did.We have arranged the generic object
model in an object database.The knowledge information
is held in the object database.So your relational database is used only as a "simple" storage, everything has go through your object database.
But the data schema is held in the RDBMS with code
generation that creates a schema to hold data.If you think that this approach makes sense, why not.
But in able to have a efficent mapping and a good
performance we have thought about building only one
table.The problem is we know we are losing some space
but the thing is harddisk is much cheaper than RAM
and CPU.So our trade off concerated on the storage
cost.But I still wonder if there is a point that I
have missed in terms performance?Just test your approach by using sufficiently data - only you know how many records you have to store in your modell.
PS: it is not wise effective using generic object
models also in object databases as CPU cost is a lot
when u are holding the data.I don't know if I'd have taken your approach - using two database systems to hold data and business logic.
PS2: RDBMS is a value based system where object
databases are identity based.we are trying to be in
the gray area of both worlds.Like I wrote: if your approach works and scales to the required size, why not? I would assume that you did a load test with your approach.
What I would question though is that your discussing a "SIMPLE Database Design" problem. I don't see anything simple in your approach when it comes to implementation.
C. -
How can i define database name in oracle ADI
Hai Friends,
I am facing a problem when i am going to define database name in oracle ADI there is a error u can enter minimum 6 char database name but my database name is PROD it is only 4 char long. how can i define can i will change the database name. Please suggest me.
If u have any query regarding oracle apps plse discuss with me.
Many thanks
Ghanshyam khetanDatabase is used internally by ADI and does not have any relationship to the name of your database.
Using ADI I am able to create a database with the following:
Name - My Wacky Database
GWYUID and FNDNAM as usual
Connect String - VIS
I'm able to signon and work successfully with that definition. The connect string is more important in this scenario as that tells the networking layer which database to actually talk to. As you can see here mine is only three characters. -
Database not found/Error: ORA-16621: database name for ADD DATABASE must be
I am new to Data Guard and am trying to set up Data Guard Broker. I had created a configuration file with both my primary and standby databases and at one time I could show both databases. But now I can no longer show the standby database nor can I enable, disable or reinstate it. Here is what I have:
Primary Database: orcl10g
Standby Database: 10gSB
DGMGRL> show configuration
Configuration
Name: orcl10g
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
orcl10g - Primary database
10gSB - Physical standby database
Current status for "orcl10g":
SUCCESS
DGMGRL> show database verbose orcl10g
Database
Name: orcl10g
Role: PRIMARY
Enabled: YES
Intended State: ONLINE
Instance(s):
orcl10g
Properties:
InitialConnectIdentifier = 'orcl10g'
LogXptMode = 'ASYNC'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '180'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '10gSB, orcl10g'
LogFileNameConvert = '/oracle/oracle/product/10.2.0/oradata/orcl10g/redo01.log, /oracle/oracle/product/10.2.0/oradata/10gSB/redo01.log, /oracle/oracle/product/10.2.0/oradata/orcl10g/redo02.log, /oracle/oracle/product/10.2.0/oradata/10gSB/redo02.log, /oracle/oracle/product/10.2.0/oradata/orcl10g/redo03.log, /oracle/oracle/product/10.2.0/oradata/10gSB/redo03.log'
FastStartFailoverTarget = ''
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'remarkable.mammothnetworks.com'
SidName = 'orcl10g'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=tcp)(HOST=remarkable.mammothnetworks.com)(PORT=1521))'
StandbyArchiveLocation = '/oracle/flash_recovery_area/orcl10g/archivelog'
AlternateLocation = ''
LogArchiveTrace = '1024'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Current status for "orcl10g":
SUCCESS
DGMGRL> show database verbose 10gSB
Object "10gsb" was not found
DGMGRL>
DGMGRL> remove database 10gSB
Object "10gsb" was not found
DGMGRL>
DGMGRL> reinstate database 10gSB
Object "10gsb" was not found
DGMGRL>
DGMGRL> enable database 10gSB
Object "10gsb" was not found
DGMGRL>
DGMGRL> add database '10gSB' as
connect identifier is 10gSB
maintained as physical;Error: ORA-16621: database name for ADD DATABASE must be unique
Failed.
How can I get Data Guard to see the standby database correctly again?Thank you for the constructive feedback. I have been able to make progress on this issue.
I did check the Data Guard Log files as you suggested. I did not find anything when I checked them before but this time I found the following:
DG 2011-06-16-17:23:18 0 2 0 RSM detected log transport problem: log transport for database '10gSB' has the following error.
DG 2011-06-16-17:23:18 0 2 0 RSM0: HEALTH CHECK ERROR: ORA-16737: the redo transport service for standby database "10gSB" has an error
DG 2011-06-16-17:23:18 0 2 0 NSV1: Failed to connect to remote database 10gSB. Error is ORA-12514
DG 2011-06-16-17:23:18 0 2 0 RSM0: Failed to connect to remote database 10gSB. Error is ORA-12514
DG 2011-06-16-17:23:18 0 2 753988034 Operation CTL_GET_STATUS cancelled during phase 2, error = ORA-16778
DG 2011-06-16-17:23:18 0 2 753988034 Operation CTL_GET_STATUS cancelled during phase 2, error = ORA-16778
I verified that I am able to connect to both the primary and standby databases via external connections:
-bash-3.2$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 17-JUN-2011 12:41:03
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 17-JUN-2011 01:40:30
Uptime 0 days 11 hr. 0 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=remarkable.mammothnetworks.com)(PORT=1521)))
Services Summary...
Service "10gSB" has 1 instance(s).
Instance "10gSB", status READY, has 1 handler(s) for this service...
Service "10gSB_DGB" has 1 instance(s).
Instance "10gSB", status READY, has 1 handler(s) for this service...
Service "10gSB_XPT" has 1 instance(s).
Instance "10gSB", status READY, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl10g" has 1 instance(s).
Instance "orcl10g", status READY, has 1 handler(s) for this service...
Service "orcl10gXDB" has 1 instance(s).
Instance "orcl10g", status READY, has 1 handler(s) for this service...
Service "orcl10g_DGB" has 1 instance(s).
Instance "orcl10g", status READY, has 1 handler(s) for this service...
Service "orcl10g_XPT" has 1 instance(s).
Instance "orcl10g", status READY, has 1 handler(s) for this service...
The command completed successfully
-bash-3.2$
-bash-3.2$
-bash-3.2$ sqlplus system/dbas4ever@orcl10g
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 17 12:43:41 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
-bash-3.2$ sqlplus system/dbas4ver@10gSB
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 17 12:43:59 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress <== I think this is normal since the database is in mount mode
Enter user-name:
I also checked the listener log file and did see and error associated with a known bug:
WARNING: Subscription for node down event still pending
So I added the following to the listener.ora file and bounced the listener:
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
That seems to have taken care of the error.
The following is my listener.ora file:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
(SID_DESC = ( GLOBAL_DBNAME = 10gsb_DGMGRL.remarkable.mammothnetworks.com )
( SERVICE_NAME = 10gsb.remarkable.mammothnetworks.com )
( SID_NAME = 10gsb )
( ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1 )
(SID_DESC = ( GLOBAL_DBNAME = orcl10g_DGMGRL.remarkable.mammothnetworks.com )
( SERVICE_NAME = orcl10g.remarkable.mammothnetworks.com )
( SID_NAME = orcl10g )
( ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1 )
(SID_DESC = ( GLOBAL_DBNAME = orcl10g.remarkable.mammothnetworks.com )
( SERVICE_NAME = orcl10g.remarkable.mammothnetworks.com )
( SID_NAME = orcl10g )
( ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1 )
(SID_DESC = ( GLOBAL_DBNAME = 10gsb.remarkable.mammothnetworks.com )
( SERVICE_NAME = 10gsb.remarkable.mammothnetworks.com )
( SID_NAME = 10gsb )
( ORACLE_HOME = /oracle/oracle/product/10.2.0/db_1 )
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
I again tried connecting externally to the standby database:
-bash-3.2$ sqlplus system/dbas4ever@10gSB
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 17 13:09:00 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Enter user-name:
and see this in the listener.log file:
17-JUN-2011 13:10:22 * (CONNECT_DATA=(SERVICE_NAME=10gSB_XPT)(SERVER=dedicated)(CID=(PROGRAM=oracle)(HOST=remarkable.mammothnetworks.com)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=199.187.124.130)(PORT=11357)) * establish * 10gSB_XPT * 0
17-JUN-2011 13:10:22 * (CONNECT_DATA=(SERVICE_NAME=10gSB_XPT)(SERVER=dedicated)(CID=(PROGRAM=oracle)(HOST=remarkable.mammothnetworks.com)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=199.187.124.130)(PORT=11358)) * establish * 10gSB_XPT * 0
17-JUN-2011 13:10:24 * service_update * 10gSB * 0
17-JUN-2011 13:10:30 * (CONNECT_DATA=(SID=orcl10g)(CID=(PROGRAM=perl)(HOST=remarkable.mammothnetworks.com)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=25119)) * establish * orcl10g * 0
17-JUN-2011 13:10:30 * (CONNECT_DATA=(SID=orcl10g)(CID=(PROGRAM=perl)(HOST=remarkable.mammothnetworks.com)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=25120)) * establish * orcl10g * 0
17-JUN-2011 13:10:30 * (CONNECT_DATA=(SID=orcl10g)(CID=(PROGRAM=emagent)(HOST=localhost.localdomain)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=25121)) * establish * orcl10g * 0
17-JUN-2011 13:11:22 * (CONNECT_DATA=(SERVICE_NAME=10gSB_XPT)(SERVER=dedicated)(CID=(PROGRAM=oracle)(HOST=remarkable.mammothnetworks.com)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=199.187.124.130)(PORT=11420)) * establish * 10gSB_XPT * 0
17-JUN-2011 13:11:22 * (CONNECT_DATA=(SERVICE_NAME=10gSB_XPT)(SERVER=dedicated)(CID=(PROGRAM=oracle)(HOST=remarkable.mammothnetworks.com)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=199.187.124.130)(PORT=11422)) * establish * 10gSB_XPT * 0
17-JUN-2011 13:11:24 * service_update * 10gSB * 0
I tried again to see the database in Data Guard Broker:
DGMGRL> show database 10gSB
Object "10gsb" was not found
however, I then was able to add the database in Data Guard Broker:
DGMGRL> add database 10gSB
as connect identifier is 10gSB
maintained as physical;Database "10gsb" added <== this is progress!!!
However the configuration shows the following:
DGMGRL> show database 10gSB
Database
Name: 10gsb
Role: PHYSICAL STANDBY
Enabled: NO
Intended State: OFFLINE
Instance(s):
10gSB
Current status for "10gsb":
DISABLED <=====
So I tried to enable the database:
DGMGRL> enable database 10gSB
Error: ORA-16626: failed to enable specified object
Failed.
and I tried to reinstate the database:
DGMGRL> reinstate database 10gSB
Reinstating database "10gsb", please wait...
Error: ORA-16653: failed to reinstate database
Failed.
Reinstatement of database "10gsb" failed
So I checked the configuration and now see two entries for the standby database but with case differences:
DGMGRL> show configuration
Configuration
Name: orcl10g
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
orcl10g - Primary database
10gSB - Physical standby database
10gsb - Physical standby database (disabled)
Current status for "orcl10g":
SUCCESS
Question: How do I get rid of 10gSB and enable 10gsb? -
RMAN-05520: database name mismatch
Hi All,
My DB Version :11.2.0
OS :Linux
What i am doing is to try duplicating the database on the same machine using RMAN. But what happens when i am trying to run the below mentione command i am getting below error
RMAN> duplicate target database to test2 from active database nofilenamecheck;
Starting Duplicate Db at 31-DEC-12
using channel ORA_AUX_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/31/2012 02:25:32
RMAN-05520: database name mismatch, auxiliary instance has TEST1, command specified TEST2
Can anyone please suggest me why i am facing this problem.
connecting to rman as follows
rman target sys/tiger@test1
RMAN> connecting auxiliary sys/tiger@test2
Connected to auxiliary database: TEST1(not mounted)
my pfile entries for test2(cloned db ) are as follows:
test2.__db_cache_size=658505728
test2.__java_pool_size=4194304
test2.__large_pool_size=4194304
test2.__oracle_base='/home/app/oracle/app/oracle'#ORACLE_BASE set from environment
test2.__pga_aggregate_target=306184192
test2.__sga_target=914358272
test2.__shared_io_pool_size=0
test2.__shared_pool_size=239075328
test2.__streams_pool_size=0
*.audit_file_dest='/home/app/oracle/app/oracle/admin/test2/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/home/app/oracle/app/oracle/oradata/test2/control01.ctl','/home/app/oracle/app/oracle/flash_recovery_area/test2/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='test1'
*.db_recovery_file_dest='/home/app/oracle/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4039114752
*.diagnostic_dest='/home/app/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=test2XDB)'
*.local_listener='LISTENER_TEST1'
*.open_cursors=300
*.pga_aggregate_target=304087040
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=912261120
*.undo_tablespace='UNDOTBS1'
*.db_file_name_convert='/home/app/oracle/app/oracle/oradata/test1','/home/app/oracle/app/oracle/oradata/test2'
*.log_file_name_convert='/home/app/oracle/app/oracle/oradata/test','/home/app/oracle/app/oracle/oradata/test2'You are cloning...right?
Then shutdown the target database. Then change the init parameter file *.db_name='test2' (that is your target database name)
and then startup the instance in nomount mode and then try to fire the RMAN command. -
DBLINK Name problem????
I create a DBLINK called "MYDBLINK" but ORACLE rename it as "MYDBLINK.ES.AULAS-GRP"
I create it:
create database link MYDBLINK
connect to USER1
identified by "USER1"
using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = AUPDMANAS53525.ES.AULAS-GRP) (PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = BDED1.es.aulas-grp)))';
I need the name MYDBLINK instead of "MYDBLINK.ES.AULAS-GRP"
I have executed ALTER SYSTEM SET DB_DOMAIN='' scope=spfile; instruction but I continue with the same problem .
What do I have to configure?
I attach tnsnames and some data.
Thanks very much in advance!
TNSNAMES:
BDED1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = AUPDMANAS53525.ES.AULAS-GRP)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = BDED1.es.aulas-grp)
(SRVR = DEDICATED)
SQL> show parameter service;
NAME TYPE VALUE
service_names string BDED1.es.aulas-grp
SQL> show parameter global;
NAME TYPE VALUE
global_context_pool_size string
global_names boolean FALSE<font face="courier new">
Why do you need it? I think it's not a problem if you have to mention "MYDBLINK.ES.AULAS-GRP" instead of MYDBLINK.
<br><br>
You can try this:
<br><br>
First chack your gobal_name:<br>
SELECT * FROM global_name;<br><br>
If it is MYDBLINK.ES.AULAS-GRP then you can change your GLOBAL_NAME format from <database name>[.db_domain] to <database name> only
<br>
ALTER DATABASE RENAME GLOBAL_NAME TO MYDBLINK;
<br><br>
This may have serious consequences in other links/queries of you Database. Please check all associated options before doing it.
<br><br>
Please know more about Global Database Name from Metalink: <br>
Note 115499.1 Global Database Name Explained
</font>
Maybe you are looking for
-
Display company logo on display in SAP ESS
I copied HR_ESS_PAYSLIP_TO_PDF to ZHR_ESS_PAYSLIP_TO_PDF with the purpose to display a logo in the ADOBE reader screen in the browser. When form attributes output settings are set to HTM XSF no logo is displayed, when set to standard the output is ou
-
Whose files do I see in wwv_flow_files.
Hi, I wish to download and run a piece of vbscript in the users environment. The vbscript does a mail merge with word, dowloading the mail recipients through a URL that I provide. Using the upload/download tutorial I have created my own procedure to
-
Rebate settlements should not hit the VAT account
Hello everyone, There is a question on Rebate Settlement. There is a customer who is entitled to a 15% BPR rebate. We are accruing for this rebate successfully The issue we are having is that the materials that this customer buy from us attract 20% V
-
i have this code that write a class Compare3 that provides a static method largest. Method largest should take three Comparable parameters and return the largest of the three (so its return type will also be Comparable) public class Compare3 { public
-
Problem Uploading with CyberDuck to GoDaddy host site
I created an iWeb site that looks and functions fine on my computer (10.5.8). I successfully uploaded it with Cyberduck (3.2.1) to be hosted by GoDaddy on a domain I own. At that point, everything was lovely. Then, I revised the site in iWeb on my co