Sop - DB Admin

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

PTCL Upgrade – DB Admin SOP

S# P Dependency Owner IBM DB Area DB Admin Sub Area Before Downtime


1 Admin
Description Copy and export grants into nahmad schema
Comments

Solution :
Create table dba_tab_privs

create table dbatabprivs as select * from dba_tab_privs;

export this table using exp

S# P Dependency Owner IBM DB Area DB Admin Sub Area Downtime


2 Admin
Description Stop Production 11G Database [Primary Database]
Comments

Solution :
Connect through Sqlplus and shutdown the database.

Load Primary database environment parameter [eq siebprod.env]

. .siebprod.env
sqlplus / as sysdba
shutdown immediate

S# P Dependency P2 Owner PTCL DB Area DB Admin Sub Area Downtime


3 Admin
Description Stop Managed Recovery at 11G Upgrade DB [Standby Database]
Comments

Solution :
Load Standby database environment parameter [eq siebprodnew.env]
. .siebprodnew.env
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

S# P Dependency Owner PTCL DB Area DB Admin Sub Area Downtime


4 Admin
Description Activate Upgrade DB i.e standby database

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP
Comments

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

S# P Dependency Owner IBM DB Area DB Admin Sub Area Downtime


5 Admin
Description 12c R1 Upgrade
Comments
Solution :

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

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> shutdown immediate


ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 1.0689E+10 bytes


Fixed Size 2255784 bytes
Variable Size 2147484760 bytes
Database Buffers 8522825728 bytes
Redo Buffers 16908288 bytes
Database mounted.
Database opened.
SQL>
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
PURGE DBA_RECYCLEBIN

@?/rdbms/admin/utlrp.sql
@?/rdbms/admin/utlprp.sql

--alter system set db_recovery_file_dest='/u01/FRA' scope=both;


alter database archivelog; -- optional database will be already in archivelog mode
alter database flashback on; -- optional database will be already in flashback mode
startup force

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;

COMP_NAME STATUS VERSION

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP
---------------------------------------- ----------- ----------
JServer JAVA Virtual Machine VALID 11.2.0.4.0
OLAP Analytic Workspace VALID 11.2.0.4.0
OLAP Catalog VALID 11.2.0.4.0
Oracle Application Express VALID 3.2.1.00.1
Oracle Database Catalog Views VALID 11.2.0.4.0
Oracle Database Java Packages VALID 11.2.0.4.0
Oracle Database Packages and Types VALID 11.2.0.4.0
Oracle Enterprise Manager VALID 11.2.0.4.0
Oracle Expression Filter VALID 11.2.0.4.0
Oracle Multimedia VALID 11.2.0.4.0
Oracle OLAP API VALID 11.2.0.4.0
Oracle Rules Manager VALID 11.2.0.4.0
Oracle Text VALID 11.2.0.4.0
Oracle Workspace Manager VALID 11.2.0.4.0
Oracle XDK VALID 11.2.0.4.0
Oracle XML Database VALID 11.2.0.4.0
Spatial VALID 11.2.0.4.0
cp /oracle/product/12.1.0/dbhome_1/rdbms/admin/preupgrd.sql .
cp /oracle/product/12.1.0/dbhome_1/rdbms/admin/utluppkg.sql .
SQL> truncate table sys.aud$;
 
Table truncated.
 
SQL> truncate table sys.fga_log$;
Table truncated

@/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

bash-4.2$ echo $ORACLE_HOME


/oracle/product/12.1.0/dbhome_1
bash-4.2$
bash-4.2$ create restore point before_db_upgrd guarantee flashback database;

CONN / AS SYSDBA
PURGE DBA_RECYCLEBIN

Load 12c Environment

bash-4.2$ dbua

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP

@$ORACLE_HOME/rdbms/admin/utlrp.sql
select comp_id,status from dba_registry;
Shutdown immediate
Startup mount
Alter database flashback off;
Alter database open;

16 Version 1.2 08/10/2021


PTCL Upgrade – DB Admin SOP
S# P Dependency Owner IBM DB Area DB Admin Sub Area Downtime
6 Admin
Description Backup of 12C DB
Comments

Solution :
PTCL team to get cold backup of database.

S# P Dependency Owner IBM DB Area DB Admin Sub Area Downtime


7 Admin
Description Stats Gathering using coe_stat package.
Comments Stats gathering as per oracle support Doc ID 2077227.2

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.

S# P1 Dependenc OwnerIBM DB Area DB Admin Sub Area After Upgrade


0 y Admin
Description Handover for Application Upgrade.
Comments

Solution :
Application Upgrade

S# P1 Dependenc P9 Owne DB Area DB Sub Area After Upgrade


1 y r Admin Admin
Description Indexes, triggers and grant scripts to be run.
Comments Scripts Application team will forward

Solution :
sqlplus / as sysdba
SQL> @indexes
SQL> @trigger
SQL> @grants

S# P1 Dependenc Owner PTCL/IBM Area DB Admin Sub Area After Upgrade


2 y
Description Roles and grants comparison.
Comments

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 '%$%';

S# P1 Dependenc Owner PTCL/IBM Area DB Admin Sub Area After Upgrade


16 Version 1.2 08/10/2021
PTCL Upgrade – DB Admin SOP
3 y
Description Update db_file_multiblock_read_count.
Comments

Solution :
ALTER SYSTEM SET db_file_multiblock_read_count=16 SCOPE=SPFILE;
SHUTDOWN IMMEDIATE
STARTUP

S# P1 Dependenc Owner PTCL/IBM Area DB Admin Sub Area After Upgrade


4 y
Description GUESTCST user creation
Comments

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;

16 Version 1.2 08/10/2021

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy