Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all 1640 articles
Browse latest View live

Identify the Mapping device in ASM

$
0
0
The below script will find the device and associated mapping device.

#!/bin/bash
ORACLEASM=/usr/sbin/oracleasm
echo "ASM Disk Mappings"
echo "----------------------------------------------------"
for f in `$ORACLEASM listdisks`
do
dp=`$ORACLEASM querydisk -p  $f | head -2 | grep /dev | awk -F: '{print $1}'`
echo "$f: $dp"
done



Sample Output.
ASM Disk Mappings
----------------------------------------------------
test3_DATA: /dev/sdh1
test3_DATA_02: /dev/sdj1
test3_FRA: /dev/sdi1
test2_DATA_01: /dev/sdn1
test4_VOTE_01: /dev/sdm1
test4_VOTE_02: /dev/sdl1
test4_VOTE_03: /dev/sdo1
test1_DATA: /dev/sdc1
test1_DATA_02: /dev/sdp1
test1_FRA: /dev/sdd1
[oracle@testmachine:+ASM]




To identify the plan change of the query using sqlplus

$
0
0
The below query will help the dba to find out the plan change at the sqlplus level

set pagesize 1000
set linesize 200
column begin_interval_time format a20
column milliseconds_per_execution format 999999990.999
column rows_per_execution format 999999990.9
column buffer_gets_per_execution format 999999990.9
column disk_reads_per_execution format 999999990.9
break on begin_interval_time skip 1
SELECT
to_char(s.begin_interval_time,'mm/dd hh24:mi')
AS begin_interval_time,
ss.plan_hash_value,
ss.executions_delta,
CASE
WHEN ss.executions_delta > 0
THEN ss.elapsed_time_delta/ss.executions_delta/1000
ELSE ss.elapsed_time_delta
END AS milliseconds_per_execution,
CASE
WHEN ss.executions_delta > 0
THEN ss.rows_processed_delta/ss.executions_delta
ELSE ss.rows_processed_delta
END AS rows_per_execution,
CASE
WHEN ss.executions_delta > 0
THEN ss.buffer_gets_delta/ss.executions_delta
ELSE ss.buffer_gets_delta
END AS buffer_gets_per_execution,
CASE
WHEN ss.executions_delta > 0
THEN ss.disk_reads_delta/ss.executions_delta
ELSE ss.disk_reads_delta
END AS disk_reads_per_execution
FROM wrh$_sqlstat ss
INNER JOIN wrm$_snapshot s ON s.snap_id = ss.snap_id
WHERE ss.sql_id = '&sql_id'
AND ss.buffer_gets_delta > 0
ORDER BY s.snap_id, ss.plan_hash_value;


Sample output:


BEGIN_INTERVAL_TIME  PLAN_HASH_VALUE EXECUTIONS_DELTA MILLISECONDS_PER_EXECUTION ROWS_PER_EXECUTION BUFFER_GETS_PER_EXECUTION DISK_READS_PER_EXECUTION
-------------------- --------------- ---------------- -------------------------- ------------------ ------------------------- ------------------------
09/14 01:00    3397365948    118        114266.620  0.0      1403567.4       1330861.7
     3397365948    118        114266.620  0.0      1403567.4       1330861.7
09/14 02:00    3397365948    120         71123.629  0.0      1366799.1       1295165.8
     3397365948    120         71123.629  0.0      1366799.1       1295165.8





Fixing the Catctl upgrade issue "Unexpected error encountered in catctlMain; Error Stack Below; exiting"

$
0
0

Problem.

Unexpected error encountered in catctlMain; Error Stack Below; exiting
Unexpected error encountered in catconInit; exiting
Interrupted system call at catctl.pl line 2205.
at catctl.pl line 2205
main::catctlLogon() called at catctl.pl line 955
main::catctlMain() called at catctl.pl line 903
eval {…} called at catctl.pl line 901

Cause

OS authentication was not there for sys user

catctl.pl will use sys user which should have OS authentication

Solution

Explicitly  provide  the sys user in upgrade command as below :

For 12.1.x
You need to be in $ORACLE_HOME/rdbms/admin directory to run the catctl.pl :
$ cd $ORACLE_HOME/rdbms/admin
$ORACLE_HOME/perl/bin/perl catctl.pl -u SYS -n 6 -l $ORACLE_HOME/diagnostics catupgrd.sql

How to set the clusterware home in the Central inventory.

$
0
0
Goal:

Oracle clusterware/database utilities depend on "CRS=true" flag in central inventory to determine which is current clusterware home, if the flag is not set or set on wrong home, those utilities will fail. "CRS=true" is allowed to be only on active clusterware home(in upgraded case) as there can be only one active clusterware home per node


To set the flag on a three-node RAC cluster on UNIX:

On node1 as clusterware user:

/u01/app/grid/oui/bin/runInstaller -updateNodeList "racnode1,racnode2,racnode3" ORACLE_HOME="/u01/app/grid" CRS=true

## ==> /u01/app/grid is current clusterware home

To unset the flag on a three-node RAC cluster on UNIX:

On node1 as clusterware user:

/u01/app/grid_1/oui/bin/runInstaller -updateNodeList "racnode1,racnode2,racnode3" ORACLE_HOME="/u01/app/grid_1" CRS=false


To confirm the changes, review inventory.xml in central inventory.

Central inventory location is defined by parameter inventory_loc in /etc/oraInst.loc,

$ cat /etc/oraInst.loc | grep inventory_loc
inventory_loc=/u01/app/grid/oraInventory
$ cat /home/grid/oraInventory/ContentsXML/inventory.xml
..
<HOME NAME="Gridinfrahome1" LOC="/u01/app/grid" TYPE="O" IDX="4" CRS="true">
   <NODE_LIST>
      <NODE NAME="racnode1"/>
      <NODE NAME="racnode2"/>
       <NODE NAME="racnode3"/>
    </NODE_LIST>
</HOME>
..

Note: inventory.xml must not be modified manually to avoid inventory corruption.

Create a “CRS Managed" ACFS FileSystem On a Cluster RAC Configuration"

$
0
0
1) Please create the mount points on all the nodes (as root user):

[root@testdb ~]#  mkdir /goldengate

2) Connect to the ASM instance & create the ACFS diskgroup (from the +ASM1 instance):
SQL> CREATE DISKGROUP VOLTEST EXTERNAL REDUNDANCY
DISK 'ORCL:ASMDISK18' SIZE 4157 M
DISK 'ORCL:ASMDISK19' SIZE 4157 M
ATTRIBUTE 'compatible.asm' = '11.2', 'compatible.advm' = '11.2';
Diskgroup created.

3) Create the ACFS volume (from the +ASM1 instance):
SQL> ALTER DISKGROUP VOLTEST ADD VOLUME VOLTESTVOL SIZE 7G;
Diskgroup altered.

4) Verify the volume was created and obtain the new volume name:
[grid@testdb grid]$ asmcmd
ASMCMD> volinfo -a

Diskgroup Name: VOLTEST
Volume Name: VOLTESTVOL
Volume Device: /dev/asm/VOLTESTvol-76
State: ENABLED
Size (MB): 7168
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:

5) From the first node, please create the ACFS filesystem on the new volume ( e.g. “/dev/asm/VOLTESTvol-76”) as “grid” user:
[root@testdb ~]# /sbin/mkfs -t acfs -b 4k /dev/asm/voltestvol-76
mkfs.acfs: version = 11.2.0.1.0.0
mkfs.acfs: on-disk version = 39.0
mkfs.acfs: volume = /dev/asm/voltestvol-76
mkfs.acfs: volume size = 7516192768
mkfs.acfs: Format complete


6) Register the ACFS filesystem & new volume with the CRS as root user:
[root@testdb ~]#  <GI Oracle Home>/bin/srvctl add filesystem -d /dev/asm/VOLTESTvol-76 -g 'VOLTEST' -v VOLTESTVOL -m /goldengate -u oracle

7) Start the new ACFS CRS resource (as root user):

[root@testdb ~]# <GI Oracle Home>/bin/srvctl start filesystem -d /dev/asm/voltestvol-76

8) Set the desired new ownership and permissions as root user:
[root@testdb ~]# chown oracle:oinstall /goldengate
[root@testdb ~]# chmod 775 /goldengate

9) Verify the new ACFS CRS managed filesystem is mounted on both nodes:

Node #1
[root@asmgrid1 ~]# df -k /goldengate
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/asm/voltestvol-76  35651584   4590104  31061480  13% /goldengate
Node #2
[root@asmgrid2 ~]# df -k /goldengate
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/asm/voltestvol-76  35651584   4590104  31061480  13% /goldengate

10) Verify the ACFS CRS resource is present in the CRS:


[root@asmgrid1 ~]# crsctl stat res -w  "TYPE = ora.acfs.type"
NAME=ora.voltest.voltestvol.acfs
TYPE=ora.acfs.type
TARGET=ONLINE
STATE=ONLINE on asmgrid1, asmgrid2

Cluster addition failed with PRVG-1013

$
0
0

Problem:

Checking CRS home location...
PRVG-1013 : The path "/u01/app/grid" does not exist or cannot be created on the nodes to be added
Shared resources check for node addition failed

Cause;

New node grid home is set as existing home permision.
Existing Node:
[root@rac1 ~]# ls -ld /u01/app/grid
drwxr-xr-t 3 root oinstall 4096 Sep 18 10:28 /u01/app/grid


Solution:

On the new database node, change the directory permissions to GI home owner (say grid user).
For example, if the Grid Infrastructure Install user is grid and install group is oinstall, then do.

# chown -R grid:oinstall /u01

Once that is changed, the cluvfy/addNode.sh completes successfully.

Checking CRS home location...
Shared resources check for node addition passed

How to validate ASM diskgroup Normal status:

$
0
0
1) Shutdown CRS on all the nodes:

# crsctl stop crs

2) Then start the clusterware in exclusive mode on node #1:

# crsctl start crs -excl -nocrs

Note: On release 11.2.0.1, you need to use the next command:

# crsctl start crs -excl

3) Connect to the +ASM1 instance and then make sure all the diskgroups are mounted including the OCRVOTE diskgroup:

SQL> select name, state from v$asm_diskgroup;

4) If not, then mount them (example):
SQL. alter diskgroup OCRVOTE mount;

SQL> select name, state from v$asm_diskgroup;

5) Then shutdown the clusterware on node #1:

# crsctl stop crs -f

6) Now, start  the the clusterware in exclusive mode on node #2:

# crsctl start crs -excl -nocrs

Note: On release 11.2.0.1, you need to use the next command:

# crsctl start crs -excl


7) Connect to the +ASM2 instance and then make sure all the diskgroups are mounted including the
OCRVOTE diskgroup:

SQL> select name, state from v$asm_diskgroup;

8) If not, then mount them:

SQL. alter diskgroup OCRVOTE mount;
SQL> select name, state from v$asm_diskgroup;

9) Then shutdown the clusterware on node #2:

# crsctl stop crs -f

10) Please repeat the same steps on the additional nodes.

How to resolve the ora-600 with argument 4194

$
0
0
Problem:

The following error is occurring in the alert.log right before the database crashes.

 ORA-00600: internal error code, arguments: [4194], [#], [#], [], [], [], [], []

Cause:


This issue generally occurs when there is a power outage or hardware failure that initially crashes the database. On startup, the database does the normal roll forward (redo) and then rollback (undo), this is where the error is generated on the rollback.

 ORA-00600: internal error code, arguments: [4194], [#], [#], [], [], [], [], []

 This error indicates that a mismatch has been detected between redo records and rollback (undo) records.

 ARGUMENTS:
 Arg [a] - Maximum Undo record number in Undo block
 Arg [b] - Undo record number from Redo block

 Since we are adding a new undo record to our undo block, we would expect that the new record number is equal to the maximum record number in the undo block plus one. Before Oracle can add a new undo record to the undo block it validates that this is correct. If this validation fails, then an ORA-600 [4194] will be triggered.

Solution:

1. Create pfile from spfile to edit

SQL> Create pfile='/tmp/initsid.ora' from spfile;

2. Shutdown the instance

3. set the following parameters in the pfile /tmp/initsid.ora
 
    undo_management = manual
     event = '10513 trace name context forever, level 2'

4. SQL>>startup restrict pfile='/tmp/initsid.ora'

5. SQL>select tablespace_name, status, segment_name from dba_rollback_segs where status != 'OFFLINE';

 If tablespace is completely offline then continue to the next step or any other status contact oracle support.

6. Create new undo tablespace - example

SQL>create undo tablespace <new undo tablespace> datafile <datafile> size 2000M;

7. Drop old undo tablespace

SQL>drop tablespace <old undo tablespace> including contents and datafiles;

8. SQL>shutdown immediate;

9 SQL>startup nomount;  --> Using your Original spfile

10. Modify the spfile with the new undo tablespace name

SQL> Alter system set undo_tablespace = '<new tablespace created in step 6>' scope=spfile;

11. SQL>shutdown immediate;

12. SQL>startup;  --> Using spfile
 

Note:

The reason we create a new undo tablespace first is to use new undo segment numbers that are higher then the current segments being used.  This way when a transaction goes to do block clean-out the reference to that undo segment does not exist and continues with the block clean-out.

Schedule RMAN Backup in Database Using 12c New Feature for NON-CDB

$
0
0
Aim:
 we have the new feature of DBMS_SCHEDULER job type “BACKUP_SCRIPT”, that allows us to create backup jobs without creating them as an OS file, and without need for a wrapper script that’s called by a job type EXECUTABLE.
This is an example to create a scheduler job to run a backup job in 12c. With the introduction of backup_script in 12c, we can directly write scripts as if the RMAN interpreter is already invoked.

Solution:

1. Create a common user inside the container database

sql>create user bkpuser identified by bkpuser;

sql>grant connect, resource, create job, create external job, create credential to bkpuser;

2. Create a credential logged in as the common user. This ensures that script runs as the correct OS user on the server:

sql>begin
dbms_credential.create_credential(
credential_name => 'oracle_bkpuser',
username => 'oracle',
password => 'orclpswd'
);
end;
/

3. Prepare an rman script

$ vi sample_bkp.rman
connect target /
RUN
{
backup database plus archivelog;
crosscheck backup;
crosscheck archivelog all;
};

4. Create the scheduler job
sql> begin
dbms_scheduler.create_job(
job_name => sample_backup_job,
job_type => 'backup_script',
job_action => '/u01/app/oracle/scripts/sample_bkp.rman',
credential_name => 'oracle_bkpuser',
enabled => true
);
end;
/

5. Check the job status

column job_name format a20
select job_name, status, error# from dba_scheduler_job_run_details
where job_name=upper('&job_name);  -- Provide the job name "sample_backup_job"

RMAN 12C New Prompt Enhancement.

$
0
0

With RMAN 12c, We don't need to switch prompt. In RMAN prompt it self we can do the operation and we don't need to specify 'sql' for the command execution.

Sample Test:


RMAN> desc dba_profiles;
Name                              Null?           Type
----------------------------      --------         ----------------------------
PROFILE                           NOT NULL         VARCHAR2(128)
RESOURCE_NAME                     NOT NULL         VARCHAR2(32)
RESOURCE_TYPE                                      VARCHAR2(8)
LIMIT                                              VARCHAR2(128)
COMMON                                             VARCHAR2(3)

You can run DDL/DML Commands from RMAN Command prompt, but note that in order to insert you need to use:

RMAN> create table ora_table(col1 number, col2 varchar2(20));

Statement processed

RMAN> insert into ora_table values (1,'Test');

Statement processed

RMAN> update ora_table set col1=2;

Statement processed

RMAN> drop table ora_table;

Statement processed

The user can SHUTDOWN/STARTUP the database and also can use ALTER commands:

RMAN> shutdown immediate
database closed
database dismounted
Oracle instance shut down

RMAN> startup mount
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area    1610612736 bytes
Fixed Size                  2924928 bytes
Variable Size               520097408 bytes
Database Buffers            1073741824 bytes
Redo Buffers                13848576 bytes

RMAN> alter database open;
Statement processed

Benefit:

With this new SQL Interface improvement’s, users don’t need to switch between RMAN and SQL* Plus prompts during Backup & Recovery, administration…etc.

RMAN 12c DUPLICATE enhancements

$
0
0
Existing Version:

When you duplicate a database using RMAN DUPLICATE, the database is created and opened with RESETLOGS mode.

In 12c :

With Oracle database 12c, you can specify that the database must not be opened with “NOOPEN”
clause.

Situation for NOOPEN:

•If you need to make changes to initialization parameters after the duplication
•Opening the database conflict with other source database in the same server
•If you plan to create database for upgrade and want to open in upgrade mode

Sample Example:

The command below creates duplicate database, but it will not open.

RMAN> DUPLICATE TARGET DATABASE TO DB1 FROM ACTIVE DATABASE NOOPEN;

Unable to provision an Oracle SOA Suite Cloud Service due to error 'You must first create an Oracle Database Cloud Service'

$
0
0
Error :

Unable to provision an Oracle SOA Suite Cloud Service due to error 'You must first create an Oracle Database Cloud Service'

Issue :

The cause is that the Oracle Database Cloud Service backups are not enabled. SOA Cloud Service requires an "Oracle Database Cloud Service" with backups enabled to the "Oracle Storage Cloud Service"

Solution :

The "SOA Cloud Service" requires an "Oracle Database Cloud Service" with backups enabled to the "Oracle Storage Cloud Service".

If the "Oracle Database Cloud Service" does not have backups enabled, then it is not possible to create a "SOA Cloud Service".

Error During Oracle Java Cloud Service Server Backup

$
0
0
Error :
Error During Oracle Java Cloud Service Server Backup

Issue :

Error during Oracle Java Cloud Service server backup

Some files located under the middleware config home volume could not be read. Log in to the VM and use operating system commands to allow read access to the files at the path /u01/app/oracle/middleware. Then start the backup again. Until this problem is resolved, the instance cannot be backed up and other operations that require a backup, such as patching and scaling, will also fail.
Unable to start backup




Solution :

1. Login into your instance.
2. Run chmod -R 755 under /u01/app/oracle/middleware. 

Oracle Cloud : DB Startup Fails with "LRM-00101: unknown parameter name 'encrypt_new_tablespaces'" Error

$
0
0
Error :

Oracle Cloud : DB Startup Fails with "LRM-00101: unknown parameter name 'encrypt_new_tablespaces'" Error

Issue :

Patches 21923026 and 26984583 have been rolled back manually using OPatch


Solution :


Download and install DB PSU patch 27338041, 21923026 and 27702320 using the OPatch utility & then do the post steps.

Start the database.

Backup to Oracle Cloud Failing with Error: Failed to load Media Management Library, Additional information: 4004

$
0
0
Error :

Backup to Oracle Cloud Failing with Error: Failed to load Media Management Library, Additional information: 4004 



Issue :

Unable to backup on-premises database running on AIX operating system to Oracle Cloud.

RMAN backup  and sbttest diagnostic tool failing with errors.


Solution :


Change the configured stat at system restart from Defined to Available.

1. $ lsdev -c iocp
iocp0 Defined I/O Completion Ports
bash$ smitty iocp

2. Restart the server

3. Validate the new configuration:

bash$ lsdev -c iocp
iocp0 Available I/O Completion Ports

4. Run sbttest to test the cloud backup library:

bash$ sbttest a -libname /<cloud backup library path/libopc.so


RMAN Cloud Backup to Encrypted Storage Container Returns Error

$
0
0
Error : RMAN Cloud Backup to Encrypted Storage Container Returns Error


RMAN-03002: failure of backup command
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27023: skgfqsbi: media manager protocol error
ORA-19511: non RMAN, but media manager or vendor specific failure, error text:
KBHS-00208: server side encryption container demo_securex is not supported

Issue :

Bug 25836129 - Prevent Oracle Database Backup Cloud module to work with SSE containers

RMAN backups return inconsistent results when writing to an encrypted container

Solution :

Create non-encrypted container to house the RMAN backups. Encryption should be done within RMAN rather than the storage container. 

Oracle Database Backup Service Fails with: ORA-19511: - KBHS-00715: HTTP error occurred 'oracle-error'

$
0
0
Error :  Oracle Database Backup Service Fails with: ORA-19511: - KBHS-00715: HTTP error occurred 'oracle-error'



Issue :

The issue is caused by Bug 22481516 - ORA-19511: - KBHS-00715: HTTP error occurred 'oracle-error'

Solution :


1)  Download the latest updated Cloud Backup Module

2)  Rerun the Java Installer opc_install.jar. Make sure you specify -libDir option to update the SBT Library.

3)  Confirm you are using the latest library from the channel allocation

Find Shared Pool Advisory advice without taking AWR report

$
0
0
Find Shared Pool Advisory advice without taking AWR report:

SELECT SHARED_POOL_SIZE_FOR_ESTIMATE || ' MB' SHARED_POOL_SIZE_MB,
SHARED_POOL_SIZE_FACTOR*100 || '%' RESIZE_SHARED_POOL_PERC, ESTD_LC_SIZE,
ESTD_LC_MEMORY_OBJECTS, ESTD_LC_TIME_SAVED, ESTD_LC_TIME_SAVED_FACTOR, ESTD_LC_MEMORY_OBJECT_HITS
FROM V$SHARED_POOL_ADVICE;

Output:

SHARED_POOL_SIZE_MB  RESIZE_SHARED_POOL_PERC  ESTD_LC_SIZE ESTD_LC_MEMORY_OBJECTS ESTD_LC_TIME_SAVED ESTD_LC_TIME_SAVED_FACTOR ESTD_LC_MEMORY_OBJECT_HITS
-------------------- ------------------------ ------------ ---------------------- ------------------ ------------------------- --------------------------
336 MB               36.84%                              5                    878                377                     .9792                      37946
432 MB               47.37%                             68                   4043                385                         1                      38709
528 MB               57.89%                             68                   4043                385                         1                      38709
624 MB               68.42%                             68                   4043                385                         1                      38709
720 MB               78.95%                             68                   4043                385                         1                      38709
752 MB               82.46%                             68                   4043                385                         1                      38709
768 MB               84.21%                             68                   4043                385                         1                      38709
784 MB               85.96%                             68                   4043                385                         1                      38709
800 MB               87.72%                             68                   4043                385                         1                      38709
816 MB               89.47%                             68                   4043                385                         1                      38709
832 MB               91.23%                             68                   4043                385                         1                      38709
848 MB               92.98%                             68                   4043                385                         1                      38709
864 MB               94.74%                             68                   4043                385                         1                      38709
880 MB               96.49%                             68                   4043                385                         1                      38709
896 MB               98.25%                             68                   4043                385                         1                      38709
912 MB               100%                               68                   4043                385                         1                      38730
928 MB               101.75%                            68                   4043                385                         1                      38736
944 MB               103.51%                            68                   4043                385                         1                      38736
960 MB               105.26%                            68                   4043                385                         1                      38736
976 MB               107.02%                            68                   4043                385                         1                      38736
992 MB               108.77%                            68                   4043                385                         1                      38736
1008 MB              110.53%                            68                   4043                385                         1                      38736
1024 MB              112.28%                            68                   4043                385                         1                      38736
1040 MB              114.04%                            68                   4043                385                         1                      38736
1056 MB              115.79%                            68                   4043                385                         1                      38736
1104 MB              121.05%                            68                   4043                385                         1                      38736
1200 MB              131.58%                            68                   4043                385                         1                      38736
1296 MB              142.11%                            68                   4043                385                         1                      38736
1392 MB              152.63%                            68                   4043                385                         1                      38736
1488 MB              163.16%                            68                   4043                385                         1                      38736
1584 MB              173.68%                            68                   4043                385                         1                      38736
1680 MB              184.21%                            68                   4043                385                         1                      38736
1776 MB              194.74%                            68                   4043                385                         1                      38736
1872 MB              205.26%                            68                   4043                385                         1                      38736

34 rows selected.



rsrc_plan_status_detail.sql

$
0
0



SET TERMOUT OFF;
COLUMN current_instance NEW_VALUE current_instance NOPRINT;
SELECT rpad(instance_name, 17) current_instance FROM v$instance;
SET TERMOUT ON;

PROMPT 
PROMPT +------------------------------------------------------------------------+
PROMPT | Report   : Database Resource Manager - Resource Plans / Status         |
PROMPT | Instance : &current_instance                                           |
PROMPT +------------------------------------------------------------------------+

SET ECHO        OFF
SET FEEDBACK    6
SET HEADING     ON
SET LINESIZE    180
SET PAGESIZE    50000
SET TERMOUT     ON
SET TIMING      OFF
SET TRIMOUT     ON
SET TRIMSPOOL   ON
SET VERIFY      OFF

CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTES

COLUMN resource_plan_name         FORMAT a30    HEAD 'Resource Plan Name'           JUST left
COLUMN num_plan_directives        FORMAT 999    HEAD '# of Plan|Directives'         JUST left
COLUMN cpu_method                 FORMAT a9     HEAD 'CPU|Method'                   JUST left
COLUMN active_sess_pool_mth       FORMAT a25    HEAD 'Active Sess|Pool Method'      JUST left
COLUMN parallel_degree_limit_mth  FORMAT a30    HEAD 'Parallel Degree|Limit Method' JUST left
COLUMN queueing_mth               FORMAT a13    HEAD 'Queueing|Method'              JUST left
COLUMN status                     FORMAT a10    HEAD 'Status'                       JUST left
COLUMN mandatory                  FORMAT a10    HEAD 'Mandatory?'                   JUST left
COLUMN run_status                  FORMAT a11    HEAD 'Run|Status'                   JUST left

SELECT
    a.plan                       resource_plan_name
  , a.num_plan_directives       num_plan_directives
  , a.cpu_method                 cpu_method
  , a.active_sess_pool_mth       active_sess_pool_mth
  , a.parallel_degree_limit_mth parallel_degree_limit_mth
  , a.queueing_mth               queueing_mth
  , a.status                     status
  , a.mandatory                  mandatory
  , DECODE(b.name, a.plan, 'Running', 'Not Running')  run_status
FROM
    dba_rsrc_plans a LEFT OUTER JOIN v$rsrc_plan b ON (a.plan = b.name)
/

mts_dispatcher_status.sql

$
0
0
SET TERMOUT OFF;
COLUMN current_instance NEW_VALUE current_instance NOPRINT;
SELECT rpad(instance_name, 17) current_instance FROM v$instance;
SET TERMOUT ON;

PROMPT
PROMPT +------------------------------------------------------------------------+
PROMPT | Report : Multi-threaded Server: Dispatcher Status |
PROMPT | Instance : &current_instance |
PROMPT +------------------------------------------------------------------------+

SET ECHO OFF
SET FEEDBACK 6
SET HEADING ON
SET LINESIZE 180
SET PAGESIZE 50000
SET TERMOUT ON
SET TIMING OFF
SET TRIMOUT ON
SET TRIMSPOOL ON
SET VERIFY OFF

CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTES

COLUMN instance_name FORMAT a10 HEAD 'Instance'
COLUMN dispatcher_name FORMAT a16 HEAD 'Dispatcher Name'
COLUMN dispatcher_status FORMAT a10 HEAD 'Status'
COLUMN accept FORMAT a10 HEAD 'Accept'
COLUMN created HEAD 'Created'
COLUMN conf_indx HEAD 'Config. Index'
COLUMN network FORMAT a70 HEAD 'Network'

SELECT
i.instance_name instance_name
, d.name dispatcher_name
, d.status dispatcher_status
, d.accept accept
, d.created created
, d.conf_indx conf_indx
, d.network network
FROM
gv$instance i
, gv$dispatcher d
WHERE
i.inst_id = d.inst_id
ORDER BY
i.instance_name
, d.name;

Viewing all 1640 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>