Standby Database

Physical Standby Database


Steps :

1. Prepare of standby database.
2. Prepare of primary database
3. Configure physical standby

Given :

Source (Primary) database = orcl
Target (Standby) database = angel
All database in single node/machine.
** Database is in archive log mode**

**Note :- If Primary & Standby database is different node / machine , then add the machine IP address & Hostname entry on each machine.

Prepare the Standby database

1. Create password file for database :-
     

 Go to dbs folder :-
oracle@r0179] cd  /10g/product/10.2.0/db_1/dbs
oracle@r0179] orapwd file= orapwangel password=sys entries=3

2. Create pfile for target database :-

Go to dbs folder and copy Primary pfile and paste Standby pfile and edit :-

**Note :-  If pfile is no there then create pfile from spfile.

oracle@r0179]  cd  /10g/product/10.2.0/db_1/dbs
oracle@r0179]  cp initorcl.ora initangel.ora
oracle@r0179]  vi initangel.ora { :%s/orcl/angel/g}

and ** And add these parameters in target pfile:- **
*.db_name='orcl'    # PRIMARY DATABASE SID
*.db_unique_name=angel  # STANGBY DATABASE SID

*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,angel)'

*.LOG_ARCHIVE_DEST_1=
'LOCATION=/10g/flash_recovery_area/ANGEL/archivelog
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=angel'

*.LOG_ARCHIVE_DEST_2=
'SERVICE=orcl
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=orcl'

*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
*.LOG_ARCHIVE_MAX_PROCESSES=30
*.FAL_SERVER=orcl
*.FAL_CLIENT=angel
*.STANDBY_FILE_MANAGEMENT=AUTO

*.Db_file_name_convert='/10g/oradata/orcl','/10g/oradata/angel'
*.Log_file_name_convert='/10g/oradata/orcl','/10g/oradata/angel'

**Note :-  1. Check the path and save the file
                2. You can chenge the log format
                3. db_name should be primary database name.

3.  Create Spfile from pfile :-

 Create  to dbs folder :-
oracle@r0179] export ORACLE_SID=angel
oracle@r0179] sqlplus / as sysdba
sql> startup nomount
sql> create spfile from pfile
sql> shutdown immediate;

4. Create folder :-

Go to admin folder :-

oracle@r0179] cd /10g/oracle/admin/
oracle@r0179] mkdir angel
oracle@r0179] cd angel
oracle@r0179] mkdir bdump adump udump cdump dpdump

5. Configure tns entry for target database :-
By netca or add database enter in tnsname.ora

6. Listener restart & check tnsping:-
oracle@r0170] lsnrctl stop
oracle@r0170] lsnrctl start  {tnsping orcl & tnsping angel}


Prepare the Primary database                                                                                                                                         


1.    In Primary database enable the two paraneter in mount stage :-

oracle@r0179] export ORACLE_SID=orcl
oracle@r0179] sqlplus / as sysdba
sql> startup mount
sql> alter database archivelog;
sql> alter database force logging;


2. Create logfile & controlfile for standby in primary database :-

sql> alter database open;
sql> ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 '/10g/oradata/angel/stdby01.log' size 50m;
sql> ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 '/10g/oradata/angel/stdby02.log' size 50m;
sql> ALTER DATABASE ADD STANDBY LOGFILE GROUP 6 '/10g/oradata/angel/stdby03.log' size 50m;
sql> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/10g/oradata/angel/control_sb01.ctl';
sql> create pfile from spfile;
sql> shutdown immediate;

**Note:- Standby logfile and controlfile path is save in target database ($ORACLE_BASE/oradata/angel )

3.  Edit primary parameter :-

** And add these parameters in primary pfile:- **

*.db_name=orcl
*.db_unique_name=orcl
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,angel)'

*.LOG_ARCHIVE_DEST_1=
'LOCATION=/10g/flash_recovery_area/ORCL/archivelog
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=orcl'

*.LOG_ARCHIVE_DEST_2=
'SERVICE=angel LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=angel'

*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
*.LOG_ARCHIVE_MAX_PROCESSES=30
*.REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE'
*.FAL_SERVER=angel
*.FAL_CLIENT=orcl
*.STANDBY_FILE_MANAGEMENT=AUTO
*.Db_file_name_convert='/10g/oradata/orcl','/10g/oradata/angel'
*.Log_file_name_convert='/10g/oradata/orcl','/10g/oradata/angel'

4.  Create Spfile from pfile :-
 Create  to dbs folder :-

oracle@r0179] export ORACLE_SID=orcl
oracle@r0179] sqlplus / as sysdba
sql> startup mount
sql> create spfile from pfile
sql> shutdown immediate;

Configure physical standby

1. Copy the datafile + standby log file + standby controlfile to standy database and multiplexing og cont :-

oracle@r0179] cp /10g/oradata/orcl/*.dbf ../angel

2.Create spfile from pfile :-

oracle@r0179] export ORACLE_SID=angel
oracle@r0179] sqlplus / as sysdba
sql> startup mount;
sql> create spfile from pfile;
sql> shutdown immediate;

3. Start the bothe database :-

oracle@r0179] export ORACLE_SID=orcl
oracle@r0179] sqlplus / as sysdba
sql> startup;

oracle@r0179] export ORACLE_SID=angel
oracle@r0179] sqlplus / as sysdba
sql> startup mount;
sql> alter database recover managed standby database disconnect from session;

FOR READ ONLY (STANBY DATABASE):-

sql> alter database recover managed standby database cancel;
sql> alter database open read only;

Objective :- Physical Standby is completed  

 SQL> select sequence# from v$archived_log;

*****************************************END***************************************************

Windows Keyboard Shortcuts


20 Windows Keyboard Shortcuts You Might Not Know

Mastering the keyboard will not only increase your navigation speed but it can also help with
 wrist fatigue. Here are some lesser known Windows shortcuts to help you become a
keyboard ninja.
Global Windows Shortcuts
Win+1, 2, 3, 4, etc. will launch each program in your taskbar. It is helpful then to keep
your most used programs at the beginning of your task bar so you can open them one
right after another. This also works in Windows Vista for the quick launch icons.
Win+Alt+1, 2, 3, etc. will open the jump list for each program in the taskbar. You can
then use your arrows to select which jump list option you want to open.
Win+T will cycle through taskbar programs. This is similar to just hovering over the
item with your mouse but you can launch the program with Space or Enter.
Win+Home minimizes all programs except current the window. This is similar to the
Aero shake and can be disabled with the same registry key.
Win+B selects the system tray which isn’t always useful but can come in very handy if
your mouse stops working.
Win+Up/Down maximizes and restores down the current window so long as that window
has the option to be maximized. It is exactly the same as clicking on the middle button on
your windows.
Alt+Esc is like Alt+Tab but switches windows in the order they were opened and does not
have the fancy window preview overlay.
Win+Pause/Break will open your system properties window. This can be helpful if you
need to see the name of a computer or simple system statistics.
Ctrl+Esc can be used to open the start menu but will not work as a Windows key
replacement for other shortcuts.
Ctrl+Shift+Esc will open the task manager without needing to hit Ctrl+Alt+Del first.
Alt+Space will open the window system menu which can be used to maximize (x), minimize
 (n), close (c), or move (m) the window
 which can be especially helpful if your window is somehow off-screen.
This shortcut can also be helpful with windows that don’t close with the Alt+F4
 shortcut such as the command window.

Windows Explorer Shortcuts

Here are handy shortcuts built into Windows Explorer which may have similar features
 in other programs too.
Alt+Up will navigate up one folder level since the up arrow on the menu bar was removed in Windows Vista. Alternatively, you can also
 make Backspace go up one folder level with a handy AutoHotKey script.
Shift+F10 opens the contextual or “right click” menu for a file/folder. This can be very
handy for speed especially if you know which option you want to select. Look for an
underlined letter in each option to know which letter you can press for faster access.
Shift+Del deletes a file without sending it to the recycle bin because who wants to
 empty their recycle bin anyway?
Ctrl+Shift+N creates a new folder in your current directory.
Alt+Enter opens the file properties so you can view file size, sharing settings, and
creation date.
F2 renames a file or folder.
F3 will open explorer and select the search bar. If you already have an explorer window
open it will highlight the search bar. In some programs it will also open the search
dialog to search within that program.

F6 cycles objects in the current window. In explorer this will cycle between the location bar,
 options bar, left pane, and right pane. It also works with varying success in other programs.
F10 toggles the file menu in explorer.

10g installation step on Windows XP


Using the Oracle Universal Installer, you install the Oracle Database 10g software and create a database.


Installing Oracle 10g database software :

1. Insert Oracle CD , the auto-run window opens automatically. If you are installing from network or hard disk, click setup.exe in the installation folder.

my setup location:-c:\TEMP\database
2. The Oracle Universal Installer (OUI) will run and display the Select Installation MethodWindow.




3. Choose Basic Installation:
Select this option to quickly install Oracle Database 10g. This method requires minimal user input. It installs the software and optionally creates a general-purpose database based on the information you provide. 
For basic installation, you specify the following:
Oracle Home Location — Enter the directory in which to install the Oracle Database 10g software. You must specify a new Oracle home directory for each new installation of Oracle Database 10g. Use the default value, which is :
  1. c:\oracle\product\10.2.0\db_1

    Installation Type — Select Enterprise Edition :
    If you have limited space, select standard edition. Personal edition installs the same software as the Enterprise Edition, but supports only a single-user development and deployment environment.
    Create Starter Database — Check this box to create a database during installation. Oracle recommends that you create a starter database for first Create Starter Database — time installations. Choose a Global Database Name, like cs157b, or just use the default value.
    Type a password. Don’t lose this password, since you will need it to connect to the database server. Click next  







4. The Product-Specific Prerequisite Checks window appears: Click next 



5. A summary screen appears showing information such as your global settings, space requirements and the new products to be installed. Click Install to start the installation..

6. The Install window appears showing installation progress.

7. At the end of the installation phase, the Configuration Assistants window appears. This window lists the configuration assistants that are started automatically. 
If you are creating a database, then the Database Configuration Assistant starts automatically in a separate window.






At the end of database creation, you are prompted to unlock user accounts to make the accounts accessible. The SYS and SYSTEM accounts are already unlocked. Click OK to bypass password management.
Note: Oracle 10g still keeps HR /HR username and password (UID=HR, PWD=HR) from the old version of oracle. In the old version of oracle, HR/HR user ID is available by default, but not in oracle 10g. If you want to use  HR  / HR  account, you must unlock it by clicking “Password Management” at the last window. Password Management window will appear like the one shown below. Find the user name “HR” and uncheck the “Lock Account?” column for the user name.Here unlock two more account OE or SH..



8. Your installation and database creation is now complete. The End of Installation window displays several important URLs, one of which is for Enterprise Manager.


9. You can navigate to this URL in your browser and log in as the SYS user with the associated password, and connect as SYSDBA. You use Enterprise Manager to perform common database administration tasks 
Note : you can access Oracle Enterprise Manager using browser by typing the URL shown above in your browser. Instead of typing the IP address, you can also access the Enterprise Manager by typing http://localhost:1158/em or “http://[yourComputerName]:1158/em” or by clicking “Start >> All Programs >> Oracle – [YourOracleHome_home1] >> Database Control – [yourOracleID]” in Windows menu.
By default, use user ID “SYSTEM”, with the password that you have chosen at the beginning of installation, to connect to database, SQLPlus, etc. If you want to use other user ID, you may create a new user .



To test that your installation completed successfully, perform the following:
1.
When you click exit from the previous section, a browser opens and the Database Control URL is already launched. If this does not happen, open a browser and enter the following URL:
http://<hostname>:1158/em
Enter system as the User Name and oracle as the Password and click Login.






2.
The Licensing window appears. Scroll to the bottom and click I agree.



3.
The Database Control Home Page appears. Your Installation was successful. 







**********************END*********************************************





External Hard Disk suddenly cannot open

Your external hard disk was working very good all the times but suddenly you can't open it anymore, when you are trying to open it, it give the error message "You need to format disk in drive before you can use it", and your hard disk is 0 byte, means there is no file inside the hard disk. Means all the data inside the hard disk are gone!!!

Reason :
1) The external hard disk lost power while you are copying a file onto it.
2) The external hard disk usb cable was unplugged while transferring data.

Solution :
Please follow the steps at below :
1) Click the Safely Remove Hardware icon at the bottom right corner near the clock/time area on your desktop to safely remove your external hard disk.

2) Off the power supply of your external hard disk.
3) Unplug the usb cable of your external hard disk from your computer.
4) On the power supply, replug in the usb cable.
5) You will see the error message, Please Cancel it. (DON'T click Okay/Format/Whatever, click the X if necessary).
6) Click the Start button
7) Go to Accessories
8) Click Command Prompt
9) Type chkdsk e: /f (if your external hard disk drive is Drive E)... Replace the e letter if your external hard disk is not drive e.

10) Wait for few minutes to let the program fix the errors on your external hard disk. For me, it took about 3 minutes to fix it. Below is the screen shot that show the fix of my external hard disk :
 

Manually creating a new database on 11gR2

These are notes about creating a database manually. The DBCA can also be used to do this much more easily.

STEP:-1 

Create the directories

First, create the directories you need for the datafiles, eg:
# Don't need to create the admin directories in 11g since introduction 
# of diag_dest
mkdir -p /u01/oracle/dborafiles/11gr2/admin
mkdir -p /u01/oracle/dborafiles/11gr2/admin/bdump
mkdir -p /u01/oracle/dborafiles/11gr2/admin/cdump
mkdir -p /u01/oracle/dborafiles/11gr2/admin/udump
mkdir -p /u01/oracle/dborafiles/11gr2/datafiles
mkdir -p /u01/oracle/dborafiles/11gr2/redo
For a production setup, each of these areas is probably a separate mount point on different disks etc.

STEP:-2

Create a minimal init.ora

This file should go into $ORACLE_HOME/dbs and be called initSID.ora:
control_files = (/u01/oracle/dborafiles/ora11gr2/datafiles/control01.ora,
                 /u01/oracle/dborafiles/ora11gr2/datafiles/control02.ora,
                 /u01/oracle/dborafiles/ora11gr2/datafiles/control03.ora)

undo_management = auto
db_name = ora11gr2
db_block_size = 8192

# 11G (oracle will create subdir diag and all the required subdirs)
diagnostic_dest      = /u01/oracle/dborafiles/ora11gr2

# Pre 11G specifiy these parameters
# background_dump_dest = /u01/oracle/dborafiles/ora11gr2/admin/bdump
# core_dump_dest       = /u01/oracle/dborafiles/ora11gr2/admin/cdump
# user_dump_dest       = /u01/oracle/dborafiles/ora11gr2/admin/udump

STEP:-3

Set the SID for your session

export ORACLE_SID=ora11gr2

Connect to SQLPLUS

$ sqlplus /nolog
SQL11g> connect / as sysdba
 

STEP:-4

Create the SPFILE

$ create SPFILE from PFILE='/dboracle/product/11.2.0/dbhome_1/dbs/init11gr2.ora'

STEP:-5

 Startup the instance

SQL> startup nomount

STEP:-6

Create the database

create database ora11gr2
  logfile   group 1 ('/u01/oracle/dborafiles/ora11gr2/redo/redo1.log') size 10M,
            group 2 ('/u01/oracle/dborafiles/ora11gr2/redo/redo2.log') size 10M,
            group 3 ('/u01/oracle/dborafiles/ora11gr2/redo/redo3.log') size 10M
  character set          WE8ISO8859P1
  national character set utf8
  datafile '/u01/oracle/dborafiles/ora11gr2/datafiles/system.dbf' 
            size 50M
            autoextend on 
            next 10M
            extent management local
  sysaux datafile '/u01/oracle/dborafiles/ora11gr2/datafiles/sysaux.dbf' 
            size 10M
            autoextend on 
            next 10M 
  undo tablespace undo
            datafile '/u01/oracle/dborafiles/ora11gr2/datafiles/undo.dbf'
            size 10M
            autoextend on
  default temporary tablespace temp
            tempfile '/u01/oracle/dborafiles/ora11gr2/datafiles/temp.dbf'
            size 10M
            autoextend on
( TODO - unsure about setting max files sizes on these files )

STEP:-7

Create the catalogue

SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql

STEP:-8

As SYSTEM (not SYS) run the following:

SQL> @$ORACLE_HOME/sqlplus/admin/pupbld.sql
(not doing this doesn't cause any harm, but a warning is displayed when logging into SQLPLUS if it is not run)
The database is now basically ready to use, but there no users and no users tablespace. Note it is also NOT in archive log mode, so is certainly not production ready, but may be good enough for a non-backed up dev instance.

STEP:-9

Create the users tablespace, local, auto allocate

SQL>CREATE TABLESPACE users DATAFILE '/u01/oracle/dborafiles/ora11gr2/datafiles/users_01.dbf' 
    SIZE 50M
    autoextend on 
    maxsize 2048M
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

STEP:-10

Create a user

SQL >   create user sonu 
        identified by sonu 
        default tablespace users 
        temporary tablespace temp;

SQL> alter user sonu quota unlimited on users;

SQL> grant connect, create procedure, create table, alter session to sonu;

STEP:-11

Ensure the database comes up at start-up time

Add a line to /etc/oratab to tell Oracle about the instance. This is used by the dbstart command, which will start all the database specified in this file:
ora11gr2:/u01/oracle/dboracle/product/11.2.0/dbhome_1:Y
To start all instances use dbstart and to stop use dbshut.
TODO - control script to autostart databases when the machine boots.

STEP:-12

Setup the listener

At this point, only people on the local machine can connect to the database, so the last step is to setup the listener. All you need to do here is add a file called listener.ora in $ORACLE_HOME/network/admin, and have it contain something like the following:
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = sonu.oracle.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
  )
Creating a tnsnames.ora file at this point would be a good idea too. It also goes into $ORACLE_HOME/network/admin:
ora11gr2 =
 (DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(Host = sonu.oracle.com)(Port = 1521))
   )
 (CONNECT_DATA =
   (SERVICE_NAME = ora11gr2)
 )
) 
 
********************END***************************************** 

Creating a Custom Application in Apps11i

Custom Applications are required if you are creating new forms, reports, etc. This allows you to segregate your custom written files from the standard seeded functionality that Oracle Applications provide. Customizations can therefore be preserved when applying patches or upgrades to your environment.
1) Make the directory structure for your custom application files.
cd $APPL_TOP
mkdir cust
mkdir cust/11.5.0
mkdir cust/11.5.0/admin
mkdir cust/11.5.0/admin/sql
mkdir cust/11.5.0/admin/odf
mkdir cust/11.5.0/sql
mkdir cust/11.5.0/bin
mkdir cust/11.5.0/reports
mkdir cust/11.5.0/reports/US
mkdir cust/11.5.0/forms
mkdir cust/11.5.0/forms/US
mkdir cust/11.5.0/$APPLLIB
mkdir cust/11.5.0/$APPLOUT
mkdir cust/11.5.0/$APPLLOG
2) Add the custom module into the environment
Apply ADX.E.1 and add the entry to topfile.txt as a standard product top entry (follow the existing model in the file) Customised environment variables can be added to AutoConfig by using the filename specificed by s_custom_file, which is then called from the APPSORA.env file.
If using Forms Listener Servlet, you may also need to add $CUSTOM_TOP to formsservlet.ini in $APACHE_TOP/Jserv/etc
3) Create new tablespace for database objects

[oracle@r0469 ~]$ cd /oracle/VIS/db/tech_st/11.1.0/
[oracle@r0469 11.1.0]$ . VIS_r0469.env
[oracle@r0469 11.1.0]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on Fri Aug 31 16:23:12 2012

Copyright (c) 1982, 2008, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create tablespace cust datafile '/oracle/VIS/db/apps_st/data/cust.dbf' size 20M;

Tablespace created.


4) Create schema
create user cust identified by cust
default tablespace cust
temporary tablespace temp
quota unlimited on cust
quota unlimited on temp;
grant connect, resource to cust;


SQL> create user cust identified by cust default tablespace cust;
SQL> grant connect, resource to cust;


5) Register your Oracle Schema.
Login to Applications with System Administrator responsibility
Navigate to Application-->Register
Application = cust Custom
Short Name = cust
Basepath = cust_TOP
Description = cust Custom Application
6) Register Oracle User
Naviate to Security-->Oracle-->Register
Database User Name = cust
Password = cust
Privilege = Enabled
Install Group = 0
Description = cust Custom Application User
7) Add Application to a Data Group
Navigate to Security-->Oracle-->DataGroup
Data Group = custGroup
Description =custCustom Data Group
Click on "Copy Applications from" and pick Standard data Group, then add the following entry.
Application = custCustom
Oracle ID = APPS
Description = custCustom Application

8) Create custom request group
This will act as a placeholder for any custom reports we wish to make available for the Custom Responsibility (which is defined at a
later stage)
Navigate to Security-->responsibility-->Request
Group = custRequest Group
Application = custCustom
Code =cust
Description = cust Custom Requests
We will not define any requests to add to the group at this stage, but you can add some now if required.

9) Create custom menu
This will act as a placeholder for any menu items we wish to make available for the Custom Responsibility (which is defined at a later
stage) We will create two menus, one for Core Applications and one for Self Service.
Navigate to Application-->Menu
Menu = cust_CUSTOM_MENU
User Menu Name =cust Custom Application
Menu Type =
Description =custCustom Application Menu
Seq = 100
Prompt = View Requests
Submenu =
Function = View All Concurrent Requests
Description = View Requests
Seq = 110
Prompt = Run Requests
Submenu =
Function = Requests: Submit
Description = Submit Requests
Menu =cust_CUSTOM_MENU_SSWA
User Menu Name = custCustom Application SSWA
Menu Type =
Description =cust Custom Application Menu for SSWA
10) Create new responsibility. One for Core Applications and One for Self Service (SSWA)
Navigate to Security-->Responsibility-->Define
Responsibility Name = cust Custom
Application = cust Custom
Responsibility Key = custCUSTOM
Description = custCustom Responsibility
Available From = Oracle Applications
Data Group Name = custGroup
Data Group Application = cust Custom
Menu = cust Custom Application
Request Group Name = cust Request Group
Responsibility Name = cust Custom SSWA
Application = cust Custom
Responsibility Key = custCUSTOMSSWA
Description = cust Custom Responsibility SSWA
Available From = Oracle Self Service Web Applications
Data Group Name = custGroup
Data Group Application = cust Custom
Menu = cust Custom Application SSWA
Request Group Name = cust Request Group
11) Add responsibility to user
Navigate to Security-->User-->Define
AddcustCustom responsibility to users as required.
12) Other considerations
You are now ready to create your database Objects, custom Reports, Forms, Packages, etc
Create the source code files in the cust_TOP directory appropriate for the type of object. For example forms would be located in
$cust_TOP/forms/US or package source code in $cust_TOP/admin/sql for example.

Database Objects, such as tables, indexes and sequences should be created in the cust schema, then you need to
a) Grant all privilege from each custom data object to the APPS schema.
For example : logged in as cust user
grant all privileges on my Table to apps;
b) Create a synonym in APPS for each custom data object
For example : logged in as APPS user
create synonym myTable for cust.myTable;
Other database objects, such as views and packages should be created directly in the APPS schema.

******************************END****************************************

ERROR 1396 (HY000): Operation ALTER USER failed for 'Mysql'@'%'

 This MySQL error — ERROR 1396 (HY000): Operation ALTER USER failed for 'Mysql'@'%' — means that MySQL cannot find the user ...