Total Pageviews

Sunday, March 5, 2023

Access Django app from other computers

This is very very simple

change in setting.py

ALLOWED_HOSTS = ['*']

python manage.py runserver 0.0.0.0:8000 

open linux terminal

sudo ifconfig

Get inet ipv4 address Run on other same local network PC

If you find following error

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: 
1. polls/ [name='index'] 
2. admin/ 
The current path, polls/, didn’t match any of these. Then

replace path(' ', views.index, name='index') with path('', views.index, name='index') in your polls/urls.py and check the result.



Thursday, November 10, 2022

Installation and setup of SAMBA and TkSmb in RedHat Linux 5

SAMBA is an open source software suite that provides seamless file and print services to SMB/CIFS clients. It is available for Linux, Solaris, SunOS, HP-UX, ULTRIX, DEC OSF/1, Digital UNIX, Dynix (Sequent), IRIX (SGI), SCO Open Server, DG-UX, UNIXWARE, AIX, BSDI, NetBSD, NEXTSTEP, A/UX, etc. For a detailed introduction see this article. Linux machines using SAMBA are seen by NT as part of a NT Domain and can share printers and directories with Windows (95/98/NT) machines. This tutorial will cover the basics of installing and setting up SAMBA, and also TkSmb, a graphical tool to manage shares between Linux and NT.

Read more...
 

Sunday, October 16, 2022

ORA-01017 Invalid username/password logon denied

In Oracle 11g a new parameter called SEC_CASE_SENSITIVE_LOGON which is defaults to TRUE for case sensitive passwords. My SCOTT password was "tiger" is small case and Forms 10g was taking it as "TIGER" on runtime.

Solution 1:

- Connect as sys and change the parameter to false.

      alter system set SEC_CASE_SENSITIVE_LOGON = FALSE; 

Sunday, August 28, 2022

ORA-01658: unable to create INITIAL extent for segment in tablespace SYSTEM

Import terminated successfully with warnings.

ALTER DATABASE DATAFILE 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF' RESIZE 3000M;

Or by adding a second datafile to the tablespace:

ALTER TABLESPACE SYSTEM

ADD DATAFILE 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF'

SIZE 1000M;

Or just allow the datafile to auto extend:

ALTER DATABASE

DATAFILE 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF'

AUTOEXTEND ON

MAXSIZE UNLIMITED;

ORA-00845: MEMORY_TARGET not supported on this system (During Starting Instance )

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.1.0.6 and later
Oracle Database - Standard Edition - Version 11.2.0.1 to 11.2.0.1 [Release 11.2]
Linux x86
Linux x86-64
***Checked for relevance on 30-Sep-2014***

SYMPTOMS

During the startup of the database instance the following error is raised:

SQL> connect sys as sysdba
Enter password: *****
Connected to an idle instance.

SQL> STARTUP NOMOUNT
ORA-00845: MEMORY_TARGET not supported on this system

The instance alert file shows:

Starting ORACLE instance (normal)
WARNING: You are trying to use the MEMORY_TARGET feature.
This feature requires the /dev/shm file system to be mounted for at Least <size> bytes.The /dev/shm is either not mounted or is mounted with available space less than this size.
Please fix this so that MEMORY_TARGET can work as expected. Current available is <size> and used is <size> bytes.memory_target needs larger /dev/shm


Also error messages like ORA-4031 may be reported and no new connections can be established to the database.

CHANGES

The Automatic Memory Management (AMM) has been implemented by setting parameters like MEMORY_TARGET and/or MEMORY_MAX_TARGET.

CAUSE

The new Automatic Memory Management functionality uses /dev/shm on Linux for SGA and PGA management. The errors occur if either MEMORY_TARGET or MEMORY_MAX_TARGET is configured larger than the configured /dev/shm size, or if /dev/shm is mounted incorrectly.

SOLUTION

Please confirm that ORACLE_HOME is set correctly. This error sometimes happens when it is not set correctly.

Make sure that the /dev/shm size is configured large enough, like in:

# mount -t tmpfs shmfs -o size=7g /dev/shm

In this case, the size of the shared memory device is configured to be 7GB.

In order to make the same change persistent across system reboots, add an entry for this to the /etc/fstab mount table, as in:

shmfs /dev/shm tmpfs size=7g 0

Note:

You should check with your System Administrator what the "best" size for /dev/shm is, based on what has been reported in the alert file. 

Also, many best practices now suggest disabling AMM especially in Exa* Engineered boxes that have larger memory capability and can use Huge / Large pages.
This is because AMM and Huge / Large pages are mutually exclusive and overall performance will be better using Huge pages

Make sure that the df output shows the correct /dev/shm configuration when using Oracle on the system:

$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
...
shmfs 6291456 832356 5459100 14% /dev/shm

This document is taken from Oracle Support Doc ID 465048.1 

ORA-01034: ORACLE not available or ORA-27101: shared memory realm does not exist

Open command prompt and execute the below commands:

set oracle_sid=DATABASE NAME
sqlplus /nolog
conn sys/sys as sysdba
shutdown abort

startup 

ORA-01012: Not Logged On

Problem Description Users cant able to login to database server. Though it allow sysdba to login, it does not allow to run any query. Sometimes it will show database is connected to an idle instance. But when we startup database it shall throw error ORA-01081: cannot start already-running ORACLE - shut it down first.

 $ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.3.0 Production on Sat Oct 12 07:53:11 2013

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance_name,status from v$instance;

ERROR at line 1:

ORA-01012: not logged onSQL> desc v$instance

ERROR:

ORA-01012: not logged on

SQL> startup

ORA-01012: not logged on

Changes

Oracle has been forcefully shutdown at OS level or crashed.

CAUSE

An orphaned shared memory segment belonging to the ORACLE_SID still exists from a previous instance startup.

The command

ps -ef | grep $ORACLE_SID

shows no processes but with ORACLE_SID set the Oracle 'sysresv' utility shows a shared memory segment for a non-existing instance, e.g.

$ sysresv

IPC Resources for ORACLE_SID "TEST" :

Shared Memory:

ID KEY

5963794 0x00000000

5996563 0x00000000

6029332 0xb2e3c9ac

Semaphores:

ID KEY

No semaphore resources used

Oracle Instance not alive for sid "TEST"

Solution

On OS level, remove the orphaned shared memory segment using:

ipcrm -m <problem shared memory id>

$ ipcrm -m 5963794

$ ipcrm -m 5996563

$ ipcrm -m 6029332

$sqlplus '/as sysdba'

Connected to an idle instance.

SQL> startup Oracle instance started

Total System Global Area 10689474560 bytes

Fixed Size 2237776 bytes

Variable Size 6375344816 bytes

Database Buffers 4294967296 bytes

Redo Buffers 16924672 bytes

Oracle Instance Started.

Oracle Database Opened.

The Fix for the Double Login Prompt when run report 6i from form

  Since you are running in a Desktop (client-server) architecture , the login prompt and buffering are directly tied to how the local Window...