Get DBID
Hi friends,
I am new person. I saw lots of example abouy restore/revovery DB. How do I know a DBID ( for set DBID= ) during recovering DB or control file.
Thanks
Jim
You can see Note 227060.1 How To Determine The DBID When Using RMAN and Note:580414.1 RMAN - How to restore the controlfile using RMAN to know where you can get dbid and under what circumstances it's needed.
Enrique
PS. There another not documented ways to get the dbid as stated here: http://arjudba.blogspot.com/2008/05/how-to-discover-find-dbid.html
Similar Messages
-
Error during Backup/Recovery settings configuration
Hi all,
Using the Oracle Enterprise Manager 10g Application Server control,
i am configuring backup/recovery settings for my infrastructure tier in a 10g Rel 2 application server environment. however after specifying the various locations for Log Files, Configuration files, Metadata repository database backup etc i get the following error after clicking the 'Ok' button.
An Internal Error has occurred while performing the operation.
Performing configuration ...
oracle_sid: cinfra
The command /oracle/appn/oracle/infra/perl/bin/perl /oracle/appn/oracle/infra/backup_restore/bkp_restore.pl -m configure -h /oracle/appn/oracle/infra -f > /infrahome/backups/log_files/2009-12-06_17-13-38_output.log failed with return code 255
i am at a loss as to why i am having this error and how to fix it.
I examined the log file and saw an error snippet saying
*"Unable to get dbid from the database. Please ensure that ORACLE_HOME and ORACLE_SID are set to the same values used when starting up the database and that the database is open.... Failure: Configure failed"*
Also examined another file generated at the same time as the output log file and in there i saw the following
*"ld,so.1: oracle: fatal: relocation error: file /oracle/appn/oracle/product/10.2.0/cm2t/lib/libjox10.so: symbol kgestKguard_: referenced symbol not found*
*ERROR:*
*ORA-12547: TNS: lost contact*
*SP2-0751: Unable to connect to oracle. exiting SQL*Plus"*
Apart from the infrastructure database, i have another database with SID 'cm2t' on the same machine and i am suspecting that OEM Application server control is referencing the wrong file while it's doing it's work. How do i tell it to look in the right place if indeed that is the cause of my problem?
In my config.inp file all the right parameter values are in place.
Thanks.
Steve.Hi AMN,
Thanks for your reply. I managed to solve it by taking the following steps.
I use the runstartupconsole.sh script to start up my infrastructure tier. At startup it was using an LD_LIBRARY_PATH pointing to that used by an existing Oracle database instance on the same machine.
I set ORACLE_HOME, ORACLE_SID, LD_LIBRARY_PATH etc correctly before running the runstartupconsole.sh script and after that i was able to setup my backup/recovery settings properly.
I hope this will be useful to others.
Steve. -
Backng up failed with return code 255 ...Help!!!
Hi,
I am in a process of backing up Oracle application server 10g through "Configure Backup/Recovery Settings" feature of the app server, when I provide the directories for:
1. Log File Location
2. Configuration Files Backup Location
3. Metadata Repository Database Backup Location
4. Metadata Repository Database SID
and click on OK it provides me the following error:
"The command <ORACLE_HOME>/perl/5.6.1/bin/MSWin32-x86/perl.exe <ORACLE_HOME>\backup_restore/bkp_restore.pl -m configure -h <ORACLE_HOME> -f > <ORACLE_HOME>\backup_restore\logs/2008-12-06_13-36-02_output.log failed with return code 255"
And the log file says -"Unable to get dbid from the database."
Please Help..!!!
ThanksThis turns out to be a non-issue. I re-installed JDK 1.6,
thinking this might have been the problem, but as it turns out,
this Windows machine was a VM, and there haven't been any issues
with other VM's, only this one, leading me to conclude the problem
was the VM. We've since migrated off this machine and recycled
it. -
i have lost my spfile and i want get back from my backup
but i didnt record my dbid
what can i doyou can have dbid by
1. if you have your database
SELECT dbid FROM v$database;
2. if you have your recover catalog, connect as catalog owner and select from rc_database
3.if you have any old copy of controlfile, mount using that one, either connect via rman to get dbid or select * from v$database
4. if you have autobackup of controlfile enabled , you will see your dbid as part of your filename like C-2282329623-20030123-00
5.last resort is to get dbif from any of your old backup logs -
Logs are not getting applied in the standby database
Hello,
I have created a physical standby database and in it the logs are not getting applied..
following is an extract of the standby alert log
Wed Sep 05 07:53:59 2012
Media Recovery Log /u01/oracle/oradata/ABC/archives/1_37638_765704228.arc
Error opening /u01/oracle/oradata/ABC/archives/1_37638_765704228.arc
Attempting refetch
Media Recovery Waiting for thread 1 sequence 37638
Fetching gap sequence in thread 1, gap sequence 37638-37643
Wed Sep 05 07:53:59 2012
RFS[46]: Assigned to RFS process 3081
RFS[46]: Allowing overwrite of partial archivelog for thread 1 sequence 37638
RFS[46]: Opened log for thread 1 sequence *37638* dbid 1723205832 branch 765704228
Wed Sep 05 07:55:34 2012
RFS[42]: Possible network disconnect with primary database
However, the archived files are getting copied to the standby server.
I tried registering and recovering the logs but it also failed..
Follows some of the information,
Primary
Oralce 11R2 EE
SQL> select max(sequence#) from v$log where archived='YES';
MAX(SEQUENCE#)
37668
SQL> select DEST_NAME, RECOVERY_MODE,DESTINATION,ARCHIVED_SEQ#,APPLIED_SEQ#, SYNCHRONIZATION_STATUS,SYNCHRONIZED,GAP_STATUS from v$archive_dest_status where DEST_NAME = 'LOG_ARCHIVE_DEST_3';
DEST_NAME RECOVERY_MODE DESTINATION ARCHIVED_SEQ# APPLIED_SEQ# SYNCHRONIZATION_STATUS SYNCHRONIZED GAP_STATUS
LOG_ARCHIVE_DEST_3 MANAGED REAL TIME APPLY ABC 37356 0 CHECK CONFIGURATION NO RESOLVABLE GAP
Standby
Oralce 11R2 EE
SQL> select max(sequence#) from v$archived_log where applied='YES';
MAX(SEQUENCE#)
37637
SQL> select * from v$archive_gap;
no rows selected
SQL> select open_mode, database_role from v$database;
OPEN_MODE DATABASE_ROLE
READ ONLY WITH APPLY PHYSICAL STANDBY
Please help me to troubleshoot this and get the standby in sync..
Thanks a lot..the results are as follows..
SQL> select process, status, group#, thread#, sequence# from v$managed_standby order by process, group#, thread#, sequence#;
PROCESS STATUS GROUP# THREAD# SEQUENCE#
ARCH CLOSING 1 1 37644
ARCH CLOSING 1 1 37659
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
ARCH CONNECTED N/A 0 0
MRP0 WAIT_FOR_GAP N/A 1 37638
RFS IDLE N/A 0 0
RFS IDLE N/A 0 0
RFS IDLE N/A 0 0
RFS RECEIVING N/A 1 37638
RFS RECEIVING N/A 1 37639
RFS RECEIVING N/A 1 37640
RFS RECEIVING N/A 1 37641
RFS RECEIVING N/A 1 37642
RFS RECEIVING N/A 1 37655
RFS RECEIVING N/A 1 37673
RFS RECEIVING N/A 1 37675
42 rows selected.
SQL>
SQL> select name,value, time_computed from v$dataguard_stats;
NAME VALUE TIME_COMPUTED
transport lag +00 02:44:33 09/05/2012 09:25:58
apply lag +00 03:14:30 09/05/2012 09:25:58
apply finish time +00 00:01:09.974 09/05/2012 09:25:58
estimated startup time 12 09/05/2012 09:25:58
SQL> select timestamp , facility, dest_id, message_num, error_code, message from v$dataguard_status order by timestamp
TIMESTAMP FACILITY DEST_ID MESSAGE_NUM ERROR_CODE MESSAGE
05-SEP-12 Remote File Server 0 60 0 RFS[13]: Assigned to RFS process 2792
05-SEP-12 Remote File Server 0 59 0 RFS[12]: Assigned to RFS process 2790
05-SEP-12 Log Apply Services 0 61 16037 MRP0: Background Media Recovery cancelled with status 16037
05-SEP-12 Log Apply Services 0 62 0 MRP0: Background Media Recovery process shutdown
05-SEP-12 Log Apply Services 0 63 0 Managed Standby Recovery Canceled
05-SEP-12 Log Apply Services 0 64 0 Managed Standby Recovery not using Real Time Apply
05-SEP-12 Log Apply Services 0 65 0 Attempt to start background Managed Standby Recovery process
05-SEP-12 Log Apply Services 0 66 0 MRP0: Background Managed Standby Recovery process started
05-SEP-12 Log Apply Services 0 67 0 Managed Standby Recovery not using Real Time Apply
05-SEP-12 Log Apply Services 0 68 0 Media Recovery Waiting for thread 1 sequence 37638 (in transit)
05-SEP-12 Network Services 0 69 0 RFS[5]: Possible network disconnect with primary database
05-SEP-12 Network Services 0 70 0 RFS[6]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 71 0 RFS[14]: Assigned to RFS process 2829
05-SEP-12 Remote File Server 0 72 0 RFS[15]: Assigned to RFS process 2831
05-SEP-12 Network Services 0 73 0 RFS[9]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 74 0 RFS[16]: Assigned to RFS process 2833
05-SEP-12 Network Services 0 75 0 RFS[1]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 76 0 RFS[17]: Assigned to RFS process 2837
05-SEP-12 Network Services 0 77 0 RFS[3]: Possible network disconnect with primary database
05-SEP-12 Network Services 0 78 0 RFS[2]: Possible network disconnect with primary database
05-SEP-12 Network Services 0 79 0 RFS[7]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 80 0 RFS[18]: Assigned to RFS process 2848
05-SEP-12 Network Services 0 81 0 RFS[16]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 82 0 RFS[19]: Assigned to RFS process 2886
05-SEP-12 Network Services 0 83 0 RFS[19]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 84 0 RFS[20]: Assigned to RFS process 2894
05-SEP-12 Log Apply Services 0 85 16037 MRP0: Background Media Recovery cancelled with status 16037
05-SEP-12 Log Apply Services 0 86 0 MRP0: Background Media Recovery process shutdown
05-SEP-12 Log Apply Services 0 87 0 Managed Standby Recovery Canceled
05-SEP-12 Remote File Server 0 89 0 RFS[22]: Assigned to RFS process 2900
05-SEP-12 Remote File Server 0 88 0 RFS[21]: Assigned to RFS process 2898
05-SEP-12 Remote File Server 0 90 0 RFS[23]: Assigned to RFS process 2902
05-SEP-12 Remote File Server 0 91 0 Primary database is in MAXIMUM PERFORMANCE mode
05-SEP-12 Remote File Server 0 92 0 RFS[24]: Assigned to RFS process 2904
05-SEP-12 Remote File Server 0 93 0 RFS[25]: Assigned to RFS process 2906
05-SEP-12 Log Apply Services 0 94 0 Attempt to start background Managed Standby Recovery process
05-SEP-12 Log Apply Services 0 95 0 MRP0: Background Managed Standby Recovery process started
05-SEP-12 Log Apply Services 0 96 0 Managed Standby Recovery starting Real Time Apply
05-SEP-12 Log Apply Services 0 97 0 Media Recovery Waiting for thread 1 sequence 37638 (in transit)
05-SEP-12 Log Transport Services 0 98 0 ARCa: Beginning to archive thread 1 sequence 37644 (7911979302-7912040568)
05-SEP-12 Log Transport Services 0 99 0 ARCa: Completed archiving thread 1 sequence 37644 (0-0)
05-SEP-12 Network Services 0 100 0 RFS[8]: Possible network disconnect with primary database
05-SEP-12 Log Apply Services 0 101 16037 MRP0: Background Media Recovery cancelled with status 16037
05-SEP-12 Log Apply Services 0 102 0 Managed Standby Recovery not using Real Time Apply
05-SEP-12 Log Apply Services 0 103 0 MRP0: Background Media Recovery process shutdown
05-SEP-12 Log Apply Services 0 104 0 Managed Standby Recovery Canceled
05-SEP-12 Network Services 0 105 0 RFS[20]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 106 0 RFS[26]: Assigned to RFS process 2930
05-SEP-12 Network Services 0 107 0 RFS[24]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 108 0 RFS[27]: Assigned to RFS process 2938
05-SEP-12 Network Services 0 109 0 RFS[14]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 110 0 RFS[28]: Assigned to RFS process 2942
05-SEP-12 Network Services 0 111 0 RFS[15]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 112 0 RFS[29]: Assigned to RFS process 2986
05-SEP-12 Network Services 0 113 0 RFS[17]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 114 0 RFS[30]: Assigned to RFS process 2988
05-SEP-12 Log Apply Services 0 115 0 Attempt to start background Managed Standby Recovery process
05-SEP-12 Log Apply Services 0 116 0 MRP0: Background Managed Standby Recovery process started
05-SEP-12 Log Apply Services 0 117 0 Managed Standby Recovery starting Real Time Apply
05-SEP-12 Log Apply Services 0 118 0 Media Recovery Waiting for thread 1 sequence 37638 (in transit)
05-SEP-12 Network Services 0 119 0 RFS[18]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 120 0 RFS[31]: Assigned to RFS process 3003
05-SEP-12 Network Services 0 121 0 RFS[26]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 122 0 RFS[32]: Assigned to RFS process 3005
05-SEP-12 Network Services 0 123 0 RFS[27]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 124 0 RFS[33]: Assigned to RFS process 3009
05-SEP-12 Remote File Server 0 125 0 RFS[34]: Assigned to RFS process 3012
05-SEP-12 Log Apply Services 0 127 0 Managed Standby Recovery not using Real Time Apply
05-SEP-12 Log Apply Services 0 126 16037 MRP0: Background Media Recovery cancelled with status 16037
05-SEP-12 Log Apply Services 0 128 0 MRP0: Background Media Recovery process shutdown
05-SEP-12 Log Apply Services 0 129 0 Managed Standby Recovery Canceled
05-SEP-12 Network Services 0 130 0 RFS[32]: Possible network disconnect with primary database
05-SEP-12 Log Apply Services 0 131 0 Managed Standby Recovery not using Real Time Apply
05-SEP-12 Log Apply Services 0 132 0 Attempt to start background Managed Standby Recovery process
05-SEP-12 Log Apply Services 0 133 0 MRP0: Background Managed Standby Recovery process started
05-SEP-12 Log Apply Services 0 134 0 Managed Standby Recovery not using Real Time Apply
05-SEP-12 Log Apply Services 0 135 0 Media Recovery Waiting for thread 1 sequence 37638 (in transit)
05-SEP-12 Network Services 0 136 0 RFS[33]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 137 0 RFS[35]: Assigned to RFS process 3033
05-SEP-12 Log Apply Services 0 138 16037 MRP0: Background Media Recovery cancelled with status 16037
05-SEP-12 Log Apply Services 0 139 0 MRP0: Background Media Recovery process shutdown
05-SEP-12 Log Apply Services 0 140 0 Managed Standby Recovery Canceled
05-SEP-12 Remote File Server 0 141 0 RFS[36]: Assigned to RFS process 3047
05-SEP-12 Log Apply Services 0 142 0 Attempt to start background Managed Standby Recovery process
05-SEP-12 Log Apply Services 0 143 0 MRP0: Background Managed Standby Recovery process started
05-SEP-12 Log Apply Services 0 144 0 Managed Standby Recovery starting Real Time Apply
05-SEP-12 Log Apply Services 0 145 0 Media Recovery Waiting for thread 1 sequence 37638 (in transit)
05-SEP-12 Network Services 0 146 0 RFS[35]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 147 0 RFS[37]: Assigned to RFS process 3061
05-SEP-12 Network Services 0 148 0 RFS[36]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 149 0 RFS[38]: Assigned to RFS process 3063
05-SEP-12 Remote File Server 0 150 0 RFS[39]: Assigned to RFS process 3065
05-SEP-12 Network Services 0 151 0 RFS[25]: Possible network disconnect with primary database
05-SEP-12 Network Services 0 152 0 RFS[21]: Possible network disconnect with primary database
05-SEP-12 Remote File Server 0 153 0 Archivelog record exists, but no file is found
05-SEP-12 Remote File Server 0 154 0 RFS[40]: Assigned to RFS process 3067
05-SEP-12 Network Services 0 155 0 RFS[37]: Possible network disconnect with primary database -
Dispatcher getting stopped due to possible user/schema mismatch.Plz help
Hello All,
I have SAP Netweaver 7.01 ABAP AS installed on windows 2003. Was working fine but I had to have a bug fixed in win 2003 and restarted my SAP machine. Now, dispatcher is not running. Stops after a while. I have tried restarting SAP and the machine but dispatcher is not running. I looked at the dispatcher trace and dev_w0 but could not figure out the reason as I am new to SAP, please provide any pointers to solve this issue. Any general tips is also welcome. Timely help is greatly appreciated!
I have pasted parts of dev_disp and dev_w0 below. If you require more details, please let me know. Thank you very much!
-Arvind
dev_disp:
=========
trc file: "dev_disp", trc level: 1, release: "701"
sysno 00
sid NSP
systemid 560 (PC with Windows NT)
relno 7010
patchlevel 0
patchno 29
intno 20020600
make: multithreaded, Unicode, optimized
pid 3784
Fri Jun 10 19:25:12 2011
kernel runs with dp version 241000(ext=110000) (@(#) DPLIB-INT-VERSION-241000-UC)
length of sys_adm_ext is 576 bytes
*** SWITCH TRC-HIDE on ***
***LOG Q00=> DpSapEnvInit, DPStart (00 3784) [dpxxdisp.c 1261]
shared lib "dw_xml.dll" version 29 successfully loaded
shared lib "dw_xtc.dll" version 29 successfully loaded
shared lib "dw_stl.dll" version 29 successfully loaded
shared lib "dw_gui.dll" version 29 successfully loaded
shared lib "dw_mdm.dll" version 29 successfully loaded
rdisp/softcancel_sequence : -> 0,5,-1
use internal message server connection to port 3900
Fri Jun 10 19:25:18 2011
*** WARNING => DpNetCheck: NiAddrToHost(1.0.0.0) took 5 seconds
***LOG GZZ=> 1 possible network problems detected - check tracefile and adjust the DNS settings [dpxxtool2.c 5529]
MtxInit: 30000 0 0
DpSysAdmExtInit: ABAP is active
DpSysAdmExtInit: VMC (JAVA VM in WP) is not active
DpIPCInit2: start server >egsap701_NSP_00 <
DpShMCreate: sizeof(wp_adm) 13632 (1704)
DpShMCreate: sizeof(tm_adm) 4415616 (21968)
DpShMCreate: sizeof(wp_ca_adm) 1664 (80)
DpShMCreate: sizeof(appc_ca_adm) 1600 (80)
DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528056/528064
DpShMCreate: sizeof(comm_adm) 528064 (1048)
DpSlockTableSize: max/headSize/ftSize/fiSize/tableSize=0/0/0/0/0
DpShMCreate: sizeof(slock_adm) 0 (96)
DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
DpShMCreate: sizeof(file_adm) 0 (72)
DpShMCreate: sizeof(vmc_adm) 0 (1544)
DpShMCreate: sizeof(wall_adm) (38456/34360/64/184)
DpShMCreate: sizeof(gw_adm) 48
DpShMCreate: SHM_DP_ADM_KEY (addr: 07050040, size: 5042120)
DpShMCreate: allocated sys_adm at 07050040
DpShMCreate: allocated wp_adm at 07052170
DpShMCreate: allocated tm_adm_list at 070556B0
DpShMCreate: allocated tm_adm at 070556E0
DpShMCreate: allocated wp_ca_adm at 0748B760
DpShMCreate: allocated appc_ca_adm at 0748BDE0
DpShMCreate: allocated comm_adm at 0748C420
DpShMCreate: system runs without slock table
DpShMCreate: system runs without file table
DpShMCreate: allocated vmc_adm_list at 0750D2E0
DpShMCreate: allocated gw_adm at 0750D320
DpShMCreate: system runs without vmc_adm
DpShMCreate: allocated ca_info at 0750D350
DpShMCreate: allocated wall_adm at 0750D358
MBUF state OFF
DpCommInitTable: init table for 500 entries
rdisp/queue_size_check_value : -> off
ThTaskStatus: rdisp/reset_online_during_debug 0
*** ERROR => ztta/cua_area is 180000. [sapinit.c 975]
*** ERROR => ztta/cua_area adjusted to 500000. [sapinit.c 979]
EmInit: MmSetImplementation( 2 ).
MM global diagnostic options set: 0
<ES> client 0 initializing ....
<ES> InitFreeList
<ES> block size is 1024 kByte.
Using implementation view
<EsNT> Using memory model view.
<EsNT> Memory Reset disabled as NT default
<ES> 1023 blocks reserved for free list.
ES initialized.
rdisp/http_min_wait_dia_wp : 1 -> 1
***LOG CPS=> DpLoopInit, ICU ( 3.0 3.0 4.0.1) [dpxxdisp.c 1656]
***LOG Q0K=> DpMsAttach, mscon ( egsap701) [dpxxdisp.c 12362]
DpStartStopMsg: send start message (myname is >egsap701_NSP_00 <)
DpStartStopMsg: start msg sent
CCMS: alert/MONI_SEGM_SIZE = 0 monitoring and alerting switched off.
DpMsgAdmin: Set release to 7010, patchlevel 0
MBUF state PREPARED
MBUF component UP
DpMBufHwIdSet: set Hardware-ID
***LOG Q1C=> DpMBufHwIdSet [dpxxmbuf.c 1048]
DpMsgAdmin: Set patchno for this platform to 29
Release check o.K.
Fri Jun 10 19:25:58 2011
my types changed after wp death/restart 0xbf --> 0xbe
my types changed after wp death/restart 0xbe --> 0xbc
my types changed after wp death/restart 0xbc --> 0xb8
my types changed after wp death/restart 0xb8 --> 0xb0
my types changed after wp death/restart 0xb0 --> 0xa0
my types changed after wp death/restart 0xa0 --> 0x80
*** DP_FATAL_ERROR => DpWPCheck: no more work processes
*** DISPATCHER EMERGENCY SHUTDOWN ***
increase tracelevel of WPs
NiWait: sleep (10000ms) ...
NiISelect: timeout 10000ms
NiISelect: maximum fd=1565
NiISelect: read-mask is NULL
NiISelect: write-mask is NULL
Fri Jun 10 19:26:08 2011
NiISelect: TIMEOUT occured (10000ms)
dump system status
max_rq_id 11
wake_evt_udp_now 0
wake events total 7, udp 7 (100%), shm 0 ( 0%)
since last update total 7, udp 7 (100%), shm 0 ( 0%)
Workprocess Comm. Area Blocks Fri Jun 10 13:56:08 2011
=============================
Slots: 20, Used: 1, Max: 0
+------+--------------+----------+-------------+
| id | owner | pid | eyecatcher |
+------+--------------+----------+-------------+
| 0 | DISPATCHER | -1 | *WPCAAD000* |
<SNIP>
[DpProcDied] Process died (PID:3492 HANDLE:1540)
DpStartStopMsg: send stop message (myname is >egsap701_NSP_00 <)
DpStartStopMsg: Write AD_STARTSTOP message with type= 0, name=egsap701_NSP_00 , sapsysnr= 0, hostname=egsap701
AdGetSelfIdentRecord: > <
AdCvtRecToExt: opcode 60 (AD_SELFIDENT), ser 0, ex 0, errno 0
AdCvtRecToExt: opcode 4 (AD_STARTSTOP), ser 0, ex 0, errno 0
DpConvertRequest: net size = 189 bytes
<SNIP>
AdGetSelfIdentRecord: > <
AdCvtRecToExt: opcode 60 (AD_SELFIDENT), ser 0, ex 0, errno 0
AdCvtRecToExt: opcode 40 (AD_MSBUF), ser 0, ex 0, errno 0
AdCvtRecToExt: opcode 40 (AD_MSBUF), ser 0, ex 0, errno 0
blks_in_queue/wp_ca_blk_no/wp_max_no = 1/20/8
LOCK WP ca_blk 1
make DISP owner of wp_ca_blk 1
DpRqPutIntoQueue: put request into queue (reqtype 1, prio LOW, rq_id 14)
MBUF component DOWN
NiICloseHandle: shutdown and close hdl 2 / sock 1496
NiBufIClose: clear extension for hdl 2
MsIDetach: detach MS-system
cleanup EM
EsCleanup ....
EmCleanup() -> 0
Es2Cleanup: Cleanup ES2
***LOG Q05=> DpHalt, DPStop ( 3784) [dpxxdisp.c 10924]
Good Bye .....
dev_w0
========
trc file: "dev_w0", trc level: 1, release: "701"
* ACTIVE TRACE LEVEL 1
* ACTIVE TRACE COMPONENTS all, MJ
B
B Fri Jun 10 19:25:18 2011
B create_con (con_name=R/3)
B Loading DB library 'C:\usr\sap\NSP\DVEBMGS00\exe\dbsdbslib.dll' ...
B Library 'C:\usr\sap\NSP\DVEBMGS00\exe\dbsdbslib.dll' loaded
B Version of 'C:\usr\sap\NSP\DVEBMGS00\exe\dbsdbslib.dll' is "700.08", patchlevel (0.24)
B New connection 0 created
M sysno 00
M sid NSP
M systemid 560 (PC with Windows NT)
M relno 7010
M patchlevel 0
M patchno 29
M intno 20020600
M make: multithreaded, Unicode, optimized
M pid 2768
M
M kernel runs with dp version 241000(ext=110000) (@(#) DPLIB-INT-VERSION-241000-UC)
M length of sys_adm_ext is 576 bytes
M ***LOG Q0Q=> tskh_init, WPStart (Workproc 0 2768) [dpxxdisp.c 1323]
I MtxInit: 30000 0 0
M DpSysAdmExtCreate: ABAP is active
M DpSysAdmExtCreate: VMC (JAVA VM in WP) is not active
M DpShMCreate: sizeof(wp_adm) 13632 (1704)
M DpShMCreate: sizeof(tm_adm) 4415616 (21968)
M DpShMCreate: sizeof(wp_ca_adm) 1664 (80)
M DpShMCreate: sizeof(appc_ca_adm) 1600 (80)
M DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528056/528064
M DpShMCreate: sizeof(comm_adm) 528064 (1048)
M DpSlockTableSize: max/headSize/ftSize/fiSize/tableSize=0/0/0/0/0
M DpShMCreate: sizeof(slock_adm) 0 (96)
M DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
M DpShMCreate: sizeof(file_adm) 0 (72)
M DpShMCreate: sizeof(vmc_adm) 0 (1544)
M DpShMCreate: sizeof(wall_adm) (38456/34360/64/184)
M DpShMCreate: sizeof(gw_adm) 48
M DpShMCreate: SHM_DP_ADM_KEY (addr: 07050040, size: 5042120)
M DpShMCreate: allocated sys_adm at 07050040
M DpShMCreate: allocated wp_adm at 07052170
M DpShMCreate: allocated tm_adm_list at 070556B0
M DpShMCreate: allocated tm_adm at 070556E0
M DpShMCreate: allocated wp_ca_adm at 0748B760
M DpShMCreate: allocated appc_ca_adm at 0748BDE0
M DpShMCreate: allocated comm_adm at 0748C420
M DpShMCreate: system runs without slock table
M DpShMCreate: system runs without file table
M DpShMCreate: allocated vmc_adm_list at 0750D2E0
M DpShMCreate: allocated gw_adm at 0750D320
M DpShMCreate: system runs without vmc_adm
M DpShMCreate: allocated ca_info at 0750D350
M DpShMCreate: allocated wall_adm at 0750D358
M rdisp/queue_size_check_value : -> off
M ThTaskStatus: rdisp/reset_online_during_debug 0
Y *** ERROR => ztta/cua_area is 180000. [sapinit.c 975]
Y *** ERROR => ztta/cua_area adjusted to 500000. [sapinit.c 979]
X EmInit: MmSetImplementation( 2 ).
X MM global diagnostic options set: 0
X <ES> client 0 initializing ....
X Using implementation view
X <EsNT> Using memory model view.
M <EsNT> Memory Reset disabled as NT default
X ES initialized.
M ThInit: running on host egsap701
M
M Fri Jun 10 19:25:19 2011
M calling db_connect ...
C
C DBSDBSLIB : version 700.08, patch 0.024 (Make PL 0.29)
C MAXDB shared library (dbsdbslib) patchlevels (last 10)
C (0.024) Default value for max. input variables is 2000 (note 655018)
C (0.024) Profile parameter to define max. input variables (note 655018)
C (0.024) Switch SQLMODE after CREATE INDEX SERIAL (note 1267841)
C (0.024) Input parameters for SQL statements increased (note 655018)
C (0.018) Create index serial for MaxDB 7.6 (note 1267841)
C (0.018) More trace in case of packed to string conversion error (note 1262799)
C (0.016) R3trans export aborts with signal 6 (note 1262245)
C (0.009) IA64 alignment errors (note 1245982)
C (0.007) Support DB-Type 'SAP DB' by UPDSTAT (note 1225668)
C
C
C Loading SQLDBC client runtime ...
C SQLDBC SDK Version : SQLDBC.H 7.6.0 BUILD 002-121-083-965
C SQLDBC Library Version : libSQLDBC 7.6.5 BUILD 011-123-196-300
C SQLDBC client runtime is MaxDB 7.6.5.011 CL 196300
C SQLDBC supports new DECIMAL interface : 0
C SQLDBC supports VARIABLE INPUT data : 1
C SQLDBC supports keepAlive indicator : 0
C INFO : SQLOPT= -I 0 -t 0 -S SAPR3
C Try to connect (DEFAULT) on connection 0 ...
C Attach to SAP DB : Kernel 7.7.06 Build 007-123-197-046
C Database release is SAP DB 7.7.06.007
C INFO : Database 'NSP' instance is running on 'egsap701'
C DB max. input host variables : 2000
C INFO : SAP DB Packet_Size = 131072
C INFO : SAP DB Min_Reply_Size = 4096
C INFO : SAP DB Comm_Size = 126976
C INFO : DBSL buffer size = 126976
C INFO : SAP DB MaxLocks = 300000
C INFO : Connect to DB as 'SAPNSP'
C *** ERROR => the connected user (SAPNSP) does not work with the right user/schema
[dbslsdb.cpp 4818]
C *** ERROR => application has to work with schema SAPR3 (dbs/ada/schema)
[dbslsdb.cpp 4820]
M ***LOG R19=> ThInit, db_connect ( DB-Connect 000256) [thxxhead.c 1449]
M in_ThErrHandle: 1
M *** ERROR => ThInit: db_connect (step 1, th_errno 13, action 3, level 1) [thxxhead.c 10563]
M
M Info for wp 0
M
M pid = 2768
M severity = 0
M status = 0
M stat = WP_RUN
M waiting_for = NO_WAITING
M reqtype = DP_RQ_DIAWP
M act_reqtype = NO_REQTYPE
M rq_info = 0
M tid = -1
M mode = 255
M len = -1
M rq_id = 65535
M rq_source =
M last_tid = 0
M last_mode = 0
M semaphore = 0
M act_cs_count = 0
M csTrack = 0
M csTrackRwExcl = 0
M csTrackRwShrd = 0
M mode_cleaned_counter = 0
M control_flag = 0
M int_checked_resource(RFC) = 0
M ext_checked_resource(RFC) = 0
M int_checked_resource(HTTP) = 0
M ext_checked_resource(HTTP) = 0
M report = > <
M action = 0
M tab_name = > <
M attachedVm = no VM
M
M *****************************************************************************
M *
M * LOCATION SAP-Server egsap701_NSP_00 on host egsap701 (wp 0)
M * ERROR ThInit: db_connect
M *
M * TIME Fri Jun 10 19:25:19 2011
M * RELEASE 701
M * COMPONENT Taskhandler
M * VERSION 1
M * RC 13
M * MODULE thxxhead.c
M * LINE 10783
M * COUNTER 1
M *
M *****************************************************************************
M
M PfStatDisconnect: disconnect statistics
M Entering TH_CALLHOOKS
M ThCallHooks: call hook >BtcCallLgCl< for event BEFORE_DUMP
M ThCallHooks: call hook >ThrSaveSPAFields< for event BEFORE_DUMP
M *** ERROR => ThrSaveSPAFields: no valid thr_wpadm [thxxrun1.c 723]
M *** ERROR => ThCallHooks: event handler ThrSaveSPAFields for event BEFORE_DUMP failed [thxxtool3.c 261]
M Entering ThSetStatError
M ThIErrHandle: do not call ThrCoreInfo (no_core_info=0, in_dynp_env=0)
M Entering ThReadDetachMode
M call ThrShutDown (1)...
M ***LOG Q02=> wp_halt, WPStop (Workproc 0 2768) [dpnttool.c 334]Hello Rattandeep and Markus,
Thanks for explaining the error to me. I'm still facing the issue though!
My start profile is START_DVEBMGS00_egsap701 and instance profile is NSP_DVEBMGS00_egsap701 (they are included below).
In both profiles, the dbs/ada/schema has been currently deactivated. I get the same errors even after deactivating the parameter in both profiles. I also tried your suggestions by setting parameter values to SAPNSP and then to SAPR3 in both profiles but I'm still getting the same errors.
> the above log shows that you have to change the parameter with schema user SAPR3 instead of SAPNSP
You mean that the SAP system is started by SAPNSP user and since the profile is executed by SAPNSP user, we are getting the error? I don't know about the SAPR3 user or the user's credential. I only use bcuser/ddic RFC user to logon to SAP.
I don't know how to check the table space for SAPR3 database. As far as I know, BRTools is only for Oracle backends. So, I used Max DB database manager tool instead and found that the default NSP database has utilized about 50% data area (disk space). Overwrite mode is on and I have about 100% free log area (also determined through database manager tool). Still have not clue as to how to solve this. Please help. Thanks for your tips so far!
The start profile is as follows :
#.* Start profile START_DVEBMGS00_EGSAP701 *
#.* Version = 000004 *
#.* Generated by user = DDIC *
#.* Generated on = 27.04.2011 , 11:02:57 *
SAPSYSTEMNAME = NSP
SAPGLOBALHOST = egsap701
SAPSYSTEM = 00
INSTANCE_NAME = DVEBMGS00
DIR_CT_RUN = $(DIR_EXE_ROOT)\$(OS_UNICODE)\NTI386
DIR_EXECUTABLE = $(DIR_INSTANCE)\exe
DIR_PROFILE = $(DIR_INSTALL)\profile
_PF = $(DIR_PROFILE)\NSP_DVEBMGS00_egsap701
# Copy SAP Executables
Start_Program_00 = immediate $(DIR_CT_RUN)\sapcpe$(FT_EXE) pf=$(_PF)
# Start ABAP database
_DB = $(DIR_CT_RUN)\strdbs.cmd
Start_Program_01 = immediate $(_DB) NSP
# Start SAP message server
_MS = $(DIR_EXECUTABLE)\msg_server$(FT_EXE)
Start_Program_02 = local $(_MS) pf=$(_PF)
# Start application server
_DW = $(DIR_EXECUTABLE)\disp+work$(FT_EXE)
Start_Program_03 = local $(_DW) pf=$(_PF)
rsdb/dbid = NSP
#dbs/ada/schema = SAPNSP
Instance profile is as follows:
#.* Instance profile NSP_DVEBMGS00_EGSAP701 *
#.* Version = 000006 *
#.* Generated by user = DDIC *
#.* Generated on = 27.05.2011 , 11:30:39 *
SAPSYSTEMNAME = NSP
SAPGLOBALHOST = egsap701
SAPSYSTEM = 00
INSTANCE_NAME = DVEBMGS00
DIR_CT_RUN = $(DIR_EXE_ROOT)\$(OS_UNICODE)\NTI386
DIR_EXECUTABLE = $(DIR_INSTANCE)\exe
rdisp/wp_no_dia = 3
rdisp/wp_no_btc = 1
icm/server_port_0 = PROT=HTTP,PORT=80$$
# SAP Message Server parameters are set in the DEFAULT.PFL
ms/server_port_0 = PROT=HTTP,PORT=81$$
rdisp/wp_no_enq = 1
rdisp/wp_no_vb = 1
rdisp/wp_no_vb2 = 1
rdisp/wp_no_spo = 1
PHYS_MEMSIZE = 128
em/initial_size_MB = 10240
em/max_size_MB = 1024
abap/buffersize = 100000
#old_value: 0 changed: DDIC 27.04.2011 11:04:52
#old_value: 60000000 changed: DDIC 27.05.2011 11:29:55
alert/MONI_SEGM_SIZE = 0
enque/table_size = 2000
#parameter deactivated by: DDIC 27.05.2011 11:11:00
#rspo/local_print/method = 2
rsdb/ntab/entrycount = 5000
rsdb/ntab/ftabsize = 3000
rsdb/ntab/sntabsize = 100
rsdb/ntab/irbdsize = 1000
rsdb/cua/buffersize = 500
rsdb/obj/buffersize = 2048
rsdb/obj/max_objects = 500
rsdb/otr/buffersize_kb = 1000
rsts/ccc/cachesize = 6000000
rtbb/buffer_length = 500
rtbb/max_tables = 50
sap/bufdir_entries = 200
zcsa/presentation_buffer_area = 350000
zcsa/calendar_area = 300000
zcsa/table_buffer_area = 3000000
zcsa/db_max_buftab = 500
ztta/roll_area = 1000000
ztta/diag_area = 128000
ztta/dynpro_area = 150000
ztta/cua_area = 180000
rdisp/PG_SHM = 100
rdisp/PG_MAXFS = 256
rdisp/ROLL_SHM = 100
rdisp/ROLL_MAXFS = 2048
#old_value: 0 changed: DDIC 27.04.2011 11:04:52
#old_value: 300 changed: DDIC 27.05.2011 11:29:38
rdisp/autoabaptime = 0
rdisp/wp_ca_blk_no = 20
rdisp/appc_ca_blk_no = 20
rdisp/max_wprun_time = 30000
icm/min_threads = 5
icm/max_threads = 10
icm/max_conn = 20
mpi/total_size_MB = 10
rsdb/dbid = NSP
#parameter deactivated by: DDIC 27.05.2011 11:11:22
#dbs/ada/schema = SAPNSP -
We license our software by number of workstations.
I have a query that I have used for years to get an accurate count of the workstations logged in to my SQL Server database. For simplicity, all users use the same login name/password. This is built in to the script that attaches to the DB. They
have access only to that DB with the exception of
USE [Master] GRANT VIEW SERVER STATE to MyUser
The query that has been working is below:
Basically this relies on the mac address (Master.dbo.sysprocesses.net_addre
SELECT COUNT(Users) AS UserCount FROM (SELECT COUNT(Master.dbo.sysprocesses.hostname) AS Users FROM Master.dbo.sysprocesses LEFT OUTER JOIN Master.dbo.sysdatabases ON Master.dbo.sysdatabases.dbid = Master.dbo.sysprocesses.dbid WHERE (Master.dbo.sysdatabases.name = 'MyDatabase') GROUP BY Master.dbo.sysprocesses.net_address) AS UserCount_1
ss), since both Workstation names and ip addresses can be duplicated.
Recently this has stopped working at a number of customers. Suddenly individual workstations are showing multiple net addresses for the same workstation causing a substantial overcount of users. This may be related to SQL Server 2012 - not sure.
What I need is a very reliable way to get a count of workstations logged in to my database.
If anyone can tell me why I am suddenly getting multiple net_addresses for each workstation and how to prevent that that would be one possible solution.
Otherwise if anyone can give me a rock solid way to get a workstation count other than the above that would be great. Our largest customer is 50 users by the way.
Thanks in advance for any help.
KimI think your count is getting skewed because of duplicate rows in sysprocesses because of parallelism. Add DISTINCT to your query:
SELECT COUNT(Users) AS UserCount
FROM
( SELECT COUNT(DISTINCT Master.dbo.sysprocesses.hostname) AS Users
FROM Master.dbo.sysprocesses LEFT OUTER JOIN Master.dbo.sysdatabases
ON Master.dbo.sysdatabases.dbid = Master.dbo.sysprocesses.dbid
WHERE (Master.dbo.sysdatabases.name = 'MyDatabase'
GROUP BY Master.dbo.sysprocesses.net_address) AS UserCount_1
Satish Kartan www.sqlfood.com -
How to get status of a backup job
Hello everybody,
I scheduled our daily RMAN backup using the DBMS_SCHEDULER package. The DB job calls an external batch file which in turns calls rman's executable and passes it a command file containing the actual backup script. Similar to what's described here:
Problems with automated RMAN Backup in Oracle 11GR1 with DBMS_SCHEDULER
The backup works perfectly. The problem is that if I intentially corrupt the command file (simulating a backup failure) so that the backup fails, and then query the dba_scheduler_job_log view, I always get a status of SUCCEEDED. Regardless of the actual backup outcome, the job seems to always succeed. That's a problem for me, because I'd like to set up a user defined metric which would check the status of the job in dba_scheduler_job_log. If the job wasn't successfully executed, a mail would be sent.
Does anybody know why the job doesn't fail when it should? I also tried to execute the failing script manually and then checked the %ERRORLEVEL% environment variable. It has a value of 1, meaning error.
Btw, I know that if I schedule the same backup with Enterprise Manager's job system (instead of DBMS_SCHEDULER), the backup failure is correctly reported (and the metric works). The issue with EM is its limited scheduling capability - I do a full backup on Sunday, a cummulative incremental backup on Wednesday and all the other days a differential incremental backup. Since now I haven't found a way to define a schedule with an appropriate repeating interval. The only solution I figured out is to have 7 jobs, one for each day of the week....
Thanks in advance for any answers,
JureHi,
@alanm: I completely forgot checking that view :-) Using it is a solution, but I should probably set up a job chain to handle that (run backup & chack status in the view afterwards)....if there isn't be another solution, maye I'll do that. But then, maybe using 7 EM jobs is a simpler solution.
@RnR: I tried to execute the batch file manually from the command line like that:
C:\>echo %errorlevel%
0
C:\>rman target / cmdfile=backup_full.rcv
Recovery Manager: Release 10.2.0.3.0 - Production on Sre Jul 2 09:46:37 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: TESTDB (DBID=2890535676)
RMAN> RUN
2> {
3> aa;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "allocate, alter, backup, beginline,
blockrecover, catalog, change, copy, convert, crosscheck, configure, duplicate, debug, delete, exec
ute, endinline, flashback, host, mount, open, plsql, recover, release, replicate, report, restore, r
esync, set, setlimit, sql, switch, startup, shutdown, send, show, transport, validate"
RMAN-01008: the bad identifier was: aa
RMAN-01007: at line 3 column 1 file: backup_full.rcv
C:\>echo %errorlevel%
1
So the if the script fails, I get an errorlevel of 1. Is it possible that the status isn't propagated back to the Oracle job?
@alanm: I'm already appending to the log, but I don't see how can that affect the outcome status of the job?
Thanks for your answers.
Regards,
Jure -
30EA1: Database mounted, can't get rows with DATEs
I'm starting to use SQL Developer 3.0.02 build MAIN-02.37. I tried to use it with a 10g standby database that is only mounted, to check on its recovery progress, and it appears to NOT return rows with DATE columns in them. I've tried this with both a TNS connection and a basic connection. If the database is open, no problem.
Example: select instance_name, host_name, startup_time from v$instance;
If I remove the DATE column "startup_time" from the query, I get the expected rows. The Logging Page pane at the bottom shows ORA-01219 errors "database not open, queries allowed on fixed tables/views only."
I get that ORA-01219 message in TOAD against the mounted standby database, but I also get all the rows including the DATE column when I run the exact same statement there.
Is this a bug, or expected behaviour, or is there some setting I'm missing?
Edited by: gmaccrim on Nov 25, 2010 4:26 PMI have similar problem on standby database with query on v$database.
This query
SELECT name,dbid FROM V$database
works fine, but this one
SELECT name,dbid,created FROM V$database
doesn't return any row.
I have Version 2.1.1.64 Build MAIN-64.45. -
Trying to register 10.2.0.3 db in Rec Catalog using OEM, getting errors
Hi all,
I didn't know whether to post this here in the RMAN forum or in the OEM Grid Control forum, but the issue is more related to RMAN, so I'll post it here, and hope someone can help me out!
I have a new 10.2.0.3 database that I am getting configured to manage using OEM Grid Control. Through the OEM interface, I am trying to register this database with my recovery catalog - the recovery catalog is version 10.02.00.02. When I try to register this new db with the recovery catalog, I am getting this lengthy collection of errors:
Recovery Manager: Release 10.2.0.3.0 - Production on Wed Jan 30 14:58:36 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. RMAN> connected to target database: INSIGHT (DBID=4016731035) RMAN> connected to recovery catalog database PL/SQL package RMAN.DBMS_RCVCAT version 10.02.00.02 in RCVCAT database is not current PL/SQL package RMAN.DBMS_RCVMAN version 10.02.00.02 in RCVCAT database is not current RMAN> echo set on RMAN> register database; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of register command at 01/30/2008 14:58:40 RMAN-06004: ORACLE error from recovery catalog database: ORA-06550: line 1, column 2453: PLS-00302: component 'RESTORECMD_T' must be declared ORA-06550: line 1, column 2424: PL/SQL: Statement ignored RMAN> exit; Recovery Manager complete.
It sounds like it has something to do with the fact that my recovery catalog database is not at a current version?? In the OEM tool, I went to the page that lists the Recovery Catalog, and tried hitting the Update button, and it succeeded, but the Recovery Catalog version did not change, it is still at 10.02.00.02.
Can anyone give me some assistance on this one?
Thanks!
--BradHi,
please check with
select comp_name,status,version from dba_registry;
COMP_NAME
STATUS VERSION
Oracle Database Catalog Views
VALID 10.2.0.3.0
Oracle Database Packages and Types
UPGRADED 10.2.0.3.0
The UPGRADED status is not good. Run utlrp.sql again and then again as rman user the "upgrade catalog". Now it should work fine.
Bye
Matthias -
How do I get rid of this sql warning?
Hi folks,
I am running oracle 10.2.0 on Linux. I would like to get rid of this sql code warning
(Warning(151,3): PLW-07202: bind type would result in conversion away from column type)I get when I compile the code below. Basically Oracle does not like the idea of using a number in an expression with sysdate. eg (sampling_date < sysdate - p_n_value) where p_n_value is a number;
What is the best way to do this?
CREATE TABLE "USERDATA"."TBL_SESSION_SQL_WAIT_HISTORY"
( "SESSION_SQL_WAIT_HIST_SEQ_ID" NUMBER,
"DBID" NUMBER,
"SID" NUMBER,
"SEQ#" NUMBER,
"EVENT" VARCHAR2(64 BYTE),
"P1TEXT" VARCHAR2(64 BYTE),
"P1" NUMBER,
"P1RAW" RAW(8),
"P2TEXT" VARCHAR2(64 BYTE),
"P2" NUMBER,
"P2RAW" RAW(8),
"P3TEXT" VARCHAR2(64 BYTE),
"P3" NUMBER,
"P3RAW" RAW(8),
"WAIT_TIME" NUMBER,
"SECONDS_IN_WAIT" NUMBER,
"STATE" VARCHAR2(19 BYTE),
"SAMPLING_DATE" DATE,
"SAMPLING_TIME" VARCHAR2(8 BYTE),
"SERIAL#" NUMBER,
"USERNAME" VARCHAR2(30 BYTE),
"OSUSER" VARCHAR2(30 BYTE),
"PADDR" RAW(4),
"LOGON_TIME" DATE,
"PROCESS" VARCHAR2(24 BYTE),
"SQL_HASH_VALUE" NUMBER,
"SADDR" RAW(4),
"MODULE" VARCHAR2(48 BYTE),
"ROW_WAIT_OBJ#" NUMBER,
"ROW_WAIT_FILE#" NUMBER,
"ROW_WAIT_BLOCK#" NUMBER,
"ROW_WAIT_ROW#" NUMBER
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 16384 NEXT 65536 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERDATA" ;
CREATE TABLE "USERDATA"."TBL_SQLTEXT_WAIT_HISTORY"
( "SQLTEXT_SEQ_ID" NUMBER,
"DBID" NUMBER,
"ADDRESS" RAW(4),
"HASH_VALUE" NUMBER,
"SQL_ID" VARCHAR2(13 BYTE),
"COMMAND_TYPE" NUMBER,
"PIECE" NUMBER,
"SQL_TEXT_PIECE" VARCHAR2(64 BYTE),
"SQL_TEXT" VARCHAR2(1000 BYTE),
"DISK_READS" NUMBER,
"BUFFER_GETS" NUMBER,
"DIRECT_WRITES" NUMBER,
"PARSE_CALLS" NUMBER
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 16384 NEXT 65536 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERDATA" ;
create or replace
PROCEDURE data_coll AS
p_n_value userdata.tbl_options.n_value%type; -- number
BEGIN
-- irrelevant code here
select n_value into p_n_value from tbl_options where name ='PURGE_DAY_COUNT';
DELETE FROM tbl_sqltext_wait_history t where t.hash_value in
(select s.sql_hash_value from cc_session_sql_wait_history s
where s.sampling_date < sysdate - p_n_value
and s.sql_hash_value = t.hash_value);
DELETE FROM tbl_session_sql_wait_history
WHERE sampling_date < sysdate - p_n_value;
END;Thanks in advance for your feedback.
rgds, Efachim
Edited by: efachim on Jan 19, 2009 10:44 AMOne general suggestion.
"TBL_SESSION_SQL_WAIT_HISTORY"Did you create your table and column names within double quotes?
It will make your table as case sensitive.
Regards.
Satyaki De. -
How can I get an execution plan for a Function in oracle 10g
Hi
I have:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
I would like to know if is possible to get an EXECUTION PLAN for a FUNCTION if so, how can I get it ?
RegardsYou can query the AWR data if your interesting SQL consumes enough resources.
Here is a SQL*Plus script I call MostCPUIntensiveSQLDuringInterval.sql (nice name eh?)
You'll need to know the AWR snap_id numbers for the time period of interest, then run it like this to show the top 20 SQLs during the interval:
@MostCPUIntensiveSQLDuringInterval 20The script outputs a statement to run when you are interested in looking at the plan for an interesting looking statement.
-- MostCPUintesticeSQLDuringInterval: Report on the top n SQL statements during an AWR snapshot interval.
-- The top statements are ranked by CPU usage
col inst_no format 999 heading 'RAC|Node'
col sql_id format a16 heading 'SQL_ID'
col plan_hash_value format 999999999999 heading 'Plan|hash_value'
col parsing_schema_name format a12 heading 'Parsing|Schema'
col module format a10 heading 'Module'
col pct_of_total format 999.99 heading '% Total'
col cpu_time format 999,999,999 heading 'CPU |Time (ms)'
col elapsed_time format 999,999,999 heading 'Elapsed |Time (ms)'
col lios format 9,999,999,999 heading 'Logical|Reads'
col pios format 999,999,999 heading 'Physical|Reads'
col execs format 99,999,999 heading 'Executions'
col fetches format 99,999,999 heading 'Fetches'
col sorts format 999,999 heading 'Sorts'
col parse_calls format 999,999 heading 'Parse|Calls'
col rows_processed format 999,999,999 heading 'Rows|Processed'
col iowaits format 999,999,999,999 heading 'iowaits'
set lines 195
set pages 75
PROMPT Top &&1 SQL statements during interval
SELECT diff.*
FROM (SELECT e.instance_number inst_no
,e.sql_id
,e.plan_hash_value
,e.parsing_schema_name
,substr(trim(e.module),1,10) module
,ratio_to_report(e.cpu_time_total - b.cpu_time_total) over (partition by 1) * 100 pct_of_total
,(e.cpu_time_total - b.cpu_time_total)/1000 cpu_time
,(e.elapsed_time_total - b.elapsed_time_total)/1000 elapsed_time
,e.buffer_gets_total - b.buffer_gets_total lios
,e.disk_reads_total - b.disk_reads_total pios
,e.executions_total - b.executions_total execs
,e.fetches_total - b.fetches_total fetches
,e.sorts_total - b.sorts_total sorts
,e.parse_calls_total - b.parse_calls_total parse_calls
,e.rows_processed_total - b.rows_processed_total rows_processed
-- ,e.iowait_total - b.iowait_total iowaits
-- ,e.plsexec_time_total - b.plsexec_time_total plsql_time
FROM dba_hist_sqlstat b -- begining snap
,dba_hist_sqlstat e -- ending snap
WHERE b.sql_id = e.sql_id
AND b.dbid = e.dbid
AND b.instance_number = e.instance_number
and b.plan_hash_value = e.plan_hash_value
AND b.snap_id = &LowSnapID
AND e.snap_id = &HighSnapID
ORDER BY e.cpu_time_total - b.cpu_time_total DESC
) diff
WHERE ROWNUM <=&&1
set define off
prompt to get the text of the SQL run the following:
prompt @id2sql &SQL_id
prompt .
prompt to obtain the execution plan for a session run the following:
prompt select * from table(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID'));
prompt or
prompt select * from table(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID',NULL,NULL,'ALL'));
prompt .
set define on
undefine LowSnapID
undefine HighSnapIDI guess you'll need the companion script id2sql.sql, so here it is:
set lines 190
set verify off
declare
maxDisplayLine NUMBER := 150; --max linesize to display the SQL
WorkingLine VARCHAR2(32000);
CurrentLine VARCHAR2(64);
LineBreak NUMBER;
cursor ddl_cur is
select sql_id
,sql_text
from v$sqltext_with_newlines
where sql_id='&1'
order by piece
ddlRec ddl_cur%ROWTYPE;
begin
WorkingLine :='.';
OPEN ddl_cur;
LOOP
FETCH ddl_cur INTO ddlRec;
EXIT WHEN ddl_cur%NOTFOUND;
IF ddl_cur%ROWCOUNT = 1 THEN
dbms_output.put_line('.');
dbms_output.put_line(' sql_id: '||ddlRec.sql_id);
dbms_output.put_line('.');
dbms_output.put_line('.');
dbms_output.put_line('SQL Text');
dbms_output.put_line('----------------------------------------------------------------');
END IF;
CurrentLine := ddlRec.sql_text;
WHILE LENGTH(CurrentLine) > 1 LOOP
IF INSTR(CurrentLine,CHR(10)) > 0 THEN -- if the current line has an embeded newline
WorkingLine := WorkingLine||SUBSTR(CurrentLine,1,INSTR(CurrentLine,CHR(10))-1); -- append up to new line
CurrentLine := SUBSTR(CurrentLine,INSTR(CurrentLine,CHR(10))+1); -- strip off up through new line character
dbms_output.put_line(WorkingLine); -- print the WorkingLine
WorkingLine :=''; -- reset the working line
ELSE
WorkingLine := WorkingLine||CurrentLine; -- append the current line
CurrentLine :=''; -- the rest of the line has been processed
IF LENGTH(WorkingLine) > maxDisplayLine THEN -- the line is morethan the display limit
LineBreak := instr(substr(WorkingLine,1,maxDisplayLine),' ',-1); --find the last space before the display limit
IF LineBreak = 0 THEN -- there is no space, so look for a comma instead
LineBreak := substr(WorkingLine,instr(substr(WorkingLine,1,maxDisplayLine),',',-1));
END IF;
IF LineBreak = 0 THEN -- no space or comma, so force the line break at maxDisplayLine
LineBreak := maxDisplayLine;
END IF;
dbms_output.put_line(substr(WorkingLine,1,LineBreak));
WorkingLine:=substr(WorkingLine,LineBreak);
END IF;
END IF;
END LOOP;
--dbms_output.put(ddlRec.sql_text);
END LOOP;
dbms_output.put_line(WorkingLine);
dbms_output.put_line('----------------------------------------------------------------');
CLOSE ddl_cur;
END;
/ -
There is anyway to find the tables name where data is getting inserted currently.
Hi All,
I need T-Sql Query to find list of tables in which data is getting loaded currently.
Thanks Shiven:) If Answer is Helpful, Please VoteHi,
What About This Query:
SELECT B.TEXT,A.SESSION_ID,A.STATUS,A.COMMAND,A.CPU_TIME,A.TOTAL_ELAPSED_TIME,A.*,B.*
FROM SYS.DM_EXEC_REQUESTS A
CROSS APPLY SYS.DM_EXEC_SQL_TEXT (SQL_HANDLE) B
WHERE TEXT NOT LIKE '%SELECT B.TEXT,A.SESSION_ID,A.STATUS,A.COMMAND,A.CPU_TIME,A.TOTAL_ELAPSED_TIME,A.*,B.*%'
--AND TEXT LIKE '%'
ORDER BY START_TIME DESC
Thanks Shiven:) If Answer is Helpful, Please Vote
The query would return the currently executing query irrespective of insert. But, you are looking for the logging of table. Is my understanding wrong?
If you are looking for what is running on the server, then you can use the above script. The below is the one am using to get those info:
SELECT r.session_id ,
(Select Top 1 CON.client_net_address From sys.dm_exec_connections AS CON
where CON.session_id = r.session_id) Client_Address,
OBJECT_NAME(qt.objectid, qt.dbid),
r.[status] ,
r.wait_type ,
r.scheduler_id ,
SUBSTRING(qt.[text], r.statement_start_offset / 2,
( CASE WHEN r.statement_end_offset = -1
THEN LEN(CONVERT(NVARCHAR(MAX), qt.[text])) * 2
ELSE r.statement_end_offset
END - r.statement_start_offset ) / 2) AS [statement_executing] ,
DB_NAME(qt.[dbid]) AS [DatabaseName] ,
Object_NAME(qt.objectid) AS [ObjectName] ,
r.cpu_time ,
r.total_elapsed_time ,
r.reads ,
r.writes ,
r.logical_reads ,
r.plan_handle
FROM sys.dm_exec_requests AS r
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS qt
WHERE r.session_id > 50 and r.session_id <> @@SPID -
Trying to change DBNAME and DBID at a time
Hello all;
I am trying to change DBNAME AND DBID at a time. but getting error.
I am pasting following below wht i did. please have a look and help me to solve it.
SQL> select instance from v$thread ;
INSTANCE
clone
SQL> select name , dbid from v$database;
NAME DBID
CLONE 1028509667
SQL> alter database close;
Database altered.
SQL> select status from v$instance;
STATUS
MOUNTED
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ nid target=/ dbname=CLONEDB
DBNEWID: Release 10.2.0.4.0 - Production on Fri Oct 25 04:21:46 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to database CLONE (DBID=1028509667)
Connected to server version 10.2.0
Control Files in database:
/u01/app/oracle/oradata/clone/control01.ctl
/u01/app/oracle/oradata/clone/control02.ctl
/u01/app/oracle/oradata/clone/control03.ctl
Change database ID and database name CLONE to CLONEDB? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 1028509667 to 916366170
Changing database name from CLONE to CLONEDB
Control File /u01/app/oracle/oradata/clone/control01.ctl - modified
Control File /u01/app/oracle/oradata/clone/control02.ctl - modified
Control File /u01/app/oracle/oradata/clone/control03.ctl - modified
Datafile /u01/app/oracle/oradata/clone/system01.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/clone/undotbs01.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/clone/sysaux01.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/clone/users01.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/clone/example01.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/clone/temp01.dbf - dbid changed, wrote new name
Control File /u01/app/oracle/oradata/clone/control01.ctl - dbid changed, wrote new name
Control File /u01/app/oracle/oradata/clone/control02.ctl - dbid changed, wrote new name
Control File /u01/app/oracle/oradata/clone/control03.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to CLONEDB.
Modify parameter file and generate a new password file before restarting.
Database ID for database CLONEDB changed to 916366170.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
$ echo $ORACLE_SID
clone
[oracle@oel5 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Oct 25 04:26:52 2013
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
startup nomount pfile='/u01/app/oracle/admin/clone/pfile/initclone.ora';
ORACLE instance started.
Total System Global Area 608174080 bytes
Fixed Size 1268920 bytes
Variable Size 188744520 bytes
Database Buffers 415236096 bytes
Redo Buffers 2924544 bytes
SQL> alter database mount;
alter database mount
ERROR at line 1:
ORA-01103: database name 'CLONEDB' in control file is not 'CLONEDB '
--------------------------------- vi /u01/app/oracle/admin/clone/pfile/initclone.ora ---------------------
clone.__db_cache_size=415236096
clone.__java_pool_size=25165824
clone.__large_pool_size=4194304
clone.__shared_pool_size=159383552
clone.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/clone/adump'
*.background_dump_dest='/u01/app/oracle/admin/clone/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/clone/control01.ctl','/u01/app/oracle/oradata/clone/control02.ctl','/u01/app/oracle/oradata/clone/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/clone/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='clonedb '
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=cloneXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=201326592
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=605028352
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/clone/udump'
~
Thnaks in advance ..@ MahirM.Quluzade
Thanks
SQL> create spfile from pfile ='/u01/app/oracle/admin/clone/pfile/initclone.ora';
File created.
SQL> startup force;
ORACLE instance started.
Total System Global Area 608174080 bytes
Fixed Size 1268920 bytes
Variable Size 188744520 bytes
Database Buffers 415236096 bytes
Redo Buffers 2924544 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
Anything Else ? --- i mean above steps are correct or anything i missed ? -
To get information before one month
Hi,
All,
I have 10.2.0.3 database on AIX.
I try to create AWR report but there no snapshot available there. what are other alternative to get information before a month.
Thanks,
VishalWhat are you doing and where?
Run the following to find out for sure:
set pagesize 0
set linesize 121
col instart_fmt noprint;
col inst_name format a12 heading 'Instance';
col db_name format a12 heading 'DB Name';
col snap_id format 99999990 heading 'Snap Id';
col snapdat format a18 heading 'Snap Started' just c;
col lvl format 99 heading 'Snap|Level';
set heading on;
break on inst_name on db_name on host on instart_fmt skip 1;
ttitle off;
SELECT TO_CHAR(s.startup_time,' DD MON "at" HH24:MI:SS') INSTART_FMT,
di.instance_name INST_NAME, di.db_name DB_NAME, s.snap_id SNAP_ID,
TO_CHAR(s.end_interval_time,'DD MON YYYY HH24:MI') SNAPDAT,
s.snap_level LVL
FROM dba_hist_snapshot s, dba_hist_database_instance di
WHERE di.dbid = s.dbid
AND di.instance_number = s.instance_number
AND di.startup_time = s.startup_time
ORDER BY snap_id;Taken from the AWR entry in Morgan's Library at www.psoug.org.
If you need to change the snapshot retention window then look in the library for DBMS_WORKLOAD_REPOSITORY and the MODIFY_SNAPSHOT_SETTINGS procedure. You can set snapshot interval and retention.
Maybe you are looking for
-
OracleX509TrustManagerInterface missing in 9.2.01???
I found this in the documentation (ASO Admin Guide). I included the proper JARs in my classpath per the various installation instructions. I was able to successfully compile my code using my implementation of this interface. I then did a loadjava on
-
How to do that with Automator?
Hi there, I've a certain difficulty using Automator for my problem: Let's say that I have a folder named "Movie" on my desktok, and in it I have a movie (.avi, mp4 or whatever) and I also have a subtitled file (.srt) for subtitles. How can i do to se
-
[BUG] Business Components refactoring fails (TP4)
Hi, I tried to do some refactoring of Business Components without much success. Here's what I noted: - After renaming entities/view objects, names in the Application Navigator are not updated; - Moving associations/links to another package fails (the
-
I used a linksys router password protected. On my mac, i have to type in a "$" before the password. I've tried just the password and added the "$" at the beginning. Still can't connect. Any suggestions?
-
One control file corrupted, how to recover?
The first control file get corrupted, and the db can't start up. The second and third are ok. How can I recover the first control file and bring the db up? Thanks