Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Oracle users to automatically increase the partition table     - Install the latest Eclipse IDE in Ubuntu (Linux)

- 10 useful Linux command line tips (Linux)

- APT-mirror using a four-step configuration Ubuntu local depot (Linux)

- Ubuntu Slingscold (Linux)

- How to display a dialog Bash Shell script (Programming)

- Let OpenCV face detection score output codes (Programming)

- Docker: Mirroring and container operations (Server)

- C language preprocessor command (Programming)

- ls command: 15 Level Linux interview question (Linux)

- Redhat 5 prohibit IPv6 (Linux)

- Linux operation and maintenance of the automated installation and deployment RHEL7.0 Cobbler (Linux)

- VMware virtual machine to use bridged mode fast Internet access (Linux)

- How ONLYOFFICE collaborative editing document on Linux (Linux)

- Eclipse 3.7.2 can not start solving under Ubuntu 14.04 (Linux)

- Redis-- persistence articles (Database)

- Nginx version information hidden or modified (Server)

- PostgreSQL Stream Configuration (Database)

- Android custom slideshow menu slidmenu (Programming)

- Cryptography development environment to build under Ubuntu (Linux)

- Oracle 11g creates virtual private directory RMAN-06004 ORA-00942 error handling (Database)

 
         
  Oracle users to automatically increase the partition table
     
  Add Date : 2018-11-21      
         
         
         
  The program can be used as an Oracle JOB execution of the month on the 28th execution (February 28 days to consider the reasons), automatically increase the partition table for the partition under the user. [@ More @]
create or replace procedure guan_add_partition
/ *
/ * All of a user partition table partition partition automatically increase as date types, partition name similar to:. P200706.
* /
as
v_table_name varchar2 (50);
v_partition_name varchar2 (50);
v_month char (6);
v_add_month_1 char (6);
v_sql_string varchar2 (2000);
v_add_month varchar2 (20);
cursor cur_part is select distinct u.table_name, max (p.partition_name) max_part_name from user_tables u, user_tab_partitions p
where u.table_name = p.table_name and u.partitioned = 'YES'
group by u.table_name;
Begin
select to_char (sysdate, 'yyyymm') into v_month from dual;
select to_char (add_months (sysdate, 1), 'yyyymm') into v_add_month_1 from dual;
select to_char (add_months (trunc (sysdate, 'mm'), 2), 'yyyy-mm-dd') into v_add_month from dual;
open cur_part;
loop
fetch cur_part into v_table_name, v_partition_name;
exit when cur_part% notfound;
if to_number (substr (v_partition_name, 2)) <= to_number (substr (v_month, 1)) then
v_sql_string: = 'alter table' || v_table_name || 'add partition p' || v_add_month_1 ||
'VALUES LESS THAN (to_date (' '' || v_add_month || '' ',' 'yyyy-mm-dd' ')) tablespace users';
execute immediate v_sql_string;
else
null;
end if;
end loop;
close cur_part;
end;
     
         
         
         
  More:      
 
- To setup Cocos2dx project under Ubuntu (Linux)
- Those things packaged using Gradle to Android (Programming)
- JBPM6 Installation and Configuration Tutorial (Linux)
- grep command output highlighted word (Linux)
- Spring multi data source configuration (Programming)
- Oracle rebuild index script (Database)
- Solve ORA-01012: not logged on (Database)
- Ubuntu installed Komodo editor by PPA (Linux)
- Linux support exFAT and NTFS (Linux)
- C language Bubble Sort - integer sort (Programming)
- Oracle Database High-Risk Vulnerability Warning (Database)
- Installation Sublime Text 3 (Build 3065) text editor in Ubuntu (Linux)
- Java inheritance initialization problem (Programming)
- Install Debian Linux with R on the Android system (Linux)
- Mac OS X 10.9 build Nginx + MySQL + php-fpm environment (Server)
- GROUP BY extension (Database)
- CentOS7 installed MySQL (Database)
- Qt for file splitting and fusion gadgets (Programming)
- Teach you the Ubuntu Server enabled SSH multifactor authentication (Server)
- Binary Packages Golang (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.