Friday, October 11, 2024

 Linux Foundation Coupn Codes


Linux Foundation Coupn Codes 🎉 

Are you looking to advance your career with Linux Foundation certifications or training? You're in the right place! As an official partner of the Linux Foundation, We are excited to share exclusive discount coupons for a variety of training courses and certifications. 

[Up to 40% OFF] Linux Foundation Exclusive Discount 

As part of our partnership with the Linux Foundation, you can get 30% off ANY Linux Foundation certification or training. 

Steps to redeem: 

1. Visit https://lf.kubeflex.io

2. Locate the certification/training you wish to purchase 

3. Apply the coupon KUBEFLEX30


[Up to 40% OFF] Direct links to certifications and bundles 

Use the coupon KUBEFLEX30 at checkout 

👉Certified Kubernetes Administrator (CKA): https://cka.kubeflex.io 

👉Certified Kubernetes Application Developer (CKAD): https://ckad.kubeflex.io 

👉Prometheus Certified Associate (PCA): https://pca.kubeflex.io 

👉Certified Kubernetes Security Specialist (CKS): https://cks.kubeflex.io 

👉 Istio Certified Associate (ICA): https://ica.kubeflex.io 

👉 Kubernetes and Cloud Native Associate (KCNA): https://kcna.kubeflex.io 

👉 Kubernetes and Cloud Native Security Associate (KCSA): https://kcsa.kubeflex.io 

👉 Certified Argo Project Associate (CAPA): https://capa.kubeflex.io 

👉 Certified GitOps Associate (CGOA): https://cgoa.kubeflex.io 

👉 Cilium Certified Associate (CCA): https://cca.kubeflex.io


Wednesday, June 26, 2013

OCM Preparation - 4 - Determine and set Sizing Parameters for Database Structures




Initialization Parameters.

Documentation Library ->  Administrator's Guide - > Creating and Configuring an Oracle Database -> Specifying Initialization Parameters


Memory Configurations.
 Documentation Library ->  Administrator's Guide - > Managing Memory


Changing the Database Archiving Mode

 Documentation Library ->  Administrator's Guide - > Managing Archived Redo Logs -> Controlling Archiving

Changing the Database Archiving Mode using EM

Database Control Home -> Availability -> Recovery Settings.

Adding a Control File

Create pfile from spfile
Shutdown the database.
Copy existing control file to a new location.
Edit "control_file" parameter in pfile and add the new location.
Start the database with pfile.
Create spfile from pfile.
Restart the database.

Notes

How to check if the database was started with SPFILE or PFILE

SQL>SELECT DECODE(value, NULL, 'PFILE', 'SPFILE') "Init File Type"
FROM sys.v_$parameter
WHERE name = 'spfile';


How to check if the database is running on archive log mode.
SQL>archive log list

How to check session/process utilization.

SQL>select * from v$resource_limit where resource_name in ('processes','sessions');

Tuesday, May 28, 2013

OCM Preparation - 2

Following steps will create the basic virtual environment to play with.

Download VMware Server and install it. 
Download Oracle Linux Release 5.4 (32-bit) at Oracle Software Delivery Cloud.
Create a virtual machine in VMware Server and install Oracle Linux. Check this out.
Download 11.2.0.3.0 patch set.
Patch ID=10404530. If you are not sure which files to download, Check this out.



Installation Type
Zip File
Oracle Database (includes Oracle Database and Oracle RAC)
p10404530_112030_platform_1of7.zip
p10404530_112030_platform_2of7.zip
Oracle Grid Infrastructure (includes Oracle ASM, Oracle Clusterware, and Oracle Restart)
p10404530_112030_platform_3of7.zip
Oracle Database Client
p10404530_112030_platform_4of7.zip
Oracle Gateways
p10404530_112030_platform_5of7.zip
Oracle Examples
p10404530_112030_platform_6of7.zip
Deinstall
p10404530_112030_platform_7of7.zip


Install Oracle Database 11g Enterprise Edition Release 11.2.0.3.0  32-bit (Software Only).
Installation Guides: Oracle Oracle-Base

 Notes:
VNC Server is used.
Resize /dev/shm more than the value you want for MEMORY_MAX_TARGET.
mount -t tmpfs shmfs -o size=1.1G /dev/shm
To change tmpfs value permanently, change /etc/fstab as follows.

#tmpfs /dev/shm tmpfs defaults 0 0
tmpfs /dev/shm tmpfs size=1g 0 0

Monday, May 27, 2013

OCM Preparation - 1

Exam Environment

  • Oracle Linux Release 5.4 (32-bit)
  • Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 (32-bit)
  • Oracle Enterprise Manager 11g Grid Control Release 1 (11.1.0.1.0)  (32-bit)
  • Non-Searchable Documentation

Exam Topics

Server Configuration
  • Create the database
  • Determine and set sizing parameters for database structures
  • Create and manage temporary, permanent, and undo tablespaces
  • Stripe data files across multiple physical devices and locations
  • Configure the database environment to support optimal data access performance
  • Create and manage database configuration files
  • Create and manage bigfile tablespaces
  • Create and Manage a tablespace that uses NFS mounted file system file  
  • Create and manage multiple network configuration files
  • Create and configure a listener
  • Configure the database instance to support shared server connections
  • Set up network tracing
  • Manage Oracle network processes  
  • Configure the network environment to allow connections to multiple databases
  • Use configurationless connections
  • Use OPatch to install a patch
  • Use Grid Infrastructure to manage oracle databases and other resources
  • Use Enterprise Manager Configuration Assistant(EMCA) utility
Enterprise Manager Grid Control
  • Install and Patch Enterprise Manager Grid Control software
  • Configure the Enterprise Manager repository
  • Create Enterprise Manager Grid Control users
  • Use Enterprise Manager to modify a database configuration
  • Configure Enterprise Manager to modify database availability
  • Create and manage jobs
  • Create and monitor alerts
  • Create notifications
  • Implement Grid Control and Database Control
  • Choose the appropriate tablespace type for the intended use
  • Create Scheduler jobs
  • Create schedules
  • Assign jobs to windows
  • Create programs
  • Create job classes
  • Install the Enterprise Manager Grid Control infrastructure
  • Deploy Enterprise Manager Grid Control agents
  • Configure Grid Control for business requirements
Managing Database Availability
  • Mantain recovery catalogs
  • Configure Recovery Manager
  • Use Recovery Manager to perform database backups
  • Use Recover Manager to perform complete database restore and recovery operations
  • Configure RMAN
  • Create different types of RMAN backups to cater for different performance and retention requirements
  • Set Flashback Database parameters
  • Configure a Fast Recovery Area
  • Perform various recovery operations using Flashback technology
Data Management
  • Manage Materialized Views to improve rewrite and refresh performance
  • Configure and manage distributed materialized views
  • Create and Manage encrypted tablespaces
  • Manage Transport of tablespaces across platforms
  • Configure a schema to support a star transformation query
  • Administer external tables
  • Implement Data Pump export and import jobs for data transfer
  • Implement Data Pump to and from remote databases  
  • Configure and use parallel execution for queries
  • Use SQL*Loader
  • Administer, manage and tune parallel execution
Data Warehouse Management  
  • Administer partitioned tables and indexes using appropriate methods and keys 
  • Perform partition maintenance operations  
  • Maintain indexes on a pa rtitioned table
  • Implement securefile LOB
  • Create and manage LOB segments  
  • Implement fine-grained access control  
  • Create and manage contexts
  • Administer flashback data archive and schema evolution
Performance Management  
  • Administer Resource Manager 
  • Use Result Cache 
  • Use multi column statistics 
  • Gather statistics on a specific table without invalidating cursors 
  • Use partitioned indexes 
  • Administer and tune schema object to support various access methods 
  • Interpret execution plan  
  • Use SQL tuning tools and features 
  • Use SQL Tuning Advisor 
  • Use SQL Access Advisor 
  • Use SQL Performance Analyzer
  • Configure baseline templates  
  • Use SQL Plan Management feature
  • Implement instance caging 
Grid Infrastructure and ASM
  • Install Oracle Grid Infrastructure 
  • Create ASM Disk Groups 
  • Create and manage as ASM instance
  • Implement ASM failure groups
  • Creating ACFS File System   
  • Start, stop, configure and administer Oracle Grid Infrastructure
Real Application Clusters  
  • Install the Oracle Database 11gR2 software
  • Configure ASM for the shared disks and create a clustered database   
  • Configure archiving  
  • Configure services using both Manual and Policy Managed methods 
Data Guard  
  • Create Physical Standby Database with real-time apply. 
  • Configure the data guard environment to reduce overheads of fast incremental backups on the primary database 
  • Configure the Observer 
  • Switchover and switch back  
  • Configure connect time failover
  • Convert the standby to a snapshot standby 
  • Configure archivelog deletion policy for the Dataguard configuration

This will be used as the base documentation for this series, hereafter.

Friday, July 13, 2012

Get distinct datafile paths.

Code:

select distinct substr(file_name,1,instr(file_name,'/',-1)) from dba_data_files;

Wednesday, April 18, 2012

List tables which have specific column with number of rows for a given requirement.


select q'[select ']'||table_name||q'[' as table_name, count(*) from ]'||table_name||q'[ where COL1='VAL1';]' from dba_tab_columns where column_name='COL1' and upper(owner) ='USER';

Friday, March 30, 2012

Exclude specific tables from expdp

Here is the command
 
expdp user/password@sid schemas=schema_name include=TABLE:"IN ('TABLE1', 'TABLE2')" 
directory=DATAPUMP_DIR dumpfile=user_date.dmp logfile=user_date.log
 
Some operating systems need special characters to be escaped
 
include=TABLE:\"IN (\'TABLE1\', \'TABLE2\')"
 
Or
 
include=TABLE:\"IN \(\'TABLE1\', \'TABLE2\'\)"
  
 
 
 
 

Monday, March 26, 2012

Update a table column using a sequence


create table duplicate as select * from original
alter table duplicate add ID number;
create sequence seq1

set pagesize 0
set linesize 200
spool update.sql
select 'update duplicate set ID='||seq1.nextval||q'[ where rowid=']'||rowid||q'[';]' from duplicate;
spool off

>@update.sql

Monday, February 27, 2012

/OVS is empty after installing Oracle VM Server

Had to pull your hair to figure out why /OVS is empty after a fresh installation of Oracle VM Server? Well It's the default behavior in OVM Server 3.0.3, unlike 2.2.0.
It can be and should be done via Oracle VM Manager.
Click here to see how I found it out.


Saturday, February 25, 2012

OVM-1004 XML-RPC Client Call Oracle VM Agent API 'register_server' error: exceptions.Exception:method "register_server" is not supported, please try again later.

If you get this error when you try to create a new server pool, then you are probably using two different versions of VM Server and  VM Manager which are not compatible. Look! error is misleading. This won't get resolved even if you try again a bit later, until you  have right packages installed.

Click here to see how I found this out. 


VM Manager 3.0.3 on SuSE 11

Today I tried installing VM Manager 3.0.3 on SuSE 11 and got the following.

Oracle VM Manager can only be installed on a 64 bit Oracle Linux version 5.5 and higher.
Current version is 'SuSE' version '11'
**** WARNING: Recommended memory for the Oracle VM Manager server installation is 3950 MB RAM*
Configuration verification failed
 Solution:
Error says it all. Have OL 5.5 or higher!

Can't connect to Oracle VM Manager home page

This is a firewall issue!

Open http access

system-config-securitylevel-tui -q -p 8888
 
 
Open https access

system-config-securitylevel-tui -q -p 4443


Disable iptables altogether!

service iptables stop

Thursday, February 23, 2012

Installing Oracle Linux over network - No DVD-ROM

I was able to install Oracle VM Server and wanted to install Oracle VM Manager in a separate machine in order to manage VM's in VM Server. Oracle does not recommend installing Oracle VM Manager in a VM which will eventually be managed by Oracle VM Manager itself. So, my plan was to install Oracle Linux and then install Oracle VM Manager on top of it. The machine in question, did not have a DVD-ROM, but had a CD-ROM. Here is how I got through.

Packages in hand
Oracle Linux Release 6 boot iso image
Oracle Linux Release 6

Configuring NFS
I used a separate Linux server for this. Yes it did have a DVD-ROM and I did not want to install VM Manager on it.
Create two directories.
mkdir /x01/package  /x01/inst

Place OEL6 iso at /x01/package directory.
 Unzip it


 Now mount it.
mount -ro loop /x01/package/OEL6.iso /media

Copy required files to /x01/inst directory.

cp -ar /media/. /x01/inst/

To setup NFS share, Add following line to /etc/export.

/x01/inst         *(ro,sync)

export the directory and restart NFS service.
exportfs -a
service nfs stop
service nfs start

To see the status of the share
showmount -e

NFS share is created. Rest is easy. Boot the machine with OEL boot cd and select the installation method as NFS. Provide NFS IP address and the path (/x01/ins). Installation would be started in no time. After the installation is completed, Oracle VM Manager package can be installed right away. I used FTP to transfer the package.


Tuesday, January 31, 2012

Installing Oracle VM Server in VMware Workstation

These days I'm particularly interested in Oracle Virtualization, though I do not have enough resources to play with. Today I decided to install Oracle VM Server in VMware workstation which is actually useless for real world scenarios.
I tried to install Oracle VM in VMware as I used to do with any other operating systems, but it didn't work out. But later on I found what was missing.
These are the additional steps.

1. Download Oracle VM Server ISO and extract it.
2. Open out VMware workstation
3. Select VMware Workstation 5 from the drop down menu when a new virtual machine is created and additionally tick on "ESX Server Compatible"
4. Operating system : Linux -> Other Linux 2.6.x kernel64-bit

Rest of the steps are quite the usual.

When booting the new virtual machine, I got the following error

ERR: Not a 64-Bit CPU!erver-ovs (xen-64-3 .1.3 2.6.18-8.1.15.0.16.el5ovs)
This can be resolved by pressing [ENTER] while booting and selecting 32 bit installation from the menu.

Friday, January 20, 2012

ORA-15505: cannot start workload capture because instance 1 encountered errors

I was trying to start a database workload capture so that I can replay it. Here is the sequence.

Directory was created.

SQL> create directory mydir as '/x01/oracle/softwares/datapump';

Capture was started

SQL> begin
  2   dbms_workload_capture.start_capture('Migration Test','MYDIR');
  3  end;
  4  /

PL/SQL procedure successfully completed.

After some time I decided to finish the capture.


SQL> begin
  2  dbms_workload_capture.finish_capture;
  3  end;
  4  /

PL/SQL procedure successfully completed.


Suddenly I thought the workload captured is not just enough for my simulations. So I started capturing again. Destination is the same directory. Here is what I got.

SQL> begin
  2  dbms_workload_capture.start_capture('Migration Test 2','MYDIR');
  3  end;
  4  /
begin
*
ERROR at line 1:
ORA-15505: cannot start workload capture because instance 1 encountered errors
while accessing directory "/x01/oracle/softwares/datapump"
ORA-06512: at "SYS.DBMS_WORKLOAD_CAPTURE", line 811
ORA-06512: at line 2

Solution.

It was turned out to be impossible to direct my capture destination to a directory which is not empty. Removing old files in MYDIR solved the issue.


Wednesday, January 18, 2012

ORA-01187: cannot read from file because it failed verification tests

After doing some intensive database simulations I decided to do some SQL tuning. So I went to EM and selected SQL tuning advisor. Since I did not have pre-configured SQL tuning sets, I selected a suitable time window in SQL top activity pane. Everything  looked fine until I clicked on submit button.
Bad luck.

There was a problem creating a SQL tuning task. ORA-01187: cannot read from file because it failed verification tests ORA-01110: data file 201: '/u01/app/oracle/oradata/testdb/temp01.dbf' ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 7718 ORA-06512: at "SYS.PRVT_SQLADV_INFRA", line 275 ORA-06512: at "SYS.DBMS_SQLTUNE", line 674 ORA-06512: at line 1


As you can see, error was ridiculously  long. Look, something is wrong with the temp file. So first thing I did was to check if the temp file really exists!

SQL> !ls /u01/app/oracle/oradata/testdb/temp01.dbf
/u01/app/oracle/oradata/testdb/temp01.dbf
It does exist. Now what? I checked dba_temp_files to check if it is listed there.


SQL> show user
USER is "SAJEEVA"
SQL> conn / as sysdba
Connected.
SQL> select file_name from dba_temp_files;
select file_name from dba_temp_files
                      *
ERROR at line 1:
ORA-01187: cannot read from file  because it failed verification tests
ORA-01110: data file 201: '/u01/app/oracle/oradata/testdb/temp01.dbf'

Something terribly wrong with the temp file. So here is how I solved it.

First I added another temp file to temp tablespace.

SQL> alter tablespace temp add tempfile;

Tablespace altered.
OMF was enabled, So no need to give the absolute path. 
Then I deleted the currupted (lets say currupted)


SQL> alter tablespace temp drop tempfile '/u01/app/oracle/oradata/testdb/temp01.dbf';

Tablespace altered.

Problem solved.

SQL> select file_name from dba_temp_files;

FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/TESTDB2/datafile/o1_mf_temp_7kfxh4jq_.tmp

Monday, January 16, 2012

Understanding Block Curruption

When oracle detects a block curruption, It writes an error in alert log as follows.

ORA-01578: ORACLE data block corrupted (file # X, block # Y)
ORA-01110: data file X: '/x01/app/oracle/oradata/ora11g/users01.dbf
Error itself shows which data file has the corrupted block. Usually curruption is caused by hardware failure or operating system caching problems.

To get the tablespace name, we can use following query.

select tablespace_name from dba_data_files where file_id=X;
Let's say tablespace is USERS for the moment.
Then we can use following query to find more details.

select tablespace_name,segment_name,extent_id,bytes,file_id,blocks,block_id from dba_extents where tablespace_name='USERS' order by block_id;
Output will give each extents and the starting block id. So we can easily find the specific segment name which has the corrupted block.


Block media recovery.
Following prerequisites should be fullfilled.
Database must be in ARCHIVELOG mode.
Full backup or Level 0 incremental backup should be available.

RMAN>recover datafile X block Y;

Sunday, January 15, 2012

ORA-00845: MEMORY_TARGET not supported on this system

I have seen this error under two different circumstances and thought it would be helpful to note it down how I got it solved.

Case 1:
I already had the database installed. Oracle 11.2.0.2.0, RHEL 5, single instance. Then I installed Grid Infrastructure and created several ASM disk groups. Everything was just fine until server got rebooted. When the server was up, ASM instance was automatically up and running. When I tried to start the database instance, I got the following.

ORA-00845: MEMORY_TARGET not supported on this system

Solution to this particular problem is painfully explained in the web. But for non-ASM instance scenarios!
The reason here is that, now we have database instance plus an ASM instance, means oracle needs more memory!

I already had a shared file system, but to increase it's size, I did unmount it and mounted again with a larger size.



# umount tmpfs
# mount -t tmpfs shmfs -o size=<size>m /dev/shm
Then I tried to startup the database, but eventually found out that ASM instance had been crashed mysteriously ( I guess umount might have released the memory which was allocated to ASM, hence crashed )

So, then I tried to startup the ASM instance, but effort was in vain, until I execute this command,

crsctl start resources -all

Then everything seems to be fine and I could start the database instance.


Case 2:
My oracle database was in ASMM (Automatic Shared Memory Management) mode and I wanted to enable AMM (Automatic Memory Management).


alter system set memory_max_target=1G scope=spfile;
shutdown immediate;
startup;
Then I got our beloved error again.  (Yes, this system is not so generous to give 1G to oracle, It was a VMware 1G guest in 2G windows host)


Unfortunately I realised that I hadn't created a spfile so that there is no way that I can revert it back just in case. But fortunately I had enabled autobackup and had taken several database backups. So spfile is luckily available in FRA.


So I deleted renamed current spfile and logged in to RMAN to start the database with default parameters. 

rman target /
startup;
Chaos! system did not mount as control files locations are not known. But it's ok for the moment. Then I tried to restore the spfile

RMAN>restore spfile from autobackup;
RMAN-06495: must explicitly specify DBID with SET DBID command
Now how to find dbid? I could have found it by querying v$database if database was mounted. But it was not. chicken egg problem!
Luckily there are other ways too. This can be obtained using existing backups. here is how,

strings file_name |grep MAXVALUE, (In case of SYSTEM datafile)
strings file_name |grep MAXVALUE (In case of UNDO datafile)

So, Then suddenly everything seemed to be easy.


RMAN>set dbid=xxxxxxx
RMAN>restore spfile from autobackup;


SQL>shutdown immediate;
SQL>startup;