Sop - DB Admin
Sop - DB Admin
Sop - DB Admin
Solution :
Create table dba_tab_privs
Solution :
Connect through Sqlplus and shutdown the database.
. .siebprod.env
sqlplus / as sysdba
shutdown immediate
Solution :
Load Standby database environment parameter [eq siebprodnew.env]
. .siebprodnew.env
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Solution :
1- Check status of standby database
2- Create flashback restore point
3- Activate standby database
sqlplus / as sysdba
Check recovery and mode
SQL> SELECT RECOVERY_MODE FROM V$ARCHIVE_DEST_STATUS;
SQL> select name,open_mode,database_role from v$database;
SQL> recover standby database until cancel;
SQL> alter database activate standby database;
SQL> shutdown immediate
SQL> startup
SQL> select name,open_mode,database_role from v$database;
NAME OPEN_MODE DATABASE_ROLE
--------- -------------------- ----------------
SIEBPROD READ WRITE PRIMARY
Prerequisites
Environemnt : 11gR2
There are a lot of potential prerequisites, which will vary depending on the functionality you are using in
your source version. Please check them in the documentation, or you may fail to upgrade your database
successfully.
In addition to other prerequisites, you will always be asked to do the following actions
Gather dictionary statistics. For a non-CDB database you will do the following from an SQL prompt.
SQL> startup
ORACLE instance started.
@?/rdbms/admin/utlrp.sql
@?/rdbms/admin/utlprp.sql
set pagesize500
set linesize 100
select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from
dba_registry order by comp_name;
@/oracle/product/12.1.0/dbhome_1/rdbms/admin/emremove.sql
SQL> select aclid, start_date, end_date from xds_ace where start_date is not null;
no rows selected
CONN / AS SYSDBA
PURGE DBA_RECYCLEBIN
bash-4.2$ dbua
@$ORACLE_HOME/rdbms/admin/utlrp.sql
select comp_id,status from dba_registry;
Shutdown immediate
Startup mount
Alter database flashback off;
Alter database open;
Solution :
PTCL team to get cold backup of database.
Solution :
sqlplus / as sysdba
sql> @coe_stats.sql
S# P Dependency P6 Owner IBM DBA Area Database Sub Area Before Downtime
8
Description Oracle system parameters to be checked and verified as per 12C.
Comments
Solution :
Oracle 12c R1 parameters to be verified and set as per Doc ID 2077227.2
NAME RECOMMENDED Parameters in 12C
_always_semi_join OFF
_b_tree_bitmap_plans FALSE
_gc_defer_time 0 (for RAC implementation)
_like_with_bind_as_equality TRUE
_no_or_expansion FALSE
_optimizer_max_permutations 100
_partition_view_enabled FALSE
cursor_sharing EXACT
db_file_multiblock_read_count 8 - 32 ****
open_cursors > 2000
optimizer_adaptive_features FALSE
optimizer_adaptive_reporting_only FALSE
optimizer_dynamic_sampling 1, 2 (D) or 11 ***
optimizer_features_enable 12..x.x.x or <12.1.0.1*
optimizer_index_caching 0
16 Version 1.2 08/10/2021
PTCL Upgrade – DB Admin SOP
optimizer_index_cost_adj 1 or 100 (D) **
optimizer_mode ALL_ROWS
pga_aggregate_target 1 GB or greater - See AWR PGA Memory Advisory
query_rewrite_enabled FALSE
query_rewrite_integrity ENFORCED
session_cached_cursors >= 50 (D) - 200
sga_target See AWR SGA Target Advisory ******
shared_pool_size See AWR Shared Pool Advisory
sort_area_retained_size if PGA_AGGREGATE_TARGET is set, then AUTO
sort_area_size set PGA_AGGREGATE_TARGET instead
star_transformation_enabled FALSE
statistics_level TYPICAL *****
workarea_size_policy if PGA_AGGREGATE_TARGET is set, then AUTO
Note : Only db_file_multiblock_read_count will not be set before upgrade, it will pick the value from system by
default, we will change its value to 8 or 16 after upgrade.
S# P Dependency P7 Owner IBM DBA Area Database Sub Area Before Downtime
9
Description Pre-requisites for Upgrade.
Comments - NLS_SORT parameter must be BINARY (NLS_DATABASE_PARAMETERS)
- Pctincrease on the tablespaces should be high to avoid too many extents
- Pctfree must be 30 or higher on the large tables.like S_ORG_EXT,S_CONTACT etc
- DB_CACHE_SIZE. Set parameter to a minimum of 394264576, higher would be
better.
- SORT_AREA_SIZE. Set this parameter to a minimum of 1524288. Higher would be
better - AUTOMATIC
- UNDO_MANAGEMENT should be set to auto - CONFIRMED
- Rollback Segments. Verify that you have only one large rollback segment on line
that is appropriately sized so that the largest of transactions can be accommodated.
Take all other rollback segments off line
Solution :
- NLS_SORT :
ALTER SYSTEM SET NLS_SORT=BINARY SCOPE=SPFILE;
Shutdown immediate;
Startup
Show parameter nls_sort
- Pctincrease: Since tablespaces are locally managed so we unable to set this parameter.
- Pctfree : table sizes > 10GB, use alter table siebel.S_WFA_STPRP_LOG pctfree 30;
- DB_CACHE_SIZE: This parameter is automatically set and it depends upon sga_max_size.
- SORT_AREA_SIZE. Obsolete parameter – below mentioned parameter to be set instead.
- UNDO_MANAGEMENT: AUTO
- Rollback Segments. Obsolete rollback segments are to be handled automatically using above parameter.
- For multiple processors (CPUs), then verify that the following parameters are set correctly parallel_max_servers.
- DB is in no archive mode or FRA to be monitored by PTCL, there wont be space related issue in FRA so it is better to turn
16 Version 1.2 08/10/2021
PTCL Upgrade – DB Admin SOP
DB on NOARCHIVELOG mode.
Solution :
Application Upgrade
Solution :
sqlplus / as sysdba
SQL> @indexes
SQL> @trigger
SQL> @grants
Solution :
Use below query to find out
select 'grant '||privilege||' on '||owner||'.'||TABLE_NAME||' to "'||grantee||'";'
from
(select Grantee,owner,table_name,grantor,privilege from dbarole_privs
minus
select Grantee,owner,table_name,grantor,privilege from dba_tab_privs where owner in
('SIEBEL','CRMR')
) where table_name not like '%$%';
Solution :
ALTER SYSTEM SET db_file_multiblock_read_count=16 SCOPE=SPFILE;
SHUTDOWN IMMEDIATE
STARTUP
Solution :
CREATE USER "GUESTCST" IDENTIFIED BY ptcl123 DEFAULT TABLESPACE "SIEBEL_TABLESPACE" TEMPORARY
TABLESPACE "TEMP_TABLESPACE2";
ALTER USER "GUESTCST" DEFAULT ROLE "SSE_ROLE";
GRANT CONNECT,RESOURCE,SSE_ROLE,CREATE SESSION,SSE_ROLE_IU,SQLT_USER_ROLE,UNLIMITED
TABLESPACE TO GUESTCST;