Thursday, April 30, 2020

ORA-01012: not logged on

I was testing to restore a database from a VEEAM backup. After it reports it is finished I try to connect to the database and there is where I got this error.

ORA-01012: not logged on


[oracle@serpentcustom trace]$ tail -f $ORACLE_BASE/diag/tnslsnr/$(hostname -s)/listener/trace/listener.log
30-APR-2020 17:07:24 * service_update * wind * 0
2020-04-30T17:09:20.655123+08:00
30-APR-2020 17:09:20 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=epchrs.ecp.priv)(CID=(PROGRAM=sqlplus)(HOST=serpentcustom.ecp.priv)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.131.128.39)(PORT=27398)) * establish * epchrs.ecp.priv * 12518
TNS-12518: TNS:listener could not hand off client connection
 TNS-12547: TNS:lost contact
  TNS-12560: TNS:protocol adapter error
   TNS-00517: Lost contact
    Linux Error: 32: Broken pipe
2020-04-30T17:09:30.499809+08:00
30-APR-2020 17:09:30 * service_update * epchrs * 0


There is no problem with the listener since I still cannot connect using local oracle


[oracle@serpentcustom bin]$ sysresv

----TOP HALF NOT SHOWN

***************** End of Resource Limits Dump ******************
Maximum map count configured per process:  65530
Total /dev/shm size: 4100820992 bytes, used: 0 bytes
Shared Memory:
ID              KEY
5210115         0x00000000
5242884         0x00000000
5177346         0x00000000
5275653         0x3b6212a0
Semaphores:
ID              KEY
3440640         0x6466d928
3473409         0x6466d929
Oracle Instance alive for sid "epchrs"
[oracle@serpentcustom bin]$
[oracle@serpentcustom bin]$ ipcrm -m 5210115
[oracle@serpentcustom bin]$ ipcrm -m 5242884
[oracle@serpentcustom bin]$ ipcrm -m 5177346
[oracle@serpentcustom bin]$ ipcrm -m 5275653

This caused the database to shutdown.

I opened it but got an errror
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 4731170856 bytes
Fixed Size                  8667176 bytes
Variable Size             989855744 bytes
Database Buffers         3724541952 bytes
Redo Buffers                8105984 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode

-- So I bounce the database

SQL> shutdown immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 4731170856 bytes
Fixed Size                  8667176 bytes
Variable Size             989855744 bytes
Database Buffers         3724541952 bytes
Redo Buffers                8105984 bytes
Database mounted.
Database opened.
SQL> select * from chrs.backup_test;

DESCRIPTION
--------------------
CAP_DATE
----------------------------------------------------------
First One
29-APR-20 12.36.12.170958 PM

Second One
30-APR-20 09.27.12.569540 AM


SQL>
SQL> conn system/N3ptun30n3@epchrs
Connected.
SQL>


Tuesday, April 28, 2020

Configure Email on SQLSERVER

and then just do next>next


The only thing real here is the servername. You need to ask an Adminstrator to give you an SMTP server. I want to point out that all that has WatchDogOne in it can be anything you want. It can be spongebob if you want, you don't have to configure anything and this should work.

This is the most minimal setup you can do for mail setup



Monday, April 27, 2020

Check if SQL SERVER account is locked

SELECT LOGINPROPERTY('EWDocCon', 'IsLocked');

where EWDocCon is the user.

0=unlocked
1=locked

Friday, April 24, 2020

Read Audit file for SQL SERVER

select * from fn_get_audit_file('D:\SQL_AUDIT\Audit-20200424-144933_5CC133E8-7A26-4473-A638-ADBD88A6D173_0_132321940222150000.sqlaudit',
default,
default);


select [statement],[event_time] from fn_get_audit_file('D:\SQL_AUDIT\Audit-20200424-144933_5CC133E8-7A26-4473-A638-ADBD88A6D173_0_132321940222150000.sqlaudit',
default,
default);

Friday, April 17, 2020

EBS Cloning

If it was existing before and you just have to refresh.

1. run autoconfig on db tier

It is located on
login as oracle
cd $CONTEX_FILE

for me it was /dbapps/oracle/HRD2/db/tech_st/11.2.0/appsutil/scripts/HRD2_apollo


./adautocfg.sh

2. run autoconfig for appstier

apollo:/dbapps/applmgr>whoami
applmgr
 apollo:/dbapps/applmgr>cd $ADMIN_SCRIPTS_HOME
 apollo:/dbapps/applmgr/HRD2/inst/apps/HRD2_apollo/admin/scripts>./adautocfg.sh

How do I know which EBS am I using

connect as apps
select release_name from apps.fnd_product_groups;

Wednesday, April 15, 2020

RMAN BEST PRACTICAL PRACTICES

RMAN> configure archivelog deletion policy to backed up 2 times to device type disk;