Systimestamp value in different timezoon database server
Hi Experts,
There is a SQL (select systimestamp from dual; )
If we run above sql between PST and EST two different timezone database serves at same time, does SQL return different value from systimestamp?
if return same value from different timezone database server, why?
Please explaining!
Thanks
Jim
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions173.htm#SQLRF06125
SYSTIMESTAMP returns the system date, including fractional seconds and time zone, of the system on which the database resides. The return type is TIMESTAMP WITH TIME ZONE.systimestamp returns database server OS's timezone.
if server is in PST systimestamp will return PST.
if server is EST systimestamp will use EST.
Similar Messages
-
Separate ASCS and PAS from Database server
Dear friends, in a customer we have the following need:
We need to separate de ASCS and the Primary application server to a host different from database server. The SAP system is an ERP 6.0 EHP4 based in NW 7.01.
We have used Software provisoning manager to splitt off the ASCS from the CI. Before the splitt off we only had the directory DVEBMSG00, and after the splitt off, we had ASCS01 and DVEBMSG00 directories. But, this is only half of the solution, because we need to move this services to another hosts.
We tried to use Software provisioning manager to deinstall the ASCS, and install it in the other host. This works. But the problem is the Primary application server, because if we uninstall it, when insttall in the other host with the option "System Copy" the sapinst promts for the installation export.
In the Marketplace i could not find any note form aour scenario.
Do you know a way to separate de CI and the PAS from de database server without a system copy?
Thanks and best regards.Hi
http://scn.sap.com/community/netweaver-administrator/blog/2013/12/04/why-splitting-off-the-ascs-from-pas
This link might be useful
But if you have a system based on SAP NetWeaver 7.0x, this option is not available in the 70SWPM, The only way to do that would be running a system copy of the system. Then during the target system installation, you would be able to install the new system with sepated ASCS from PAS . " -
Store values of different data types into single database field
Hi Friends,
I have to store values of different data types(character, numeric, date, time, text, etc) into a single database field(Char 80). Then read the same values and display it into ABAP Webdynpro report.
Appreciate any ideas, examples, suggestions.
Thanks
JBHi,
Try like this:
data: txt1 type string,
var1(1) type c,
var2(1) type n,
var3 like sy-datum,
var4 like sy-uzeit.
parameters: a type c,
b type n,
c like sy-datum,
d like sy-uzeit.
concatenate a b c d into txt1.
write txt1.
var1 = txt1+0(1).
var2 = txt1+1(1).
var3 = txt1+2(8).
var4 = txt1+8(8).
write: / var1,
/ var2,
/ var3,
/ var4.
Regards,
Bhaskar -
Use same report with same database structure to different database server.
Hi,
I have standard crystal reports which needs to be copied to another database server.
The origin database has exactly same database structure with the data base in other server.
My only question is how to change the connection of the crystal report file from old database server to new one without affecting the linked tables in the report. Would it be possible?
Note: origin database and new database has same structure, tables and columns but differ in data on it. and both has different server. (MS SQL)
Thanks,Hi Mark,
Open the report in the CR Designer > select Database option on the top > select Set Datasource location.
The pane on the top shows the current connection. Go ahead and create a new connection to the target database from the pane at the bottom. Once created, highlight one table from the top, highlight the corresponding table from the bottom pane and click Update. Do this for each table.
-Abhilash -
Two SharePoint server Farms using different configuration databases with same content DB's
Hi everyone,
I am having strange problem while cloning the environments for SharePoint 2007 farm. We cloned the WFE and DB servers with different names. When the configuration wizard has run pointing to the new DB server for complete the new FARM, The config is pointed
to the new Database server but the content databases remains same as old. This makes the production and cloned sites pointed to the same content.
How can this be possible to have a SharePoint farms with separate config DB's and same content DB's. Please advise and now the search service in the production is also broken.
Thanks keshav,Share point DeveloperHi,
This is one reason why you should always use SQL Aliases when configuring SharePoint
Stop the SharePoint Services, you can use Server Manager on the WFE
From the command line
Enter CLICONFG
Highlight TCPIP, Click Enable
Click on the Alias Tab, and Click Add
Click the TCPIP Radio Button
Enter the (Old Database Server Name) in the Server Alias Box
Enter the (Cloned Database Server Name) Server Name in the Server Name Box
Uncheck, Dynamically Assign
Enter Port 1433, and Click OK. Make sure on your new SQL Server that you don't have an inbound rule blocking Port 1433.
On the new Cloned Server WFE start the SharePoint Services
Run IISReset
On The WFE and the App Server. Start the SharePoint Services, you can use Server Manager
I would normally test this by stopping the SQL Service on the Old Server and login to SharePoint on the Cloned Server...
Cheers,
-Ivan -
More than one Database Server on one host
Hallo,
We want to implement two systems on one host with MaxDb as database. I know it is possible to run 2 DB-Instances on one host, is it possible to upgrade or patch one instance without inflicting the other one with this changes?
For example:
I have the development and test system on one host with two database instances running. is it possible to only upgrade the Database Instance of the Development System without upgrading the test instance.
I know it is possible in Oracle but is this also possible for MaxDB?
I hope you can give me an answer.
best regards,
Patrick VolnyHello Patrick,
1) "If I understand you correctly, I am able to patch each Instance separately but because the instances share the same kernel to upgrade an Database I have to upgrade all instances?"
Answer: You can update the database instance separately.
As the independent database software is shared between database instances, located in /sapdb/programs by default installation and it's downward compatible
==>
you could upgrade only one database instance & run the another database instance with the higher version of the independent database software.
Warning: Please follow the recommended structure of the database software installation & install the dependent on the version of the database system software once for each database instance.
By default it's installed in /sapdb/<SID>/db
Example : On the local server ::
dbmcli db_enum
OK
SC1#C:\sapdb\sc1\db #7.6.04.11#fast#running
SC1#C:\sapdb\sc1\db #7.6.04.11#slow#offline
LVC750#c:\sapdb\lvc750\db #7.6.00.21#fast#offline
LVC750#c:\sapdb\lvc750\db #7.6.00.21#slow#offline
xinstinfo SC1
IndepData : C:\sapdb\data
IndepPrograms : C:\sapdb\programs
InstallationPath : C:\sapdb\sc1\db
Kernelversion : KERNEL 7.6.04 BUILD 011-123-181-372
Rundirectory : c:\sapdb\data\wrk\SC1
xinstinfo LVC750
IndepData : C:\sapdb\data
IndepPrograms : C:\sapdb\programs
InstallationPath : c:\sapdb\lvc750\db
Kernelversion : KERNEL 7.6.00 BUILD 021-123-117-795
Rundirectory : c:\sapdb\data\wrk\LVC750
In my case, I have installed two database instances of the versions 7.6.00 BUILD 021 and 7.6.04 BUILD 011 on one server,
Independent database software is installed in C:\sapdb\programs and each database instance has own InstallationPath.
And you could run also 'sdbregview -l' to get the short list of all installed database packages, pay attention to the "Database Kernel" package
for the dependent database software installation path/version.
2) "I also read that to patch an instance you have to stop an x server service. But this service is necessary for the communication between applications and the database. so if i patch an instance the second one can't work properly?"
The X Server is needed for the client to establish the connection to a database instance located on a remote computer. As you know the X Server is the communication server for the database system. The X Server listens out for connection requests from clients such as database applications and database tools.
As I already wrote you, that the independent database software is downward compatible & you should not have the problems with the communication to the Test database on the TEST system.
I case you would like to know more details about the database version software, if there are any known problems, please update with additional information::
What are the current versions of the DEV and Test databases?
Did you install the application servers on the database server or not?
To what version of the database are you going to update the DEV database instance?
What is the version/SP of the SAP basis on the TEST system?
What is the version/patch of the SAP kernel on the TEST system?
3) The installation distinguishes between different software directories, as you already know.
For example, the following directories:
- <independent_program_path>
SAP Standard:/sapdb/programs
Run the command 'dbmcli -s dbm_getpath IndepProgPath' or 'xinstinfo' to get the current value on your system.
!!!! This directory contains instance- or version-independent software that works downwardly-compatible.
- <independent_data_path>
SAP Standard:/sapdb/data
Run the command 'dbmcli -s dbm_getpath IndepDataPath' or 'xinstinfo' to get the current value on your system.
- <independent_data_path>/config
SAP Standard:/sapdb/data/config
- <InstallationPath>
SAP standard: /sapdb/<SID>/db
- <run_directory>
SAP standard: /sapdb/data/wrk/SID
If you are SAP customer,
please see the SAP notes::
1020175 FAQ: MaxDB installation, upgrade or applying a patch
820824 FAQ: MaxDB / SAP liveCache technology
767598 Available documentation
&& SAP documentation link:
http://help.sap.com/saphelp_nw04/helpdata/en/23/d1a03cc24efd1de10000000a114084/frameset.htm
Thank you and best regards, Natalia Khlopina -
Invalid or unknown NLS parameter value specifiedBR0310E Connect to database
Dear all ,
While installing Db instance (4.7 e,HPIA64-oracle), in database update stati.
got error like
"WARNING 2008-03-19 01:36:25
Execution of the command "/sapmnt/C2P/exe/brconnect -u / -c -f crsyn -o SAPC2P" finished with return code 3. Output: BR0801I BRCONNECT 6.40 (11)BR0280I BRCONNECT time stamp: 2008-03-19 01.36.25BR0301E SQL error -12705 at location db_connect-2ORA-12705: invalid or unknown NLS parameter value specifiedBR0310E Connect to database instance C2P failed
ERROR 2008-03-19 01:36:25
CJS-00288 Could not update database statistics.<br>DIAGNOSIS: Command brconnect -u / -c -f crsyn -o SAPC2P returned 3.<br>SOLUTION: See brconnect.log for details.
Brconnect.log shows like
R0801I BRCONNECT 6.40 (11)
BR0280I BRCONNECT time stamp: 2008-03-19 01.36.25
BR0301E SQL error -12705 at location db_connect-2
ORA-12705: invalid or unknown NLS parameter value specified
BR0310E Connect to database instance C2P failed
BR0280I BRCONNECT time stamp: 2008-03-19 01.36.25
BR0804I BRCONNECT terminated with errors
How resolve this issue.
Regards,
satish kumarHi Sergo,
those notes are a bit outdated, that is the reason I indicate to read the FAQ.
If you read it carefully you will realize of several things:
1) the oracle client to be used depends on the SAP kernel version
2) the way the oracle client is "linked" with the kernel depends also on the version.
You can take a look at the powerpoint attached to the note.
For the sake of simplification I'll go from kernel 4.6D (and forgot the exceptions)
Kernel 4.6D was linked against oracle client 8.0
The ORA_NLS33 has to point to the NLS files of that version. But oracle made something easier.
Oracle NLS files for version 8.1 are also compatible with 8.0.
This means that, even when the client was 8.0, you could use NLS files of 8.1.7 without any error (the one is refered in this thread)
Another thing is that the oracle client library was included on the SAP kernel, it was statically linked, SAP only needed the NLS files.
This changed a little with newer kernels.
What happens with Kernel 6.20?
SAP does not includes the client inside the KERNEL, now the oracle library is dinamically linked. By default the kernel looks for it on the /oracle/client/81x_64/lib (assumming here 64 bit)
ORA_NLS33 can point to the oracle client or the oracle home, again we have compatibility.
But, then oracle start doing "funny" things with oracle 9i.
SAP kernel 6.40 is dynamically linked against this oracle client version. Now the search directory is /oracle/client/92x_64. But NLS files are not backwards compatible (later on Oracle provided information about a couple of environment variables to be able to use 9i nls files with 8x client)
it is more, nls files are not even compatible between oracle 9i versions.
For that reason, it could be that you have installed in your oracle home, lets say 9.2.0.7 and your ORA_NLS33 pointing to the oacle home.
But SAP kernel is using (if your environmet variables are OK) the library on the /oracle/client/92x_64 and you get the error ORA-12705 even when you think everything is OK.
Again, my recommendation is to follow the proper note.
If you are using a kernel that uses the client 9.2 then you have to configure the environment variables as the correspondent note for that client (539922 Installing the ORACLE client software 9.2.X for UNIX t) or other note that could complement it (like installing several clients on one server)
Hope the explanation is clear.
Note. This is only valid for UNIX, in windows it is a different history. -
How to FTP a file from client machine to database server using forms 10g
Hi
I want to ftp a file from a client machine to the database server machine using forms 10G (or PL/SQL).
could you please tell me how can I do this
Regardshi
How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
Solution
Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
here are steps to get a small test form running, using WebUtil 1.06.
Note: Oracle_Home is used as an alias for your real oDS ORACLE_HOME.
Feel free to copy this note to a text editor, and do a global find/replace on
Oracle_Home with your actual value (no trailing slash). Then it is easy to
copy/paste actual commands to be executed from the note copy.
1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
2) Copy or move jacob.jar and jacob.dll
C:\webutile is the folder where you extracted Jacob, and will end in ...\jacob_18
cd C:\webutile
copy jacob.jar Oracle_Home\forms\java\.
copy jacob.dll Oracle_Home\forms\webutil\.
The Jacob staging area is no longer needed, and may be deleted.
3) Sign frmwebutil.jar and jacob.jar
Open a DOS command prompt.
Add Oracle_Home\jdk\bin to the PATH:
set PATH=Oracle_Home\jdk\bin;%PATH%
Sign the files, and check the output for success:
Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\frmwebutil.jar
Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\jacob.jar
4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
you may skip this step. Otherwise,
Create a schema to hold the WebUtil stored code, and privileges needed to
connect and create a stored package. Schema name "WEBUTIL" is recommended
for no reason other than consistency over the user base.
Open Oracle_Home\forms\create_webutil_db.sql in a text editor, and delete or comment
out the EXIT statement, to be able to see whether the objects were created witout
errors.
Start SQL*Plus as SYSTEM, and issue:
CREATE USER webutil IDENTIFIED BY [password]
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp;
GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
CONNECT webutil/webutil@rcci
@Oracle_Home\forms\create_webutil_db.sql
-- Inspect SQL*Plus output for errors, and then
CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
Reconnect as SYSTEM, and issue:
grant execute on webutil_db to public;
5) Modify Oracle_Home\forms\server\default.env, and append Oracle_Home\jdk\jre\lib\rt.jar
to the CLASSPATH entry.
6) Modify Oracle_Home\forms\server\formsweb.cfg insde [default] add :
archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
archive=frmall.jar
also add :
[webutil]
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
baseHTML=webutilbase.htm
archive_jini=frmall_jinit.jar
WebUtilArchive=frmwebutil.jar,jacob.jar,f90all.jar
archive=frmwebutil.jar,f90all.jar
lookAndFeel=oracle
7) Modify Oracle_Home\forms\server\webutil.cfg and add :
transfer.database.enabled=TRUE
transfer.appsrv.enabled=TRUE
8) Start the OC4J instance
9) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
It is important to generate the PLX, to avoid the FRM-40039 discussed in Note 303682.1
If the PLX is not generated, the Webutil.pll library would have to be attached with
full path information to all forms wishing to use WebUtil. This is NOT recommended.
10) Create a new FMB.
Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
There is no need to Subclass the WebutilConfig object.
Attach the Webutil.pll Library, and remove the path.
Add an ON-LOGON trigger with the code
NULL;
to avoid having to connect to an RDBMS (optional).
Create a new button on a new canvas, with the code
show_webutil_information (TRUE);
in a WHEN-BUTTON-PRESSED trigger.
Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
11) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
the "Application Server URL" is empty.
Then append "?config=webutil" at the end, so you end up with a URL of the form
http://server:port/forms/frmservlet?config=webutil
12) Run your form. -
Reading text file from database server in OA Page
Hi Guys,
I am trying to embed an applet with in an OA Page. The applet is used to mainly for showing Gantt chart. I have to pass my connection details from OA Page to applet, I dont pass directly the connection details to the applet so i am placing all the server details, user name and password in a text file on the database server.
So from the OA Page i have to read the contents of the file on the database server and pass them to the applet using the <PARAM> tag. My question is how to read the text file from the database server.Any Inputs?
Thanks in advance for your help.
Regards,
Nagesh Manda.If the file to be read is on the database, then it makes sense to use the pl/sql code to read the file. Make a call to this pl/sql code from page controller to get back the values.
--Shiv -
Oracle 9i database server and Space
Hi,
I am new to Oracle. I installed 9i database server ( personal edition) on my machine at home just to play around and get a feel of Oracle. Unfortunately within a month my Harddrive was maxed out to full capacity of 72 Gigs. I had only used 12 Gigs when I first installed Oracle a month ago. I had to uninstall it completely from my computer. I am wondering if anyone has had this problem or how to rectify the problem
Thanks
RishiAs Justin said, verify all trace files.
You can see with sqlplus where they are
SQL> show parameter dump_dest
NAME TYPE VALUE
background_dump_dest string E:\oracle\admin\demo9i\bdump
core_dump_dest string E:\oracle\admin\demo9i\cdump
user_dump_dest string E:\oracle\admin\demo9i\udump
SQL> And you can see the size of each datafiles too, and verify if your undotbs is not in autoextend mode (it can growth) :
1 select substr(file_name,1,50), bytes/1024/1024 SizeMb, autoextensible
2 from dba_data_files
3 union
4 select substr(file_name,1,50), bytes/1024/1024 SizeMb, autoextensible
5 from dba_temp_files
6 union
7 select substr(a.member,1,50), bytes/1024/1024, ' '
8* from v$logfile a, v$log b where a.group#=b.group#
SQL> /
E:\ORACLE\ORADATA\DEMO9I\CWMLITE01.DBF 20 YES
E:\ORACLE\ORADATA\DEMO9I\DRSYS01.DBF 20 YES
E:\ORACLE\ORADATA\DEMO9I\EXAMPLE01.DBF 149,375 YES
E:\ORACLE\ORADATA\DEMO9I\INDX01.DBF 25 YES
E:\ORACLE\ORADATA\DEMO9I\ODM01.DBF 20 YES
E:\ORACLE\ORADATA\DEMO9I\REDO01_1.LOG 100
E:\ORACLE\ORADATA\DEMO9I\REDO02_1.LOG 100
E:\ORACLE\ORADATA\DEMO9I\REDO03_1.LOG 100
E:\ORACLE\ORADATA\DEMO9I\SYSTEM01.DBF 430 YES
E:\ORACLE\ORADATA\DEMO9I\TBS_TST_01.DBF 2 NO
E:\ORACLE\ORADATA\DEMO9I\TEMP01.DBF 40 NO
E:\ORACLE\ORADATA\DEMO9I\TOOLS01.DBF 10 YES
E:\ORACLE\ORADATA\DEMO9I\UNDOTBS01.DBF 405 YES
E:\ORACLE\ORADATA\DEMO9I\USERS01.DBF 25 YES
E:\ORACLE\ORADATA\DEMO9I\XDB01.DBF 46,875 YES
15 rows selected.
SQL> And to verify if you generate archivelog :
SQL> conn / as sysdba
Connected.
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination E:\oracle\ora92\RDBMS
Oldest online log sequence 38
Current log sequence 40
SQL> HTH,
Nicolas.
Message was edited by:
N. Gasparotto
Adding archive log list command -
How to get database server IP address?
I have Php backend website, where i have a text area to run sql queries against underlying Oracle 10g/solaris database.
I have ca 10 such Backend web sites, and 10 underlying Oracle databases for each website. Each Backend website lives different computer than Backend Php webserver.
I have problems to understand what is the database IP of the Backend website.
Can i query it?
My example wrong queries:
I know that underlying database in this example is with IP "192.168.2.165", but i canät manage to query that out, see:
This is not the database IP:
select UTL_INADDR.GET_HOST_ADDRESS from dual--127.0.0.1
This is some mysterical computer name that i cant ping:
select UTL_INADDR.GET_HOST_NAME from dual;--tar_071_z
This is wrong IP:
select UTL_INADDR.GET_HOST_ADDRESS('tar_071_z') from dual;--127.0.0.1
Wrong:
select UTL_INADDR.GET_HOST_ADDRESS( UTL_INADDR.GET_HOST_NAME ) from dual;--127.0.0.1
I don't know what IP is that:
select sys_context('USERENV','IP_ADDRESS') from dual;--192.168.2.160
My php-website i run queries in this example:
C:\Users\charlesr>ping myphpbackend.com
Pinging admin.live.casino.playtech.com [192.168.2.160] with 32 bytes of data:
Reply from 192.168.2.160: bytes=32 time=17ms TTL=252
Reply from 192.168.2.160: bytes=32 time=9ms TTL=252
Reply from 192.168.2.160: bytes=32 time=6ms TTL=252
Reply from 192.168.2.160: bytes=32 time=7ms TTL=252
Ping statistics for 192.168.2.160:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 6ms, Maximum = 17ms, Average = 9ms
C:\Users\charlesr>
C:\Users\charlesr>ping tar_071_z
Ping request could not find host tar_071_z. Please check the name and try again.
If i type Into my Windows 7 File Explorer address "\\tar_071_z" then it says it doesn't find the computer.
C:\Users\charlesr>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : videobet.corp
Link-local IPv6 Address . . . . . : fe80::702d:f154:fb5e:5c20%11
IPv4 Address. . . . . . . . . . . : 192.168.15.105
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.15.1
Tunnel adapter isatap.videobet.corp:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : videobet.corp
Tunnel adapter Teredo Tunneling Pseudo-Interface:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
C:\Users\charlesr>Edited by: CharlesRoos on 1.06.2011 10:59user8950100 wrote:
try this:
select sys_context('USERENV','IP_ADDRESS') from dual;That would give you the client ip address, not the server.
on a side note: working with IP address's is not advisable in large complex systems, should always try to use the hostname that way if IP address is changed does not impact the application conectivity....Why would you need the IP address of the database server anyway?
Each database should have a unique name, use that instead.
sql> select ora_database_name from dual;
ORA_DATABASE_NAME
xxxx.xx.xxx.xxx.xx(database name mangled to protect the innocent) -
How to send e-mail with an attachment from remote database server.???
Hi All,
I have tried the simple mail sending and with the attachment using UTL_SMTP. But the problem is , it is sending the mail with attachment of the file name i give, it takes and creates that file and sends as attachment not from the actual file location. I am trying to attach the file which i stored in remote database server.
The following code I tried. But not worked for attachment
DECLARE
v_From VARCHAR2(80) := '[email protected]';
v_Recipient VARCHAR2(80) := '[email protected]';
v_Subject VARCHAR2(80) := 'test subject';
v_Mail_Host VARCHAR2(30) := 'pop3.somedomain.com';
v_Mail_Conn utl_smtp.Connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
BEGIN
v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
utl_smtp.Mail(v_Mail_Conn, v_From);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
utl_smtp.Data(v_Mail_Conn,
'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
'From: ' || v_From || crlf ||
'Subject: '|| v_Subject || crlf ||
'To: ' || v_Recipient || crlf ||
'MIME-Version: 1.0'|| crlf || -- Use MIME mail standard
'Content-Type: multipart/mixed;'|| crlf ||
' boundary="-----SECBOUND"'|| crlf ||
crlf ||
'-------SECBOUND'|| crlf ||
'Content-Type: text/html;'|| crlf ||
'Content-Transfer_Encoding: 7bit'|| crlf ||
crlf ||
'some message text'|| crlf || -- Message body
'more message text'|| crlf ||
crlf ||
'-------SECBOUND'|| crlf ||
'Content-Type: text/html;'|| crlf ||
' name="Fund Authorization report"'|| crlf ||
'Content-Transfer_Encoding: 8bit'|| crlf ||
'Content-Disposition: attachment;'|| crlf ||
' filename="/usr/tmp/Test.html"'|| crlf ||
crlf ||
'HTML Attachment'|| crlf || -- Content of attachment
crlf ||
'-------SECBOUND--' -- End MIME mail
utl_smtp.Quit(v_mail_conn);
EXCEPTION
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END;How can I attach a file which is stored in database server and send it in a mail.
Please someone help me in this.
Thanks,
Alaka.Try this code
Regards Salim.
CREATE OR REPLACE TRIGGER EmailOnServerErr AFTER SERVERERROR ON DATABASE
DECLARE
mail_conn UTL_SMTP.connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
msg VARCHAR2(32760);
sid_name VARCHAR2(16);
bdump_dest VARCHAR2(128);
smtp_relay VARCHAR2(32) := 'MyMailRelay';
recipient_address VARCHAR2(64) := '[email protected]';
sender_address VARCHAR2(64) := '[email protected]';
mail_port NUMBER := 25;
log_file_handle UTL_FILE.FILE_TYPE;
log_file_dir VARCHAR2(256) := 'ERR_LOG_DIR';
log_file_name VARCHAR2(256) := 'OracleErrors.log';
maxlinesize NUMBER := 32767;
session_rec sys.v_$session%ROWTYPE;
audit_rec sys.dba_audit_trail%ROWTYPE;
auditing BOOLEAN;
LinesOfSQL BINARY_INTEGER;
offending_sql DBMS_STANDARD.ora_name_list_t;
CURSOR bdump_cur IS
SELECT TRIM(value)
FROM v$parameter
WHERE name = 'background_dump_dest'
CURSOR sid_cur IS
SELECT TRIM(instance_name)
FROM v$instance
CURSOR session_cur IS
SELECT s.*
FROM v$session s
WHERE s.sid = dbms_support.mysid
CURSOR audit_trail_cur(AUDSID IN NUMBER) IS
SELECT *
FROM dba_audit_trail
WHERE sessionid = AUDSID
BEGIN
IF (USER = 'SYSTEM' OR USER = 'SYS') THEN
-- Ignore this error
NULL;
ELSIF IS_SERVERERROR (1034) THEN
-- Ignore this error
NULL;
ELSE
-- get the sid
OPEN sid_cur;
FETCH sid_cur INTO sid_name;
CLOSE sid_cur;
-- get the location of the alert log
OPEN bdump_cur;
FETCH bdump_cur INTO bdump_dest;
CLOSE bdump_cur;
-- get the session information
OPEN session_cur;
FETCH session_cur INTO session_rec;
CLOSE session_cur;
-- get the audit_trail information if it exists
OPEN audit_trail_cur(session_rec.audsid);
FETCH audit_trail_cur INTO audit_rec;
auditing := audit_trail_cur%FOUND;
CLOSE audit_trail_cur;
IF session_rec.program = 'MyProgram.exe' THEN
NULL; -- ignore actions from MyProgram - that's where I do maintenance
ELSE
-- compose the message
msg := 'Subject: Oracle error '||' on '||sid_name||crlf;
msg := msg||'To: '||recipient_address||crlf;
msg := msg||'For more information see the alert log file located at:'||crlf;
msg := msg||bdump_dest||'/alert_'||sid_name||'.log'||crlf;
msg := msg||'or the error log file: $'||log_file_dir||'/'||log_file_name||crlf;
msg := msg||'Error Time='||TO_CHAR(SYSDATE,'DD-Mon-YYYY HH24:MI:SS')||crlf;
msg := msg||DBMS_UTILITY.FORMAT_CALL_STACK||crlf;
LinesOfSQL := sql_txt(offending_sql);
msg := msg||'Offending SQL is:'||crlf;
FOR loop_counter IN offending_sql.FIRST..offending_sql.LAST
LOOP
msg := msg||offending_sql(loop_counter);
END LOOP;
msg := msg||crlf||'----- PL/SQL Error Stack -----'||crlf;
msg := msg||DBMS_UTILITY.FORMAT_ERROR_STACK||crlf;
msg := msg||'V$SESSION.SADDR=' ||session_rec.saddr ||crlf;
msg := msg||'V$SESSION.SID=' ||session_rec.sid ||crlf;
msg := msg||'V$SESSION.SERIAL#=' ||session_rec.serial# ||crlf;
msg := msg||'V$SESSION.AUDSID=' ||session_rec.audsid ||crlf;
msg := msg||'V$SESSION.PADDR=' ||session_rec.paddr ||crlf;
msg := msg||'V$SESSION.USER#=' ||session_rec.user# ||crlf;
msg := msg||'V$SESSION.USERNAME='||session_rec.username||crlf;
msg := msg||'V$SESSION.COMMAND=' ||session_rec.command ||crlf;
msg := msg||'V$SESSION.OWNERID=' ||session_rec.ownerid ||crlf;
msg := msg||'V$SESSION.TADDR=' ||NVL(session_rec.taddr ,'Null')||crlf;
msg := msg||'V$SESSION.LOCKWAIT='||NVL(session_rec.lockwait,'Null')||crlf;
msg := msg||'V$SESSION.STATUS=' ||NVL(session_rec.status ,'Null')||crlf;
msg := msg||'V$SESSION.SERVER=' ||NVL(session_rec.server ,'Null')||crlf;
msg := msg||'V$SESSION.SCHEMA#=' ||session_rec.schema#||crlf;
msg := msg||'V$SESSION.SCHEMANAME=' ||NVL(session_rec.schemaname,'Null')||crlf;
msg := msg||'V$SESSION.OSUSER=' ||NVL(session_rec.osuser ,'Null')||crlf;
msg := msg||'V$SESSION.PROCESS=' ||NVL(session_rec.process ,'Null')||crlf;
msg := msg||'V$SESSION.MACHINE=' ||NVL(session_rec.machine ,'Null')||crlf;
msg := msg||'V$SESSION.TERMINAL=' ||NVL(session_rec.terminal ,'Null')||crlf;
msg := msg||'V$SESSION.PROGRAM=' ||NVL(session_rec.program ,'Null')||crlf;
msg := msg||'V$SESSION.TYPE=' ||NVL(session_rec.type ,'Null')||crlf;
msg := msg||'V$SESSION.SQL_ADDRESS=' ||session_rec.sql_address ||crlf;
msg := msg||'V$SESSION.SQL_HASH_VALUE=' ||NVL(TO_CHAR(session_rec.sql_hash_value) ,'Null')||crlf;
msg := msg||'V$SESSION.PREV_SQL_ADDR=' ||session_rec.prev_sql_addr||crlf;
msg := msg||'V$SESSION.PREV_HASH_VALUE='||NVL(TO_CHAR(session_rec.prev_hash_value),'Null')||crlf;
msg := msg||'V$SESSION.MODULE=' ||NVL(session_rec.module ,'Null')||crlf;
msg := msg||'V$SESSION.MODULE_HASH='||NVL(TO_CHAR(session_rec.module_hash),'Null')||crlf;
msg := msg||'V$SESSION.ACTION=' ||NVL(session_rec.action ,'Null')||crlf;
msg := msg||'V$SESSION.ACTION_HASH='||NVL(TO_CHAR(session_rec.action_hash),'Null')||crlf;
msg := msg||'V$SESSION.CLIENT_INFO='||NVL(session_rec.client_info ,'Null')||crlf;
msg := msg||'V$SESSION.FIXED_TABLE_SEQUENCE='||NVL(TO_CHAR(session_rec.fixed_table_sequence),'Null')||crlf;
msg := msg||'V$SESSION.ROW_WAIT_OBJ#=' ||NVL(TO_CHAR(session_rec.row_wait_obj#) ,'Null')||crlf;
msg := msg||'V$SESSION.ROW_WAIT_FILE#=' ||NVL(TO_CHAR(session_rec.row_wait_file#) ,'Null')||crlf;
msg := msg||'V$SESSION.ROW_WAIT_BLOCK#='||NVL(TO_CHAR(session_rec.row_wait_block#),'Null')||crlf;
msg := msg||'V$SESSION.ROW_WAIT_ROW#=' ||NVL(TO_CHAR(session_rec.row_wait_row#) ,'Null')||crlf;
msg := msg||'V$SESSION.LOGON_TIME=' ||NVL(TO_CHAR(session_rec.logon_time,'DD-Mon-YYYY HH24:MI:SS'),'Null')||crlf;
msg := msg||'V$SESSION.LAST_CALL_ET=' ||NVL(TO_CHAR(session_rec.last_call_et) ,'Null')||crlf;
msg := msg||'V$SESSION.PDML_ENABLED=' ||NVL(session_rec.pdml_enabled ,'Null')||crlf;
msg := msg||'V$SESSION.FAILOVER_TYPE=' ||NVL(session_rec.failover_type ,'Null')||crlf;
msg := msg||'V$SESSION.FAILOVER_METHOD='||NVL(session_rec.failover_method,'Null')||crlf;
msg := msg||'V$SESSION.FAILED_OVER=' ||NVL(session_rec.failed_over ,'Null')||crlf;
msg := msg||'V$SESSION.RESOURCE_CONSUMER_GROUP='||NVL(session_rec.resource_consumer_group,'Null')||crlf;
msg := msg||'V$SESSION.PDML_STATUS=' ||NVL(session_rec.pdml_status ,'Null')||crlf;
msg := msg||'V$SESSION.PDDL_STATUS=' ||NVL(session_rec.pddl_status ,'Null')||crlf;
msg := msg||'V$SESSION.PQ_STATUS=' ||NVL(session_rec.pq_status ,'Null')||crlf;
IF auditing THEN
msg := msg||'DBA_AUDIT_TRAIL.OS_USERNAME=' ||NVL(audit_rec.os_username,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.USERNAME=' ||NVL(audit_rec.username ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.USERHOST=' ||NVL(audit_rec.userhost ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.TERMINAL=' ||NVL(audit_rec.terminal ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.TIMESTAMP=' ||TO_CHAR(audit_rec.timestamp,'DD-Mon-YYYY HH24:MI:SS')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.OWNER=' ||NVL(audit_rec.owner ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.OBJ_NAME=' ||NVL(audit_rec.obj_name ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.ACTION=' ||audit_rec.action ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.ACTION_NAME=' ||NVL(audit_rec.action_name ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.NEW_OWNER=' ||NVL(audit_rec.new_owner ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.NEW_NAME=' ||NVL(audit_rec.new_name ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.OBJ_PRIVILEGE='||NVL(audit_rec.obj_privilege ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.SYS_PRIVILEGE='||NVL(audit_rec.sys_privilege ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.ADMIN_OPTION=' ||NVL(audit_rec.admin_option ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.GRANTEE=' ||NVL(audit_rec.grantee ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.AUDIT_OPTION=' ||NVL(audit_rec.audit_option ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.SES_ACTIONS=' ||NVL(audit_rec.ses_actions ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_TIME=' ||NVL(TO_CHAR(audit_rec.logoff_time) ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_LREAD=' ||NVL(TO_CHAR(audit_rec.logoff_lread) ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_PREAD=' ||NVL(TO_CHAR(audit_rec.logoff_pread) ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_LWRITE='||NVL(TO_CHAR(audit_rec.logoff_lwrite),'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_DLOCK=' ||NVL(audit_rec.logoff_dlock ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.COMMENT_TEXT=' ||NVL(audit_rec.comment_text ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.SESSIONID=' ||audit_rec.sessionid ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.ENTRYID=' ||audit_rec.entryid ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.STATEMENTID=' ||audit_rec.statementid ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.RETURNCODE=' ||audit_rec.returncode ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.PRIV_USED=' ||NVL(audit_rec.priv_used,'Null')||crlf;
END IF;
msg := msg||'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'||crlf||crlf;
-- write the message to the error log file
log_file_handle := UTL_FILE.FOPEN (log_file_dir, log_file_name, 'A',maxlinesize);
UTL_FILE.PUT_LINE(log_file_handle,msg);
UTL_FILE.FCLOSE(log_file_handle);
-- send the message by Email
mail_conn := UTL_SMTP.open_connection(smtp_relay, mail_port);
UTL_SMTP.HELO(mail_conn, smtp_relay);
UTL_SMTP.MAIL(mail_conn, sender_address);
UTL_SMTP.RCPT(mail_conn, recipient_address);
UTL_SMTP.DATA(mail_conn, msg);
UTL_SMTP.QUIT(mail_conn);
END IF; -- client_program = MyProgram.exe
END IF;
END;
/ -
Essbase Studio - Failed to Establish Connection With SQL Database Server
Hi all,
I am new to Hyperion and am having trouble deploying what seems a simple cube in Essbase Studio.
My environment is Windows 2003, EPM 11.1.1.2, SQL Server 2000.
I have the following two issues which may be related.
1. The EPM System Diagnostic tool says that Hyperion Foundation cannot connect to the SQL database.
Error:
Failed: Connection to database
Error: java.net.UnknownHostException: <server name: <server name>
Recommended Action:
Every other EPM application is able to connect to the database. I have tried re-configuring Foundation Services and checking the config files and nothing looks wrong. I would appreciate advice on how to fix this.
2 In Essbase Studio, I was able to connect to the database where the source data is, build the minischema and create dimensions and measures. But when I run the cube deployment wizard I get the error:
Message: Failed to deploy Essbase cube
Caused By: Failed to build Essbase cube dimension: (Time)
Caused By: Cannot incremental build. Essbase Error(1021001): Failed to Establish Connection With SQL Database Server. See log for more information
…ODBC Layer Error: [08001] ==> [[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL Server does not exist or access denied.]
I have checked the DSN as well as the connections set up within Studio, and they are all able to connect to the database. I am using the admin user for the Essbase server and have created a different user for the databases where the data resides and the shared services database. I tried using the same user all the way through and this didn’t help.
Can you please advise what else I can check or change to resolve this issue.
Also, can you work in EAS with cubes that are created in Studio? I tried looking at it and I got an error that the rule file couldn’t be accessed because it was created in Studio.
After the above failures, I tried creating a cube in EIS, with mixed success. I have been able to load the members and data without errors. But when I try to view the data in the cube, I am seeing field names for the measures instead of the data itself.
...Definitely more questions than answers at this stage of my learning.
Regards
MichelleMichelle,
I don't know if you found an answer to you question after so many months but I was hoping I could be helpful.
The issue you are experience happens often when the dimension that you are getting an error on, in this case TIME, is built from a snowflake lineage and there is a bad foreign key reference. This dimension is most like high-up in your outline build process for Essbase Studio and this prevents the build from happening usually early on.
Check your logs also. They are in Hyperion > Products > logs > essbase > essbasestudio.
You can also make your logs more verbose by setting a configuration variable in the essbase studio server.properties file but that should only be used for debugging as it really saps performance.
And, yes, you can of course edit an Essbase Studio deployed cube in EAS. However, any changes you make to the cube in EAS are subject to being wiped-out upon the next Essbase Studio deployment of that Applicaion/Database combo.
If you want to provide more detail, screenshots, etc. I would be glad to help where I can.
Cheers,
Christian
http://www.artofbi.com -
Export then Import to a different Hyper-V server
In http://social.technet.microsoft.com/Forums/en-US/winserverhyperv/thread/85dc7d36-491f-4b02-88ac-63c1ed0d94db I described a problem when exporting from a Hyper-V server and trying to import into a different Hyper-V server in a different domain. The import failed and the event log contained:
Failed to import the virtual machine from import directory 'D:\HV\Test\Test4GB-3\'. Error: One or more arguments are invalid(0x80070057)Well I've now identified the source of the problem. In the .exp file is:
<INSTANCE
CLASSNAME="Msvm_VirtualSystemGlobalSettingData">
<PROPERTY NAME="ScopeOfResidence" TYPE="string">
<VALUE>
e7668fbc-216e-4ed1-8ce3-3b932b42e22b
</VALUE>
</PROPERTY>
If I edit the .exp file and delete the <value>..</value> then the virtual machine imports with no errors.
Looks like a Hyper-V bug to me!
JRWe are not planning to fix this for Windows 2008 at the moment - as SCVMM work around the problem when they move virtual machines (they remove the scope section just like you have done here). But here is a handy VBScript that you can run on a Hyper-V server that will go through and nuke all the scopes (do not use this if you are still using SCVMM) so you can export and import happily (note that you need to run this before exporting):
Option Explicit
Dim WMIService
Dim VMList
Dim VM
Dim VMSystemGlobalSettingData
Dim VMManagementService
Dim Result
'Get instance of 'virtualization' WMI service on the local computer
Set WMIService = GetObject("winmgmts:\\.\root\virtualization")
'Get a VMManagementService object
Set VMManagementService = WMIService.ExecQuery("SELECT * FROM Msvm_VirtualSystemManagementService").ItemIndex(0)
'Get all the MSVM_ComputerSystem object
Set VMList = WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem")
For Each VM In VMList
if VM.Caption = "Virtual Machine" then
Set VMSystemGlobalSettingData = (VM.Associators_("MSVM_ElementSettingData", "Msvm_VirtualSystemGlobalSettingData")).ItemIndex(0)
VMSystemGlobalSettingData.ScopeOfResidence = ""
Result = VMManagementService.ModifyVirtualSystem(VM.Path_.Path, VMSystemGlobalSettingData.GetText_(1))
end if
Next
Cheers,
Benjamin Armstrong
============================
Windows Virtualization
Senior Lead Program Manager
This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use. -
How does Oracle client communicate with a database server
Looking to idenify how Oracle Database Client for OpenVMS communicates with database server and whether the protocol used is secure. Realize that it is using whatever the configured network protocol is (ie. tcpip) but is languauge it uses ( ie. SQL, etc..) secured/encrypted and if not what steps can be taken to encypt
Arizuddin wrote:
I have installed oracle client 10g on client pc for getting connection to Oracle databse 10g (runng on windows server) usng ODBC through SAGE ACC PAC (ERP). Working fine earlier. Now all of a suddent user starts complaining about database connection. When checked his pc registry values. Two values of ODBC keys are reset to null. Those are DSN and DRIVER values. How come this values reset to null? What is causing this to reset?Nothing in this has anything to do with the sever. You need to check what the client did on his machine that caused registry to get modified?
How does oracle ODBC works with Oracle database? Need to know all the steps involved?The connectoin from any client is initiated by a client process. This client process is supposed to get a server process to do his work. So if this is done, the client can work now with oracle . Please see the concepts guide for the gory details of the entire process.
HTH
Aman....
Maybe you are looking for
-
Default application for media files reverts with a fresh boot
I want my media files to open with VLC as the default application. I do the whole work-around: I select the file, I go to "Get Info," I choose "Open with: VLC" and I select "Change All" to use the application to open all files of the same type. That
-
Problem in running animation in forms runtime , can any body help me
Hi, I did a small project using forms 6I . When I run my project the first cansvas named Welcome Screen will be displayed. I.e this is the first canvas displayed. Now my problem is : In that WelcomeScreen canvas I placed a OLE object and inserte
-
Satellite P75-A7200 headphone jack not recognized at all
model number PSPLNU-00H004 i've tried updating all drivers etc, still will not pick up headphones when i plug them in. scanned for new devices in device manager and it just sees microphone and speakers, nothing else. any help would be appreciated
-
Package version identification
I just completed going through the http://developer.java.sun.com/developer/TechTips/1999/tt0414.html#tip2 article on "Package version identification" and based on the results I got, unless I did something wrong, I'd say that who ever implemented Java
-
Listing first user on basis of time
hi Sir/Madam, i am developing a Quiz and there is an entry question.if user answered that answer correct then the name,password and answer and TIme(what time he answered the question) is stored in text file shown below. I want to set this quiz on LAN