SQL Server : Truncate Transaction Log

We can truncate transaction log (to reclaim free space in our drive) by using command :

ALTER DATABASE CRM_MSCRM
SET RECOVERY SIMPLE
GO

DBCC SHRINKFILE (mscrm_log, 1)
GO
       
ALTER DATABASE CRM_MSCRM
SET RECOVERY FULL
GO

Switch back to simple recovery >> then shrink >> switch back again to full recovery

ALTER DATABASE MSCRM_CONFIG
SET RECOVERY SIMPLE
GO

DBCC SHRINKFILE (MSCRM_CONFIG_LOG, 1)
GO
       
ALTER DATABASE MSCRM_CONFIG
SET RECOVERY FULL
GO

Script synchronize : Windows Server to Linux

Script to synchronize from Windows to Linux Server.

We need to install winscp first :

@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /ini=nul ^
  /command ^
    "open sftp://username:password@ipaddress/ -hostkey=""ssh-rsa 2048 DjbPCYr0zjTEFTgiADlitTP0vFVJK+a5s6+69Q1wDnQ=""" ^
"synchronize remote C:\xampp\mysql\data\itracking ""/share/CACHEDEV2_DATA/BACKUP 2018/bkp_itracking/data""" ^
"synchronize remote C:\xampp\htdocs\itracking ""/share/CACHEDEV2_DATA/BACKUP 2018/bkp_itracking/htdocs""" ^
    "exit"
   
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0
(
  echo Success
)
else
(
  echo Error
)

exit

save as .bat file, then execute via task scheduler windows

Error Startup ASM Instance : ORA-29701 ORA-29701

[oracle@icndrc db_1]$ export ORACLE_HOME=/u01/app/11.2.0/grid/product/11.2.0/asm/
[oracle@icndrc db_1]$ asmcmd
Connected to an idle instance.
ASMCMD> exit
[oracle@icndrc db_1]$ echo $ORACLE_SID
+ASM1
[oracle@icndrc db_1]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 24 13:56:34 2018

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service
SQL> exit
Disconnected
[oracle@icndrc db_1]$ echo $PATH
/u01/app/oracle/product/11.2.0/db_1/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
[oracle@icndrc db_1]$ export PATH=/u01/app/11.2.0/grid/product/11.2.0/asm/bin
[oracle@icndrc db_1]$ asmcmd
Connected to an idle instance.
ASMCMD> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service
Connected to an idle instance.
ASMCMD> exit
[oracle@icndrc db_1]$ sqlplus / as sysasm

[oracle@icndrc db_1]$ crsctl start resource ora.cssd
CRS-2679: Attempting to clean 'ora.cssd' on 'icndrc'
CRS-2672: Attempting to start 'ora.diskmon' on 'icndrc'
CRS-2676: Start of 'ora.diskmon' on 'icndrc' succeeded
CRS-2681: Clean of 'ora.cssd' on 'icndrc' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'icndrc'
CRS-2676: Start of 'ora.cssd' on 'icndrc' succeeded
[oracle@icndrc db_1]$ crsctl enable has
CRS-4622: Oracle High Availability Services autostart is enabled.
[oracle@icndrc db_1]$ crsctl start has
CRS-4640: Oracle High Availability Services is already active
CRS-4000: Command Start failed, or completed with errors.
[oracle@icndrc db_1]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DG_DATA.dg ora....up.type ONLINE    OFFLINE
ora.DG_RECO.dg ora....up.type ONLINE    OFFLINE
ora....BY.lsnr ora....er.type ONLINE    ONLINE    icndrc
ora....BY.lsnr ora....er.type ONLINE    ONLINE    icndrc
ora....BY.lsnr ora....er.type ONLINE    ONLINE    icndrc
ora....ER.lsnr ora....er.type ONLINE    ONLINE    icndrc
ora.asm        ora.asm.type   ONLINE    OFFLINE
ora.cssd       ora.cssd.type  ONLINE    ONLINE    icndrc
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   ONLINE    OFFLINE
ora.fmsstby.db ora....se.type ONLINE    OFFLINE
ora....stby.db ora....se.type ONLINE    OFFLINE
ora....stby.db ora....se.type ONLINE    OFFLINE
ora.ons        ora.ons.type   OFFLINE   OFFLINE
[oracle@icndrc db_1]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 24 14:05:32 2018

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-00099: warning: no parameter file specified for ASM instance
ASM instance started

Total System Global Area  409194496 bytes
Fixed Size                  2228864 bytes
Variable Size             381799808 bytes
ASM Cache                  25165824 bytes
ORA-15110: no diskgroups mounted


SQL> alter diskgroup mount;
alter diskgroup mount
                    *
ERROR at line 1:
ORA-15101: no action specified

SQL> select name,state from v$asm_diskgroup;

NAME                           STATE
------------------------------ -----------
DG_DATA                        DISMOUNTED
DG_RECO                        DISMOUNTED

SQL> alter diskgroup all mount;
*
ERROR at line 1:
ORA-15110: no diskgroups mounted


SQL> shu immediate;
ORA-15100: invalid or missing diskgroup name


ASM instance shutdown
SQL> startup restrict;
ORA-00099: warning: no parameter file specified for ASM instance
ASM instance started

Total System Global Area  409194496 bytes
Fixed Size                  2228864 bytes
Variable Size             381799808 bytes
ASM Cache                  25165824 bytes
ORA-15110: no diskgroups mounted

SQL> select name,state from v$asm_diskgroup;

NAME                           STATE
------------------------------ -----------
DG_DATA                        DISMOUNTED
DG_RECO                        DISMOUNTED

SQL> startup
ORA-00099: warning: no parameter file specified for ASM instance
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate;
ORA-15100: invalid or missing diskgroup name


ASM instance shutdown
SQL> startup
ORA-00099: warning: no parameter file specified for ASM instance
ASM instance started

Total System Global Area  409194496 bytes
Fixed Size                  2228864 bytes
Variable Size             381799808 bytes
ASM Cache                  25165824 bytes
ORA-15110: no diskgroups mounted


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64                                                                                        bit Production
With the Automatic Storage Management option
[oracle@icndrc db_1]$ asmcmd lsdg
[oracle@icndrc db_1]$ asmcmd

SQL> startup
ORA-00099: warning: no parameter file specified for ASM instance
ASM instance started

Total System Global Area  409194496 bytes
Fixed Size                  2228864 bytes
Variable Size             381799808 bytes
ASM Cache                  25165824 bytes
ORA-15110: no diskgroups mounted


SQL> select name from v$asm_diskgroup;

NAME
------------------------------
DG_DATA
DG_RECO

SQL> alter diskgroup dg_data mount;

Diskgroup altered.

SQL> alter diskgroup dg_reco mount;

Diskgroup altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option
[oracle@icndrc db_1]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576    511990   287819                0          287819              0             N  DG_DATA/
MOUNTED  EXTERN  N         512   4096  1048576    102398    59227                0           59227              0             N  DG_RECO/

RMAN : Backup DB Oracle to another location

We can using RMAN backup to another location by using command :

run
{
  allocate channel d1 device type disk format '/home/oracle/hore_%T_%t_%s.bck';
  backup database plus archivelog;
  release channel d1;
}

Create Domain Weblogic

Step by step create weblogic's domain :

1. Cd to bin weblogic, execute config.sh

2. Create a new Weblogic domain

3. Choose Oracle SOA Suite, Oracle EM, & Oracle WSM Policy manager

4. Open new session terminal, create folder for domains,applicatiopns, & nodemanager

5. Specify password & username for Administrator

6. Choose JDK, then click next

7. Enter password for schema based from previous setup RCU

8. Choose Administration Server, Managed Servers, Clusters and Machines

9. Enter name & listen port 7001

10. Enter Server Name & Listen Port

11. Enter cluster name

12. Assign Server to clusters

13. Input machine name

14. Assign servers to machine

15. Summary Configuration, click create

16. Done

Step by Step Install Oracle Fusion Middleware SOA

Step by step install Oracle Fusion Middleware SOA :

1. Execute runinstaller

2. Specify JDK location

3. Click Next

4. Choose skip software updates

5. Make sure all prerequisites have been passed

6. Specify oracle Middleware Home & Oracle Home directory

7. Choose Weblogic

8. Click Install

9. Installation Progress


10. Installation Complete

Step by Step setup Repository Creation Utility (RCU) for Oracle SOA

Step by Step setup Repository Creation Utility (RCU) for Oracle SOA

1. Unzip installer file

2. Execute file installer ./rcu

3. Click Next on Welcome Screen

4. Click create

5. Enter hostname,port,db_name,password from user sys

6. Checking Prerequisites

7. Choose New Prefix, check SOA & BPM Infrastructure

8. Specify for password

9. Summary DB details, click create

10. On progress

11. Completion Summary