Tuesday, 23 January 2018

ORACLE MISCELLANEOUS

ORACLE MISCELLANEOUS

When you use DIRECT=Y this causes export to extract data by reading the data directly, bypassing the SQL Command Processing layer. This method can be much faster than a conventional path export.

Conventional path export uses the SQL SELECT statement to extract data from tables. Data is read from disk into a buffer cache, and rows are transferred to the evaluating buffer. The data, after passing expression evaluation, is transferred to the export client, which then writes the data into the export file.

In a direct path export, data is read from disk into the buffer cache and rows are transferred directly to the export client. The evaluating buffer is bypassed. The data is already in the format that export expects, thus avoiding unnecessary data conversion. The data is transferred to the export client, which then writes the data into the export file.


[23/10, 18:31] ‪+91 88845 46426‬: How to reduce sysaux tablespace occupancy due to fragmented tables and indexes, could you please suggest me
[23/10, 19:09] ‪+91 96996 17243‬: Doc id-1029252.6
[23/10, 19:09] ‪+91 96996 17243‬: Check this
[23/10, 19:10] ‪+91 96996 17243‬: Also check 1965061.1 and 287679.1
[23/10, 19:10] ‪+91 96996 17243‬: You can also rebuild indexes

[24/10, 13:37] ‪+91 82372 03726‬: I have a below table having two columns.
GENDER   NAME
M                 A
F                 B
F                 C
M                D

I need o/p like-
Name1   Name2
A              B
D              C
[24/10, 13:38] ‪+91 82372 03726‬: solve it
[24/10, 15:06] ‪+91 94715 28382‬: Use self join

Very good document for undo retention.

https://community.oracle.com/community/support/support-blogs/database-support-blog/blog/2015/12/10/ora-1555-do-you-know-how-to-resolve-this-issue

https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:275215756923

DB upgrade
http://dbaclass.com/article/upgrade-database-from-11g-to-12c-manually/


$ find . -name oraenv -print
./11204/bin/oraenv



if database is down , what and all you check

1st one is alert log and 2nd one is  server up time.




To get Oracle Dumps :

http://srimahesh-world.blogspot.in/2013/07/1z0-053-dump-free-download-oracle-11g.html?m=1

To get all dumps :

www.ora-certification.com

Demonstration of Linux Io

https://haydenjames.io/linux-server-performance-disk-io-slowing-application/

http://www.informit.com/articles/article.aspx?p=481867

You will get all DBA scripts.
http://itexpert-tech.com/oracle-database-administration-scripts-dba-bundle/

Rman scenario :
My requirement was to restore the RMAN backup in another server. At the time of restore i need only one tablespace need to restore because to export the deleted table.

Did any one have document plz share to my email id: ravipatisrinath@gmail.com



g1u2560c:home/oracle $ oerr ora 01677
01677, 00000, "standby file name convert parameters differ from other instance"
// *Cause: The DB_FILE_STANDBY_NAME_CONVERT or LOG_FILE_STANDBY_NAME_CONVERT
//         initialization parameters are not the same as in other instances
//         that already have the database mounted.
// *Action: Change initialization parameters DB_FILE_STANDBY_NAME_CONVERT and
//          LOG_FILE_STANDBY_NAME_CONVERT to match other instances.
g1u2560c:home/oracle $

http://oracle-dba-quickanswers.blogspot.com/2012/01/startup-of-rac-database-fails-with-ora.html



https://www.youtube.com/watch?v=CoN3nbB4tQc --> How to set display variable for oracle installation.


https://docs.oracle.com/cd/E19421-01/820-5016/ggxof/index.html ---> oracle dataguard

https://asktom.oracle.com/pls/asktom/f%3Fp%3D100:11:0::::P11_QUESTION_ID:5081036300346841765 ---> difference between static listener and dynamic listener. Why static listeners are needed for oracle dataguard.


http://www.dbaces.com/database-consulting-and-projects/database-performance-assessment-and-tuning - database tuning.

http://www.dbaces.com/resources/knowledge-base/112-oracle-listener-registration - excellent for static listeners and dynamic listeners.

how to create and add block values to table.


CREATE TABLE EVENTS(
  EVENTID INTEGER NOT NULL,
  SOURCE VARCHAR2(50 ),
  TYPE VARCHAR2(50 ),
  EVENT_DATE DATE,
  DESCRIPTION VARCHAR2(100 )
)
/


INSERT INTO EVENTS (EVENTID, "SOURCE", TYPE, EVENT_DATE, DESCRIPTION)
SELECT level, level, 'warning',
        TO_DATE(TRUNC(DBMS_RANDOM.VALUE(TO_CHAR(DATE '2000-01-01','J') ,TO_CHAR(DATE '9999-12-31','J'))),'J')
        ,dbms_random.value(1,100)
  FROM DUAL
CONNECT BY LEVEL <= 1000;


insert into scott.dept values(&num,'&name','&loc');


http://rocky-dba.blogspot.in/2017/12/blog-post.html

how to track alert log file.

http://www.oracle-ckpt.com/tracking-alert-log-file-by-xdbgalertext/

http://www.oracle-ckpt.com/table-fragmentation/

http://www.oracle-ckpt.com/database-administration/

http://www.oracle-ckpt.com/cpu-usage-queries/

http://www.oracle-ckpt.com/scripts-for-locks-and-blocking-sessions/

http://www.oracle-ckpt.com/unixos-scripts/

http://www.oracle-ckpt.com/snapshot-workload-repository-retention/



http://oraclerac-rips.blogspot.in/2012/11/tuning-oracle-disk-io-asm-configuration.html -- good


how to check ORA error solution using Oerr utility...

g1u3536:db_2/dbs $ oerr rman 06429
6429, 1, "%s database is not compatible with this version of RMAN"
// *Cause:  The indicated database is not compatible with this version of
//          the Recovery Manager (RMAN).  Other messages have also
//          been issued which detail the cause of the error.
// *Action: See the other messages.  If the database is CATALOG, then you may
//          be able to use the CREATE CATALOG or UPGRADE CATALOG commands
//          to correct the problem.  If the database is TARGET or AUXILIARY,
//          then you must either upgrade the target database or use a
//          newer version of the RMAN executable.


https://blog.dbi-services.com/querying-the-oracle-management-repository/ -- OEM


https://web.stanford.edu/dept/itss/docs/oracle/10gR2/backup.102/b14191/osrecov005.htm - restoring control files.


_______________________________________


HTTP protocol
Hypertext Transfer Protocol. A protocol that provides the language that enables Web browsers and application Web servers to communicate


WebDAV protocol
World Wide Web Distributed Authoring and Versioning. A protocol with a set of extensions to the HTTP protocol which allows users to manage files on remote Web servers.


An Oracle database is represented to clients as a service; that is, the database performs work on behalf of clients. A database can have one or more services associated with it.


To connect to a database service, clients use a connect descriptor that provides the location of the database and the name of the database service. 



(DESCRIPTION= 
  (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
  (CONNECT_DATA=
    (SERVICE_NAME=sales.us.acme.com)))



======================================

IM25957160

02/18/2018 18:23:36 US/Central (john.headley@hpe.com):
gvu0599.austin.hp.com is not a server it is an oracle vip.  Please check from your end as it is supposed to be up on g1u0523c.

g1u0525c:home/oracle $ srvctl status nodeapps -n g1u0523c
Network is enabled
Network is running on node: g1u0523c
GSD is disabled
GSD is not running on node: g1u0523c
ONS is enabled
ONS daemon is running on node: g1u0523c
PRKO-2165 : VIP does not exist on node(s) : g1u0523c

g1u0525c:home/oracle $ srvctl status nodeapps -n g1u0525c
VIP gvu0600.austin.hp.com is enabled
VIP gvu0600.austin.hp.com is running on node: g1u0525c
Network is enabled
Network is running on node: g1u0525c
GSD is disabled
GSD is not running on node: g1u0525c
ONS is enabled
ONS daemon is running on node: g1u0525c
g1u0525c:home/oracle $ srvctl status nodeapps -n g1u0524c
VIP gvu0601.austin.hp.com is enabled
VIP gvu0601.austin.hp.com is running on node: g1u0524c
Network is enabled
Network is running on node: g1u0524c
GSD is disabled
GSD is not running on node: g1u0524c
ONS is enabled
ONS daemon is running on node: g1u0524c
g1u0525c:home/oracle $ srvctl status nodeapps -n g1u0526c
VIP gvu0602.austin.hp.com is enabled
VIP gvu0602.austin.hp.com is running on node: g1u0526c
Network is enabled
Network is running on node: g1u0526c
GSD is disabled
GSD is not running on node: g1u0526c
ONS is enabled
ONS daemon is running on node: g1u0526c
>>>>>>>>>>>>>>>>>>>>>>>>>

02/18/2018 17:29:20 US/Central (murillo-alvarez@hpe.com):
Hello team

mentioned gvu0599 package is not listed in cluster:

g1u0523c:home/murilloa $ cmviewcl

CLUSTER        STATUS
gvc10523       up

  NODE           STATUS       STATE
  g1u0523c       up           running
  g1u0525c       up           running
  g1u0524c       up           running

    PACKAGE           STATUS           STATE            AUTO_RUN    NODE
    gvu0599-b         up               running          disabled    g1u0524c
    gvu0600-b         up               running          disabled    g1u0524c

  NODE           STATUS       STATE
  g1u0526c       up           running

    PACKAGE           STATUS           STATE            AUTO_RUN    NODE
    gvu0601-b         up               running          enabled     g1u0526c
    gvu0602-b         up               running          enabled     g1u0526c

MULTI_NODE_PACKAGES

  PACKAGE           STATUS           STATE            AUTO_RUN    SYSTEM
  SG-CFS-pkg        up               running          enabled     yes
  SG-CFS-DG02-ORA   up               running          enabled     no
  SG-CFS-DG03-ORA   up               running          enabled     no
  SG-CFS-DG04-ORA   up               running          enabled     no
  SG-CFS-DG05-ORA   up               running          enabled     no
  SG-CFS-DG06-ORA   up               running          enabled     no
  SG-CFS-DG07-ORA   up               running          enabled     no
  SG-CFS-DG08-ORA   up               running          enabled     no
  SG-CFS-DG10-ORA   up               running          enabled     no
  crsp              up               running          enabled     no


NSLOOKUP detects an IP and resolves the name:

Default Server:  resolver.hp.net
Address:  16.110.135.52

 gvu0599.austin.hp.com
Server:  resolver.hp.net
Address:  16.110.135.52

Non-authoritative answer:
Name:    gvu0599.austin.hp.com
Address:  16.236.21.103

 16.236.21.103
Server:  resolver.hp.net
Address:  16.110.135.52

Name:    gvu0599.austin.hp.com
Address:  16.236.21.103


C:\Users\mjorgeal>ping 16.236.21.103

Pinging 16.236.21.103 with 32 bytes of data:
Control-C

but no ping or ssh  connectivity

that IP is also not listed in the active NICs:

g1u0523c:home/murilloa $ netstat -in
Name      Mtu  Network         Address         Ipkts              Ierrs Opkts              Oerrs Coll
lan0:1    1500 16.236.20.0     16.236.21.89    25104              0     18356              0     0
lan13:80  1500 169.254.0.0     169.254.35.122  0                  0     0                  0     0
Warning: The above name 'lan13:801' is truncated, use -w to show the output in wide format
lan11     1500 16.237.0.0      16.237.2.74     144293             0     10797              0     0
lan9*     1500 none            none            0                  0     0                  0     0
lan8*     1500 none            none            0                  0     0                  0     0
lan0      1500 16.236.20.0     16.236.21.58    9794480            0     13415338           0     0
lo0      32808 127.0.0.0       127.0.0.1       688638             0     688659             0     0
lan13     1500 16.236.240.0    16.236.240.93   13876714           0     13859223           0     0


There are any entries for that package in log files:

g1u0523c:home/murilloa $ tail -f /var/adm/syslog/syslog.log  | grep 16.236.21.103
g1u0523c:home/murilloa $ tail  /var/adm/syslog/syslog.log  | grep 16.236.21.103
g1u0523c:home/murilloa $ tail  /var/adm/syslog/syslog.log  | grep gvu0599
g1u0523c:home/murilloa $


Please check

Thanks
>>>>>>>>>>>>>>>>>>>>>>>>>

02/18/2018 22:28:32 Greenwich/Universal (HPOO):
|OO - 077 - Automated Lean Dispatcher~ Run ID 10584088|
>>>>>>>>>>>>>>>>>>>>>>>>>

02/18/2018 16:24:24 US/Central (gusdlt92@hpe.com):
bundle lean (itio use only)
>>>>>>>>>>>>>>>>>>>>>>>>>

02/18/2018 22:23:46 Greenwich/Universal (HPOO):
|OO - 080 - Lean Interaction IM Elevation~ Incident generated per Lean SD Elevation SCR ruleID (32) SCR comparator runID (10584063)|
Service Recipient: rakesh.karam@hp.com
Contact: rakesh.karam@hp.com
${theJournal}
>>>>>>>>>>>>>>>>>>>>>>>>>
02/21/18 08:01:49 Greenwich/Universal (sla):
TTF - Low - Normal - Inc has hit 50% warning level
02/22/18 17:10:05 Greenwich/Universal (sla):
TTF - Low - Normal - Inc has been breached



-------------------------------------------


change permision of oracle directory or binary files and check what errors you get


-------------------------------------------------------------------------------------------



Subramanian, Saravanan
  1* select owner,index_name ,index_type from  dba_indexes where table_name='CORETRA'
SQL> /

OWNER                          INDEX_NAME                     INDEX_TYPE
------------------------------ ------------------------------ ---------------------------
WSSDBA                         CORETRA_KEY                    NORMAL
04:30
Subramanian, Saravanan 11:58 AM:

GDBA to rebuild index of CORETRA

George Peter, Nishant ((IS DBA Services)) 12:21 PM:

rebuid of WSSDBA.CORETRA_KEY  is completed
04:30
IM25988046
04:31
IM26007169
04:35

ALTER INDEX WSSDBA.CORETRA_KEY REBUILD ONLINE PARALLEL 32;


ALTER INDEX WSSDBA.CORETRA_KEY REBUILD PARALLEL 32;


select owner, index_name, table_name, status, degree from dba_indexes where index_name='CORETRA_KEY';

27 February 2018Karam, Rakesh (IS DBA Services)Hey .. Manoj ,
04:46TUesday and wednesday
04:46L3 people wont prepare HO..
04:46again I have to prepare for those day..
04:47Vakamalla, Manoj Reddy (IS DBA Services)Thursday and Friday who prepared then ?
04:47Karam, Rakesh (IS DBA Services)ok
04:48let it be
04:48Vakamalla, Manoj Reddy (IS DBA Services)If you have problem in prepring HO. No issues. yes or no should do bro.
No need all the details.
04:48you have to rebuild the index with no parallel again
04:57Karam, Rakesh (IS DBA Services)Bro... Ok .. will prepare , you dont do.
04:58Bro... Ok .. will prepareHO , you dont do.

04:58Why No parallel ?
04:58agian
04:58again
04:58Vakamalla, Manoj Reddy (IS DBA Services)I've already started HO
No issues you leave it.
04:59select owner, index_name, table_name, status, degree from dba_indexes where index_name='&index_name';
04:59
run this and enter index name
04:59
and then give me the output
04:59
Karam, Rakesh (IS DBA Services)
SQL> select owner, index_name, table_name, status, degree from dba_indexes where index_name='CORETRA_KEY';

OWNER                          INDEX_NAME
------------------------------ ------------------------------
TABLE_NAME                     STATUS   DEGREE
------------------------------ -------- ----------------------------------------
WSSDBA                         CORETRA_KEY
CORETRA                        VALID    32
05:00
 ---------------------------------------------------------------------------Vakamalla, Manoj Reddy (IS DBA Services)
alter index WSSDBA.CORETRA_KEY noparallel;
05:01
run this now
05:01
and then again run below query.

select owner, index_name, table_name, status, degree from dba_indexes where index_name='CORETRA_KEY';

05:01
then send me the output.
05:02
Karam, Rakesh (IS DBA Services)
SQL> alter index WSSDBA.CORETRA_KEY noparallel;

Index altered.

SQL> select owner, index_name, table_name, status, degree from dba_indexes where index_name='CORETRA_KEY';

OWNER                          INDEX_NAME
------------------------------ ------------------------------
TABLE_NAME                     STATUS   DEGREE
------------------------------ -------- ----------------------------------------
WSSDBA                         CORETRA_KEY
CORETRA                        VALID    1


SQL>
05:02
Vakamalla, Manoj Reddy (IS DBA Services)
got it ?
05:02
Karam, Rakesh (IS DBA Services)
Number of threads per instance for scanning the index

05:03
Degree means Number of threads per instance for scanning the index

05:04
If degree is more ,then index scanning wil be faster right
05:04
?
05:04
Vakamalla, Manoj Reddy (IS DBA Services)
When you see at the degree column, the value was 32 as you ran the index with 32 parallel. So, everytime a query uses this index, it will fetch the data in 32 parallel.
So, it will use lot of resources and keep much load on DB.
So, unless we keep the noparallel, it will be running in parallel and cause performance issues.
05:04
we need to run the rebuild index in parallel and again in no parallel.
05:05
to rebuild alone, we need to use parallel. So, once the rebuild is completed, we will make it to no parallel and just as single instance.

05:05
Karam, Rakesh (IS DBA Services)
Ok Thanks
05:05
Vakamalla, Manoj Reddy (IS DBA Services)
Np!
05:05

====================
query to check instance start time.

SQL> select STARTUP_TIME,INSTANCE_NAME from v$instance;

INSTANCE_NAME             HOST_NAME      STARTUP_TIME
CRNAP3               g1u3764c            2/24/2018 4:39:45 PM
CRNAP2               g1u3763c            8/26/2017 7:55:57 AM
CRNAP1               g1u3762c            8/24/2017 9:00:54 AM


http://www.oracle.com/technetwork/articles/linux/saternos-scripting-088882.html - Oracle techniques for shell scripting.



Background


Different processes such as lmon, lmd, and lms communicate with corresponding processes on other instances, so when the instance and database hang, those processes may be waiting for a resource such as a latch, an enqueue, or a data block.  Those processes that are waiting can not respond to the network ping or send any communication over the network to the remote instances.  As a result, other instances evict the problem instance.

You may see a message similar to the following in the alert.log of the instance that is evicting another instance:
Remote instance kill is issued [112:1]: 8
or
Evicting instance 2 from cluster

Query to check if data is increased recently in the tables.

SELECT
--SS.BEGIN_INTERVAL_TIME,
SS. END_INTERVAL_TIME,
STAT.SQL_ID,
PLAN_HASH_VALUE,
EXECUTIONS_TOTAL Executions,
-- round(ELAPSED_TIME_DELTA/1000/1000/60) Ela_time_delta_min,
round(ELAPSED_TIME_TOTAL/1000/1000/60) Ela_time_total_min,
--round(CPU_TIME_DELTA/1000/1000/60) CPU_time_min,
ROWS_PROCESSED_TOTAL ROWS_PROCESSED,
BUFFER_GETS_TOTAL BUFFER_GETS,
--round(decode(ROWS_PROCESSED_DELTA,O,BUFFER_GETS_DELTA,BUFFER_GETS_DELTA/ROWS_PROCESSED_DELTA)) BLOCKS_PER_ROW, DISK_READS_TOTAL DISK_READS,
SQL_PROFILE
FROM DBA_HIST_SQLSTAT STAT, DBA_HIST_SQLTEXT TXT, DBA_HIST_SNAPSHOT SS
WHERE STAT.SQL_ID = TXT.SQL_ID AND STAT.DBID = TXT.DBID
AND SS.DBID = STAT.DBID AND SS. INSTANCE_NUMBER = STAT.INSTANCE_NUMBER
AND STAT.SNAP_ID = SS.SNAP_ID
--AND SS. BEGIN_INTERVAL_TIME >= sysdate-60
AND UPPER(STAT.SQL_ID) = upper('&SQL_ID')
ORDER BY SS. END_INTERVAL_TIME desc,
ELAPSED_TIME_DELTA desc;

=================================

http://www.dba-oracle.com/art_oramag_rac_taf.htm

Oracle RAC and Hardware Failover
To detect a node failure, the Cluster Manager uses a background process?Global Enqueue Service Monitor (LMON)?to monitor the health of the cluster. When a node fails, the Cluster Manager reports the change in the cluster's membership to Global Cache Services (GCS) and Global Enqueue Service (GES). These services are then re-mastered based on the current membership of the cluster.
To successfully re-master the cluster services, Oracle RAC keeps track of all resources and resource states on each node and then uses this information to restart these resources on a backup node.

These processes also manage the state of in-flight transactions and work with TAF to either restart or resume the transactions on the new node. Now let's see how Oracle RAC and TAF work together to ensure that a server failure does not cause an unplanned service interruption.


http://www.orafaq.com/node/1840  -- Oracle connection is explained well