SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
ORACLE
SEGMENT
ADVISOR
Create test tablespace
We will create a separate tablespace to store new table for this
activity
Create test table & index
Let us create a test table, insert some records and create an index into the
above tablespace
Note: you can use this method to create new tables into a different
tablespace even though the default tablespace of a user is different.
Insert some dummy 100K records inside the table
Create index on table
Analyze table & index
Gather table and index stats
Let us check the size of each segment (table and index)
Delete some rows
Let us delete half of the rows from the table. Note, the below
procedure is deleting alternate rows from the table which will create
lot of fragmented space
Analyze table & index again
Now that we have delete half of the rows, let us gather stats
for table and index again
Let us check the size of each segment (table and index)
Note: even after deleting half of the records, the segment size
will still show same as it was before delete.
Run Oracle segment advisor
Even though we have delete half of the rows, the statistics
show no change. We will run Oracle segment advisor and see
what recommendations we will get
Create advisor task for table
Verify tasks are completed
Review segment advisor
Let us check what Oracle segment advisor has to say
Mostly the advisor will recommend you to run shrink space
command on the table and give an estimate as to how much
space can be saved.
Shrink table cascade
Use below command to shrink table but before that you must
enable row movement
Note: the CASCADE option will shrink space for associated
indexes with table. No need to run separate command for
index.
Analyze table & index size
Post shrinking table and index, let us gather stats and check
segment space savings
Let us check the size of each segment (table and index)
Note: this time the segment space size has been reduced from 797
earlier to 393.
Deallocate space
Now that we have shrink table and index, we can release the
deallocated space to the tablespace so that new data can be
inserted
At this stage, you can delete the advisor tasks that you
created earlier
Courses | Projects | Bootcamps

Mais conteúdo relacionado

Semelhante a ORACLE SEGMENT ADVISOR DEMONSTRATES SPACE SAVINGS

Excel Tips
Excel TipsExcel Tips
Excel TipsKritika
 
Excel Tips
Excel TipsExcel Tips
Excel Tipskktv
 
Microsoft Excel Tips
Microsoft Excel TipsMicrosoft Excel Tips
Microsoft Excel Tipsmifarooqui
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005rainynovember12
 
02 database oprimization - improving sql performance - ent-db
02  database oprimization - improving sql performance - ent-db02  database oprimization - improving sql performance - ent-db
02 database oprimization - improving sql performance - ent-dbuncleRhyme
 
Application sql issues_and_tuning
Application sql issues_and_tuningApplication sql issues_and_tuning
Application sql issues_and_tuningAnil Pandey
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007paulguerin
 
Page 5 of 7Delete this text and type your name hereThis fi.docx
Page 5 of 7Delete this text and type your name hereThis fi.docxPage 5 of 7Delete this text and type your name hereThis fi.docx
Page 5 of 7Delete this text and type your name hereThis fi.docxalfred4lewis58146
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowPavithSingh
 

Semelhante a ORACLE SEGMENT ADVISOR DEMONSTRATES SPACE SAVINGS (20)

Excel useful tips
Excel useful tipsExcel useful tips
Excel useful tips
 
Excel useful tips
Excel useful tipsExcel useful tips
Excel useful tips
 
Excel Tips
Excel TipsExcel Tips
Excel Tips
 
Excel Tips
Excel TipsExcel Tips
Excel Tips
 
Excel Tips
Excel TipsExcel Tips
Excel Tips
 
Microsoft Excel Tips
Microsoft Excel TipsMicrosoft Excel Tips
Microsoft Excel Tips
 
Excel Tips
Excel TipsExcel Tips
Excel Tips
 
Excel tips
Excel tipsExcel tips
Excel tips
 
Excel Tips 101
Excel Tips 101Excel Tips 101
Excel Tips 101
 
Excel tips
Excel tipsExcel tips
Excel tips
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
Excel Tips.pptx
Excel Tips.pptxExcel Tips.pptx
Excel Tips.pptx
 
02 database oprimization - improving sql performance - ent-db
02  database oprimization - improving sql performance - ent-db02  database oprimization - improving sql performance - ent-db
02 database oprimization - improving sql performance - ent-db
 
Excel Tips
Excel TipsExcel Tips
Excel Tips
 
Excel Tips
Excel TipsExcel Tips
Excel Tips
 
Excel Tips
Excel TipsExcel Tips
Excel Tips
 
Application sql issues_and_tuning
Application sql issues_and_tuningApplication sql issues_and_tuning
Application sql issues_and_tuning
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 
Page 5 of 7Delete this text and type your name hereThis fi.docx
Page 5 of 7Delete this text and type your name hereThis fi.docxPage 5 of 7Delete this text and type your name hereThis fi.docx
Page 5 of 7Delete this text and type your name hereThis fi.docx
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
 

Mais de Arun Sharma

Important Linux Commands
Important Linux CommandsImportant Linux Commands
Important Linux CommandsArun Sharma
 
Oracle Golden Gate Functions
Oracle Golden Gate FunctionsOracle Golden Gate Functions
Oracle Golden Gate FunctionsArun Sharma
 
Oracle Golden Gate Bidirectional Replication
Oracle Golden Gate Bidirectional ReplicationOracle Golden Gate Bidirectional Replication
Oracle Golden Gate Bidirectional ReplicationArun Sharma
 
Install Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle LinuxInstall Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle LinuxArun Sharma
 
Configure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change SyncConfigure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change SyncArun Sharma
 
Oracle TKPROF Utility
Oracle TKPROF UtilityOracle TKPROF Utility
Oracle TKPROF UtilityArun Sharma
 
Oracle 11g Installation With ASM and Data Guard Setup
Oracle 11g Installation With ASM and Data Guard SetupOracle 11g Installation With ASM and Data Guard Setup
Oracle 11g Installation With ASM and Data Guard SetupArun Sharma
 
Oracle 11g to 12c Upgrade With Data Guard and ASM
Oracle 11g to 12c  Upgrade With Data Guard and ASMOracle 11g to 12c  Upgrade With Data Guard and ASM
Oracle 11g to 12c Upgrade With Data Guard and ASMArun Sharma
 
Oracle 11g to 12c Rolling Upgrade
Oracle 11g to 12c Rolling UpgradeOracle 11g to 12c Rolling Upgrade
Oracle 11g to 12c Rolling UpgradeArun Sharma
 
Convert Physical Standby Into Logical Standby
Convert Physical Standby Into Logical StandbyConvert Physical Standby Into Logical Standby
Convert Physical Standby Into Logical StandbyArun Sharma
 
Enable Fast Start Failover Data Guard Broker
Enable Fast Start Failover Data Guard BrokerEnable Fast Start Failover Data Guard Broker
Enable Fast Start Failover Data Guard BrokerArun Sharma
 
Data Guard Broker Failover
Data Guard Broker FailoverData Guard Broker Failover
Data Guard Broker FailoverArun Sharma
 
Oracle Data Guard Physical Standby Configuration
Oracle Data Guard Physical Standby ConfigurationOracle Data Guard Physical Standby Configuration
Oracle Data Guard Physical Standby ConfigurationArun Sharma
 
Schedule RMAN Backups On Windows
Schedule RMAN Backups On WindowsSchedule RMAN Backups On Windows
Schedule RMAN Backups On WindowsArun Sharma
 
RMAN Backup Compression Types
RMAN Backup Compression TypesRMAN Backup Compression Types
RMAN Backup Compression TypesArun Sharma
 
Scheduling Jobs With DBMA_Scheduler
Scheduling Jobs With DBMA_SchedulerScheduling Jobs With DBMA_Scheduler
Scheduling Jobs With DBMA_SchedulerArun Sharma
 
Oracle User Management
Oracle User ManagementOracle User Management
Oracle User ManagementArun Sharma
 
Create Directory Under ASM Diskgroup
Create Directory Under ASM DiskgroupCreate Directory Under ASM Diskgroup
Create Directory Under ASM DiskgroupArun Sharma
 
Create Diskgroup Sqlplus Command
Create Diskgroup Sqlplus CommandCreate Diskgroup Sqlplus Command
Create Diskgroup Sqlplus CommandArun Sharma
 
Oracle Golden Gate Interview Questions
Oracle Golden Gate Interview QuestionsOracle Golden Gate Interview Questions
Oracle Golden Gate Interview QuestionsArun Sharma
 

Mais de Arun Sharma (20)

Important Linux Commands
Important Linux CommandsImportant Linux Commands
Important Linux Commands
 
Oracle Golden Gate Functions
Oracle Golden Gate FunctionsOracle Golden Gate Functions
Oracle Golden Gate Functions
 
Oracle Golden Gate Bidirectional Replication
Oracle Golden Gate Bidirectional ReplicationOracle Golden Gate Bidirectional Replication
Oracle Golden Gate Bidirectional Replication
 
Install Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle LinuxInstall Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle Linux
 
Configure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change SyncConfigure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change Sync
 
Oracle TKPROF Utility
Oracle TKPROF UtilityOracle TKPROF Utility
Oracle TKPROF Utility
 
Oracle 11g Installation With ASM and Data Guard Setup
Oracle 11g Installation With ASM and Data Guard SetupOracle 11g Installation With ASM and Data Guard Setup
Oracle 11g Installation With ASM and Data Guard Setup
 
Oracle 11g to 12c Upgrade With Data Guard and ASM
Oracle 11g to 12c  Upgrade With Data Guard and ASMOracle 11g to 12c  Upgrade With Data Guard and ASM
Oracle 11g to 12c Upgrade With Data Guard and ASM
 
Oracle 11g to 12c Rolling Upgrade
Oracle 11g to 12c Rolling UpgradeOracle 11g to 12c Rolling Upgrade
Oracle 11g to 12c Rolling Upgrade
 
Convert Physical Standby Into Logical Standby
Convert Physical Standby Into Logical StandbyConvert Physical Standby Into Logical Standby
Convert Physical Standby Into Logical Standby
 
Enable Fast Start Failover Data Guard Broker
Enable Fast Start Failover Data Guard BrokerEnable Fast Start Failover Data Guard Broker
Enable Fast Start Failover Data Guard Broker
 
Data Guard Broker Failover
Data Guard Broker FailoverData Guard Broker Failover
Data Guard Broker Failover
 
Oracle Data Guard Physical Standby Configuration
Oracle Data Guard Physical Standby ConfigurationOracle Data Guard Physical Standby Configuration
Oracle Data Guard Physical Standby Configuration
 
Schedule RMAN Backups On Windows
Schedule RMAN Backups On WindowsSchedule RMAN Backups On Windows
Schedule RMAN Backups On Windows
 
RMAN Backup Compression Types
RMAN Backup Compression TypesRMAN Backup Compression Types
RMAN Backup Compression Types
 
Scheduling Jobs With DBMA_Scheduler
Scheduling Jobs With DBMA_SchedulerScheduling Jobs With DBMA_Scheduler
Scheduling Jobs With DBMA_Scheduler
 
Oracle User Management
Oracle User ManagementOracle User Management
Oracle User Management
 
Create Directory Under ASM Diskgroup
Create Directory Under ASM DiskgroupCreate Directory Under ASM Diskgroup
Create Directory Under ASM Diskgroup
 
Create Diskgroup Sqlplus Command
Create Diskgroup Sqlplus CommandCreate Diskgroup Sqlplus Command
Create Diskgroup Sqlplus Command
 
Oracle Golden Gate Interview Questions
Oracle Golden Gate Interview QuestionsOracle Golden Gate Interview Questions
Oracle Golden Gate Interview Questions
 

Último

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 

Último (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 

ORACLE SEGMENT ADVISOR DEMONSTRATES SPACE SAVINGS

  • 2. Create test tablespace We will create a separate tablespace to store new table for this activity
  • 3. Create test table & index Let us create a test table, insert some records and create an index into the above tablespace Note: you can use this method to create new tables into a different tablespace even though the default tablespace of a user is different.
  • 4. Insert some dummy 100K records inside the table
  • 6. Analyze table & index Gather table and index stats
  • 7. Let us check the size of each segment (table and index)
  • 8. Delete some rows Let us delete half of the rows from the table. Note, the below procedure is deleting alternate rows from the table which will create lot of fragmented space
  • 9.
  • 10.
  • 11. Analyze table & index again Now that we have delete half of the rows, let us gather stats for table and index again Let us check the size of each segment (table and index) Note: even after deleting half of the records, the segment size will still show same as it was before delete.
  • 12.
  • 13. Run Oracle segment advisor Even though we have delete half of the rows, the statistics show no change. We will run Oracle segment advisor and see what recommendations we will get Create advisor task for table
  • 14.
  • 15.
  • 16. Verify tasks are completed
  • 17. Review segment advisor Let us check what Oracle segment advisor has to say
  • 18. Mostly the advisor will recommend you to run shrink space command on the table and give an estimate as to how much space can be saved.
  • 19. Shrink table cascade Use below command to shrink table but before that you must enable row movement
  • 20. Note: the CASCADE option will shrink space for associated indexes with table. No need to run separate command for index.
  • 21. Analyze table & index size Post shrinking table and index, let us gather stats and check segment space savings
  • 22. Let us check the size of each segment (table and index) Note: this time the segment space size has been reduced from 797 earlier to 393.
  • 23. Deallocate space Now that we have shrink table and index, we can release the deallocated space to the tablespace so that new data can be inserted
  • 24. At this stage, you can delete the advisor tasks that you created earlier
  • 25. Courses | Projects | Bootcamps