Specifying Database name in dictionary perspective
Hi Experts,
Can someone please tell me how can i specify Database in which i want to create tables in dictionary perspective. We dont want to use WAS server database for our application database tables.
Regards
Pranav
Hi,
In which NW version are you using? I don't think it possible in NW 7.
You can always create new scheme/table from the DB management tools (SQL Plus, SQL Server Management Studio etc)
Omri
Similar Messages
-
Can't Connect When Specifying Database Name
Hi all,
I have an issue with an Oracle 9 database where I can connect if I do not specify a database to connect to but when i do specify one i get an error.
For example, my database is called WEB. If i open sqlplus and type connect username/password it will connect fine. If I type connect username/password@web I get an error.
The full error that appears in the log is:
TNS-12500: TNS:listener failed to start a dedicated server process
TNS-12546: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00516: Permission denied
*32-bit Windows Error: 5: Input/output error*
I have checked the tns entries and listener file and both are fine. Here are the entries:
TNSNAMES:
WEB =
*(DESCRIPTION =*
*(ADDRESS_LIST =*
*(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))*
*(CONNECT_DATA =*
*(SERVER = DEDICATED)*
*(SERVICE_NAME = web)*
LISTENER:
LISTENER =
*(DESCRIPTION_LIST =*
*(DESCRIPTION =*
*(ADDRESS_LIST =*
*(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))*
*(ADDRESS_LIST =*
*(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))*
SID_LIST_LISTENER =
*(SID_LIST =*
*(SID_DESC =*
*(SID_NAME = PLSExtProc)*
*(ORACLE_HOME = D:\OraHome_1)*
*(PROGRAM = extproc)*
*(ENVS = "EXTPROC_DLLS=ANY")*
*(SID_DESC =*
*(GLOBAL_DBNAME = web)*
*(ORACLE_HOME = D:\OraHome_1)*
*(SID_NAME = web)*
This is on a Windows machine and I have checked and all the services are running. I have also checked the sqlnet.ora file for this entry:
SQLNET.AUTHENTICATION_SERVICES= (NONE) and tried it with NONE and NTS.
WEB is the only database on the Oracle server.
Can anyone suggest a solution to this problem?
Edited by: ThomasK on Jul 19, 2010 2:10 PMHere are the results from the commands:
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\Documents and Settings\ava>lsnrctl service
LSNRCTL for 32-bit Windows: Version 9.2.0.4.0 - Production on 19-JUL-2010 15:03:
33
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "web" has 2 instance(s).
Instance "web", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Instance "web", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:5 state:ready
LOCAL SERVER
Service "webXDB" has 1 instance(s).
Instance "web", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER <machine: 296508-WEB3, pid: 3812>
(ADDRESS=(PROTOCOL=tcp)(HOST=296508-web3)(PORT=2667))
The command completed successfully
C:\Documents and Settings\ava>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\ava\Application Data
CLIENTNAME=SERENITY
ClusterLog=C:\WINDOWS\Cluster\cluster.log
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
COMPUTERNAME=296508-WEB3
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\ava
LOGONSERVER=\\296508-WEB3
NUMBER_OF_PROCESSORS=4
OPENSSL_CONF=C:\OpenSSL-Win32\bin\openssl.cfg
OS=Windows_NT
Path=D:\OraHome_1\bin;D:\OraHome_1\jre\1.3.1\bin;D:\OraHome_1\jre\1.1.8\bin;C:\P
rogram Files (x86)\Windows Resource Kits\Tools\;C:\Program Files\ava Tools\;
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\D
ell\SysMgt\RAC5;C:\Program Files (x86)\Dell\SysMgt\oma\bin;C:\PHP;C:\PHP\ext;C:\
Program Files\MySQL\MySQL Server 5.1\bin;C:\PHP\libmcrypt.dll;C:\PHP\ext\php_mbs
tring.dll;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Micr
osoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools
\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86
)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86
)\Microsoft SQL Server\100\DTS\Binn\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1;.VBS
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=EM64T Family 6 Model 15 Stepping 11, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0f0b
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
PROMPT=$P$G
SESSIONNAME=RDP-Tcp#3
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\~1\LOCALS~1\Temp\1
TMP=C:\DOCUME~1\~1\LOCALS~1\Temp\1
USERDOMAIN=296508-WEB3
USERNAME=ava
USERPROFILE=C:\Documents and Settings\ava
windir=C:\WINDOWS
C:\Documents and Settings\ava>tnsping web
TNS Ping Utility for 32-bit Windows: Version 9.2.0.4.0 - Production on 19-JUL-20
10 15:03:33
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
D:\OraHome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = localhost)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_
NAME = web)))
OK (0 msec)
C:\Documents and Settings\ava>ping 296508-web3
Pinging 296508-web3 [192.168.100.42] with 32 bytes of data:
Reply from 192.168.100.42: bytes=32 time<1ms TTL=128
Reply from 192.168.100.42: bytes=32 time<1ms TTL=128
Reply from 192.168.100.42: bytes=32 time<1ms TTL=128
Reply from 192.168.100.42: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.100.42:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Documents and Settings\ava>lsnrctl status -
Openrowset - how to specify database name
Hi,
I want to run
DBCC SHOWFILESTATS against a specific database on my server. I can get openrowset to retun the data for master; but, how do I specify a different database?
select * FROM OPENROWSET ('SQLOLEDB','SERVER=(local) ;TRUSTED_CONNECTION=YES;',
'Set FmtOnly OFF;EXEC (''DBCC SHOWFILESTATS'')'
How/where do I put the DB name?You're right. I forgot the closing paren.
select
FROM
OPENROWSET
('SQLOLEDB','SERVER=(local);database=test1
;TRUSTED_CONNECTION=YES;',
'Set FmtOnly OFF;EXEC (''DBCC SHOWFILESTATS'')' ) -
[Symptom]
======================
In Exchange 2007, when you want to export mailbox to a .pst file, you should run the
Export-Mailbox cmdlet from a 32-bit computer that has the following installed:
The 32-bit version of the Exchange management tools
Microsoft Office Outlook 2003 SP2 or later versions
If not, you may encounter the following error message:
You check that you have these required installed, but you get the error below when you run Export-Mailbox in EMS.
“The specified mailbox database [Mailbox Database Name] does not exist.”
[Cause Analysis]
=======================================
This is because that the account you use to run Export-Mailbox cmdlet don’t have the Exchange Server Administrator role assigned.
You can check if this account has been delegated the Exchange Server Administrator role through the following path.
EMC -> Organization Configuration-> Check permissions in the result pane.
To delegate this Exchange Server Administrator role, right click on the
Organization Configuration node and choose Add Exchange Administrator,
you will see the Add Exchange Administrator window.
[More Information]
==============================
Export-Mailbox
http://technet.microsoft.com/en-gb/library/aa998579(v=exchg.80).aspx
How to Export and Import mailboxes to PST files in Exchange 2007 SP1
http://blogs.technet.com/b/exchange/archive/2007/04/13/3401913.aspx
Exchange 2007 cannot export pst files via its powershell
http://social.technet.microsoft.com/Forums/forefront/en-US/b3bc0dce-35f3-4a69-9a33-4f2a855b9f94/exchange-2007-cannot-export-pst-files-via-its-powershell?forum=exchangesvrgenerallegacy
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.Hi,
Based on my test, if you make the user the owner of the database (rather than a user with the db_owner role), when you create a query, it creates it under the dbo schema rather than DOMAIN\username.
Steps to do so (in Management Studio):
Right click database, select Properties
Click File
Change Owner in the textbox
OK to confirm
Downside - other users under db_owner role will still have their username appended. So schemas have to be created for these users.
Jaynet Zhang
TechNet Community Support -
Webi Refreshing Error :database name not found and no default driver specified
Hi All,
When I refreshing the webi report from Launchpad getting bellow error
"database name not found and no default driver specified"
Bellow is the Screen shot
It is refreshing in webi Rich client (server and client tools are in same system) but not from Launch pad
1. Environment :BI 4.0 SP4
2. Server and client tools are installed in same system
3. Created a 32 bit odbc, universe connection is responding properly and report refreshing in rich client(I could not find 64 bit odbc) .
Can Please suggest me where I am doing wrong
Regards,
MahiHi Mahi,
Seems like your BO server is 64 bits and you have created a 64 bits DSN; whereas your database requires 32 bits DSN.
Try below steps:
1. Navigate to the C:\Windows\SysWOW64 directory and open odbcad32.exe. This will open the ODBC Data Source Administrator for 32-bit drivers on the 64-bit server. NOTE: The ODBC Data Source Administrator that is located by clicking Start and Administrative Tools will only create 64-bit ODBC connections.
2. Click on the System DSN tab
3. Click on Add to create a new Data Source
4. Provide the database details
5. Your 32-bit ODBC data source is now ready for use.
Hope it will help.
Regards,
Yuvraj -
How to know database name and schema name
Hi ,
Once after logging in the database,how is it possible to know the current database and schema which we r using?Is there any system table where we can get the database names and schema names?
please help me out.itz urgent.
Regards,
SravanProbably not.
If the database name is the name of the current database, it would be essentially redundant. If the database name is the name of some other database, in order to get the names of all the tables in the specified schema, you could create a database link to the remote system (which assumes you have a login and password to the remote database with appropriate privileges, that the database server's tnsnames.ora file has an entry for the remote database, etc) and query the remote data dictionary tables. Even if you could do that, however, you could not dynamically create triggers on the remote database since DDL over a database link.
In theory, you could also load an appropriate JDBC driver into the database and write a Java stored procedure that would connect to the remote database (again, with an appropriate user name & password, host name, and port number) and issue DDL against that remote database. I have a hard time believing, however, that this would be a particularly beneficial approach. It would be easier just to put the appropriate code into each database that needs triggers generated or to have a separate Java application that generates triggers for a number of different databases.
Justin -
DB Link , ORA - 02083: illegal database name character '-'
Hi,
I work for an integration company and right now we are putting together an application that is moving a small subset of data from one db to another. I have created a db link to move the data. However, when I try to compile the procedure, that moves the data, into the database, the compile fails and I am given the following error:
ORA-02083: database name has illegal character -.
The instances Im developing/testing to are on the same machine, which is a Solaris X86 machine and the Oracle version is 8.1.7.
Now 2 things. If I do a simple query like the one below using SQL*PLUS, the link works fine.
Select sysdate
From dual@<dblink_name>;
The other thing is the domain name does in fact have a - in it, but I have removed the domain name from everyplace I can thing of from Oracle; i.e. tnsnames, init.ora file, etc.
Does anyone have any ideas?
Thanks,
Roger Christopheland set this parameter with its correct value.
DB_DOMAIN
Parameter type
String
Syntax
DB_DOMAIN = domain_name
Default value
There is no default value.
Parameter class
Static
Range of values
Any legal string of name components, separated by periods and up to 128 characters long (including the periods). This value cannot be NULL.
Real Application Clusters
You must set this parameter for every instance, and multiple instances must have the same value.
In a distributed database system, DB_DOMAIN specifies the logical location of the database within the network structure. You should set this parameter if this database is or ever will be part of a distributed system. The value consists of the extension components of a global database name, consisting of valid identifiers, separated by periods. Oracle Corporation recommends that you specify DB_DOMAIN as a unique string for all databases in a domain.
This parameter allows one department to create a database without worrying that it might have the same name as a database created by another department. If one sales department's DB_DOMAIN is JAPAN.ACME.COM, then their SALES database (SALES.JAPAN.ACME.COM) is uniquely distinguished from another database with DB_NAME = SALES but with DB_DOMAIN = US.ACME.COM.
If you omit the domains from the name of a database link, Oracle expands the name by qualifying the database with the domain of your local database as it currently exists in the data dictionary, and then stores the link name in the data dictionary. The characters valid in a database domain name are: alphanumeric characters, underscore (_), and number sign (#).
See Also:
Oracle9i Database Performance Tuning Guide and Reference for more information on setting this parameter
The data dictionary view "GLOBAL_NAME"
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96536/ch142.htm#REFRN10036
Joel Pérez -
When trying to create a new user profile service application on a new SharePoint install I get the following error:
"The specified database is not a valid synchronization database"
The installation then fails and does not create the third database.
I found some threads with similar problems but it involved upgrading an existing db. In this case we want to create a new one. Here is the relevant ULS log info:
Starting schema provisioning of SynchronizationDatabase 'SP15_TEST_ENT_SyncDB'
Provisioning the SP15_TEST_ENT_SyncDB database with the script at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Template\SQL\SPS\drop_procs.sql.
Provisioning the SP15_TEST_ENT_SyncDB database with a script stream.
Ensuring that the SP15_TEST_ENT_SyncDB database exists . . .
The SP15_TEST_ENT_SyncDB database does not exist.
It will now be created.
Setting the AutoClose option to False on the database SP15_TEST_ENT_SyncDB.
Setting the ArithAbort option to True on the database SP15_TEST_ENT_SyncDB.
Setting the TruncLogOnChkpt option to True on the database SP15_TEST_ENT_SyncDB.
Starting schema evaluation of existing SynchronizationDatabase 'SP15_TEST_ENT_SyncDB'
Validate Database: validating sync database
Validate Database: validation failed: Error code -2
Application error when access /_admin/NewProfileServiceApplicationSettings.aspx, Error=The specified database is not a valid synchronization database
at Microsoft.Office.Server.Administration.SynchronizationDatabase.Provision()
at Microsoft.Office.Server.Administration.UserProfileApplication.Provision()
at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.NewProfileServiceSettingsPage.DoCreateApplication()
at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.NewProfileServiceSettingsPage.OnOkButtonClick(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Microsoft.SharePoint.Administration.SPDatabaseException: The specified database is not a valid synchronization database
at Microsoft.Office.Server.Administration.SynchronizationDatabase.Provision()
at Microsoft.Office.Server.Administration.UserProfileApplication.Provision()
at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.NewProfileServiceSettingsPage.DoCreateApplication()
at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.NewProfileServiceSettingsPage.OnOkButtonClick(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.SharePoint.Administration.SPDatabaseException:
The specified database is not a valid synchronization database
at Microsoft.Office.Server.Administration.SynchronizationDatabase.Provision()
at Microsoft.Office.Server.Administration.UserProfileApplication.Provision()
at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.NewProfileServiceSettingsPage.DoCreateApplication()
at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.NewProfileServiceSettingsPage.OnOkButtonClick(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I Tried to create another one under a different name (databases also) and I get the same error.
The SharePoint instance has the march mandatory update installed. The sql instance we are using is an existing SQL cluster for other SharePoint poc's.
Has anybody seen this issue before?I had the same problem and could not figure out what was wrong for the longest time. I then had the idea to check in the model system database to see if there were any extra custom tables in that database. Any tables that are in the model database
are put into any new database when it is created. I had some custom tables in the model database so I deleted the custom tables in the model database and deleted the failed user profile service application and its databases and then tried to recreate
the user profile service application again and it worked with no errors -
Hi,
We have a cluster with 2 nodes. Everything works fine in Node1. When I try to failover TEST1 database to Node-2 it fails with this message.
Generic service 'Analysis Services (TEST1)' could not be brought online (with error '1060') during an attempt to open the service. Possible causes include: the service is either not installed or the specified service name is invalid.
Any help is much appreciated.
ThanksHello,
The error message is pretty straight forward, it's saying either the service isn't installed or it's not installed as the same service on that node. Did you install analysis services on the second node (from the error it seems like it isn't)?
Sean Gallardy | Blog |
Twitter -
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 -
How do i get the database name in reports. we can get this in form by get_application_property, do we have anything like that in reports
thanksCheck the database dictionary tables.
sys.v_$parameter certainly contains a parameter with the name 'db_name'and the value of the database name.
see what you get when you run:
select * from sys.v_$parameter where name='db_name'
If the user running the report won't have the select priviledge on sys.v_$parameter, then you will have to create a function that returns the value for the db_name parameter (that is in the schema of a user that has that priviledge) and grant execute on it to the user that runs the report and create a synonym for that function. -
How to know the database name?
I have installed oracle 10g and developer suite.. I am trying to create forms now.
But its error out: TNS: could not resolve the connect identifier specified!!!
I forgot the Data base name.. How can I know the database name??
Thanks in Advance!!!!!!!!!!I have installed oracle 10g and developer suite.. I'm sorry, but you are going to have be more specific as what you installed!
If you installed Oracle Database 10g Express Edition then it is not (by default) configured to allow a connection through SQL*Plus. It is primarily configured to open a connection through the "Go To Database Homepage" url/link in the Start Menu => Oracle Database 10g Express Edition => Go To Database Homepage. In order to connect to the database from SQL*Plus (which is included with Oracle Developer Suite 10g) you will need to run the Net Configuration Assistant to configure your TNSNAMES.ora and SQLNET.ora files. Go to Start Menu => Oracle - DevSuiteHome1 => Configuration and Migration Tools => Net Configuration Assistant to run the assistant. After you run the assistant, test to make sure can connect through SQL*Plus before you attempt to connect through Forms.
Hope this helps,
Craig... -
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 -
RMAN-05520: database name mismatch, auxiliary instance has ORADB
Hi,
i am using Oracle 10g (10.2.0.1.0) in RHEL 5 server. i am trying to duplicate my primary database(ORADB) to standby database with name DEVDB in different server. I have taken an RMAN backup and transferred to standby server and now i am trying to duplicate with the below commands
[oracle@rhel5 data]$ rman target / auxiliary sys/oracle@DEVDB
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Mar 9 16:11:52 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORADB (DBID=2542358497, not open)
connected to auxiliary database: ORADB (not mounted)
RMAN>
RMAN>
RMAN> duplicate target database to DEVDB
2> ;
Starting Duplicate Db at 09-MAR-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=151 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 03/09/2013 16:14:02
RMAN-05520: database name mismatch, auxiliary instance has ORADB, command specified DEVDB
My primary db pfile has
*.db_name='ORADB'
*.db_unique_name='ORADB'
My standby db has
*.db_name='ORADB'
*.db_unique_name='DEVDB'
Regards,
007Hello again;
Agreed. You have at least two issues.
Generally I change the SID
export ORACLE_SID=DEVDB
Then I start NOMOUNT using an INIT file.
Then this should be correct
connected to target database: ORADB (DBID=2542358497, not open)
connected to auxiliary database: ORADB (not mounted)h2. Later
I think I was wrong I would like to change my answer. I looked back and found my old notes and things are not as I stated above.
I used an INIT file ( standby side ) for cloning as follows :
db_name=RECOVER2
instance_name=RECOVER2
control_files=("/u01/app/oracle/oradata/RECOVER2/control01.ctl", "/u01/app/oracle/flash_recovery_area/RECOVER2/control02.ctl")
db_recovery_file_dest=/u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size=4070572032
compatible=11.2.0.0.0
core_dump_dest='/u01/app/oracle/diag/rdbms/recover2/RECOVER2/cdump'
db_block_size=8192
audit_file_dest=/u01/app/oracle/admin/RECOVER2/adump
undo_tablespace=UNDOTBS1
undo_management = AUTO
undo_retention=10800So for the duplicate I don't set DB_UNIQUE_NAME
I Backed up the target database as shown here with the ‘backup current controlfile for standby format’ command:
RMAN RUN {
allocate channel d1 type disk;
backup format '/u01/backups/RECOVER2/df_t%t_s%s_p%p' database;
sql 'alter system archive log current';
backup format '/u01/backups/RECOVER2/al_t%t_s%s_p%p' archivelog all;
backup current controlfile for standby format '/u01/backups/RECOVER2/sb_t%t_s%s_p%p';
release channel d1;
}I did a startup the standby as follows : ( Notice you are correct about the SID and I was incorrect )
export ORACLE_SID=RECOVER2
/home/oracle:SRECOVER2 >sysplus "/ as sysdba"
Connected to an idle instance.
SQL> startup nomount pfile='/u01/app/oracle/admin/RECOVER2/pfile/initRECOVER2.ora';I started RMAN like this :
/home/oracle:SRECOVER2 >export ORACLE_SID=RECOVER2
rman target sys/password@recover2 auxiliary /
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Sep 10 13:35:29 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: RECOVER2 (DBID=3806912436)
connected to auxiliary database: RECOVER2 (not mounted)So you connect to the Primary, but the auxiliary should show "not mounted"
Finally I issue the duplicate command
RMAN> run {
2> allocate channel C1 device type disk;
3> allocate auxiliary channel C2 device type disk;
4> duplicate target database for standby nofilenamecheck;
5> }Best Regards
mseberg
Edited by: mseberg on Mar 9, 2013 10:39 AM -
Help for: ORA-01103: database name PRIMARY in control file is not STANDBY
Hello all, this will be my first post to the support forum. I'm an associate dba with just 6 months on the job, so if I've forgotten something or not given some infromation that is needed please let me know.
I've also combed the forums/internet, and some of the answers haven't helped. The Oracle Document ORA-1103 While Mounting the Database Using PFILE [ID 237073.1] says my init.ora file is corrupted, but creating a new init.ora file from the spfile does not help. Neither does just starting from the spfile. I have older copies of the init.ora file and the spfiles that the database was running on previously, so I believe they are good.
This standby NIRNASD1 has existed previously, I had to refresh the primary NIKNASD2, and then re-instantiate NIRNASD1 after the refresh is complete.
My env is set correctly, and my ORACLE_SID has been exported to NIRNASD1
NIKNASD2 = Primary Database
NIRNASD1 = Secondary/Standby Database
Goal: Creation of Logical Standby NIRNASD1 after creating Physical Standby from NIKNASD2
My database versions are 10.2.0.4.0, and the databases are on a Unix server. Both databases are located on separate servers.
Steps that I have taken:
I used RMAN to backup our primary database to the staging area:
$ rman target /
run {
backup database
format '/datatransa/dg_stage/%U'
include current controlfile for standby;
sql "alter system archive log current";
backup archivelog all format '/datatransa/dg_stage/%U';
I used RMAN to Create Secondary Database utilizing RMAN DUPLICATE command.
RMAN> run {
2> allocate auxiliary channel auxdisk device type disk;
3> duplicate target database for standby NOFILENAMECHECK;
4> }
On Secondary database I started Managed Recovery mode
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
(I used pfile here, thinking that I needed to mount the database to the pfile so that the database would see the change in the dataguard parameters in the init.ora file, the change from logical to physical- I commeneted out the logical and uncommented the physical line)
# Dataguard Parameters
For logical standby, change db_name to name of standby database.
db_name=NIKNASD2 ### for physical, db_name is same as primary
#db_name=NIRNASD1 ### for logical, db_name is same as unique_name
SQL> STARTUP MOUNT PFILE = /oraa/app/oracle/product/1020/admin/NIRNASD1/pfile/initNIRNASD1.ora;
ORACLE instance started.
Total System Global Area 1577058304 bytes
Fixed Size 2084368 bytes
Variable Size 385876464 bytes
Database Buffers 1174405120 bytes
Redo Buffers 14692352 bytes
Database mounted.
SQL> ALTER DATABASE recover managed standby database using current logfile disconnect;
I then verified the Data Guard Configuration by using “alter system archive log current;” on the primary database and watching the sequence number change in the secondary database.
I made sure that:
• The primary database was in MAXIMUM PERFORMANCE MODE
• Stopped managed recover on the standby database: alter database recover managed standby database cancel;
• Built a logical standby data dictionary on the primary database
• The db_name in init.ora was changed (this is in our document at my job)
• I changed my database name (from physical to logical) in my init.ora pfile (reverse of what I did above)
# Dataguard Parameters
For logical standby, change db_name to name of standby database.
#db_name=NIKNASD2 ### for physical, db_name is same as primary
db_name=NIRNASD1 ### for logical, db_name is same as unique_name
I then went to shutdown my standby database and re-start it in a mount exclusive state, which is where I get the ORA-01103 Error (Again I used the pfile, thinking that I needed to tell the database it is now a logical standby):
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP EXCLUSIVE MOUNT PFILE = /oraa/app/oracle/product/1020/admin/NIRNASD1/pfile/initNIRNASD1.ora;
ORACLE instance started.
Total System Global Area 1577058304 bytes
Fixed Size 2084368 bytes
Variable Size 385876464 bytes
Database Buffers 1174405120 bytes
Redo Buffers 14692352 bytes
ORA-01103: database name 'NIKNASD2' in control file is not 'NIRNASD1'
From what I understand of the process, the name in the control file is correct, I want it to be NIRNASD1. But the database for some reason thinks it should be NIKNASD2. The following are the parts of my init.ora file that include the dataguard parameters:
# Database Identification
db_domain=""
#db_name=NIRNASD1
#db_unique_name=NIRNASD1
# File Configuration
control_files=("/oradba2/oradata/NIRNASD1/control01.ctl", "/oradba3/oradata/NIRNASD1/control02.ctl", "/oradba4/oradata/NIRNASD1/control03.ctl")
# Instance Identification
instance_name=NIRNASD1
# Dataguard Parameters
#db_name=NIKNASD2 ### for physical, db_name is same as prmary
db_name=NIRNASD1 ### for logical, db_name is same as unique_name
db_unique_name=NIRNASD1
dg_broker_start=TRUE
db_file_name_convert='NIKNASD2','NIRNASD1'
log_file_name_convert='NIKNASD2','NIRNASD1'
log_archive_config='dg_config=(NIRNASD1,NIKNASD2)'
log_archive_dest_1='LOCATION="/oraarcha/NIRNASD1/" valid_for=(ONLINE_LOGFILES,all_roles) db_unique_name=NIRNASD1'
#log_archive_dest_2='LOCATION="/oraarcha/NIKNASD2/" valid_for=(standby_logfiles,standby_roles) db_unique_name=NIRNASD1'
log_archive_dest_2='LOCATION="/oraarcha/NIKNASD2/" valid_for=(standby_logfile,standby_role) db_unique_name=NIRNASD1'
STANDBY_ARCHIVE_DEST='LOCATION=/oraarcha/NIKNASD2/'
# Parameters are not needed since this server will NOT become primary
#log_archive_dest_2='service=NIKNASD2
# valid_for=(online_logfiles,primary_role)
# db_unique_name=NIKNASD2'
fal_server='NIKNASD2'
fal_client='NIRNASD1'
I would appreciate any help, or pointing me in the right direction. I'm just missing something. I am reviewing the documents for building a physical and logical standby from oracle. Just not sure where to go from here.
Thank you
Edited by: 977917 on Dec 19, 2012 5:49 PMFirst of all, thank you both for answering my post. I've pulled up Mr. Hesse's page and will make it a go-to staple.
We're in the process of upgrading our databases, but we have 130+ databases and only six Oracle dba's, and I'm one of them. It's a large corporation, and things move at a "slow and tested" pace.
The pfile parameters listed above are from my secondary/standby database. And I do want to create a logical standby.
I forgot to mention that we do use DataGuard Broker, but I did not think that would be the cause of why the database was starting up incorrectly, so I did not mention it. My apologies there.
As far as the db_name, here's my question on that. It's my understanding the the db_name should be the name of the primary database when you are working with a physical standby, but as soon as you convert it to logical, you should change the db_name to the secondary/standby database? Am I correct on that?
Leading from that, during the process of creating the physical standby and converting the physical standby to the logical standby, should I change the db_name in the secondary/standby database in the spfile and never use the pfile at all? For instance, when I create the physical standby I have to change the db_name in the standby to the PRIMARY database, so that makes me think I should change db_name in the spfile? (If you see above, I changed db_name in the pfile and did a startup pfile)
This morning I was able to reach out to a fellow DBA (they are were asleep when I posted this last night), and they tried a few things. We had a redirect in the standby directory /oraa/app/oracle/product/1020/dbs folder that looked like this: spfileNIRNASD1.ora -> /oraa/app/oracle/product/1020/admin/NIRNASD1/pfile/spfileNIRNASD1.ora
She removed the redirect and the startup mount exclusive then worked without the error.
Thank you again for your help Mr.Quluzade and Mr. Hesse, I appreciate you all taking the time to teach someone new to the craft. I will definitely read up on the link that you sent me.
Chris Cranford
Maybe you are looking for
-
Animated .gif takes time to start playing in web
Hello! I'm new here... The title says it pretty much... I've made some .gif animations for the web. I use "save for web & devices" and get a nice compact file, but once it's uploaded to a server and I open the .gif in my browser (google chrome), it t
-
Will my imac (110v) work in a country with 220v if I use a voltage transformer?
-
Synchronizing Problem with Nokia Sports Manager
Hi, all, I'm using Nokia 5500 sport. But I can't syn my phone with the sports manager. The connection is fine. I can transfer other data. just can't syn properly with sports manager. everytime open it up, it display synchronizing but never finish(wai
-
TYPES : BEGIN OF itab, matnr LIKE eban-matnr, menge LIKE eban-menge, END OF itab. TYPES : BEGIN OF itab2, maktx LIKE makt-maktx, END OF itab2. DATA : it_eban TYPE STANDARD TABLE OF itab. DATA : it_makt TYPE
-
I must be doing something wrong, because I cant imagine that ADF reacts the way it does within my application. I have 2 datapages, browseDP and editDP I have 1 data action, createDA, I dragged the create method from my viewobject here The flow is as