Skip to content

Commit

Permalink
recreate table smon_scn_time
Browse files Browse the repository at this point in the history
  • Loading branch information
amacdonal committed Dec 11, 2024
1 parent 4c63367 commit 4e58dab
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

. ~/.bash_profile

sqlplus -s / as sysdba <<EOF
SET LINES 1000
SET PAGES 0
SET FEEDBACK OFF
SET HEADING OFF
WHENEVER SQLERROR EXIT FAILURE
select cluster_name
from dba_tables
where table_name = 'SMON_SCN_TIME';
EXIT
EOF
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

# Source oracle bash profile
. ~/.bash_profile

# Shutdown the database
srvctl stop database -d $ORACLE_SID

# Start the database in upgrade mode
srvctl start database -d $ORACLE_SID -o upgrade

# Wait for 60 seconds
sleep 60

# Modify the table and indexes
sqlplus -s / as sysdba <<EOF
SET LINESIZE 1000
SET PAGESIZE 0
SET FEEDBACK OFF
SET HEADING OFF
WHENEVER SQLERROR EXIT FAILURE
rename smon_scn_time to smon_scn_time_org;
create table smon_scn_time tablespace sysaux as select * from smon_scn_time_org;
drop index smon_scn_time_tim_idx;
create unique index smon_scn_time_tim_idx on smon_scn_time(time_mp) tablespace SYSAUX;
drop index smon_scn_time_scn_idx;
create unique index smon_scn_time_scn_idx on smon_scn_time(scn) tablespace SYSAUX;
exit
EOF

# Shutdown the database
srvctl stop database -d $ORACLE_SID

# Start the database
srvctl start database -d $ORACLE_SID
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
---
- name: Check if Table SMON_SCN_TIME is clustered
script: check_if_index_cluster_exists.sh
register: cluster_name
changed_when: false

- name: Recreate the table system.smon_scn_time_org
script: recreate_smon_scn_time_table.sh
when: cluster_name.stdout is search("SMON_SCN_TO_AUX")

- name: Check if Flashback Data Archive Tablespace Exists
script: check_if_fda_tablespace_exists.sh
register: tablespace_name
Expand Down
Empty file.

0 comments on commit 4e58dab

Please sign in to comment.