SET SERVEROUTPUT ON;
DECLARE
i NUMBER;
BEGIN
i := 0;
<<label_main>>
i := i + 1;
IF i > 10
THEN
GOTO label_end;
END IF;
<<label_print>>
DBMS_OUTPUT.put_line (i);
GOTO label_main;
<<label_end>>
NULL;
END;
/
শনিবার, ৬ এপ্রিল, ২০১৯
GOTO
শুক্রবার, ২৯ মার্চ, ২০১৯
RMAN Backup
Connectivity:
RMAN TARGET /
RMAN TARGET SYS/SYS123@ORCL
Configuration:
SHOW ALL;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE RETENTION POLICY TO REDUNDANCY
2;(how many backup history the repository will store)
CONFIGURE RETENTION POLICY TO RECOVERY
WINDOW OF 30 DAYS; (how many days backup history the repository will store)
CONFIGURE EXCLUDE FOR TABLESPACE USERS;
CONFIGURE EXCLUDE FOR TABLESPACE EXAMPLE;
CONFIGURE EXCLUDE FOR TABLESPACE USERS CLEAR;
CONFIGURE EXCLUDE FOR TABLESPACE EXAMPLE
CLEAR;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'F:\labs\autobakup\%F' maxpiecesize 8 G;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'D:\app\asus\backup\%U';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\app\asus\backup\%F';
SHOW EXCLUDE;
REPORT NEED BACKUP; (What is needed to
backup)
LIST BACKUP;
LIST BACKUPSET;
LIST BACKUP RECOVERABLE;
LIST BACKUP SUMMARY;
LIST ARCHIVELOG ALL;
CROSSCHECK BACKUP; (Will check backup
expired or not)
DELETE BACKUP;
DELETE EXPIRED BACKUP;
DELETE EXPIRED ARCHIVELOG ALL;
DELETE OBSOLETE;(Will delete expired
backup)
DELETE NOPROMPT OBSOLETE;(Will delete
without giving any confirmation message)
DELETE CURRENT CONTROLFILE AND SPFILE;
DELETE ARCHIVELOG ALL;
BACKUP CURRENT CONTROLFILE;
BACKUP SPFILE;
BACKUP CURRENT CONTROLFILE TAG =
mondaypmbackup;
BACKUP CURRENT CONTROLFILE TO
'D:/.......................';
BACKUP DATABASE; (Will backup
except exclude configuration tablespace)
BACKUP DATABASE EXCLUDE; (Will backup
only configuration tablespace)
BACKUP DATABASE NOEXCLUDE; (Will backup
all tablespace)
BACKUP DATAFILE 1;
BACKUP DATABASE PLUS ARCHIVELOG;
BACKUP INCREMENTAL LEVEL 1 DATABASE; (Differential incremental)
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;
FULL DATABASE BACKUP;
RUN{
ALLOCATE CHANNEL C1 TYPE DISK;
ALLOCATE CHANNEL C2 TYPE DISK;
ALLOCATE CHANNEL C3 TYPE DISK;
BACKUP INCREMENTAL LEVEL 0 DATABASE;
RELEASE CHANNEL C1;
RELEASE CHANNEL C2;
RELEASE CHANNEL C3;
}
FULL DATABASE BACKUP (DIFFERENTIAL
INCREMENTAL);
RUN{
ALLOCATE CHANNEL C1 TYPE DISK;
ALLOCATE CHANNEL C2 TYPE DISK;
ALLOCATE CHANNEL C3 TYPE DISK;
BACKUP INCREMENTAL LEVEL 1 DATABASE;
RELEASE CHANNEL C1;
RELEASE CHANNEL C2;
RELEASE CHANNEL C3;
}
USING TAG:
RUN
{
ALLOCATE CHANNEL C1 TYPE DISK;
ALLOCATE CHANNEL C2 TYPE DISK;
ALLOCATE CHANNEL C3 TYPE DISK;
BACKUP INCREMENTAL LEVEL 0 TAG MYTAG
DATABASE;
RELEASE CHANNEL C1;
RELEASE CHANNEL C2;
RELEASE CHANNEL C3;
}
BACKUP AS BACKUPSET
FORMAT 'D:/USER_BKUP/RMAN_BACKUP.BKP'
TABLESPACE USERS;
RESTORING:
RESTORE DATABASE;
RESTORE DATABASE VALIDATE; (Will create
datafile if datafile lost)
RESTORE DATABASE FROM TAG=’MYTAG';
RESTORE TABLESPACE USRES FROM TAG='TAG20160626T102325';
ACL Configure for BI Publisher
SELECT * FROM DBA_NETWORK_ACLS;
begin
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => '192.168.1.13',
ace => xs$ace_type(privilege_list => xs$name_list('connect', 'resolve'),
principal_name => 'APEX_240200',
principal_type => xs_acl.ptype_db));
end;
declare
e_31001 exception;
pragma exception_init(e_31001, -31001);
begin
dbms_network_acl_admin.drop_acl( acl => '/sys/acls/JS_EMAIL2.xml' );
exception
when e_31001 then null;
end;
https://tedstruik-oracle.nl/ords/f?p=25384:1058::::::
DECLARE
ACL_PATH VARCHAR2(4000);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_050000
-- the "connect" privilege if APEX_050000 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '192.168.0.104' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_180200',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_180200', TRUE, 'connect');
END IF;
EXCEPTION
-- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_180200', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;
after that run:
DECLARE
ACL_PATH VARCHAR2(4000);
BEGIN
-- Look for the ACL currently assigned to 'localhost' and give APEX_050000
-- the "connect" privilege if APEX_040200 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '192.168.0.104' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_180200',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_180200', TRUE, 'connect');
END IF;
EXCEPTION
-- When no ACL has been assigned to 'localhost'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml',
'ACL that lets users to connect to localhost',
'APEX_180200', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','192.168.0.104');
END;
/
COMMIT;
ACL Drop :
------------------------------------------------
begin
DBMS_NETWORK_ACL_ADMIN.DROP_ACL('power_users.xml');
commit;
end;
/
begin
DBMS_NETWORK_ACL_ADMIN.DROP_ACL('local-access-users.xml');
commit;
end;
/
begin
DBMS_NETWORK_ACL_ADMIN.DROP_ACL('local-access-users.xml.xml');
commit;
end;
/
ACL_PATH VARCHAR2(4000);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_050000
-- the "connect" privilege if APEX_050000 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '192.168.0.104' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_180200',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_180200', TRUE, 'connect');
END IF;
EXCEPTION
-- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_180200', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;
after that run:
DECLARE
ACL_PATH VARCHAR2(4000);
BEGIN
-- Look for the ACL currently assigned to 'localhost' and give APEX_050000
-- the "connect" privilege if APEX_040200 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '192.168.0.104' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_180200',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_180200', TRUE, 'connect');
END IF;
EXCEPTION
-- When no ACL has been assigned to 'localhost'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml',
'ACL that lets users to connect to localhost',
'APEX_180200', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','192.168.0.104');
END;
/
COMMIT;
ACL Drop :
------------------------------------------------
begin
DBMS_NETWORK_ACL_ADMIN.DROP_ACL('power_users.xml');
commit;
end;
/
begin
DBMS_NETWORK_ACL_ADMIN.DROP_ACL('local-access-users.xml');
commit;
end;
/
begin
DBMS_NETWORK_ACL_ADMIN.DROP_ACL('local-access-users.xml.xml');
commit;
end;
/
বুধবার, ২৭ মার্চ, ২০১৯
রবিবার, ২৯ জুলাই, ২০১৮
Apex Install
Please flow flowing step to install apex 5.2 :
** Apex 5.2 installation you must need db 11g . Other version (lower from 5.2) support 10g or less.
1.Apex software folder keep desired drive (c,d,e,f) where u want to install apex software
I install my apex folder in “c” drive for your advantage & my apex folder name is “apex”.
Open cmd –>
cd C:\apex [drive name:\apex software folder name]
Your screen show as like after read desired folder bellow:
c:\apex [this is valid format for read apex folder]
connect to sqlplus as like –> sqlplus /nolog
Connect sqlplus as sys dba –> conn / as sysdba
create a table-space for your apex user
SQL> CREATE TABLESPACE APEX_DATA datafile
‘C:\apex\APEX_data.DBF’
SIZE 1g;
SQL> @apexins APEX_DATA APEX_DATA TEMP /i/
20/25 min needs for installation.
SQL> @apxldimg.sql [after this command show bellow message for give location image folder]
enter vavue 1: C:\ [if install “C” drive] or D:\apex or D:\apex\images [if install except “C” drive]
Without any error image directory created then run flowing script:
SQL> @apxconf.sql [if install “C” drive] or @\apex\apxconf.sql [if install except “C” drive]
8 . You need to create apex user [admin user show as default] and password
[password must be contain Upper case,Special character ,lower character & number as like “Test!1”
Default port generated “8080” [if you don’t change port then enter for next step .
** Apex 5.2 installation you must need db 11g . Other version (lower from 5.2) support 10g or less.
1.Apex software folder keep desired drive (c,d,e,f) where u want to install apex software
I install my apex folder in “c” drive for your advantage & my apex folder name is “apex”.
Open cmd –>
cd C:\apex [drive name:\apex software folder name]
Your screen show as like after read desired folder bellow:
c:\apex [this is valid format for read apex folder]
connect to sqlplus as like –> sqlplus /nolog
Connect sqlplus as sys dba –> conn / as sysdba
create a table-space for your apex user
SQL> CREATE TABLESPACE APEX_DATA datafile
‘C:\apex\APEX_data.DBF’
SIZE 1g;
SQL> @apexins APEX_DATA APEX_DATA TEMP /i/
20/25 min needs for installation.
SQL> @apxldimg.sql [after this command show bellow message for give location image folder]
enter vavue 1: C:\ [if install “C” drive] or D:\apex or D:\apex\images [if install except “C” drive]
Without any error image directory created then run flowing script:
SQL> @apxconf.sql [if install “C” drive] or @\apex\apxconf.sql [if install except “C” drive]
8 . You need to create apex user [admin user show as default] and password
[password must be contain Upper case,Special character ,lower character & number as like “Test!1”
Default port generated “8080” [if you don’t change port then enter for next step .
@apxchpwd.sql change password
After this step you need to some alter statement:
SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;
User altered.
SQL> ALTER USER XDB ACCOUNT UNLOCK;
User altered.
SQL> ALTER USER APEX_040200 ACCOUNT UNLOCK; –version of release
User altered.
SQL> ALTER USER FLOWS_FILES ACCOUNT UNLOCK;
User altered.
SQL> ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;
User altere
sql> exit
N.B : All sql statement must be connect sysdba connection with sql.
Your Apex software install completed.
For enjoying finally test your connection go to your web browser & write this port for apex test :
localhost:8080/apex
11.There are issues with the configuration of the Static Files in your environment.
Please consult the “Configuring Static File Support” section in the Application Express Installation Guide
N.B :If u face flowing above error then —–>
conn / as sysdba —> Run apex_epg_config.sql. For example:
sql> @apex_epg_config.sql
—>enter value 1: C:\ [if install “C” drive] or D:\apex or D:\apex\images [if install except “C” drive]
If you want to uninstall apex software connect with sysdba and run this script:
–> SQL> @apxremov.sql
Please tuning with me for next tutorial on apex….
After this step you need to some alter statement:
SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;
User altered.
SQL> ALTER USER XDB ACCOUNT UNLOCK;
User altered.
SQL> ALTER USER APEX_040200 ACCOUNT UNLOCK; –version of release
User altered.
SQL> ALTER USER FLOWS_FILES ACCOUNT UNLOCK;
User altered.
SQL> ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;
User altere
sql> exit
N.B : All sql statement must be connect sysdba connection with sql.
Your Apex software install completed.
For enjoying finally test your connection go to your web browser & write this port for apex test :
localhost:8080/apex
11.There are issues with the configuration of the Static Files in your environment.
Please consult the “Configuring Static File Support” section in the Application Express Installation Guide
N.B :If u face flowing above error then —–>
conn / as sysdba —> Run apex_epg_config.sql. For example:
sql> @apex_epg_config.sql
—>enter value 1: C:\ [if install “C” drive] or D:\apex or D:\apex\images [if install except “C” drive]
If you want to uninstall apex software connect with sysdba and run this script:
–> SQL> @apxremov.sql
Please tuning with me for next tutorial on apex….
exec dbms_xdb.sethttpport('8081');commit; Duplicate row delete
DELETE FROM
pr_taxable_amount_final_bk A
WHERE
a.rowid >
ANY (
SELECT
B.rowid
FROM
pr_taxable_amount_final_bk B
WHERE
A.salary_date = B.salary_date
AND
A.uid_no = B.uid_no)
pr_taxable_amount_final_bk A
WHERE
a.rowid >
ANY (
SELECT
B.rowid
FROM
pr_taxable_amount_final_bk B
WHERE
A.salary_date = B.salary_date
AND
A.uid_no = B.uid_no)
বৃহস্পতিবার, ২৮ জুন, ২০১৮
External Table
create directory test as 'D:/';
grant read,write on directory test to public;
create table test
(id varchar2(3),
last_name varchar2(50),
salary number
)
organization external
( default directory test
access parameters
(
fields terminated by ','
)
location ('c.txt')
)
grant read,write on directory test to public;
create table test
(id varchar2(3),
last_name varchar2(50),
salary number
)
organization external
( default directory test
access parameters
(
fields terminated by ','
)
location ('c.txt')
)
এতে সদস্যতা:
পোস্টগুলি (Atom)