Maxl statement create or replace database freezes essbaseserver
We run on daily basis maxl scripts to copy database from one application to another.
with statements like:
alter system logout session on database 'Devel_H'.'HRM';
create or replace database 'INform'.'HRM' as 'Devel_H'.'HRM';
We just migrated (from esb7.1) to essbase 931 on a win2003 professional server 64 bit.
Overall performance looks better then before. (like calcs and retrievals)
But this proces of creating db takes far longer and even freezes all other stuff on this server.
This happens with large (20GB) and small (3Gb) databases. Only the freeze period divers.
Also EAS sessions and WA sessions are frozen the whole periode of the create.
What could cause this behavior?
Since I have an idea it’s an OS matter and not an Essbase an another question/answer which might lead to an solution:
What (on os level) happens during a "create or replace...." command:
For sure its not a simple xcopy or copy command. Since the files are filled step by step (terrible slow) and not just copied.
Similar Messages
-
Maxl statement create user to shared services
<p>when you create a user in shared services, you can specify afirst name, last name, and email address into textboxes.</p><p> </p><p>now, when you create a user with maxl, can you specify to placea first name, last name, and email address into those textboxes? ican only seem to add a comment into the description textbox.</p>
<p>actually, you can't even insert text in the description textbox.the comment code with maxl statement is only for maxl and notshared services.</p>
-
Create or Replace DB link command.
Hi all,
Ora 11.2.0.1 Windows Server 2003
Is there such a CREATE OR REPLACE DATABASE LINK command?
We have lots of Developement databases and our central TNSNAMES.ORA is constantly changing. This is because some database are decommissioned, or newly added, or migrated to other servers.
In this regard, I have a central monitoring database tool that creates dblink connecting to all the databases listed in the TNSNAMES.ORA.
So when there a new db added I will create new dblink. If there is decommissioned I will drop the dblink. If there is migrated I will create or replace db link.
How can I automate or manage this creation of database link but just by reading the TNSNAMES.ORA as input? Any bright ideas please.....
Please help....
Thanks a lot,
KinzHi;
you can create dblink than drop it and create it again.. There is no such a option like replace
You can create scritp which can parse tnsnames.ora and create or drop or recreate dblink by pasring tnsnames.ora
Regard
Helios -
Executing create or replace procedure statement from plsql script
Hi ,
I want to execute create or replace procedure from pl/sql block without using execute immediate or dbms_sql, please let me know if feasible.
Eg:
declare
begin
create or replace procedure .....
if v_temp = 4 then
end if;
end;
Thanks for help.
Regards,
RKuser588487 wrote:
Actual requirement is I have .sql file which has Create procedure command in it
and i have to conditionally execute the above .sql file so going for a pl/sql block.
Eg:
begin
if variable1 <> variable2 then
@xyz.sql -- contains create or replace procedure statement
insert into tablexyz.....
end if;
end;
Won't work. The PL/SQL code block (also called an anonymous block) is shipped from the client (e.g. SQL*Plus) to the database server. There it is parsed and executed.
It cannot execute SQL*Plus code.
There are 2 basic approaches to address this requirement.
Method 1. Use PL/SQL and SQL to perform the conditional logic checks that SQL*Plus cannot. Use bind variables to "copy" the results between SQL*Plus and PL/SQL, use substitution variables to execute the conditional branch (as a script) in SQL*Plus.
Basic example:
SQL> --// bind variable for passing data to PL/SQL code and
SQL> --// to receive data from PL/SQL code
SQL> var status varchar2(100)
SQL>
SQL> declare
2 function ExistsTable( tableName varchar2 ) return boolean is
3 i integer;
4 begin
5 select 1 into i
6 from user_objects
7 where object_type = 'TABLE'
8 and object_name = tableName;
9 return( true );
10 exception when NO_DATA_FOUND then
11 return( false );
12 end;
13 begin
14 --// determine if table exists
15 if not ExistsTable( 'FOOTAB' ) then
16 --// table does not exists and SQL*Plus client
17 --// needs to run the footab client script
18 :status := 'footab.sql';
19 else
20 :status := 'do-nothing.sql';
21 end if;
22 end;
23 /
PL/SQL procedure successfully completed.
SQL>
SQL> --// use a substitution variable to determine what to do
SQL> set define on
SQL> col STATUS new_value SCRIPT
SQL> select :status as STATUS from dual;
STATUS
footab.sql
SQL>
SQL> --// execute the relevant script (i.e. execute the conditional
SQL> --// branch of the PL/SQL IF condition
SQL> @ &SCRIPT
SQL> --// file: footab.sql
SQL>
SQL> create table footab(
2 id number primary key,
3 col1 number,
4 col2 date
5 ) organization index
6 /
Table created.
SQL>
SQL> --//eof
// running the same steps when the table does exist
SQL> --// bind variable for passing data to PL/SQL code and
SQL> --// to receive data from PL/SQL code
SQL> var status varchar2(100)
SQL>
SQL> declare
2 function ExistsTable( tableName varchar2 ) return boolean is
3 i integer;
4 begin
5 select 1 into i
6 from user_objects
7 where object_type = 'TABLE'
8 and object_name = tableName;
9 return( true );
10 exception when NO_DATA_FOUND then
11 return( false );
12 end;
13 begin
14 --// determine if table exists
15 if not ExistsTable( 'FOOTAB' ) then
16 --// table does not exists and SQL*Plus client
17 --// needs to run the footab client script
18 :status := 'footab.sql';
19 else
20 :status := 'do-nothing.sql';
21 end if;
22 end;
23 /
PL/SQL procedure successfully completed.
SQL>
SQL> --// use a substitution variable to determine what to do
SQL> set define on
SQL> col STATUS new_value SCRIPT
SQL> select :status as STATUS from dual;
STATUS
do-nothing.sql
SQL>
SQL> --// execute the relevant script (i.e. execute the conditional
SQL> --// branch of the PL/SQL IF condition
SQL> @ &SCRIPT
SQL> prompt Nothing to do...
Nothing to do...
SQL> Method 2. Move all "client scripting" to the server. You can still use .sql files. These need to contain valid DDL that can be parsed and executed. On the server, the .sql files are loaded into a table.
This can be a physical load (e.g. using <i>DBMS_LOB.LoadFromFile()</i>). Or you can keep the .sql files on the server and use BFILE pointers instead to the files.
You can now use execute immediate to execute the contents of a .sql file as a CLOB that was read from the table containing the .sql scripts.
To be honest - I have used both methods extensively in the past and no longer bother using either. Table exists when running the table create script? So what. If the table should not exist, use server exceptions in SQL*Plus to cease processing and exit. If it does not matter whether the table exists or not, why be concern with running the script to create the table if the table already exists? -
Unwanted Line Breaks in PL/SQL CODE after 'CREATE OR REPLACE' statements
Does anybody know how to keep SQL Developer from automatically editing PL/SQL code and adding line breaks after 'CREATE OR REPLACE' statements?
It keeps taking:
CREATE OR REPLACE PACKAGE DEVELOPER AUTHID DEFINER
And turns it into:
create or replace
package developer AUTHID DEFINER
This unwanted linebreak causes our autodeployment processes to break.
Thanks,
Michael Dunn
University of Notre Dame
Edited by: user9133268 on Feb 21, 2012 8:00 AMHi Michael,
I believe nothing for this issue has progressed since it was asked here:
2.1 RC Extra Line Breaks
As there may be approval for some planned improvements to the SQL Formatter feature in 3.2, I logged an enhancement request for you:
Bug 13744858 - FORUM: UNWANTED LINE BREAK AFTER CREATE OR REPLACE SYNTAX
Regards,
Gary
SQL Developer Team
Edited by: Gary Graham on Feb 21, 2012 4:19 PM
But if you have control over your auto-deployment process code, it might be quicker to enhance that to deal with CREATE OR REPLACE on the same or the preceding line. Also, note that if you edit the package DDL to put the CREATE OR REPLACE on the same line with the package name in the code editor, then immediately use Export or Save Package Spec and Body to save it to disk, then PACKAGE <name> will appear on the same line as the CREATE OR REPLACE syntax. -
Ampersand substitution in create or replace procedure statement
Hi Guys,
I wonder why my ampersand substitution does not work in a create or replace stored procedure statement.
CREATE OR REPLACE PROCEDURE UPDATE_DIM_SALES AS
UNDEFINE DimSales;
UNDEFINE FactTable;
DEFINE DimSales = 'TESTTAB';
DEFINE FactTable = myfact;
BEGIN
Error(5,20): PLS-00103: Encountered the symbol "=" when expecting one of the following: := . ( @ % ; not null range default character
If I then assign the value with := I get the error "invalid table" later on for the INSERT statemnt:
CREATE OR REPLACE PROCEDURE UPDATE_DIM_SALES AS
UNDEFINE DimSales;
UNDEFINE FactTable;
DEFINE DimSales := 'x2';
DEFINE FactTable := 'x1';
BEGIN
INSERT INTO &DimSales (column1, column2,...)
Why does ampersand substitution not work within a stored procedure?Hi,
Thanks for the suggestion.
The IF---ELSE Logic I have to write is quite complex.
I dont think joins will not do the trick and limiting the collection size to smaller than 4000 seems not very practical. there
is no poin using a collection if I have to use X amout of them.
UNDEFINE DimSALES;
UNDEFINE FactTable;
DEFINE DimSALES = 'TESTTAB';
DEFINE FactTable = 'testfact';
--Collect all distinct SELLERNr into materialized views
CREATE MATERIALIZED VIEW v1 AS select distinct SELLERnr from &FactTable;
CREATE MATERIALIZED VIEW v2 AS select distinct SELLER_ID from &DimSALES;
DECLARE
v_SELLERNr VarChar(9);
CURSOR v1_cursor IS Select * from v1;
l_exists INTEGER;
BEGIN
OPEN v1_cursor;
LOOP
FETCH v1_cursor INTO v_SELLERNr;
EXIT WHEN v1_cursor%NOTFOUND;
SELECT COUNT(*) INTO l_exists FROM v2 WHERE SELLER_id =v_SELLERNr AND ROWNUM = 1;
IF l_exists <> 1 THEN
INSERT INTO &DimSALES (K_SALES,REG,BVL,DS, VS,RS,SELLER_ID,VK,VALID_FROM)
(SELECT SEQ_DIM_SALES.NEXTVAL ,REG, BVL,DS, VS,RS,SELLERNR,VK,sysdate from &FactTable where SELLERNR =v_SELLERNr);
commit;
ELSE
--Update old combination(s), invalidate (DATE)
UPDATE &DimSALES SET VALID_TO = SYSDATE -1 WHERE REG||BVL||DS||VS||RS||SELLERNR||VK IN(
--In case the SELLER and combinations exists and differs from what is in the dimension then invalidate old combinations and insert new ones
SELECT * FROM(
SELECT REG||BVL||DS||VS||RS||SELLERNR||VK WHERE SELLERNR = v_SELLERNr FROM &FactTable;
MINUS
SELECT REG||BVL||DS||VS||RS||SELLERNR||VK WHERE SELLERNR = v_SELLERNr FROM &DimSALES;)
commit;
--Insert new combination
INSERT INTO &DimSALES (K_SALES,REG,BVL,DS, VS,RS,SELLER_ID,VK,VALID_FROM)
(SELECT SEQ_DIM_SALES.NEXTVAL ,REG, BVL,DS, VS,RS,SELLERNR,VK,sysdate from &FactTable where SELLERNR =v_SELLERNr) subselect;
WHERE &DimSALES.SELLER_Id=v_SELLERNr AND subselect.REG||BVL||DS||VS||RS||SELLERNR||VK NOT IN &DimSALES.REG||BVL||DS||VS||RS||SELLERNR||VK
commit;
END IF;
END LOOP;
CLOSE v1_cursor;
END;
DROP MATERIALIZED VIEW v1;
DROP MATERIALIZED VIEW v2;
----------------- -
Create procedure statement Hangs in 11g database, doesn't hang in 10.2
I have installed 11g on a windows workstation and created a new database. I then attempted to import a schema from a tried and tested 10.2 database, this hung.
I pinpointed the cause of the hang to a create procedure sstatement within the import file.
I removed the procedure from the 10.2 database, re-exported and imported sucessfully in to the 11g database minus the rogue prrocedure.
I now have a create statement for the procedure thats causing the hangs, and this hangs when I try and run it - it runs fine against my 10.2 database?
I can comment large chunks of the create procedure statment out so I get an anonymous block that runs, and pinpoint the hang down to the inclusion of the the line marked below
(starting FOR UPDATE OF...........).
I cant work out whats going on, I'm no programmer by the way!
Any pointers would be greatly appreciated.
Nick
declare
job_rec job_table%ROWTYPE;
err_msg varchar2(2000);
abort_msg varchar2(2000);
l_ok boolean := TRUE;
l_bat_job varchar2(14) := 's2_novate_RIC';
LINES DELETED FOR PURPOSE OF POSTING CURSOR c_sah IS
SELECT
sah_next,
sah_table_key,
sah_old_status,
sah_new_status,
sah_processed_ind,
sah_processed_date,
sah_processed_time
FROM senatordba.sah_status_audit_history
JOIN (SELECT distinct to_char(spd_next) spd_next
FROM senatordba.spd_std_risk_dets
JOIN senatordba.rso_risk_system_options
ON rso_spd_next = spd_next
AND spd_ric_code = l_ric_code
AND coalesce(l_uw_year, spd_yr) = spd_yr
AND coalesce(l_risk_ref, spd_ref) = spd_ref
ON spd_next = sah_table_key
AND sah_table_code = 'SPD'
AND sah_status_table_code = 'NOV'
AND sah_processed_ind = 'N';
FOR UPDATE OF sah_processed_ind, sah_processed_date, sah_processed_time; <---------if this line is commented out runs OK, if left in, it hangs??
r_sah c_sah%ROWTYPE;
begin
open c_sah;
close c_sah;
end;Hi Nick, no one else has answered so I thought I'd answer my own question, it appears that I was hitting Oracle bug 9294110. had to uninstall 11.2 and install 11.0.7 instead. very annoyed that I wasted ages diagnosing this known problem. The following test should replicate the hang
connect / as sysdba
create user test identified by test default tablespace users temporary tablespace temp;
grant connect, resource to test;
connect test/test
create table a_tab
( col001 number, col002 number, col003 number, col004 number);
create table b_tab( col001 number);
-- the next statement hangs forever
select
a.col002,
a.col003,
a.col004
from
a_tab a
left outer join b_tab
on a.col001 = b_tab.col001
for update of a.col002,
a.col003,
a.col004; -
CREATE OR REPLACE PROCEDURE return data like SELECT statement
"SELECT * FROM SEARCH_KEYWORD" is successfully done and return the data of the tables. Now, I want to run that on server side using PROCEDURE.
I successfully executed the below scripts. Please teach me how to call the sp_test procedure. OR if you have other way or maybe my scripts are wrong.
CREATE OR REPLACE PACKAGE GLOBALPKG
AS
TYPE RCT1 IS REF CURSOR;
TRANCOUNT INTEGER := 0;
IDENTITY INTEGER;
END;
CREATE OR REPLACE PROCEDURE LPG.sp_test
RCT1 IN OUT GLOBALPKG.RCT1
AS
BEGIN
OPEN RCT1 FOR
SELECT *
FROM SEARCH_KEYWORD;
END;
Here is my table definition:
CREATE TABLE LPG.SEARCH_KEYWORD
FRACTION VARCHAR2(50),
KEYWORD VARCHAR2(50),
PURPOSE VARCHAR2(50),
REMARKS VARCHAR2(50),
DATE_INSERTED DATE DEFAULT sysdate
PCTFREE 10
PCTUSED 40
MAXTRANS 255
TABLESPACE SYSTEM
STORAGE(INITIAL 64K MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
NOCACHE
LOGGING
Eros
JapanWrong forum. You should ask this question in the SQL and PL/SQL forum.
Couple of comments though. Oracle is not SQL-Server. So calling a procedure that returns a ref cursor is different from a T-SQL macro procedure that functions like a view.
Also, there is no need to use the SQL-Server standard (and silly one at that) of prefixing stored procedures using the text "sp_". In fact, the whole concept of Hungarian-like notation is something of the past and has no place in today's paradigm of software engineering.
As for calling a a proc that returns a ref cursor, from SQL*Plus it will look as follows:
SQL> var c refcursor
SQL>
SQL> exec LPG.sp_test( :c )
SQL> print c
Ref cursor needs to be supported by the client language you use to make this call to Oracle. -
Running MaxL statements from client desktop
I am trying to load data into an ASO cube via a batch file / maxl process. This process works fine from the server, but I want people to be able to do this without having server access to run the batch file. The batch file loads a .mxl file that clears the database, loads two files into a buffer, and then aggregates the cube.
My problem is that the two files I need to load are level 0 extracts from two BSO cubes. When I use the following statement it isn't finding the file:
import database 'ReprtASO'.'Report' data
from server data_file 'report\report\report_export.txt'
to load_buffer with buffer_id 1
on error write to 'c:\automation\ReprtASO.err';
What shows up in the log file is the following:
MAXL> import database 'ReprtASO'.'Report' data
2> from server data_file 'report\report\report_export.txt'
3> to load_buffer with buffer_id 1
4> on error write to 'c:\Automation\ReprtASO.err';
ERROR - 1003027 - Unable to open file [D:\Hyperion\products\Essbase\EssbaseServer\app\ReprtASO\Report\report\report\report_export.txt].
I have logged into the ReprtASO cube and it is using the default path for that application rather than using the Hyperion Home starting with the app directory (D:\Hyperion\products\Essbase\EssbaseServer\app\ReprtASO\ instead of D:\Hyperion\products\Essbase\EssbaseServer\app\)
Is there a way around this? My maxl statement to create the Level 0 export out of the Report\Report (app/db) works because I don't define a path. But I can't figure out how to have it start looking at the App directory instead of at the database directory. Any ideas?
Thanks,
Richard
Edited by: rchanks on Apr 14, 2010 1:30 PMHere's the scenario. I have users that use the Excel Addin to lock-send data into my ReportXL BSO cube. In order for them to see it in the ASO cube, I have to go out to the server and run a batch file to export the Level 0 out of the XL cube and the use it with the extract from my GL cube (Report) to load the both of them into the ASO cube. Now, whenever users are updating the database, they have to come find me. I was just trying to get them a way to update it themselves.
Here's the dilemma. To extract data out of the ReportXL cube via a client mxl statement, it can only save to that directory tree. In order to load, I need it in the ReprtASO\Report directory. I don't want to give drive access to the server... especially in the database directory (.otl, .pag, etc.). Do you have any ideas for a work around? -
Passing plsql parm to a sql statement in the procedure database link name
Would like to pass a parm that is the database link name to a stored procedure. I defined this as below. var1 is the name of the db link that I would like to pass
create or replace procedure proc1 (var1 in varchar2) as
cursor c1 is
select num,name,city from emp@var1;
However, this is getting a plsql error in the above code as bad bind variable, db link name expected.
Is there a method to pass a variable within a stored proc into a SQL statement that has a cursor ..
thanksHi,
Database links have to be hard-coded. If you really need to specify the database link at run-time, then you need Dyanmic SQL.
Why do you need to do this? How many databases are involved? Do you have new database links all the time? The more you can say about your business requirements, the more helpful we can be.
Are there only a couple of possible database links? If so, you might consider hard-coding each of them, and branching to the appropriate one in your code.
is the real variable here the environment (Development, Test, Production) that you're in? For example, do you need to use one database link in Development, a different one in Test, and a third in Production, but you don't want to change the code when you move from one environment to another? If so, you can try conditional comilation. -
Create Or Replace Function Error
Hello,
I'm doing text mining using Oracle SQL Developer: ODMiner.. I imported the data "WEBLOG" into a table.. This weblog data consist of users activity, date, time, url, etc. The first step I took was to use a function to transform date and time that I have in the data table, into a number representing the 40 mins since 01-01-1990. I did this by dividing it by 2400 (seconds in 40 mins). The main purpose is to have a time frame for the sessions.
I used the following code,
CREATE OR REPLACE FUNCTION ssnDate(
DATE IN VARCHAR2 DEFAULT 03-01-18,
TIME IN VARCHAR2
) RETURN NUMBER
AS
BEGIN
RETURN TRUNC((to_date(DATE||' '||TIME, 'DD-MM-YY HH:MM:SS')- to_date('01-JAN-1990','DD-MON-YYYY')) * (86400/2400);
END ssnDate;
This was what appeared in the log after running the statement,
FUNCTION ssnDate compiled
Warning: execution completed with warning
After this, I tried to create a VIEW to transform the DATE and TIME with the ssnDate that was created earlier on, and concatenate the CS_URI_STEM (which is the resource accessed), and CS_URI_QUERY (which is the the query, if any, the client was trying to perform)into a new field called WEB_LINK.
This is the code used,
CREATE OR REPLACE VIEW WEBLOG_VIEWS("C_IP", "WEB_LINK", "CS_USER_AGENT", "SESSION")
AS
SELECT ssnDate(LOG_DATE, LOG_TIME) AS 'SESSION',
C_IP,
CS_USER_AGENT,
(CS_URI_STEM||'?'||CS_URI_QUERY) AS WEB_LINK
FROM WEBLOG;
Now from this I got the following error..
Error starting at line 1 in command:
CREATE OR REPLACE VIEW WEBLOG_VIEWS("C_IP", "WEB_LINK", "CS_USER_AGENT", "SESSION")
AS
SELECT ssnDate(LOG_DATE, LOG_TIME) AS 'SESSION',
C_IP,
CS_USER_AGENT,
(CS_URI_STEM||'?'||CS_URI_QUERY) AS WEB_LINK
FROM WEBLOG
Error at Command Line:3 Column:38
Error report:
SQL Error: ORA-00923: FROM keyword not found where expected
00923. 00000 - "FROM keyword not found where expected"
*Cause:
*Action:
I don't get where I'm going wrong with this.. This is the data preparation stage which requires me to prep the data before applying modeling techniques or algorithms.. The next step would be grouping the data, based on the session time, ip and the user agent of each session along with the web_links fields visited by the user in that session.
I would really be grateful for any inputs on where I'm going wrong and any solutions for that!Ok, not sure I really understand, but I posted the query and this is the output I got..
ORA-31603: object "WEBLOG" of type TABLE not found in schema "WEBLOG_TABLE_OWNER_NAME"
ORA-06512: at "SYS.DBMS_METADATA", line 2625
ORA-06512: at "SYS.DBMS_METADATA", line 2668
ORA-06512: at "SYS.DBMS_METADATA", line 2983
ORA-06512: at "SYS.DBMS_METADATA", line 3897
ORA-06512: at "SYS.DBMS_METADATA", line 5678
ORA-06512: at line 1
31603. 00000 - "object \"%s\" of type %s not found in schema \"%s\""
*Cause: The specified object was not found in the database.
*Action: Correct the object specification and try the call again. -
Procedure hangs while create or replace!
Dear All,
My Database is Oracle 11g RAC.
I did few changes in one of my procedure and wanted to re-create it using CREATE OR REPLACE procedure...
The statement hangs for a long time and the concurrency in OEM raises up to a very high level. I tried to find the blocking sessions but for some time there was no blocking session.
I also tried stopping the activities on the tables used in this procedure.
Kindly suggest me what should I do in this situation. I have also tried running the query directly from the server.
Regards, ImranHi,
check for any locks & kill it , execute on each instance or use gv$
alter session set nls_date_format='dd-mon-yy hh24:mi:ss';
select /*+ CHOOSE */ a.sid, a.serial#,vp.spid,a.last_call_et,a.logon_time,a.status,sw.event, a.username,a.osuser, a.status,
a.program,a.MACHINE, a.type ptype,b.owner, b.object, b.type
from v$session a, v$access b,v$session_wait sw, v$process vp
where a.sid=b.sid and b.sid=sw.sid and a.paddr=vp.addr
and b.type<>'NON-EXISTENT'
and (b.owner is not null) and (b.owner<>'SYSTEM') and (b.owner<>'SYS')
and upper(b.object) like '%&obj_name%'
ORDER BY 3;Thanks,
Ajay More
http://moreajays.blogspot.com -
Issue in creating the standby database from Active database using RMAN
Hi All,
I am facing issue in creating the standby database from Active database using RMAN and getting the below issue after i executed the duplicate command.
Version of Database:11g(11.2.0.1.0)
Operating System:Linux 5
Error:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/21/2012 17:26:52
RMAN-03015: error occurred in stored script Memory Script
RMAN-04006: error from auxiliary database: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Primary Database Entries:
Tnsentry:
SONYPRD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.131)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = sonyprd.localdomain)(UR=A)
SONYPRDSTBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.132)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = sonyprdstby)(UR=A)
Listner Entry:
SID_LIST_SONYPRD =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtproc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
(SID_DESC =
(SID_NAME = SONYPRD)
(GLOBAL_DBNAME = SONYPRD)
Auxiliary Details:
Tns Entry:
SONYPRD =
(DESCRIPTION =
# (ADDRESS = (PROTOCOL = TCP)(HOST = oracle11g.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.131)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = sonyprd.localdomain)
SONYPRDSTBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.132)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = sonyprdstby)(UR=A)
Listener Entry in auxiliary:
SID_LIST_SONYPRDSTBY =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = SONYPRDSTBY)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = SONYPRDSTBY)
TNSPING from Primary DB:
[oracle@oracle11g ~]$ tnsping sonyprdstby
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 21-DEC-2012 17:39:28
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.132)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sonyprdstby)(UR=A)))
OK (0 msec)
TNSPING from Auxuliary server
[oracle@oracle11gstby ~]$ tnsping sonyprd
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 21-DEC-2012 17:40:19
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.131)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sonyprd.localdomain)))
OK (10 msec)
Script Used for duplicate:
run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'sonyprd','sonyprdstby'
set db_unique_name='sonyprdstby'
set db_file_name_convert='/sonyprd/','/sonyprdstby/'
set log_file_name_convert='/sonyprd/','/sonyprdstby/'
set control_files='/u01/app/oracle/oradata/control01.ctl'
set log_archive_max_processes='5'
set fal_client='sonyprdstby'
set fal_server='sonyprd'
set standby_file_management='AUTO'
set log_archive_config='dg_config=(sonyprd,sonyprdstby)'
set log_archive_dest_2='service=sonyprd ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=sonyprd'
Tried the script from both Primary and auxiliary but no luck
[oracle@oracle11gstby admin]$ rman target sys/welcome@sonyprd auxiliary sys/*****@sonyprdstby
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Dec 21 17:26:24 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: SONYPRD (DBID=3131093559)
connected to auxiliary database: SONYPRD (not mounted)
Listener Status from primary:
[oracle@oracle11g ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 21-DEC-2012 18:08:56
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 20-DEC-2012 17:42:17
Uptime 1 days 0 hr. 26 min. 41 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "sonyprd.localdomain" has 1 instance(s).
Instance "sonyprd", status READY, has 1 handler(s) for this service...
Service "sonyprdXDB.localdomain" has 1 instance(s).
Instance "sonyprd", status READY, has 1 handler(s) for this service...
The command completed successfully
Listener Status from Standby when database bring to Nomount state:
[oracle@oracle11gstby admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 21-DEC-2012 18:11:54
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 21-DEC-2012 16:13:47
Uptime 0 days 1 hr. 58 min. 6 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle11gstby/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11gstby)(PORT=1521)))
Services Summary...
Service "sonyprdstby" has 1 instance(s).
Instance "sonyprdstby", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
Please provide any work arounds to proceed further in creating the standby database.
Thanks,
Ram.Pl do not post duplicates - Issue in configuring Standby Database from Active database in 11g by RMAN
-
Creating a new database in Oracle Database 10g...
I have downloaded a copy of Oracle Database 10g Express Edition from Oracle's website. I am using Windows XP. I am trying to create an Oracle database that I can connect to from Access 2003 via ODBC.
1. How do I create a new database? I can see options to create tables, views, etc. but not a database.
2. I have created a System DSN connection in the ODBC Data Source Administrator for the Oracle ODBC driver. Once I create a database in Oracle, how do I actually establish a connection to it from Access? The ODBC code to connect is there, but when I run it, I get an error.
Any help would be appreciated. Thanks.1. How do I create a new database? I can see options to create tables, views, etc. but not a database.If you can see those options then you are already connected to the database. You probably want to create a user, not a database (are you by chance coming from SQL Server?)
driver={OracleDriver};Dbq=TESTDBQ;Uid=Administrator;Pwd=;You would replace "Administrator" with the name of the user you created in the database. -
hi i want to create trigger . when insert a row on table , it returns new value and old value . I have many tables and columns . i should to use :new.columntitle and :old.columntitle .Columntitle is refere to name of column in table . but sql developer is not accept it and show this error : BAD BIND VARIABLE 'NEW.COLUMNTITLE' .My code is this :
Create or replace TRIGGER hr.departments_before_insert
before insert on HR.departments
for each row
DECLARE
columnid number ;
columnval number ;
columntitle varchar2(4000);
cursor c2 is
select id,tableid from hr.columns where tableid = 1 ;
tablesid number ;
tablenames varchar2(4000);
cursor c1 is
select id , title from hr.tables where id = 1;
BEGIN
open c1;
loop
fetch c1 into tablesid , tablenames;
EXIT WHEN C1%NOTFOUND;
for rec in c2
loop
select substr(title,instr(title,'.',-1,1)+1) into columntitle from hr.columns where id = rec.id ;
dbms_output.put_line(:new.columntitle); -- in this line the eroor occured : error = " bad bind variable 'new.columntitle' "
end loop;
end loop;
close c1;
end;
-- in loop columntitle=deparment _id and department_name ; when i replace columntitle with department _id in :new , code is work ...
thanksYou have no choice but to specifically list the column names.
If you really have "too many columns", that would tend to imply that you have improperly normalized your schema. Perhaps you need to rethink the data model.
If the real problem is that you want to generate similar triggers for a large number of different tables, you could write a PL/SQL block that generates the CREATE TRIGGER statement for each table and use EXECUTE IMMEDIATE to run those statements for each table. Using dynamic SQL like this significantly complicates the complexity of building the trigger. This may be balanced out, though, by the fact that you only have to write it once rather than writing separate triggers for each table.
Justin
Maybe you are looking for
-
Do I need a firewire 800 to 400 to migrate?
I am migrating my data from a 2008 era Macbook to a Macbook Pro. (WHEEEEE!!!!) Do I need to buy an 800-400 converter for copying files, or can I use USB or some other method?
-
PDFs are displaying in black and white in Preview
My InDesign PDF's are suddenly displaying in black and white in Apple Preview. Is anyone else having this problem? Thanks! ~EZ
-
How do i enable continuous video playback in iOS 11.3?
So I recently upgraded to iTunes 11.3 from i think itunes 11.0 or something. And suddenly my video playlists are not playing continously--that is to say, when an episode ends, it just stops playing, and doesn't play anything else until i tell it to.
-
Accounting item text problems when MIRO
Dear all: In the MIRO transaction, after posted the item text will be generated to FI doc. item text? Item text of MIRO basic data will be generated to fi doc. item text when after miro. But I not sure the item text will b
-
Getting music off ipod, tried almost everything!!
I get errors when using mycomputer that say "Cannot copy KHAI: Data Error (cyclic redundancy check" and also get errors that say parameters are incorrect. Some files get copied, but it allways hangs on some of them. I've used the two programs Podutil