Thursday, August 18, 2022

ORA-31626: job does not exist

dsvmofs> expdp system/XXXXX parfile=auexpfulltts.dat Export: Release 11.2.0.4.0 - Production on Wed Aug 17 05:29:16 2022 Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ORA-31626: job does not exist ORA-31633: unable to create master table "SYSTEM.SYS_EXPORT_FULL_05" ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95 ORA-06512: at "SYS.KUPV$FT", line 1038 ORA-00372: file 7 cannot be modified at this time ORA-01110: data file 7: '/OFSSITDATA2/oradata/owad01.dbf' dsvmofs> cat auexpfulltts.dat directory=dmpdir metrics=y dumpfile=xttsfulltts%U.dmp filesize=1048576000 full=y exclude=STATISTICS logfile=expfulltts.log parallel=8 transportable=always version=12 dsvmofs> Root cause : Customer has SYS related tables in OWAPUB Tablespace, We made OWAPUB readonly as pert of TTS Activity. Solution : Moved the SYS related tables from OWAPUB tablespace to SYS. Other alternative solutions 1. Before restarting the expdp check if there are orphan Data Pump jobs left in database. Use << Note 336014.1 >> 2. After clearing the orphaned jobs if you still see the errors, Upload output of below queries. connect as sysdba spool boxa.html set pagesize 9999 set markup html on select name from v$database; SELECT * from v$version ; SELECT distinct(length(addr)*4) "Word Size" from v$process; SELECT owner,object_name,object_type,status from dba_objects where status = 'INVALID'; select owner,object_type,count(*) from dba_objects where status='INVALID' group by owner,object_type; SELECT SUBSTR(comp_id,1,15) comp_id, status, SUBSTR(version,1,10) version, modified, SUBSTR(comp_name,1,30) comp_name, substr(schema,1,15) as schema FROM dba_registry order by comp_id; select * from registry$history;

Monday, August 1, 2022

How to drop other schema’s Database link using SYS user | Drop db_link from other user

SQL> select owner,db_link from dba_db_links; OWNER DB_LINK ------------------------------ -------------------------------------- TEST TEST_DB_LINK SQL> sho user USER is "SYS" SQL> SQL> drop database link test.test_db_link; drop database link test.test_db_link * ERROR at line 1: ORA-02024: database link not found [test@test.test.com ~]$ cat drop_schema_dblink.sh username=$1 db_link=$2 sqlplus /nolog < SQL> Connected. SQL> " DB Link Before Drop" SQL> SQL> SQL> OWNER DB_LINK ------------------------------ ------------------------------ TEST TEST_DB_LINK SQL> 2 3 4 5 Procedure created. SQL> PL/SQL procedure successfully completed. SQL> Procedure dropped. SQL> " DB Link After Drop" SQL> no rows selected SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options !

Friday, April 8, 2022

Implications of latest Oracle WebLogic Server connection filters for Oracle EBS r12.2 customers

Above screenshot might click many Apps DBAs who have recently applied - 1. April 2019 CPU Patch 2. Upgraded to Latest AD and TXK level (C.11) Recently I applied Oracle E-Business Suite Technology Stack Delta 11 on an EBS r12.2.7 implementation. After applying patch we went for sanity checks and when trying to open Weblogic Server console I got this - The Server is not able to service this request: [Socket:000445]Connection rejected, filter blocked Socket, weblogic.security.net.FilterException: [Security:090220]rule 2 Below are metalink ids ideally Apps DBAs should refer to for resolving this- Alternative Methods to Allow Access to Oracle WebLogic Server Administration Console from Trusted Hosts for Oracle E-Business Suite Release 12.2 (Doc ID 2542826.1) ORA-12547 While Client Connecting Via SSH Tunnel (Doc ID 454252.1) Oracle Community also has few tips for this- https://community.oracle.com/message/15413970#15413970 Troubleshooting Part - cd $FMW_HOME/user_projects/domains/EBS_domain_/config/ cat config.xml | grep connection-filte oracle.apps.ad.tools.configuration.wls.filter.EBSConnectionFilterImpl< connection-filter> appsnode * * allow 0.0.0.0/0 * * deny We will be exploring all the 3 scenarios with real-time usecases. Option 1: Adding Specific Trusted Hosts 1. This can be done by using context variable - s_wls_admin_console_access_nodes A comma seperated set of ips/hostnames(fqdns) can be used like as follows to allow set of system administrators/weblogic administrators to access console - host1.domain.com,host2.domain.com 2. Execute autoconfig on run filesystem. 3. Stop and start Oracle Weblogic admin server adadminsrvctl.sh stop adadminsrvctl.sh start 4. perform fs_clone to synchronize filesystems adop phase=fs_clone Option 2: Allowing an IP Range This option will be available after applying Patch 29781255:R12.TXK.C. There will be requirements where you need to provide IP range and it is important to first understandd how CIDR works. According to CIDR ruling, you can have a factor set to 4^n This implies we can have ip range as 4,16,64,256 Sample example to narrow down IP range - 195.168.1.32/24 ---> 256 IP Hosts 195.168.1.32/26 ---> 64 IP Hosts 195.168.1.32/28 ---> 16 IP Hosts 195.168.1.32/30 ---> 04 IP Hosts I first checked for patch if already applied as a standard practice. Query 1- set lines 1000 col APPLIED_FILE_SYSTEM_BASE for a40 SELECT b.bug_number, asp.adop_session_id, asp.bug_number patch#, asp.session_type, asp.applied_file_system_base, asp.start_date, asp.end_date FROM ad_bugs b, ad_patch_run_bugs prb, ad_patch_runs pr, ad_patch_drivers pd, ad_adop_session_patches asp WHERE b.bug_id = prb.bug_id AND prb.patch_run_id = pr.patch_run_id AND pr.patch_driver_id = pd.patch_driver_id AND pr.patch_run_id = asp.patchrun_id AND prb.applied_flag = 'Y' AND b.bug_number = '&bug_num'; Enter value for bug_num: 29781255 old 11: AND b.bug_number = '&bug_num' new 11: AND b.bug_number = '29781255' no rows selected Query 2- SELECT adb.bug_number,ad_patch.is_patch_applied('122', 1045, adb.bug_number) FROM ad_bugs adb WHERE adb.bug_number in (29781255); Query 3- select ad_patch.is_patch_applied('R12',-1,29781255) from dual; Once patch was applied, we update CONTEXT file on run fs as follows - cat $CONTEXT_FILE | grep wls | grep nodes 195.168.1.32/30 This can me below set of 4 ips - 195.168.1.32-to-195.168.1.35 Note: Easy way to calculate range of Ips is using online calculator - https://www.ipaddressguide.com/cidr Executed autoconfig and started admin server to reflect changes. Option 3: Adding Specific Trusted Hosts SSH tunneling is pre-requisite here and I achieved it using putty. For lab environment using static ips, this can be simply achieved using below - 1. Ssh -> Logging Provide Destination IP address and keep port for ssh as 22. Save it with some name to it can be loaded later for future reference. 2. Connection -> SSH -> Tunnels Provide Source port, client machine's port which is open and not blocked or used by any other application. In my case it was 81. Provide Destination Hostname:Port and click on 'Add' 3. Go back to session and save it. 4. If you are not intending to logon to server, you can use option under 'Ssh' - 5. Login to saved session and monitor Event log for putty Session - 5. Few more settings are required on your web-browser, I used Firefox here - 127.0.0.1 is for Localhost. Clear browser cache and try console again - https://maazdba.blogspot.com/2019/09/implications-of-latest-oracle-weblogic.html

Wednesday, March 2, 2022

Here’s how a 22-year-old made $1 million by selling NFT selfies

 

Here’s how a 22-year-old made $1 million by selling NFT selfies


https://indianexpress.com/article/technology/crypto/heres-how-a-22-year-old-made-1-million-by-selling-nft-selfies-7728112/


https://photodoto.com/create-nft-from-photo/

RMAN-06023: no backup or copy of datafile number found to restore

 Hi,

Sometimes You can get “RMAN-06023: no backup or copy of datafile number found to restore ” error.

 

RMAN-06023: no backup or copy of datafile number found to restore

 

Details of error are as follows.


Details of error are as follows.

RMAN-06023: no backup or copy of datafile number found to restore

Cause: A datafile, tablespace, or database restore could not proceed because no backup or copy of the indicated

file was found. It may be the case that a backup or copy of this file exists but does not satisfy the

criteria specified in the user's restore operands.

Action: None - this is an informational message. See message 6026 for further details.

This error is related with autobackups in FRA ( Flash Recovery Area ), There are backup files but they are belonged to different incarnation than the available backups current incarnation.

 

To solve this error, reset the db_recovery_file_dest and db_recovery_file_dest_size parameters, and RMAN will not look for these files in the FRA.

 

SQL> alter system reset db_recovery_file_dest_size scope=spfile sid='*';

System altered.
RMAN-03002: failure of restore command at 03/05/2015 18:03:28
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
SQL> alter system reset db_recovery_file_dest scope=spfile sid='*';

System altered.

Restart database as follows.

SQL> shutdown immediate;
SQL> startup


Script to monitor RMAN progress

 Question:  I have a long running RMAN job, and I want a script to monitor the progress of RMAN execution.  How do you monitor RMAN progress?

Answer:  Oracle has several views that can monitor long running jobs, including v$session_longops and v$process with v$session.  Also see RMAN backup scripts from Windows DOS scripts for RMAN automated backups and example of RMAN shell script.

sselect
  sid,
  start_time,
  totalwork
  sofar,
 (sofar/totalwork) * 100 pct_done
from
   v$session_longops
where
   totalwork > sofar
AND
   opname NOT LIKE '%aggregate%'
AND
   opname like 'RMAN%';

select
   sid,
   spid,
   client_info,
   event,
   seconds_in_wait,
   p1, p2, p3
 from
   v$process p,
   v$session s
 where
   p.addr = s.paddr
 and
   client_info like 'rman channel=%';


Yousef Rifai has published this RMAN monitoring script, quite handy when you need to monitor the status of a long running RMAN backup job:

REM RMAN Progress
alter session set nls_date_format='dd/mm/yy hh24:mi:ss'
/
select SID, START_TIME,TOTALWORK, sofar, (sofar/totalwork) * 100 done,
sysdate + TIME_REMAINING/3600/24 end_at
from v$session_longops
where totalwork > sofar
AND opname NOT LIKE '%aggregate%'
AND opname like 'RMAN%'
/

REM RMAN wiats
set lines 120
column sid format 9999
column spid format 99999
column client_info format a25
column event format a30
column secs format 9999
SELECT SID, SPID, CLIENT_INFO, event, seconds_in_wait secs, p1, p2, p3
  FROM V$PROCESS p, V$SESSION s
  WHERE p.ADDR = s.PADDR
  and CLIENT_INFO like 'rman channel=%'
/

This script by Osama Mustafa will monitor the progress of a running RMAN job:

select
   to_char(start_time,'DD-MON-YY HH24:MI') "BACKUP STARTED",
   sofar,
   totalwork,
   elapsed_seconds/60 "ELAPSE (Min)",
   round(sofar/totalwork*100,2) "Complete%"
from
   sys.v_$session_longops
where  compnam = 'dbms_backup_restore';

Rename directory on ASM

 There are 2 type of Directories in ASM

1) Directories created by DBAC or RMAN are called as “System Directory” and they cannot be renamed.

2) Directories created Manually by issuing command “alter diskgroup add directory” or creating in ASMCMD console.

To check if the directory is system created or manually created check the view V$ASM_ALIAS column SYSTEM_CREATED, directories created by system will have the value as ‘Y’

To Rename “Manually” created directories

Login to the ASM console
[grid@tstdev01 ~]$ asmcmd
ASMCMD> cd DATA
ASMCMD> ls
ASM/
DEV/  — Here to rename DEV to TEST

SQL> ALTER DISKGROUP DATA RENAME DIRECTORY ‘+DATA/DEV’ to ‘+DATA/TEST’;
Diskgroup altered.

Once done longin to ASM console and verify the same
[grid@tstdev01 ~]$ asmcmd
ASMCMD> cd DATA
ASMCMD> ls
ASM/
TEST/



To Rename System Created directories

System created directory cannot be rename, use parameter db_unique_name of database. Oracle ASM and Oracle Diagnostic Dest create your own directory structure based on parameter DB_UNIQUE_NAME.

Move Database using RMAN

RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name DEV

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
—- ——– ——————– ——- ————————
1 17408 SYSTEM YES +DATA/DEV/DATAFILE/system.259.941719615
2 1800 UNDOTBS1 YES +DATA/DEV/DATAFILE/undotbs1.267.941720063
3 4696 SYSAUX NO +DATA/DEV/DATAFILE/sysaux.258.941719569
4 1243 EXAMPLE NO +DATA/DEV/DATAFILE/example.266.941719731
5 118 USERS NO +DATA/DEV/DATAFILE/users.260.941719669

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
—- ——– ——————– ———– ——————–
2 1300 TEMP 1300 +DATA/DEV/TEMPFILE/temp.271.942061583

$sqlplus sys as sysdba
SQL> show parameter db_unique_name
NAME TYPE VALUE
———————————— ———– ——————————
db_unique_name string DEV


SQL> show parameter control_files

NAME TYPE VALUE
———————————— ———– ——————————
control_files string +DATA/DEV/CONTROLFILE/current.262.941719717

SQL> Alter system set DB_UNIQUE_NAME=’TEST’ scope=spfile;

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup nomount
SQL> show parameter db_unique_name

NAME TYPE VALUE
———————————— ———– ——————————
db_unique_name string TEST

$rman target /
RMAN> restore controlfile from ‘+DATA/DEV/CONTROLFILE/current.262.941719717’;
Starting restore at 10-MAY-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=162 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA/TEST/CONTROLFILE/current.263.981519213
Finished restore at 10-MAY-17

RMAN> startup mount;
database is already started
database mounted
released channel: ORA_DISK_1

RMAN> CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 3;
new RMAN configuration parameters:

RMAN> CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 3;
new RMAN configuration parameters are successfully stored

RMAN > CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters:

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored

RMAN> BACKUP AS COPY DEVICE TYPE DISK DATABASE FORMAT ‘+DATA’;
Finished backup at 10-MAY-17

RMAN> SWITCH DATABASE TO COPY;
datafile 1 switched to datafile copy “+DATA/TEST/datafile/system.290.793638779

RMAN> run {
set newname for tablespace TEMP to ‘+DATA’ ;
switch tempfile all;
}

RMAN> report schema;
Report of database schema for database with db_unique_name TEST

List of Permanent Datafiles
==================
File Size(MB) Tablespace RB segs Datafile Name
—- ——– ——————– ——- ————————
1 17408 SYSTEM YES +DATA/TEST/datafile/system.290.793638779
2 1800 UNDOTBS1 YES +DATA/TEST/datafile/sysaux.291.793638757
3 4696 SYSAUX NO +DATA/TEST/datafile/undotbs1.292.793638823
4 1243 EXAMPLE NO +DATA/TEST/datafile/example.293.793638849
5 118 USERS NO +DATA/TEST/datafile/users.294.793638849

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
—- ——– ——————– ———– ——————–
1 1300 TEMP 1300 +DATA

RMAN> startup;
database is already started
database opened

Create the new redolog files and drop the old ones.

Once the above activity is completed backup the database.

RMAN> backup database;
Starting backup at 10-MAY-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=162 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=194 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=210 device type=DISK
.
.
Recovery Manager complete.

Now you can remove the copy:

RMAN> delete copy;

Advertisements

ewallet p12 vs cwallet sso

The  ewallet.p12  stores credentials and certificates protected by a user password, while  cwallet.sso  provides an obfuscated, random passw...