update : 28-06-2017

DBA Script : dba_cr_init.sql

-- | FILE : dba_cr_init.sql |
-- +----------------------------------------------------------------------------+
-- | |
-- | |
-- | www.high-oracle.com |
-- |----------------------------------------------------------------------------|
-- | www.high-oracle.com |
-- |----------------------------------------------------------------------------|
-- | DATABASE : Oracle |
-- | FILE : dba_cr_init.sql |
-- | CLASS : Database Administration |
-- | PURPOSE : This script reads the database instance parameters and creates |
-- | an example init.ora file. This is often used when cloning a |
-- | database and need a fresh text init.ora file for the new |
-- | database. |
-- | NOTE : As with any code, ensure to test this script in a development |
-- | environment before attempting to run it in production. |
-- +----------------------------------------------------------------------------+
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SET LINESIZE 32767
SET PAGESIZE 50000
SET TERMOUT ON
SET TIMING OFF
SET TRIMOUT ON
SET TRIMSPOOL ON
SET VERIFY OFF
CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTES
COLUMN oracle_sid NEW_VALUE xoracle_sid NOPRINT FORMAT a1
SELECT value oracle_sid
FROM v$parameter
WHERE name = 'instance_name'
/
spool init&xoracle_sid..ora.sample
SELECT
'# +-------------------------------------------------------------------+' || chr(10) ||
'# | FILE : init' || i.value || '.ora' || LPAD('|', 43-length(i.value), ' ') || chr(10) ||
'# | CREATION DATE : ' ||
to_char(sysdate, 'DD-MON-YYYY') ||
' |' || chr(10) ||
'# | DATABASE NAME : ' || d.value || LPAD('|', 51-length(d.value), ' ') || chr(10) ||
'# | INSTANCE NAME : ' || i.value || LPAD('|', 51-length(i.value), ' ') || chr(10) ||
'# | SERVER NAME : ' || s.value || LPAD('|', 51-length(s.value), ' ') || chr(10) ||
'# | GLOBAL NAME : ' || g.global_name|| LPAD('|', 51-length(g.global_name), ' ') || chr(10) ||
'# +-------------------------------------------------------------------+'
FROM
v$parameter d
, v$parameter i
, v$parameter s
, global_name g
WHERE
d.name = 'db_name'
AND i.name = 'instance_name'
AND s.name = 'service_names';
select
'# +---------------------+' || chr(10) ||
'# | DATABASE PARAMETERS |' || chr(10) ||
'# +---------------------+'
from dual;
SELECT
DECODE(isdefault, 'TRUE', '# ') ||
DECODE(isdefault, 'TRUE', RPAD(name,43), RPAD(name,45)) ||
' = ' ||
value
FROM v$parameter
ORDER BY name;
spool off
SET FEEDBACK 6
SET HEADING ON

End Script

Oracle Database Error Messages



Oracle Database High Availability Any organization evaluating a database solution for enterprise data must also evaluate the High Availability (HA) capabilities of the database. Data is one of the most critical business assets of an organization. If this data is not available and/or not protected, companies may stand to lose millions of dollars in business downtime as well as negative publicity. Building a highly available data infrastructure is critical to the success of all organizations in today's fast moving economy.

Well, the reason for above error is that i have taken the above script from a 11g database and running it on 10g database. 11g has bring some changes in password management. Below code is executed on 11g and user created successfully, which is expected result.