Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dst 16975 #490

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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