Beruflich Dokumente
Kultur Dokumente
Adminsitrators
Introduction on page 1
Considerations on page 2
System variables on page 2
Database on page 2
Show Oracle Database version on page 2
Show database details on page 2
Show database size on page 3
Show Oracle Instant Client Version on page 3
Installed components in Database on page 3
Is Database of type OLAP? on page 3
Instance on page 4
Show database instance details on page 4
DB Schema for SAP on page 4
Tablespaces on page 4
Show tablespaces details on page 4
List of datafiles for tablespace on page 5
Find tables being used by tablespace on page 5
Check autoextend on page 5
Users on page 5
Show database users on page 6
Unlock user account on page 6
Create user on page 6
Delete SAP* user (or another user) on page 7
Password complexity on page 7
Datafiles on page 7
Check datafiles on page 7
List of datafiles on page 8
Resize datafile until size on page 8
Redologs on page 8
List of redologs groups and files belonging to each group on page 8
Active Redolog groups on page 9
SAP Queries on page 9
system in upgrade, no import possible on page 10
BRBACKUP error on page 10
Introduction
The main goal of this document is serving as a base for SAP Basis Administrator who work with Oracle
Databases and want to perform simple checks.
I will try to improve this document as much as I can.
Of course, do not hesitate to collaborate by adding more SQL queries.
Considerations
DBSID: SAP
SAPSID: SAP
System variables
SPOOL <filename>
SET LINESIZE 32767
SET WRAP OFF
SPOOL OFF
Check SQL*Plus User's Guide and Reference.
Database
Show Oracle Database version
SQL> SELECT * FROM v$version;
BANNER
-------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0
Production
TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
NAME
LOG_MODE OPEN_MODE
DATABASE_ROLE PLATFORM_NAME
--------- ------------ -------------------- ---------------- -------------------------SAP
NOARCHIVELOG READ WRITE
PRIMARY
AIX-Based Systems (64bit)
CLIENT_VERSION
-------------11.2.0.3.0
For a list of all possibilities to check and identify Oracle Instant Client Version check this document.
CLIENT_VERSION
-------------11.2.0.3.0
CLIENT_VERSION
-------------11.2.0.3.0
Instance
Show database instance details
SQL> SELECT INSTANCE_NAME, HOST_NAME, VERSION, STARTUP_TIME,
STATUS, INSTANCE_ROLE FROM v$instance;
INSTANCE_NAME HOST_NAME
VERSION STARTUP_TIME STATUS
INSTANCE_ROLE
------------- --------------- ------------ -----------------SAP
SAPSERVER
11.2.0.3.0 26-MAR-15
OPEN
PRIMARY_INSTANCE
Tablespaces
Show tablespaces details
SQL> SELECT TABLESPACE_NAME, STATUS, CONTENTS,
SEGMENT_SPACE_MANAGEMENT FROM dba_tablespaces;
TABLESPACE_NAME
STATUS CONTENTS SEGMEN
------------------------------ --------- --------- -----SYSTEM
ONLINE PERMANENT MANUAL
PSAPUNDO
ONLINE UNDO
MANUAL
SYSAUX
ONLINE PERMANENT AUTO
PSAPTEMP
ONLINE TEMPORARY MANUAL
PSAPSR3
ONLINE PERMANENT AUTO
PSAPSR3USR
ONLINE PERMANENT AUTO
TOOLS
ONLINE PERMANENT AUTO
PSAPSR3731
ONLINE PERMANENT AUTO
Check autoextend
SQL> select TABLESPACE_NAME,SEGMENT_SPACE_MANAGEMENT from
dba_tablespaces;
Users
OPEN
PASSWORD
ACCOUNT_STATUS
AUTHENTI
OPEN
PASSWORD
OPEN
EXTERNAL
OPEN
PASSWORD
OPEN
PASSWORD
EXPIRED(GRACE)
PASSWORD
EXPIRED(GRACE)
PASSWORD
Create user
SQL> CREATE USER <USERNAME> IDENTIFIED BY <PASSWORD> [PROFILE
<PROFILE_NAME>]
Password complexity
Execute script sap_utlpwdmg.sql from SAP Note 1522952 in SQL Plus:
SQL> @sap_utlpwdmg.sql
Datafiles
Check datafiles
SQL> SELECT FILE#, STATUS, ENABLED FROM v$datafile;
FILE# STATUS ENABLED
---------- ------- ---------375 ONLINE READ WRITE
376 ONLINE READ WRITE
377 ONLINE READ WRITE
378 ONLINE READ WRITE
379 ONLINE READ WRITE
List of datafiles
SELECT FILE_NAME AS Datafile, BYTES/1024/1024 AS "Size(MB)" FROM
DBA_DATA_FILES WHERE TABLESPACE_NAME LIKE '%<TABLESPACE_NAME>%';
Datafile
Size(MB)
------------------------------------------ --------------[...]
/oracle/SAP/sapdata9/sr3731_3/sr3731.data3
/oracle/SAP/sapdata9/sr3731_4/sr3731.data4
/oracle/SAP/sapdata9/sr3731_5/sr3731.data5
/oracle/SAP/sapdata9/sr3731_6/sr3731.data6
20000
20000
20000
20000
/oracle/SAP/sapdata9/sr3731_7/sr3731.data7
/oracle/SAP/sapdata5/sr3_348/sr3.data348
3500
31744
Redologs
List of redologs groups and files belonging to each
group
SELECT a.group#, a.member, b.bytes FROM v$logfile a, v$log b WHERE a.group# =
b.group#;
GROUP# MEMBER
---------- ----------------------------------26 /oracle/SAP/origlogB/log_g26_m1.dbf
26 /oracle/SAP/mirrlogB/log_g26_m2.dbf
25 /oracle/SAP/origlogA/log_g25_m1.dbf
25 /oracle/SAP/mirrlogA/log_g25_m2.dbf
24 /oracle/SAP/origlogB/log_g24_m1.dbf
24 /oracle/SAP/mirrlogB/log_g24_m2.dbf
23 /oracle/SAP/origlogA/log_g23_m1.dbf
23 /oracle/SAP/mirrlogA/log_g23_m2.dbf
22 /oracle/SAP/origlogB/log_g22_m1.dbf
22 /oracle/SAP/mirrlogB/log_g22_m2.dbf
21 /oracle/SAP/origlogA/log_g21_m1.dbf
21 /oracle/SAP/mirrlogA/log_g21_m2.dbf
SAP Queries
BRBACKUP error
When you are getting follwing error:
BR0051I BRBACKUP 6.40 (43)
BR0055I Start of database backup: bebchpaa.anf 2014-01-16 01.00.34
BR0484I BRBACKUP log file: /oracle/SAP/sapbackup/bebchpaa.anf
BR0071E BRBACKUP currently running or was killed
BR0072I Please delete file /oracle/SAP/sapbackup/.lock.brb if BRBACKUP was killed
BR0073E Setting of BRBACKUP lock failed
BR0056I End of database backup: bebchpaa.anf 2014-01-16 07.00.04
BR0280I BRBACKUP time stamp: 2009-07-26 07.00.05
BR0054I BRBACKUP terminated with errors
BR0280I BRBACKUP time stamp: 2009-07-26 07.00.05
BR0291I BRARCHIVE will be started with options '-U -jid ALLOG20090607070000 -d
util_file -c force -p initSAP.sap -cds'
Connect to database:
sqlplus /nolog
SQL> connect /as sysdba
End backup:
SQL> ALTER DATABASE END BACKUP;
Then check if lock exists the lock file and delete it. If not found then run the backup again.